radeonsi: fix RB+ blending with sRGB formats
authorMarek Olšák <marek.olsak@amd.com>
Tue, 24 Jan 2023 10:52:17 +0000 (05:52 -0500)
committerEric Engestrom <eric@engestrom.ch>
Wed, 8 Feb 2023 20:34:43 +0000 (20:34 +0000)
The epsilon for 8bpc is for the linear colorspace. There is no epsilon
for sRGB.

Fixes: 17021efc742 - radeonsi: adjust RB+ blend optimization settings

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 8556b3db71683fc0393b7f75b0317890c8c0ae4e)

.pick_status.json
src/gallium/drivers/radeonsi/si_state.c

index 3c84014..8f2487d 100644 (file)
         "description": "radeonsi: fix RB+ blending with sRGB formats",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "17021efc7421495ad189b82a26dd651c9a98ccb4"
     },
index 3ab4216..548279d 100644 (file)
@@ -193,7 +193,8 @@ static void si_emit_cb_render_state(struct si_context *sctx)
                 spi_format == V_028714_SPI_SHADER_UINT16_ABGR ||
                 spi_format == V_028714_SPI_SHADER_SINT16_ABGR) {
                sx_ps_downconvert |= V_028754_SX_RT_EXPORT_8_8_8_8 << (i * 4);
-               sx_blend_opt_epsilon |= V_028758_8BIT_FORMAT << (i * 4);
+               if (G_028C70_NUMBER_TYPE(surf->cb_color_info) != V_028C70_NUMBER_SRGB)
+                  sx_blend_opt_epsilon |= V_028758_8BIT_FORMAT << (i * 4);
             }
             break;