78510: Subject: [PATCH 4/5] wined3d: Make the device parameter to wined3d_device_get_sampler_state() const.

buildbot at kegel.com buildbot at kegel.com
Wed Sep 7 13:59:29 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

The Buildbot has detected a failed build on builder runtests-default while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-default/builds/79 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed shell_3


For more info about this message, see http://wiki.winehq.org/BuildBot


-------------- next part --------------
From: Henri Verbeet <hverbeet at codeweavers.com>
Subject: [PATCH 1/5] wined3d: Use draw_binding for the surface_modify_location() call in surface_unmap() as well.
Message-Id: <1315419721-24150-1-git-send-email-hverbeet at codeweavers.com>
Date: Wed,  7 Sep 2011 20:21:57 +0200

---
 dlls/wined3d/surface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 633517d..21b4f9a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1000,7 +1000,7 @@ static void surface_unmap(struct wined3d_surface *surface)
          * date because only a subrectangle was read in Map(). */
         if (!fullsurface)
         {
-            surface_modify_location(surface, SFLAG_INDRAWABLE, TRUE);
+            surface_modify_location(surface, surface->draw_binding, TRUE);
             surface_evict_sysmem(surface);
         }
 
-- 
1.7.3.4

From: Henri Verbeet <hverbeet at codeweavers.com>
Subject: [PATCH 2/5] ddraw: Also check errors returned by ddraw_create_gdi_swapchain() in CreateSurface().
Message-Id: <1315419721-24150-2-git-send-email-hverbeet at codeweavers.com>
Date: Wed,  7 Sep 2011 20:21:58 +0200

---
 dlls/ddraw/ddraw.c |   80 +++++++++++++++++++++++++++------------------------
 1 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 24d3647..7dd0f2d 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -3209,49 +3209,57 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
         return hr;
     }
 
-    /* If the implementation is OpenGL and there's no d3ddevice, attach a d3ddevice
-     * But attach the d3ddevice only if the currently created surface was
-     * a primary surface (2D app in 3D mode) or a 3DDEVICE surface (3D app)
-     * The only case I can think of where this doesn't apply is when a
-     * 2D app was configured by the user to run with OpenGL and it didn't create
-     * the render target as first surface. In this case the render target creation
-     * will cause the 3D init. */
-    if (DefaultSurfaceType == SURFACE_OPENGL && !ddraw->d3d_initialized
-            && desc2.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE))
-    {
-        IDirectDrawSurfaceImpl *target = object, *surface;
-        struct list *entry;
-
-        /* Search for the primary to use as render target */
-        LIST_FOR_EACH(entry, &ddraw->surface_list)
+    if (!ddraw->d3d_initialized && desc2.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE))
+    {
+        HRESULT hr = WINED3D_OK;
+
+        /* If the implementation is OpenGL and there's no d3ddevice, attach a
+         * d3ddevice. But attach the d3ddevice only if the currently created
+         * surface was a primary surface (2D app in 3D mode) or a 3DDEVICE
+         * surface (3D app). The only case I can think of where this doesn't
+         * apply is when a 2D app was configured by the user to run with
+         * OpenGL and it didn't create the render target as first surface. In
+         * this case the render target creation will cause the 3D init. */
+        if (DefaultSurfaceType == SURFACE_OPENGL)
         {
-            surface = LIST_ENTRY(entry, IDirectDrawSurfaceImpl, surface_list_entry);
-            if((surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER)) ==
-               (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
+            IDirectDrawSurfaceImpl *target = object, *surface;
+            struct list *entry;
+
+            /* Search for the primary to use as render target. */
+            LIST_FOR_EACH(entry, &ddraw->surface_list)
             {
-                /* found */
-                target = surface;
-                TRACE("Using primary %p as render target\n", target);
-                break;
+                surface = LIST_ENTRY(entry, IDirectDrawSurfaceImpl, surface_list_entry);
+                if ((surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
+                        == (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
+                {
+                    TRACE("Using primary %p as render target.\n", target);
+                    target = surface;
+                    break;
+                }
             }
+
+            TRACE("Attaching a D3DDevice, rendertarget = %p.\n", target);
+            hr = ddraw_attach_d3d_device(ddraw, target);
+        }
+        else if (desc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
+        {
+            hr = ddraw_create_gdi_swapchain(ddraw, object);
         }
 
-        TRACE("(%p) Attaching a D3DDevice, rendertarget = %p\n", ddraw, target);
-        hr = ddraw_attach_d3d_device(ddraw, target);
-        if (hr != D3D_OK)
+        if (FAILED(hr))
         {
             IDirectDrawSurfaceImpl *release_surf;
-            ERR("ddraw_attach_d3d_device failed, hr %#x\n", hr);
+            ERR("Failed to create swapchain, hr %#x.\n", hr);
             *Surf = NULL;
 
-            /* The before created surface structures are in an incomplete state here.
-             * WineD3D holds the reference on the IParents, and it released them on the failure
-             * already. So the regular release method implementation would fail on the attempt
-             * to destroy either the IParents or the swapchain. So free the surface here.
-             * The surface structure here is a list, not a tree, because onscreen targets
-             * cannot be cube textures
-             */
-            while(object)
+            /* The earlier created surface structures are in an incomplete
+             * state here. Wined3d holds the reference on the parents, and it
+             * released them on the failure already. So the regular release
+             * method implementation would fail on the attempt to destroy
+             * either the parents or the swapchain. So free the surface here.
+             * The surface structure here is a list, not a tree, because
+             * onscreen targets cannot be cube textures. */
+            while (object)
             {
                 release_surf = object;
                 object = object->complex_array[0];
@@ -3261,10 +3269,6 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
             return hr;
         }
     }
-    else if(!(ddraw->d3d_initialized) && desc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
-    {
-        ddraw_create_gdi_swapchain(ddraw, object);
-    }
 
     /* Create a WineD3DTexture if a texture was requested */
     if (desc2.ddsCaps.dwCaps & DDSCAPS_TEXTURE)
-- 
1.7.3.4

From: Henri Verbeet <hverbeet at codeweavers.com>
Subject: [PATCH 3/5] ddraw: Introduce a function for creating the swapchain.
Message-Id: <1315419721-24150-3-git-send-email-hverbeet at codeweavers.com>
Date: Wed,  7 Sep 2011 20:21:59 +0200

---
 dlls/ddraw/ddraw.c |   78 ++++++++++++++++++++++++++++------------------------
 1 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 7dd0f2d..001a2be 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2833,6 +2833,47 @@ static HRESULT ddraw_create_gdi_swapchain(IDirectDrawImpl *ddraw, IDirectDrawSur
     return hr;
 }
 
+static HRESULT ddraw_create_swapchain(IDirectDrawImpl *ddraw, IDirectDrawSurfaceImpl *surface)
+{
+    HRESULT hr = WINED3D_OK;
+
+    /* If the implementation is OpenGL and there's no d3ddevice, attach a
+     * d3ddevice. But attach the d3ddevice only if the currently created
+     * surface was a primary surface (2D app in 3D mode) or a 3DDEVICE surface
+     * (3D app). The only case I can think of where this doesn't apply is when
+     * a 2D app was configured by the user to run with OpenGL and it didn't
+     * create the render target as first surface. In this case the render
+     * target creation will cause the 3D init. */
+    if (DefaultSurfaceType == SURFACE_OPENGL)
+    {
+        IDirectDrawSurfaceImpl *target = surface, *primary;
+        struct list *entry;
+
+        /* Search for the primary to use as render target. */
+        LIST_FOR_EACH(entry, &ddraw->surface_list)
+        {
+            primary = LIST_ENTRY(entry, IDirectDrawSurfaceImpl, surface_list_entry);
+            if ((primary->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
+                    == (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
+            {
+                TRACE("Using primary %p as render target.\n", target);
+                target = primary;
+                break;
+            }
+        }
+
+        TRACE("Attaching a D3DDevice, rendertarget = %p.\n", target);
+        hr = ddraw_attach_d3d_device(ddraw, target);
+    }
+    else if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
+    {
+        hr = ddraw_create_gdi_swapchain(ddraw, surface);
+    }
+
+    return hr;
+
+}
+
 /*****************************************************************************
  * IDirectDraw7::CreateSurface
  *
@@ -3211,42 +3252,7 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
 
     if (!ddraw->d3d_initialized && desc2.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE))
     {
-        HRESULT hr = WINED3D_OK;
-
-        /* If the implementation is OpenGL and there's no d3ddevice, attach a
-         * d3ddevice. But attach the d3ddevice only if the currently created
-         * surface was a primary surface (2D app in 3D mode) or a 3DDEVICE
-         * surface (3D app). The only case I can think of where this doesn't
-         * apply is when a 2D app was configured by the user to run with
-         * OpenGL and it didn't create the render target as first surface. In
-         * this case the render target creation will cause the 3D init. */
-        if (DefaultSurfaceType == SURFACE_OPENGL)
-        {
-            IDirectDrawSurfaceImpl *target = object, *surface;
-            struct list *entry;
-
-            /* Search for the primary to use as render target. */
-            LIST_FOR_EACH(entry, &ddraw->surface_list)
-            {
-                surface = LIST_ENTRY(entry, IDirectDrawSurfaceImpl, surface_list_entry);
-                if ((surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
-                        == (DDSCAPS_PRIMARYSURFACE | DDSCAPS_FRONTBUFFER))
-                {
-                    TRACE("Using primary %p as render target.\n", target);
-                    target = surface;
-                    break;
-                }
-            }
-
-            TRACE("Attaching a D3DDevice, rendertarget = %p.\n", target);
-            hr = ddraw_attach_d3d_device(ddraw, target);
-        }
-        else if (desc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
-        {
-            hr = ddraw_create_gdi_swapchain(ddraw, object);
-        }
-
-        if (FAILED(hr))
+        if (FAILED(hr = ddraw_create_swapchain(ddraw, object)))
         {
             IDirectDrawSurfaceImpl *release_surf;
             ERR("Failed to create swapchain, hr %#x.\n", hr);
-- 
1.7.3.4

From: Henri Verbeet <hverbeet at codeweavers.com>
Subject: [PATCH 4/5] wined3d: Make the device parameter to wined3d_device_get_sampler_state() const.
Message-Id: <1315419721-24150-4-git-send-email-hverbeet at codeweavers.com>
Date: Wed,  7 Sep 2011 20:22:00 +0200

---
 dlls/wined3d/device.c  |    2 +-
 include/wine/wined3d.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4a8b5c6..1b722f5 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2550,7 +2550,7 @@ HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
     return WINED3D_OK;
 }
 
-HRESULT CDECL wined3d_device_get_sampler_state(struct wined3d_device *device,
+HRESULT CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device,
         UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD *value)
 {
     TRACE("device %p, sampler_idx %u, state %s, value %p.\n",
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 2039398..ddf6561 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2243,7 +2243,7 @@ HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *dev
         WINED3DRENDERSTATETYPE state, DWORD *value);
 HRESULT __cdecl wined3d_device_get_render_target(struct wined3d_device *device,
         UINT render_target_idx, struct wined3d_surface **render_target);
-HRESULT __cdecl wined3d_device_get_sampler_state(struct wined3d_device *device,
+HRESULT __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device,
         UINT sampler_idx, WINED3DSAMPLERSTATETYPE state, DWORD *value);
 HRESULT __cdecl wined3d_device_get_scissor_rect(struct wined3d_device *device, RECT *rect);
 BOOL __cdecl wined3d_device_get_software_vertex_processing(struct wined3d_device *device);
-- 
1.7.3.4



More information about the wine-tests-results mailing list