diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c index dbea83c..d11096f 100644 --- a/src/vrend_blitter.c +++ b/src/vrend_blitter.c @@ -843,10 +843,13 @@ void vrend_renderer_blit_gl(struct vrend_resource *src_res, vrend_fb_bind_texture(dst_res, 0, info->dst.level, layer); if (has_srgb_write_control) { - if (util_format_is_srgb(info->dst.format)) + if (util_format_is_srgb(info->dst.format) || util_format_is_srgb(info->src.format)) { + VREND_DEBUG(dbg_blit, ctx, "%s: Enable GL_FRAMEBUFFER_SRGB\n", __func__); glEnable(GL_FRAMEBUFFER_SRGB); - else + } else { + VREND_DEBUG(dbg_blit, ctx, "%s: Disable GL_FRAMEBUFFER_SRGB\n", __func__); glDisable(GL_FRAMEBUFFER_SRGB); + } } buffers = GL_COLOR_ATTACHMENT0; diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 1a326f9..1f797ea 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -7563,11 +7563,6 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx, !vrend_format_is_ds(dst_res->base.format)) use_gl = true; - if (util_format_is_srgb(info->src.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; - } /* different depth formats */ if (vrend_format_is_ds(src_res->base.format) && vrend_format_is_ds(dst_res->base.format)) { @@ -7726,7 +7721,8 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx, glBindFramebuffer(GL_DRAW_FRAMEBUFFER, ctx->sub->blit_fb_ids[1]); if (has_feature(feat_srgb_write_control)) { - if (util_format_is_srgb(info->dst.format)) + if (util_format_is_srgb(info->dst.format) || + util_format_is_srgb(info->src.format)) glEnable(GL_FRAMEBUFFER_SRGB); else glDisable(GL_FRAMEBUFFER_SRGB);