diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 7150818..6fb3eb5 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -716,7 +716,7 @@ struct vrend_sub_context { uint32_t abo_used_mask; struct vrend_context_tweaks tweaks; uint8_t swizzle_output_rgb_to_bgr; - uint8_t convert_linear_to_srgb_on_write; + uint8_t needs_manual_srgb_encode_bitmask; int fake_occlusion_query_samples_passed_multiplier; int prim_mode; @@ -2645,7 +2645,7 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_sub_context *sub_ctx) } sub_ctx->swizzle_output_rgb_to_bgr = 0; - sub_ctx->convert_linear_to_srgb_on_write = 0; + sub_ctx->needs_manual_srgb_encode_bitmask = 0; for (int i = 0; i < sub_ctx->nr_cbufs; i++) { if (sub_ctx->surf[i]) { struct vrend_surface *surf = sub_ctx->surf[i]; @@ -2670,7 +2670,7 @@ static void vrend_hw_emit_framebuffer_state(struct vrend_sub_context *sub_ctx) "manually converting linear->srgb for EGL-backed framebuffer color attachment 0x%x" " (surface format is %s; resource format is %s)\n", i, util_format_name(surf->format), util_format_name(surf->texture->base.format)); - sub_ctx->convert_linear_to_srgb_on_write |= 1 << i; + sub_ctx->needs_manual_srgb_encode_bitmask |= 1 << i; } } } @@ -3491,7 +3491,7 @@ static inline void vrend_sync_shader_io(struct vrend_sub_context *sub_ctx, if (type == PIPE_SHADER_FRAGMENT) { key->fs.invert_origin = !sub_ctx->inverted_fbo_content; key->fs.swizzle_output_rgb_to_bgr = sub_ctx->swizzle_output_rgb_to_bgr; - key->fs.convert_linear_to_srgb_on_write = sub_ctx->convert_linear_to_srgb_on_write; + key->fs.needs_manual_srgb_encode_bitmask = sub_ctx->needs_manual_srgb_encode_bitmask; if (vrend_state.use_gles && can_emulate_logicop(sub_ctx->blend_state.logicop_func)) { key->fs.logicop_enabled = sub_ctx->blend_state.logicop_enable; key->fs.logicop_func = sub_ctx->blend_state.logicop_func; @@ -4980,7 +4980,7 @@ int vrend_draw_vbo(struct vrend_context *ctx, } if (sub_ctx->shader_dirty || sub_ctx->swizzle_output_rgb_to_bgr || - sub_ctx->convert_linear_to_srgb_on_write || sub_ctx->vbo_dirty) + sub_ctx->needs_manual_srgb_encode_bitmask || sub_ctx->vbo_dirty) new_program = vrend_select_program(sub_ctx, info->vertices_per_patch); if (!sub_ctx->prog) { diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 2a2005c..8bc265b 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2287,7 +2287,7 @@ static void emit_cbuf_colorspace_convert(const struct dump_ctx *ctx, struct vrend_glsl_strbufs *glsl_strbufs) { for (uint i = 0; i < ctx->num_outputs; i++) { - if (ctx->key->fs.convert_linear_to_srgb_on_write & (1 << i)) { + if (ctx->key->fs.needs_manual_srgb_encode_bitmask & (1 << i)) { emit_buff(glsl_strbufs, "{\n" " vec3 temp = fsout_c%d.xyz;\n" @@ -2319,7 +2319,7 @@ static void handle_fragment_proc_exit(const struct dump_ctx *ctx, if (ctx->key->fs.swizzle_output_rgb_to_bgr) emit_cbuf_swizzle(ctx, glsl_strbufs); - if (ctx->key->fs.convert_linear_to_srgb_on_write) + if (ctx->key->fs.needs_manual_srgb_encode_bitmask) emit_cbuf_colorspace_convert(ctx, glsl_strbufs); if (ctx->write_all_cbufs) diff --git a/src/vrend_shader.h b/src/vrend_shader.h index 14757d9..b160da5 100644 --- a/src/vrend_shader.h +++ b/src/vrend_shader.h @@ -160,7 +160,7 @@ struct vrend_shader_key { uint8_t surface_component_bits[PIPE_MAX_COLOR_BUFS]; uint32_t coord_replace; uint8_t swizzle_output_rgb_to_bgr; - uint8_t convert_linear_to_srgb_on_write; + uint8_t needs_manual_srgb_encode_bitmask; uint8_t cbufs_are_a8_bitmask; uint8_t cbufs_signed_int_bitmask; uint8_t cbufs_unsigned_int_bitmask;