panvk: Call lower_input_attachment_loads() from compile_shader()

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38821>
This commit is contained in:
Faith Ekstrand 2025-11-05 15:42:53 -05:00 committed by Marge Bot
parent cddfa4615b
commit 3747e3318a
2 changed files with 4 additions and 6 deletions

View file

@ -74,7 +74,6 @@ struct lower_desc_ctx {
bool null_descriptor_support; bool null_descriptor_support;
nir_address_format ubo_addr_format; nir_address_format ubo_addr_format;
nir_address_format ssbo_addr_format; nir_address_format ssbo_addr_format;
struct panvk_shader_variant *shader;
}; };
static nir_address_format static nir_address_format
@ -1310,7 +1309,6 @@ panvk_per_arch(nir_lower_descriptors)(
const struct vk_graphics_pipeline_state *state, struct panvk_shader_variant *shader) const struct vk_graphics_pipeline_state *state, struct panvk_shader_variant *shader)
{ {
struct lower_desc_ctx ctx = { struct lower_desc_ctx ctx = {
.shader = shader,
.add_bounds_checks = .add_bounds_checks =
rs->storage_buffers != rs->storage_buffers !=
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT || VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT ||
@ -1355,10 +1353,6 @@ panvk_per_arch(nir_lower_descriptors)(
create_copy_table(nir, &ctx); create_copy_table(nir, &ctx);
upload_shader_desc_info(dev, shader, &ctx.desc_info); upload_shader_desc_info(dev, shader, &ctx.desc_info);
if (nir->info.stage == MESA_SHADER_FRAGMENT)
NIR_PASS(progress, nir, panvk_per_arch(nir_lower_input_attachment_loads),
state, &shader->fs.input_attachment_read);
NIR_PASS(progress, nir, nir_shader_instructions_pass, NIR_PASS(progress, nir, nir_shader_instructions_pass,
lower_descriptors_instr, nir_metadata_control_flow, &ctx); lower_descriptors_instr, nir_metadata_control_flow, &ctx);

View file

@ -1379,6 +1379,10 @@ panvk_compile_shader(struct panvk_device *dev,
if (state && state->ms && state->ms->sample_shading_enable) if (state && state->ms && state->ms->sample_shading_enable)
nir->info.fs.uses_sample_shading = true; nir->info.fs.uses_sample_shading = true;
/* We need to lower input attachments before we lower descriptors */
NIR_PASS(_, nir, panvk_per_arch(nir_lower_input_attachment_loads),
state, &variant->fs.input_attachment_read);
panvk_lower_nir(dev, nir, info->set_layout_count, info->set_layouts, panvk_lower_nir(dev, nir, info->set_layout_count, info->set_layouts,
info->robustness, state, &inputs, variant); info->robustness, state, &inputs, variant);