summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-02-20 12:07:21 +0100
committerNicolai Hähnle <[email protected]>2017-02-21 10:45:13 +0100
commit066a117be77fdc2b29c8eafabb4e2c2fa902a18e (patch)
treec1df87726ea1b0fbc7c8571042e29a9e280ebde2 /src/gallium/drivers/radeonsi/si_state.c
parent6a1d9684f4ec1e1eed49bc14749be7b7784277ec (diff)
radeonsi: fix UINT/SINT clamping for 10-bit formats on <= CIK
The same PS epilog workaround as for 8-bit integer formats is required, since the CB doesn't do clamping. Fixes GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels*. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 81592a7e858..6948a74fbdd 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2137,11 +2137,15 @@ static void si_initialize_color_surface(struct si_context *sctx,
blend_bypass = 1;
}
- if ((ntype == V_028C70_NUMBER_UINT || ntype == V_028C70_NUMBER_SINT) &&
- (format == V_028C70_COLOR_8 ||
- format == V_028C70_COLOR_8_8 ||
- format == V_028C70_COLOR_8_8_8_8))
- surf->color_is_int8 = true;
+ if (ntype == V_028C70_NUMBER_UINT || ntype == V_028C70_NUMBER_SINT) {
+ if (format == V_028C70_COLOR_8 ||
+ format == V_028C70_COLOR_8_8 ||
+ format == V_028C70_COLOR_8_8_8_8)
+ surf->color_is_int8 = true;
+ else if (format == V_028C70_COLOR_10_10_10_2 ||
+ format == V_028C70_COLOR_2_10_10_10)
+ surf->color_is_int10 = true;
+ }
color_info = S_028C70_FORMAT(format) |
S_028C70_COMP_SWAP(swap) |
@@ -2405,6 +2409,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
sctx->framebuffer.spi_shader_col_format_blend = 0;
sctx->framebuffer.spi_shader_col_format_blend_alpha = 0;
sctx->framebuffer.color_is_int8 = 0;
+ sctx->framebuffer.color_is_int10 = 0;
sctx->framebuffer.compressed_cb_mask = 0;
sctx->framebuffer.nr_samples = util_framebuffer_get_num_samples(state);
@@ -2434,6 +2439,8 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
if (surf->color_is_int8)
sctx->framebuffer.color_is_int8 |= 1 << i;
+ if (surf->color_is_int10)
+ sctx->framebuffer.color_is_int10 |= 1 << i;
if (rtex->fmask.size) {
sctx->framebuffer.compressed_cb_mask |= 1 << i;