From ba15bb383f0756703e05bf202edc4771a1c54560 Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Wed, 17 Jun 2020 02:30:23 +0200 Subject: [PATCH] nir: only uniforms with dynamically_uniform offset are dynamically_uniform Previously all nir_intrinsic_load_uniform that were used as sources were considered to be dynamically_uniform but when offsets of load_uniform are indirect it can not be determined. This fixes artefacts in Google Maps 3D view in V3D. Fixes: 886d46b08971 ("nir: Add a function to determine if a source is dynamically uniform") Reviewed-by: Neil Roberts Part-of: --- src/compiler/nir/nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 8d2e1098301..2567be6efa0 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -1349,8 +1349,8 @@ nir_src_is_dynamically_uniform(nir_src src) /* As are uniform variables */ if (src.ssa->parent_instr->type == nir_instr_type_intrinsic) { nir_intrinsic_instr *intr = nir_instr_as_intrinsic(src.ssa->parent_instr); - - if (intr->intrinsic == nir_intrinsic_load_uniform) + if (intr->intrinsic == nir_intrinsic_load_uniform && + nir_src_is_dynamically_uniform(intr->src[0])) return true; } -- 2.30.2