Commit 1070e075 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Add missing GL locking to calls to FBO functions.

parent 12c4af8d
...@@ -371,6 +371,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource ...@@ -371,6 +371,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
{ {
struct fbo_entry *entry, *entry2; struct fbo_entry *entry, *entry2;
ENTER_GL();
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->contexts[i]->fbo_list, struct fbo_entry, entry) LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->contexts[i]->fbo_list, struct fbo_entry, entry)
{ {
BOOL destroyed = FALSE; BOOL destroyed = FALSE;
...@@ -388,6 +390,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource ...@@ -388,6 +390,8 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
if (!destroyed && entry->depth_stencil == (IWineD3DSurface *)resource) if (!destroyed && entry->depth_stencil == (IWineD3DSurface *)resource)
context_destroy_fbo_entry(This, entry); context_destroy_fbo_entry(This, entry);
} }
LEAVE_GL();
} }
break; break;
...@@ -1599,7 +1603,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU ...@@ -1599,7 +1603,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
case CTXUSAGE_CLEAR: case CTXUSAGE_CLEAR:
case CTXUSAGE_DRAWPRIM: case CTXUSAGE_DRAWPRIM:
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
ENTER_GL();
context_apply_fbo_state((IWineD3DDevice *)This); context_apply_fbo_state((IWineD3DDevice *)This);
LEAVE_GL();
} }
if (context->draw_buffer_dirty) { if (context->draw_buffer_dirty) {
apply_draw_buffer(This, target, FALSE); apply_draw_buffer(This, target, FALSE);
...@@ -1611,10 +1617,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU ...@@ -1611,10 +1617,9 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
if (This->render_offscreen) { if (This->render_offscreen) {
FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n"); FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n");
ENTER_GL();
context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo); context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo);
context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target); context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target);
ENTER_GL();
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0));
checkGLcall("glFramebufferRenderbufferEXT"); checkGLcall("glFramebufferRenderbufferEXT");
LEAVE_GL(); LEAVE_GL();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment