nvk: Only use view_id for layer in multiview

I can't prove that this fixes anything but it seems right.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-04-08 12:52:23 -05:00 committed by Marge Bot
parent 3e93173cc9
commit 72263d7589
4 changed files with 7 additions and 4 deletions

View file

@ -188,7 +188,7 @@ nvk_compute_pipeline_create(struct nvk_device *device,
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]);

View file

@ -249,7 +249,8 @@ nvk_graphics_pipeline_create(struct nvk_device *device,
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++) {

View file

@ -286,6 +286,7 @@ assign_io_locations(nir_shader *nir)
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);
@ -315,8 +316,8 @@ nvk_lower_nir(struct nvk_device *device, nir_shader *nir,
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,
});
}

View file

@ -113,6 +113,7 @@ nvk_nir_lower_descriptors(nir_shader *nir,
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