zink: set tess info in pipeline creation

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>
This commit is contained in:
Mike Blumenkrantz 2020-12-17 21:28:22 -05:00 committed by Marge Bot
parent 2891e0b74e
commit 291bbac12c
3 changed files with 9 additions and 0 deletions

View file

@ -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,

View file

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

View file

@ -53,6 +53,7 @@ struct zink_gfx_pipeline_state {
VkSampleMask sample_mask;
uint8_t rast_samples;
uint8_t vertices_per_patch;
unsigned num_viewports;