I can't prove that this fixes anything but it seems right.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
if (result != VK_SUCCESS)
goto fail;
- nvk_lower_nir(device, nir, &robustness, pipeline_layout);
+ nvk_lower_nir(device, nir, &robustness, false, pipeline_layout);
result = nvk_compile_nir(pdevice, nir, NULL,
&pipeline->base.shaders[MESA_SHADER_COMPUTE]);
if (result != VK_SUCCESS)
goto fail;
- nvk_lower_nir(device, nir[stage], &robustness, pipeline_layout);
+ nvk_lower_nir(device, nir[stage], &robustness,
+ state.rp->view_mask != 0, pipeline_layout);
}
for (gl_shader_stage stage = 0; stage < MESA_SHADER_STAGES; stage++) {
void
nvk_lower_nir(struct nvk_device *device, nir_shader *nir,
const struct vk_pipeline_robustness_state *rs,
+ bool is_multiview,
const struct vk_pipeline_layout *layout)
{
NIR_PASS(_, nir, nir_split_struct_vars, nir_var_function_temp);
nir_metadata_block_index | nir_metadata_dominance, NULL);
NIR_PASS(_, nir, nir_lower_input_attachments,
&(nir_input_attachment_options) {
- .use_layer_id_sysval = true,
- .use_view_id_for_layer = true,
+ .use_layer_id_sysval = is_multiview,
+ .use_view_id_for_layer = is_multiview,
});
}
void
nvk_lower_nir(struct nvk_device *device, nir_shader *nir,
const struct vk_pipeline_robustness_state *rs,
+ bool is_multiview,
const struct vk_pipeline_layout *layout);
VkResult