renderer: start of fix to srgb framebuffer

the main test still fails, but this should fix some of them.
macos/master
Dave Airlie 10 years ago
parent d0f866ad4b
commit e5b4d12cab
  1. 17
      src/vrend_renderer.c

@ -1236,8 +1236,23 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_context *ctx)
};
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->sub->fb_id);
if (ctx->sub->nr_cbufs == 0)
if (ctx->sub->nr_cbufs == 0) {
glReadBuffer(GL_NONE);
glDisable(GL_FRAMEBUFFER_SRGB_EXT);
} else {
struct vrend_surface *surf = NULL;
int i;
for (i = 0; i < ctx->sub->nr_cbufs; i++) {
if (ctx->sub->surf[i]) {
surf = ctx->sub->surf[i];
}
}
if (util_format_is_srgb(surf->format)) {
glEnable(GL_FRAMEBUFFER_SRGB_EXT);
} else {
glDisable(GL_FRAMEBUFFER_SRGB_EXT);
}
}
glDrawBuffers(ctx->sub->nr_cbufs, buffers);
}

Loading…
Cancel
Save