From 24342e499bc58348b257716f629dccca3c1b0833 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 11 Jun 2021 17:47:53 -0400 Subject: [PATCH] anv: fix dynamic primitive topology for tess this needs to use the pre-converted topology using tess state patch control points Fixes: f6fa4a80000 ("anv: add support for dynamic primitive topology change") Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_pipeline.c | 15 +-------------- src/intel/vulkan/gfx8_cmd_buffer.c | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index c7b3a721065..35d90f77ee2 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -1976,20 +1976,7 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, if (states & ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY) { assert(pCreateInfo->pInputAssemblyState); - bool has_tess = false; - for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) { - const VkPipelineShaderStageCreateInfo *sinfo = &pCreateInfo->pStages[i]; - gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage); - if (stage == MESA_SHADER_TESS_CTRL || stage == MESA_SHADER_TESS_EVAL) - has_tess = true; - } - if (has_tess) { - const VkPipelineTessellationStateCreateInfo *tess_info = - pCreateInfo->pTessellationState; - dynamic->primitive_topology = _3DPRIM_PATCHLIST(tess_info->patchControlPoints); - } else { - dynamic->primitive_topology = pCreateInfo->pInputAssemblyState->topology; - } + dynamic->primitive_topology = pCreateInfo->pInputAssemblyState->topology; } if (states & ANV_CMD_DIRTY_DYNAMIC_RASTERIZER_DISCARD_ENABLE) { diff --git a/src/intel/vulkan/gfx8_cmd_buffer.c b/src/intel/vulkan/gfx8_cmd_buffer.c index 59202fa8952..f428c022cf8 100644 --- a/src/intel/vulkan/gfx8_cmd_buffer.c +++ b/src/intel/vulkan/gfx8_cmd_buffer.c @@ -642,7 +642,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) ANV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY)) { uint32_t topology; if (anv_pipeline_has_stage(pipeline, MESA_SHADER_TESS_EVAL)) - topology = d->primitive_topology; + topology = pipeline->topology; else topology = genX(vk_to_intel_primitive_type)[d->primitive_topology];