aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c16
-rw-r--r--src/freedreno/vulkan/tu_util.h3
2 files changed, 18 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 6093881217e..e6442575af5 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -1930,6 +1930,21 @@ tu_pipeline_static_state(struct tu_pipeline *pipeline, struct tu_cs *cs,
}
static void
+tu_pipeline_builder_parse_tessellation(struct tu_pipeline_builder *builder,
+ struct tu_pipeline *pipeline)
+{
+ const VkPipelineTessellationStateCreateInfo *tess_info =
+ builder->create_info->pTessellationState;
+
+ if (!tess_info)
+ return;
+
+ assert(pipeline->ia.primtype == DI_PT_PATCHES0);
+ assert(tess_info->patchControlPoints <= 32);
+ pipeline->ia.primtype += tess_info->patchControlPoints;
+}
+
+static void
tu_pipeline_builder_parse_viewport(struct tu_pipeline_builder *builder,
struct tu_pipeline *pipeline)
{
@@ -2151,6 +2166,7 @@ tu_pipeline_builder_build(struct tu_pipeline_builder *builder,
tu_pipeline_builder_parse_shader_stages(builder, *pipeline);
tu_pipeline_builder_parse_vertex_input(builder, *pipeline);
tu_pipeline_builder_parse_input_assembly(builder, *pipeline);
+ tu_pipeline_builder_parse_tessellation(builder, *pipeline);
tu_pipeline_builder_parse_viewport(builder, *pipeline);
tu_pipeline_builder_parse_rasterization(builder, *pipeline);
tu_pipeline_builder_parse_depth_stencil(builder, *pipeline);
diff --git a/src/freedreno/vulkan/tu_util.h b/src/freedreno/vulkan/tu_util.h
index 18462c83562..c34cd689ac7 100644
--- a/src/freedreno/vulkan/tu_util.h
+++ b/src/freedreno/vulkan/tu_util.h
@@ -124,7 +124,8 @@ tu6_primtype(VkPrimitiveTopology topology)
[VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY] = DI_PT_LINESTRIP_ADJ,
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY] = DI_PT_TRI_ADJ,
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY] = DI_PT_TRISTRIP_ADJ,
- [VK_PRIMITIVE_TOPOLOGY_PATCH_LIST] = 0,
+ /* Return PATCH0 and update in tu_pipeline_builder_parse_tessellation */
+ [VK_PRIMITIVE_TOPOLOGY_PATCH_LIST] = DI_PT_PATCHES0,
};
assert(topology < ARRAY_SIZE(lookup));
return lookup[topology];