blitter: handle GL_FRAMEBUFFER_SRGB for emulated blits

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 2e3417a74b
commit 8b2e86f7b6
  1. 10
      src/vrend_blitter.c
  2. 3
      src/vrend_renderer.c
  3. 3
      src/vrend_renderer.h

@ -700,7 +700,8 @@ void vrend_renderer_blit_gl(UNUSED struct vrend_context *ctx,
struct vrend_resource *src_res, struct vrend_resource *src_res,
struct vrend_resource *dst_res, struct vrend_resource *dst_res,
const struct pipe_blit_info *info, const struct pipe_blit_info *info,
bool has_texture_srgb_decode) bool has_texture_srgb_decode,
bool has_srgb_write_control)
{ {
struct vrend_blitter_ctx *blit_ctx = &vrend_blit_ctx; struct vrend_blitter_ctx *blit_ctx = &vrend_blit_ctx;
GLuint buffers; GLuint buffers;
@ -842,6 +843,13 @@ void vrend_renderer_blit_gl(UNUSED struct vrend_context *ctx,
glBindFramebuffer(GL_FRAMEBUFFER, blit_ctx->fb_id); glBindFramebuffer(GL_FRAMEBUFFER, blit_ctx->fb_id);
vrend_fb_bind_texture(dst_res, 0, info->dst.level, layer); vrend_fb_bind_texture(dst_res, 0, info->dst.level, layer);
if (has_srgb_write_control) {
if (util_format_is_srgb(info->dst.format))
glEnable(GL_FRAMEBUFFER_SRGB);
else
glDisable(GL_FRAMEBUFFER_SRGB);
}
buffers = GL_COLOR_ATTACHMENT0; buffers = GL_COLOR_ATTACHMENT0;
glDrawBuffers(1, &buffers); glDrawBuffers(1, &buffers);
blitter_set_texcoords(blit_ctx, src_res, info->src.level, blitter_set_texcoords(blit_ctx, src_res, info->src.level,

@ -7346,7 +7346,8 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
if (use_gl) { if (use_gl) {
VREND_DEBUG(dbg_blit, ctx, "BLIT_INT: use GL fallback\n"); VREND_DEBUG(dbg_blit, ctx, "BLIT_INT: use GL fallback\n");
vrend_renderer_blit_gl(ctx, src_res, dst_res, info, vrend_renderer_blit_gl(ctx, src_res, dst_res, info,
has_feature(feat_texture_srgb_decode)); has_feature(feat_texture_srgb_decode),
has_feature(feat_srgb_write_control));
vrend_clicbs->make_current(ctx->sub->gl_context); vrend_clicbs->make_current(ctx->sub->gl_context);
return; return;
} }

@ -405,7 +405,8 @@ void vrend_renderer_blit_gl(struct vrend_context *ctx,
struct vrend_resource *src_res, struct vrend_resource *src_res,
struct vrend_resource *dst_res, struct vrend_resource *dst_res,
const struct pipe_blit_info *info, const struct pipe_blit_info *info,
bool has_texture_srgb_decode); bool has_texture_srgb_decode,
bool has_srgb_write_control);
void vrend_blitter_fini(void); void vrend_blitter_fini(void);
void vrend_renderer_reset(void); void vrend_renderer_reset(void);

Loading…
Cancel
Save