diff options
author | Jason Ekstrand <[email protected]> | 2016-01-11 10:55:57 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-01-11 11:06:06 -0800 |
commit | 790565b06ec80de663820e136105ecb18125743f (patch) | |
tree | bd37ae33ab102266c8caf427cdcffa47020f953a /src/vulkan/anv_pipeline.c | |
parent | b8ec48ee76adda4b643fb153507ac72942ecbe26 (diff) |
anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
While we're at it, we delete any unused variables. This allows us to prune
variables that are not used in the current stage from the shader.
Diffstat (limited to 'src/vulkan/anv_pipeline.c')
-rw-r--r-- | src/vulkan/anv_pipeline.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 9054d76892d..db4e19bf486 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -133,6 +133,13 @@ anv_shader_compile_to_nir(struct anv_device *device, assert(exec_list_length(&nir->functions) == 1); entry_point->name = ralloc_strdup(entry_point, "main"); + nir_remove_dead_variables(nir, nir_var_shader_in); + nir_remove_dead_variables(nir, nir_var_shader_out); + nir_remove_dead_variables(nir, nir_var_system_value); + nir_validate_shader(nir); + + nir_lower_outputs_to_temporaries(entry_point->shader, entry_point); + nir_lower_system_values(nir); nir_validate_shader(nir); } |