diff options
author | Marek Olšák <[email protected]> | 2017-08-10 22:29:54 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-08-11 20:38:29 +0200 |
commit | 27fef5d52d44c8684fa4e7a21bd7a4284f3688ee (patch) | |
tree | 7c80f288151a86abb6ac6990e69438596a236f40 /src/gallium/drivers/radeonsi/si_state.c | |
parent | 2eee03b7a11339159f9a1f6ef90259caea899048 (diff) |
radeonsi/gfx9: use the VI codepath for clamping Z
This fixes corrupted shadows in Unigine Valley.
The corruption disappeared when I stopped setting IMG_DATA_FORMAT_24_8
for depth.
Cc: 17.2 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 11dee499b87..2c413a4c365 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3177,14 +3177,13 @@ si_make_texture_descriptor(struct si_screen *screen, uint32_t *fmask_state) { struct pipe_resource *res = &tex->resource.b.b; - const struct util_format_description *base_desc, *desc; + const struct util_format_description *desc; unsigned char swizzle[4]; int first_non_void; unsigned num_format, data_format, type; uint64_t va; desc = util_format_description(pipe_format); - base_desc = util_format_description(res->format); if (desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS) { const unsigned char swizzle_xxxx[4] = {0, 0, 0, 0}; @@ -3285,15 +3284,6 @@ si_make_texture_descriptor(struct si_screen *screen, data_format = 0; } - /* Enable clamping for UNORM depth formats promoted to Z32F. */ - if (screen->b.chip_class >= GFX9 && - util_format_has_depth(desc) && - num_format == V_008F14_IMG_NUM_FORMAT_FLOAT && - util_get_depth_format_type(base_desc) != UTIL_FORMAT_TYPE_FLOAT) { - /* NUM_FORMAT=FLOAT and DATA_FORMAT=24_8 means "clamp to [0,1]". */ - data_format = V_008F14_IMG_DATA_FORMAT_24_8; - } - /* S8 with Z32 HTILE needs a special format. */ if (screen->b.chip_class >= GFX9 && pipe_format == PIPE_FORMAT_S8_UINT && |