intel/fs: Uniformize the index in readInvocation
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 2 Sep 2017 05:35:43 +0000 (22:35 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Nov 2017 18:37:52 +0000 (10:37 -0800)
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.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/intel/compiler/brw_fs_nir.cpp

index 07bb1ad0e13106889a4e28ee6ce8bdab4a299853..201a23f83bda790736515d2e0beb1a92340e026c 100644 (file)
@@ -4305,7 +4305,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)));