summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-02-13 09:42:48 +1100
committerTimothy Arceri <[email protected]>2018-02-15 09:02:41 +1100
commit3ad52501dc28a4286c97ed386419f7b617e093af (patch)
treeac66dedce27f108e88715f144a9d50ac4eede216 /src/amd
parent6acab18828f90d8ecefec059c6d646f3ab8de541 (diff)
ac/nir_to_llvm: fix image size for arrays of arrays
Fixes cts test: KHR-GL44.shader_image_size.advanced-changeSize Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index b5575d5753c..dc551172d98 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3786,12 +3786,10 @@ static LLVMValueRef visit_image_size(struct ac_nir_context *ctx,
{
LLVMValueRef res;
const nir_variable *var = instr->variables[0]->var;
- const struct glsl_type *type = instr->variables[0]->var->type;
- bool da = glsl_sampler_type_is_array(var->type) ||
- glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_CUBE ||
- glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_3D;
- if(instr->variables[0]->deref.child)
- type = instr->variables[0]->deref.child->type;
+ const struct glsl_type *type = glsl_without_array(var->type);
+ bool da = glsl_sampler_type_is_array(type) ||
+ glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE ||
+ glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_3D;
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_BUF)
return get_buffer_size(ctx,