vrend,blit: set GL_FRAMEBUFFER_SRGB based on blit dest format and not resource format

Fixes piglits spec/arb_framebuffer_srgb
   blit * * * disabled *

Closes: #63

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 3a55d4ba91
commit 2e3417a74b
  1. 9
      src/vrend_renderer.c

@ -7304,10 +7304,11 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
!vrend_format_is_ds(dst_res->base.format)) !vrend_format_is_ds(dst_res->base.format))
use_gl = true; use_gl = true;
if (util_format_is_srgb(src_res->base.format) && if (util_format_is_srgb(info->src.format) &&
!util_format_is_srgb(dst_res->base.format)) !util_format_is_srgb(info->dst.format)) {
VREND_DEBUG(dbg_blit, ctx, "BLIT: Use GL fallback because src is SRGB but dest not.");
use_gl = true; use_gl = true;
}
/* different depth formats */ /* different depth formats */
if (vrend_format_is_ds(src_res->base.format) && if (vrend_format_is_ds(src_res->base.format) &&
vrend_format_is_ds(dst_res->base.format)) { vrend_format_is_ds(dst_res->base.format)) {
@ -7465,7 +7466,7 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, ctx->sub->blit_fb_ids[1]); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, ctx->sub->blit_fb_ids[1]);
if (has_feature(feat_srgb_write_control)) { if (has_feature(feat_srgb_write_control)) {
if (util_format_is_srgb(dst_res->base.format)) if (util_format_is_srgb(info->dst.format))
glEnable(GL_FRAMEBUFFER_SRGB); glEnable(GL_FRAMEBUFFER_SRGB);
else else
glDisable(GL_FRAMEBUFFER_SRGB); glDisable(GL_FRAMEBUFFER_SRGB);

Loading…
Cancel
Save