diff --git a/src/nouveau/vulkan/nvk_compute_pipeline.c b/src/nouveau/vulkan/nvk_compute_pipeline.c index 8ec0cfc6e9c..4fdcb413f8c 100644 --- a/src/nouveau/vulkan/nvk_compute_pipeline.c +++ b/src/nouveau/vulkan/nvk_compute_pipeline.c @@ -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]); diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c b/src/nouveau/vulkan/nvk_graphics_pipeline.c index f7e9662acc7..02c605bef37 100644 --- a/src/nouveau/vulkan/nvk_graphics_pipeline.c +++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c @@ -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++) { diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 48e97e83197..fb38ac818b0 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -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, }); } diff --git a/src/nouveau/vulkan/nvk_shader.h b/src/nouveau/vulkan/nvk_shader.h index 8ef98a7d231..0e223ecb76e 100644 --- a/src/nouveau/vulkan/nvk_shader.h +++ b/src/nouveau/vulkan/nvk_shader.h @@ -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