diff options
author | Timothy Arceri <[email protected]> | 2019-02-06 20:37:14 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-02-08 02:54:56 +0000 |
commit | d0af13cfb4165366f1568ce407ee180ea2b554cd (patch) | |
tree | 9a043b19fbabab36998a47d20ab7edd32a163adb /src/mesa/state_tracker/st_glsl_to_nir.cpp | |
parent | d0abbaa528a0b23999079951c88effb3f2c0d27a (diff) |
st/glsl_to_nir: call nir_remove_dead_variables() after lowing local indirects
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_glsl_to_nir.cpp')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 5fc87354624..686c243e508 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -626,6 +626,13 @@ st_nir_link_shaders(nir_shader **producer, nir_shader **consumer, bool scalar) st_nir_opts(*producer, scalar); st_nir_opts(*consumer, scalar); + + /* Lowering indirects can cause varying to become unused. + * nir_compact_varyings() depends on all dead varyings being removed so + * we need to call nir_remove_dead_variables() again here. + */ + NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out); + NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in); } } |