ac: remove arrays when when querying sampler info
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 19 Jan 2018 04:51:15 +0000 (15:51 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 22 Jan 2018 22:50:47 +0000 (09:50 +1100)
Fixes the following ARB_arrays_of_arrays piglit tests:

basic-imagestore-const-uniform-index
basic-imagestore-mixed-const-non-const-uniform-index
basic-imagestore-mixed-const-non-const-uniform-index2
basic-imagestore-non-const-uniform-index

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_nir_to_llvm.c

index 53f5782eac577fef30e23a51aef2b9ef5202535f..214fb148a11db1ad5139cc8c78c5c06c32a3eb7c 100644 (file)
@@ -3518,9 +3518,7 @@ static LLVMValueRef adjust_sample_index_using_fmask(struct ac_llvm_context *ctx,
 static LLVMValueRef get_image_coords(struct ac_nir_context *ctx,
                                     const nir_intrinsic_instr *instr)
 {
-       const struct glsl_type *type = instr->variables[0]->var->type;
-       if(instr->variables[0]->deref.child)
-               type = instr->variables[0]->deref.child->type;
+       const struct glsl_type *type = glsl_without_array(instr->variables[0]->var->type);
 
        LLVMValueRef src0 = get_src(ctx, instr->src[0]);
        LLVMValueRef coords[4];