v3d/compiler: fix image size for 1D arrays
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 30 Jun 2020 08:59:47 +0000 (10:59 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Jul 2020 10:01:46 +0000 (10:01 +0000)
Reviewed by: Alejandro PiƱeiro <apinheiro@igalia.com>

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5692>

src/broadcom/compiler/nir_to_vir.c

index 1092c6b41dae32e3446ab971bf4be04eef77b929..2b641240d5370216cfc2a54dfb769ec81d41ea99 100644 (file)
@@ -1762,7 +1762,10 @@ ntq_emit_image_size(struct v3d_compile *c, nir_intrinsic_instr *instr)
                        vir_uniform(c, QUNIFORM_IMAGE_WIDTH, image_index));
         if (instr->num_components > 1) {
                 ntq_store_dest(c, &instr->dest, 1,
-                               vir_uniform(c, QUNIFORM_IMAGE_HEIGHT,
+                               vir_uniform(c,
+                                           instr->num_components == 2 && is_array ?
+                                                   QUNIFORM_IMAGE_ARRAY_SIZE :
+                                                   QUNIFORM_IMAGE_HEIGHT,
                                            image_index));
         }
         if (instr->num_components > 2) {