lima/gpir: fix float uniform alignment issue
authorVasily Khoruzhick <anarsoul@gmail.com>
Wed, 1 May 2019 02:53:01 +0000 (19:53 -0700)
committerVasily Khoruzhick <anarsoul@gmail.com>
Mon, 6 May 2019 21:08:09 +0000 (14:08 -0700)
If PIPE_CAP_PACKED_UNIFORMS is not set uniforms are vec4 aligned,
so lima_nir_lower_uniform_to_scalar should use first channel of vec4
for float uniforms.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/ir/lima_nir_lower_uniform_to_scalar.c

index c1bbbc4b71a956b56a2e9c8638d9b7a5d7365e2d..2bea90cef78aa04ab2a989e1022c63b551ce9eb4 100644 (file)
@@ -71,8 +71,7 @@ lima_nir_lower_uniform_to_scalar(nir_shader *shader)
 
                nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
 
-               if (intr->intrinsic != nir_intrinsic_load_uniform ||
-                   intr->num_components == 1)
+               if (intr->intrinsic != nir_intrinsic_load_uniform)
                   continue;
 
                lower_load_uniform_to_scalar(&b, intr);