vc4: don't relay on intr->num_components for non-vectorized intrinsics
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>
Sat, 13 Jun 2020 23:48:39 +0000 (01:48 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Jun 2020 02:48:18 +0000 (02:48 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>

src/gallium/drivers/vc4/vc4_program.c

index 2d16c479313dd92b7e95dcf900e80f9d99c0ee9a..4bf7e367213a58fb3a0d1a82876bec3eddc9023a 100644 (file)
@@ -1775,7 +1775,7 @@ ntq_emit_intrinsic(struct vc4_compile *c, nir_intrinsic_instr *instr)
                 break;
 
         case nir_intrinsic_load_user_clip_plane:
-                for (int i = 0; i < instr->num_components; i++) {
+                for (int i = 0; i < nir_intrinsic_dest_components(instr); i++) {
                         ntq_store_dest(c, &instr->dest, i,
                                        qir_uniform(c, QUNIFORM_USER_CLIP_PLANE,
                                                    nir_intrinsic_ucp_id(instr) *