anv: Handle patch primitives.
v2: Use anv_pipeline_has_stage rather than tess_info != NULL. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> [v1] Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -219,7 +219,6 @@ static const uint32_t vk_to_gen_primitive_type[] = {
|
|||||||
[VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY] = _3DPRIM_LINESTRIP_ADJ,
|
[VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY] = _3DPRIM_LINESTRIP_ADJ,
|
||||||
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY] = _3DPRIM_TRILIST_ADJ,
|
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY] = _3DPRIM_TRILIST_ADJ,
|
||||||
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY] = _3DPRIM_TRISTRIP_ADJ,
|
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY] = _3DPRIM_TRISTRIP_ADJ,
|
||||||
/* [VK_PRIMITIVE_TOPOLOGY_PATCH_LIST] = _3DPRIM_PATCHLIST_1 */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1099,7 +1098,13 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
|
|||||||
|
|
||||||
const VkPipelineInputAssemblyStateCreateInfo *ia_info =
|
const VkPipelineInputAssemblyStateCreateInfo *ia_info =
|
||||||
pCreateInfo->pInputAssemblyState;
|
pCreateInfo->pInputAssemblyState;
|
||||||
|
const VkPipelineTessellationStateCreateInfo *tess_info =
|
||||||
|
pCreateInfo->pTessellationState;
|
||||||
pipeline->primitive_restart = ia_info->primitiveRestartEnable;
|
pipeline->primitive_restart = ia_info->primitiveRestartEnable;
|
||||||
|
|
||||||
|
if (anv_pipeline_has_stage(pipeline, MESA_SHADER_TESS_EVAL))
|
||||||
|
pipeline->topology = _3DPRIM_PATCHLIST(tess_info->patchControlPoints);
|
||||||
|
else
|
||||||
pipeline->topology = vk_to_gen_primitive_type[ia_info->topology];
|
pipeline->topology = vk_to_gen_primitive_type[ia_info->topology];
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user