wined3d: Do not call device_switch_onscreen_ds() while under the GL lock.
authorHenri Verbeet <hverbeet@codeweavers.com>
Sun, 5 Sep 2010 21:38:48 +0000 (23:38 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 6 Sep 2010 14:14:18 +0000 (16:14 +0200)
dlls/wined3d/arb_program_shader.c
dlls/wined3d/device.c
dlls/wined3d/surface.c
dlls/wined3d/wined3d_private.h

index 7901f0f8d84a373d5c6184eb92f88260e1abe47d..3ca500459b3bc7b6456a11c1c266e63f191d3985 100644 (file)
@@ -7170,6 +7170,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
     return WINED3D_OK;
 }
 
+/* Do not call while under the GL lock. */
 static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
         const RECT *dst_rect, const WINED3DCOLORVALUE *color)
 {
index 511696192e6733fd72f7c41bdead33f314fc3fa8..6cd07bbf12fb9ce2158dc0b97645c1476749f4be 100644 (file)
@@ -576,6 +576,7 @@ void device_get_draw_rect(IWineD3DDeviceImpl *device, RECT *rect)
     }
 }
 
+/* Do not call while under the GL lock. */
 void device_switch_onscreen_ds(IWineD3DDeviceImpl *device,
         struct wined3d_context *context, IWineD3DSurfaceImpl *depth_stencil)
 {
@@ -653,6 +654,7 @@ static void prepare_ds_clear(IWineD3DSurfaceImpl *ds, struct wined3d_context *co
     surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy);
 }
 
+/* Do not call while under the GL lock. */
 HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, IWineD3DSurfaceImpl **rts,
         UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags,
         const WINED3DCOLORVALUE *color, float depth, DWORD stencil)
@@ -715,7 +717,11 @@ HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, I
         DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
 
         if (location == SFLAG_DS_ONSCREEN && depth_stencil != device->onscreen_depth_stencil)
+        {
+            LEAVE_GL();
             device_switch_onscreen_ds(device, context, depth_stencil);
+            ENTER_GL();
+        }
         prepare_ds_clear(depth_stencil, context, location, draw_rect, rect_count, clear_rect);
         surface_modify_location(depth_stencil, SFLAG_INDRAWABLE, TRUE);
 
@@ -4574,6 +4580,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Present(IWineD3DDevice *iface,
     return WINED3D_OK;
 }
 
+/* Do not call while under the GL lock. */
 static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD rect_count,
         const RECT *rects, DWORD flags, WINED3DCOLOR color, float depth, DWORD stencil)
 {
@@ -5493,6 +5500,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT
     return WINED3DERR_INVALIDCALL;
 }
 
+/* Do not call while under the GL lock. */
 static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
         IWineD3DSurface *surface, const RECT *rect, const WINED3DCOLORVALUE *color)
 {
@@ -5511,6 +5519,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
     return surface_color_fill(s, rect, color);
 }
 
+/* Do not call while under the GL lock. */
 static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *iface,
         IWineD3DRendertargetView *rendertarget_view, const WINED3DCOLORVALUE *color)
 {
index fe26fd5fc520dbe1dd156e11846d4247d7c72c92..8f39a972ee4ce270f999f56a71c03f933f804605 100644 (file)
@@ -3356,6 +3356,7 @@ static void surface_blt_fbo(IWineD3DDeviceImpl *device, const WINED3DTEXTUREFILT
     context_release(context);
 }
 
+/* Do not call while under the GL lock. */
 HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color)
 {
     IWineD3DDeviceImpl *device = s->resource.device;
@@ -3373,6 +3374,7 @@ HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED
 }
 
 /* Not called from the VTable */
+/* Do not call while under the GL lock. */
 static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *dst_surface, const RECT *DestRect,
         IWineD3DSurfaceImpl *src_surface, const RECT *SrcRect, DWORD Flags, const WINEDDBLTFX *DDBltFx,
         WINED3DTEXTUREFILTERTYPE Filter)
@@ -4873,6 +4875,7 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
     return FALSE;
 }
 
+/* Do not call while under the GL lock. */
 static HRESULT ffp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
         const RECT *dst_rect, const WINED3DCOLORVALUE *color)
 {
@@ -4924,6 +4927,7 @@ static BOOL cpu_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
     return FALSE;
 }
 
+/* Do not call while under the GL lock. */
 static HRESULT cpu_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
         const RECT *dst_rect, const WINED3DCOLORVALUE *color)
 {
index 691b8cc7e8bb961a97544ba6e36b2766347f6d7b..2963933bd670fc2a12f4319f2c3c4d612966d99f 100644 (file)
@@ -1133,7 +1133,8 @@ enum blit_operation
     BLIT_OP_COLOR_FILL
 };
 
-/* Shaders for color conversions in blits */
+/* Shaders for color conversions in blits. Do not do blit operations while
+ * already under the GL lock. */
 struct blit_shader
 {
     HRESULT (*alloc_private)(IWineD3DDevice *iface);