turnip: use nir_opt_copy_prop_vars
authorJonathan Marek <jonathan@marek.ca>
Thu, 26 Sep 2019 04:30:22 +0000 (00:30 -0400)
committerJonathan Marek <jonathan@marek.ca>
Thu, 26 Sep 2019 21:18:13 +0000 (17:18 -0400)
Avoids getting a "load_output" in a case like this:

   gl_Position = ubuf.MVP * ubuf.position[gl_VertexIndex];
   frag_pos = gl_Position.xyz;

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
src/freedreno/vulkan/tu_shader.c

index 37edf82642baeaa9fb1e87d3d96a99acd1c3b2b2..2b68aeafffb399e968c0bcabdd4132c3e91a25dc 100644 (file)
@@ -302,6 +302,8 @@ tu_shader_create(struct tu_device *dev,
    nir_assign_var_locations(&nir->uniforms, &nir->num_uniforms,
                             ir3_glsl_type_size);
 
+   NIR_PASS_V(nir, nir_opt_copy_prop_vars);
+
    NIR_PASS_V(nir, nir_lower_system_values);
    NIR_PASS_V(nir, nir_lower_frexp);