The location was only being incremented the first time we processed a
location. This meant we would incorrectly skip some elements of
an array if the first element was packed and proccessed previously
but other elements were not.
---
 src/gallium/drivers/radeonsi/si_shader_nir.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c 
b/src/gallium/drivers/radeonsi/si_shader_nir.c
index ed9f90a6a3a..4e15eeae6b9 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -911,7 +911,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, 
struct nir_shader *nir)
                                /* Packed components share the same location so 
skip
                                 * them if we have already processed the 
location.
                                 */
-                               if (processed_inputs & ((uint64_t)1 << loc)) {
+                               if (processed_inputs & ((uint64_t)1 << (loc + 
i))) {
                                        input_idx += 4;
                                        continue;
                                }
@@ -929,8 +929,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, 
struct nir_shader *nir)
                                        bitcast_inputs(ctx, data, input_idx);
                                }
 
-                               processed_inputs |= ((uint64_t)1 << loc);
-                               loc++;
+                               processed_inputs |= ((uint64_t)1 << (loc + i));
                                input_idx += 4;
                        }
                }
-- 
2.14.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to