summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-03-08 16:20:48 +1100
committerTimothy Arceri <[email protected]>2018-03-20 15:01:44 +1100
commit9a243eccae618e85aa7af762a4c40ecd8a2e4882 (patch)
treec4f30f925f15450b4733f11e3a111b1f53b15cd3 /src
parentdfe2f198550b262186e2882d7e573f1f3759deb7 (diff)
radv: don't lower indirects until after opts have run
Noticed while passing by. Not sure if it impacts anything, but likely to impact GFX9 more than anything else since we lower inputs, outputs and locals there. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_shader.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index ac577c36e9f..c6935805c79 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -275,7 +275,6 @@ radv_shader_compile_to_nir(struct radv_device *device,
nir_lower_var_copies(nir);
nir_lower_global_vars_to_local(nir);
nir_remove_dead_variables(nir, nir_var_local);
- ac_lower_indirect_derefs(nir, device->physical_device->rad_info.chip_class);
nir_lower_subgroups(nir, &(struct nir_lower_subgroups_options) {
.subgroup_size = 64,
.ballot_bit_size = 64,
@@ -287,6 +286,14 @@ radv_shader_compile_to_nir(struct radv_device *device,
radv_optimize_nir(nir);
+ /* Indirect lowering must be called after the radv_optimize_nir() loop
+ * has been called at least once. Otherwise indirect lowering can
+ * bloat the instruction count of the loop and cause it to be
+ * considered too large for unrolling.
+ */
+ ac_lower_indirect_derefs(nir, device->physical_device->rad_info.chip_class);
+ radv_optimize_nir(nir);
+
return nir;
}