anv: fix dynamic primitive topology for tess

this needs to use the pre-converted topology using tess state patch control points

Fixes: f6fa4a8000 ("anv: add support for dynamic primitive topology change")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11332>
This commit is contained in:
Mike Blumenkrantz 2021-06-11 17:47:53 -04:00 committed by Marge Bot
parent bcd82a90c2
commit 24342e499b
2 changed files with 2 additions and 15 deletions

View File

@ -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) {

View File

@ -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];