panvk: Lower blending after lower_var_copies

nir_lower_blend needs store_deref as does
io_arrays_to_elements_no_indirects.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16483>
This commit is contained in:
Jason Ekstrand 2022-05-12 09:53:08 -05:00 committed by Marge Bot
parent 4050697a8f
commit 9e22e2ac88
2 changed files with 13 additions and 9 deletions

View file

@ -33,6 +33,7 @@ include = [
"dEQP-VK.image.image_size.*",
"dEQP-VK.image.load_store.with_format.*",
"dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.depth_test_disabled.depth_write_enabled",
"dEQP-VK.pipeline.image.suballocation.sampling_type.*.view_type.2d*",
"dEQP-VK.pipeline.input_assembly.*",
"dEQP-VK.pipeline.logic_op.*",
"dEQP-VK.pipeline.sampler.view_type.*.format.r*.address_modes.all_mode_clamp_to_border*",

View file

@ -390,12 +390,6 @@ panvk_per_arch(shader_create)(struct panvk_device *dev,
NIR_PASS_V(nir, nir_opt_combine_stores, nir_var_all);
NIR_PASS_V(nir, nir_opt_trivial_continues);
if (stage == MESA_SHADER_FRAGMENT) {
/* This is required for nir_lower_blend */
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true);
panvk_lower_blend(pdev, nir, &inputs, blend_state, static_blend_constants);
}
/* Do texture lowering here. Yes, it's a duplication of the texture
* lowering in bifrost_compile. However, we need to lower texture stuff
* now, before we call panvk_per_arch(nir_lower_descriptors)() because some
@ -457,15 +451,24 @@ panvk_per_arch(shader_create)(struct panvk_device *dev,
nir_metadata_dominance,
(void *)layout);
nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs, stage);
nir_assign_io_var_locations(nir, nir_var_shader_out, &nir->num_outputs, stage);
NIR_PASS_V(nir, nir_lower_system_values);
NIR_PASS_V(nir, nir_lower_compute_system_values, NULL);
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);
/* We have to run nir_lower_blend() after we've gotten rid of copies (it
* requires load/store) and before we assign output locations.
*/
if (stage == MESA_SHADER_FRAGMENT) {
/* This is required for nir_lower_blend */
NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true);
panvk_lower_blend(pdev, nir, &inputs, blend_state, static_blend_constants);
}
nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs, stage);
nir_assign_io_var_locations(nir, nir_var_shader_out, &nir->num_outputs, stage);
/* Needed to turn shader_temp into function_temp since the backend only
* handles the latter for now.
*/