From fd132f25bafedd9c59f62add848186ff40a3fa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Wed, 1 Jun 2022 15:48:45 +0200 Subject: [PATCH] anv: mask out not applicable state flags when setting up mesh pipeline Fixes tests matching: dEQP-VK.pipeline.extended_dynamic_state.cmd_buffer_start.*unused_ms These tests bind mesh pipeline, immediately after that bind non-mesh pipeline and expect that binding mesh pipeline was a no-op. v2: do it in one place & add comment (Lionel) Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_pipeline.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index cd59946a1ba..1c7f8b05804 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2366,6 +2366,19 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, } } + /* When binding a mesh pipeline into a command buffer, it should not affect the + * pre-rasterization bits of legacy graphics pipelines. So remove all the + * pre-rasterization flags from the non-dynamic bits from the mesh pipelines + * here so we don't copy any of that stuff when binding those into a command + * buffer. + */ + if (pipeline->active_stages & VK_SHADER_STAGE_MESH_BIT_NV) { + states &= ~(ANV_CMD_DIRTY_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE | + ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_RESTART_ENABLE | + ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY); + } + + pipeline->dynamic_state_mask = states; }