[Mesa-dev] [PATCH v2 17/52] intel/fs: Uniformize the index in readInvocation

Jason Ekstrand jason at jlekstrand.net
Fri Oct 13 05:47:43 UTC 2017


The index is any value provided by the shader and this can be called in
non-uniform control flow so we can't just take component 0.  Found by
inspection.
---
 src/intel/compiler/brw_fs_nir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 653d6d8..333bb13 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4298,7 +4298,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       fs_reg tmp = bld.vgrf(value.type);
 
       bld.exec_all().emit(SHADER_OPCODE_BROADCAST, tmp, value,
-                          component(invocation, 0));
+                          bld.emit_uniformize(invocation));
 
       bld.MOV(retype(dest, BRW_REGISTER_TYPE_D),
               fs_reg(component(tmp, 0)));
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list