[Mesa-dev] [PATCH 12/17] radeonsi/gfx9: don't use the workaround for gather4 + stencil

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Apr 5 08:16:14 UTC 2018


Patches 11-12 are:

Acked-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 04/04/2018 03:59 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> it doesn't seem to be needed.
> ---
>   src/gallium/drivers/radeonsi/si_state.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index cd64d3bc0fb..f7560645ae9 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -1616,21 +1616,27 @@ static uint32_t si_translate_texformat(struct pipe_screen *screen,
>   		switch (format) {
>   		case PIPE_FORMAT_Z16_UNORM:
>   			return V_008F14_IMG_DATA_FORMAT_16;
>   		case PIPE_FORMAT_X24S8_UINT:
>   		case PIPE_FORMAT_S8X24_UINT:
>   			/*
>   			 * Implemented as an 8_8_8_8 data format to fix texture
>   			 * gathers in stencil sampling. This affects at least
>   			 * GL45-CTS.texture_cube_map_array.sampling on VI.
>   			 */
> -			return V_008F14_IMG_DATA_FORMAT_8_8_8_8;
> +			if (sscreen->info.chip_class <= VI)
> +				return V_008F14_IMG_DATA_FORMAT_8_8_8_8;
> +
> +			if (format == PIPE_FORMAT_X24S8_UINT)
> +				return V_008F14_IMG_DATA_FORMAT_8_24;
> +			else
> +				return V_008F14_IMG_DATA_FORMAT_24_8;
>   		case PIPE_FORMAT_Z24X8_UNORM:
>   		case PIPE_FORMAT_Z24_UNORM_S8_UINT:
>   			return V_008F14_IMG_DATA_FORMAT_8_24;
>   		case PIPE_FORMAT_X8Z24_UNORM:
>   		case PIPE_FORMAT_S8_UINT_Z24_UNORM:
>   			return V_008F14_IMG_DATA_FORMAT_24_8;
>   		case PIPE_FORMAT_S8_UINT:
>   			return V_008F14_IMG_DATA_FORMAT_8;
>   		case PIPE_FORMAT_Z32_FLOAT:
>   			return V_008F14_IMG_DATA_FORMAT_32;
> @@ -3572,21 +3578,24 @@ si_make_texture_descriptor(struct si_screen *screen,
>   		case PIPE_FORMAT_X32_S8X24_UINT:
>   		case PIPE_FORMAT_X8Z24_UNORM:
>   			util_format_compose_swizzles(swizzle_yyyy, state_swizzle, swizzle);
>   			break;
>   		case PIPE_FORMAT_X24S8_UINT:
>   			/*
>   			 * X24S8 is implemented as an 8_8_8_8 data format, to
>   			 * fix texture gathers. This affects at least
>   			 * GL45-CTS.texture_cube_map_array.sampling on VI.
>   			 */
> -			util_format_compose_swizzles(swizzle_wwww, state_swizzle, swizzle);
> +			if (screen->info.chip_class <= VI)
> +				util_format_compose_swizzles(swizzle_wwww, state_swizzle, swizzle);
> +			else
> +				util_format_compose_swizzles(swizzle_yyyy, state_swizzle, swizzle);
>   			break;
>   		default:
>   			util_format_compose_swizzles(swizzle_xxxx, state_swizzle, swizzle);
>   		}
>   	} else {
>   		util_format_compose_swizzles(desc->swizzle, state_swizzle, swizzle);
>   	}
>   
>   	first_non_void = util_format_get_first_non_void_channel(pipe_format);
>   
> 


More information about the mesa-dev mailing list