From 839629634fcdbe3722de90d125910f224a2ab530 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 11 Jan 2024 16:04:09 -0600 Subject: [PATCH] nvk: Move nir_lower_patch_vertices to nvk_lower_nir() As long as it happens after we merge tess info between the two stages (it does) then there's no need to have it in the pipeline code. It's just an optimization anyway. Part-of: --- src/nouveau/vulkan/nvk_graphics_pipeline.c | 1 - src/nouveau/vulkan/nvk_shader.c | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c b/src/nouveau/vulkan/nvk_graphics_pipeline.c index a57891e4d18..a59b18721bc 100644 --- a/src/nouveau/vulkan/nvk_graphics_pipeline.c +++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c @@ -224,7 +224,6 @@ nvk_graphics_pipeline_create(struct nvk_device *dev, } if (nir[MESA_SHADER_TESS_CTRL] && nir[MESA_SHADER_TESS_EVAL]) { - nir_lower_patch_vertices(nir[MESA_SHADER_TESS_EVAL], nir[MESA_SHADER_TESS_CTRL]->info.tess.tcs_vertices_out, NULL); merge_tess_info(&nir[MESA_SHADER_TESS_EVAL]->info, &nir[MESA_SHADER_TESS_CTRL]->info); } diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 77d4c66aea8..b2b70011a78 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -365,6 +365,11 @@ nvk_lower_nir(struct nvk_device *dev, nir_shader *nir, }); } + if (nir->info.stage == MESA_SHADER_TESS_EVAL) { + NIR_PASS(_, nir, nir_lower_patch_vertices, + nir->info.tess.tcs_vertices_out, NULL); + } + const struct lower_ycbcr_state ycbcr_state = { .set_layout_count = set_layout_count, .set_layouts = set_layouts,