From c488abed8d265b6662e31b85409424746b56124d Mon Sep 17 00:00:00 2001 From: Lepton Wu Date: Wed, 24 Jun 2020 17:35:58 -0700 Subject: [PATCH] vrend: Bind framebuffer when creating context This make sure we have a valid framebuffer in current context. Some GPU driver like MALI is buggy and will crash on glEndQuery with targets like GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN if no valid framebuffer in current context. Signed-off-by: Lepton Wu Reviewed-by: Gert Wollny --- src/vrend_renderer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 3c85bf9..e4b8a34 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -10309,6 +10309,7 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id) } glGenFramebuffers(1, &sub->fb_id); + glBindFramebuffer(GL_FRAMEBUFFER, sub->fb_id); glGenFramebuffers(2, sub->blit_fb_ids); list_inithead(&sub->programs);