diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c index 39c0a18528b..86c26dcff75 100644 --- a/src/gallium/drivers/zink/zink_draw.c +++ b/src/gallium/drivers/zink/zink_draw.c @@ -249,6 +249,7 @@ zink_draw_vbo(struct pipe_context *pctx, if (ctx->gfx_pipeline_state.primitive_restart != !!dinfo->primitive_restart) ctx->gfx_pipeline_state.hash = 0; ctx->gfx_pipeline_state.primitive_restart = !!dinfo->primitive_restart; + ctx->gfx_pipeline_state.vertices_per_patch = dinfo->vertices_per_patch; VkPipeline pipeline = zink_get_gfx_pipeline(screen, gfx_program, &ctx->gfx_pipeline_state, diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 50d786365e0..c36bc3c7475 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -147,6 +147,13 @@ zink_create_gfx_pipeline(struct zink_screen *screen, pci.pDepthStencilState = &depth_stencil_state; pci.pDynamicState = &pipelineDynamicStateCreateInfo; + VkPipelineTessellationStateCreateInfo tci = {}; + if (prog->shaders[PIPE_SHADER_TESS_CTRL] && prog->shaders[PIPE_SHADER_TESS_EVAL]) { + tci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO; + tci.patchControlPoints = state->vertices_per_patch; + pci.pTessellationState = &tci; + } + VkPipelineShaderStageCreateInfo shader_stages[ZINK_SHADER_COUNT]; uint32_t num_stages = 0; for (int i = 0; i < ZINK_SHADER_COUNT; ++i) { diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 1d0d5e28f3d..e895a86ae98 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -53,6 +53,7 @@ struct zink_gfx_pipeline_state { VkSampleMask sample_mask; uint8_t rast_samples; + uint8_t vertices_per_patch; unsigned num_viewports;