renderer: always restore FBO binding

Without this, the next patch gets trickier, because we try to
*avoid* passing down the wrong data rather than trying to react to it.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Erik Faye-Lund 6 years ago
parent b08bfaed3f
commit b91a85a195
  1. 6
      src/vrend_renderer.c

@ -6556,6 +6556,7 @@ static int vrend_transfer_send_readpixels(struct vrend_context *ctx,
int elsize = util_format_get_blocksize(res->base.format); int elsize = util_format_get_blocksize(res->base.format);
float depth_scale; float depth_scale;
int row_stride = info->stride / elsize; int row_stride = info->stride / elsize;
GLint old_fbo;
vrend_use_program(ctx, 0); vrend_use_program(ctx, 0);
@ -6585,6 +6586,8 @@ static int vrend_transfer_send_readpixels(struct vrend_context *ctx,
row_stride = util_format_get_nblocksx(res->base.format, u_minify(res->base.width0, info->level)); row_stride = util_format_get_nblocksx(res->base.format, u_minify(res->base.width0, info->level));
} }
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &old_fbo);
if (res->readback_fb_id == 0 || (int)res->readback_fb_level != info->level || if (res->readback_fb_id == 0 || (int)res->readback_fb_level != info->level ||
(int)res->readback_fb_z != info->box->z) { (int)res->readback_fb_z != info->box->z) {
@ -6692,8 +6695,7 @@ static int vrend_transfer_send_readpixels(struct vrend_context *ctx,
free(data); free(data);
} }
if (!info->context0 && ctx->sub) glBindFramebuffer(GL_FRAMEBUFFER, old_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, ctx->sub->fb_id);
return 0; return 0;
} }

Loading…
Cancel
Save