On 1 December 2017 at 20:25, Fabian Maurer dark.shadow4@web.de wrote:
On Freitag, 1. Dezember 2017 13:49:59 CET Henri Verbeet wrote: Alright, adding
context_bind_fbo(context, GL_FRAMEBUFFER, 0);
context_invalidate_state(context, STATE_FRAMEBUFFER);
in "context_apply_compute_state" makes it render properly, too.
But don't we need to re-bind the old framebuffer(s) afterwards?
Not necessarily. The correct framebuffer needs to be bound for subsequent draws, but that may very well be a different framebuffer than the one currently bound. Invalidating STATE_FRAMEBUFFER ensures that context_apply_draw_state() will bind the correct framebuffer even if the bound render targets didn't change since the previous draw.