broadcom/compiler: Enable PER_QUAD for UBO and SSBO loads.
authorArcady Goldmints-Orlov <agoldmints@igalia.com>
Mon, 10 Aug 2020 03:17:01 +0000 (22:17 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 20:14:14 +0000 (20:14 +0000)
Helper invocations need to be able to read from UBOs since those values
can be used for flow control, but writes from helper invocations need to
be dropped.

Fixes CTS tests:
  dEQP-VK.glsl.derivate.*.uniform_loop.*

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/6356>

src/broadcom/compiler/nir_to_vir.c

index e48db957bfb149a100ea5dd1feee22d842eb559b..171028b627eab539f076a25756962d2c41460d7f 100644 (file)
@@ -339,9 +339,12 @@ ntq_emit_tmu_general(struct v3d_compile *c, nir_intrinsic_instr *instr,
                         num_components = tmu_writes - 1;
                 }
 
+                uint32_t perquad = is_load
+                   ? GENERAL_TMU_LOOKUP_PER_QUAD
+                   : GENERAL_TMU_LOOKUP_PER_PIXEL;
                 uint32_t config = (0xffffff00 |
                                    tmu_op << 3|
-                                   GENERAL_TMU_LOOKUP_PER_PIXEL);
+                                   perquad);
                 if (num_components == 1) {
                         config |= GENERAL_TMU_LOOKUP_TYPE_32BIT_UI;
                 } else {