nir/opt_shrink_vectors: add option to skip shrinking image stores
Some games declare the wrong format, so we might want to disable this
optimization in that case.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22
("nir/opt_shrink_vectors: shrink image stores using the format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>
This commit is contained in:
@@ -2359,7 +2359,7 @@ radv_link_shaders(struct radv_pipeline *pipeline, nir_shader **shaders,
|
||||
if (nir_lower_io_to_scalar_early(ordered_shaders[i], mask)) {
|
||||
/* Optimize the new vector code and then remove dead vars */
|
||||
nir_copy_prop(ordered_shaders[i]);
|
||||
nir_opt_shrink_vectors(ordered_shaders[i]);
|
||||
nir_opt_shrink_vectors(ordered_shaders[i], true);
|
||||
|
||||
if (ordered_shaders[i]->info.stage != last) {
|
||||
/* Optimize swizzled movs of load_const for
|
||||
@@ -3351,7 +3351,7 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline,
|
||||
|
||||
radv_lower_io(device, nir[i]);
|
||||
|
||||
lower_to_scalar |= nir_opt_shrink_vectors(nir[i]);
|
||||
lower_to_scalar |= nir_opt_shrink_vectors(nir[i], true);
|
||||
|
||||
if (lower_to_scalar)
|
||||
nir_lower_alu_to_scalar(nir[i], NULL, NULL);
|
||||
|
Reference in New Issue
Block a user