summaryrefslogtreecommitdiff
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-07-15 16:55:14 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-12-05 15:40:09 -0800
commitc5d664f9dc2d281c74844cef36ecb9f5862a8f6a (patch)
tree3a1fae70847890735257b781d038ecd5a6d1b4c5 /src/intel/vulkan
parentf5232db9e5fb00efc094c5dd071da4be88527568 (diff)
anv/pipeline: Call nir_lower_constant_initializers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_pipeline.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 9b65e353a9..9104267090 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -136,6 +136,13 @@ anv_shader_compile_to_nir(struct anv_device *device,
nir_validate_shader(nir);
}
+ /* We have to lower away local constant initializers right before we
+ * inline functions. That way they get properly initialized at the top
+ * of the function and not at the top of its caller.
+ */
+ nir_lower_constant_initializers(nir, nir_var_local);
+ nir_validate_shader(nir);
+
nir_lower_returns(nir);
nir_validate_shader(nir);
@@ -155,6 +162,12 @@ anv_shader_compile_to_nir(struct anv_device *device,
nir_remove_dead_variables(nir, nir_var_system_value);
nir_validate_shader(nir);
+ /* Now that we've deleted all but the main function, we can go ahead and
+ * lower the rest of the constant initializers.
+ */
+ nir_lower_constant_initializers(nir, ~0);
+ nir_validate_shader(nir);
+
nir_propagate_invariant(nir);
nir_validate_shader(nir);