On 25 November 2017 at 20:58, Fabian Maurer <dark.shadow4(a)web.de> wrote:
@@ -858,6 +858,10 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state return; }
+ /* Unbind the FBOs to avoid have undefined behavior when reading data from it */ + GL_EXTCALL(glBindFramebuffer(GL_READ_FRAMEBUFFER, 0)); + GL_EXTCALL(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0)); + if (parameters->indirect) { const struct wined3d_indirect_dispatch_parameters *indirect = ¶meters->u.indirect; @@ -875,6 +879,10 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state } checkGLcall("dispatch compute");
+ /* Now rebind the FBOs to restore the original state */ + GL_EXTCALL(glBindFramebuffer(GL_READ_FRAMEBUFFER, context->fbo_read_binding)); + GL_EXTCALL(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, context->fbo_draw_binding)); + GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS)); checkGLcall("glMemoryBarrier");
I think I'd feel better about this if context_apply_compute_state() did a context_bind_fbo() followed by a context_invalidate_state() instead.