[Mesa-dev] [PATCH] radeonsi: fixup sizes of shader resource and sampler arrays

Christian König deathsimple at vodafone.de
Sat Jun 14 03:20:06 PDT 2014


Am 14.06.2014 03:46, schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This was wrong for a very long time. I wonder if the array size has any
> effect on anything.

We only do a bit of GEP pointer arithmetic with them and so probably 
ignore range limits anyway.

Nevertheless it's obviously wrong and should be fixed. Patch is 
Reviewed-by: Christian König <christian.koenig at amd.com>

Regards,
Christian.

> ---
>   src/gallium/drivers/radeonsi/si_shader.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index a7ca35b..4ed5906 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -2266,9 +2266,9 @@ static void create_function(struct si_shader_context *si_shader_ctx)
>   	/* We assume at most 16 textures per program at the moment.
>   	 * This need probably need to be changed to support bindless textures */
>   	params[SI_PARAM_SAMPLER] = LLVMPointerType(
> -		LLVMArrayType(LLVMVectorType(i8, 16), NUM_SAMPLER_VIEWS), CONST_ADDR_SPACE);
> +		LLVMArrayType(LLVMVectorType(i8, 16), NUM_SAMPLER_STATES), CONST_ADDR_SPACE);
>   	params[SI_PARAM_RESOURCE] = LLVMPointerType(
> -		LLVMArrayType(LLVMVectorType(i8, 32), NUM_SAMPLER_STATES), CONST_ADDR_SPACE);
> +		LLVMArrayType(LLVMVectorType(i8, 32), NUM_SAMPLER_VIEWS), CONST_ADDR_SPACE);
>   
>   	switch (si_shader_ctx->type) {
>   	case TGSI_PROCESSOR_VERTEX:



More information about the mesa-dev mailing list