const struct tu_pipeline *pipeline = cmd->state.pipeline;
enum pc_di_primtype primtype = pipeline->ia.primtype;
- if (pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY))
- primtype = cmd->state.primtype;
+ if (pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY)) {
+ if (primtype < DI_PT_PATCHES0) {
+ /* If tesselation used, only VK_PRIMITIVE_TOPOLOGY_PATCH_LIST can be
+ * set via vkCmdSetPrimitiveTopologyEXT, but primtype is already
+ * calculated at the pipeline creation based on control points
+ * for each patch.
+ *
+ * Just use the primtype as is for the case.
+ */
+ primtype = cmd->state.primtype;
+ }
+ }
uint32_t initiator =
CP_DRAW_INDX_OFFSET_0_PRIM_TYPE(primtype) |
const VkPipelineTessellationStateCreateInfo *tess_info =
builder->create_info->pTessellationState;
- assert(!(pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY)));
-
assert(pipeline->ia.primtype == DI_PT_PATCHES0);
assert(tess_info->patchControlPoints <= 32);
pipeline->ia.primtype += tess_info->patchControlPoints;