zink: expand patch_vertices pipeline key bitsize
no need to compact the bits anymore, so make this a uint16 Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16838>
This commit is contained in:
parent
1c0434dd95
commit
7ff3c75ef3
|
@ -1930,7 +1930,7 @@ zink_set_patch_vertices(struct pipe_context *pctx, uint8_t patch_vertices)
|
||||||
{
|
{
|
||||||
struct zink_context *ctx = zink_context(pctx);
|
struct zink_context *ctx = zink_context(pctx);
|
||||||
if (zink_set_tcs_key_patches(ctx, patch_vertices)) {
|
if (zink_set_tcs_key_patches(ctx, patch_vertices)) {
|
||||||
ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch = patch_vertices ? patch_vertices - 1 : 0;
|
ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch = patch_vertices;
|
||||||
if (zink_screen(ctx->base.screen)->info.dynamic_state2_feats.extendedDynamicState2PatchControlPoints)
|
if (zink_screen(ctx->base.screen)->info.dynamic_state2_feats.extendedDynamicState2PatchControlPoints)
|
||||||
VKCTX(CmdSetPatchControlPointsEXT)(ctx->batch.state->cmdbuf, patch_vertices);
|
VKCTX(CmdSetPatchControlPointsEXT)(ctx->batch.state->cmdbuf, patch_vertices);
|
||||||
else
|
else
|
||||||
|
@ -2460,7 +2460,7 @@ flush_batch(struct zink_context *ctx, bool sync)
|
||||||
ctx->di.bindless_refs_dirty = true;
|
ctx->di.bindless_refs_dirty = true;
|
||||||
ctx->sample_locations_changed = ctx->gfx_pipeline_state.sample_locations_enabled;
|
ctx->sample_locations_changed = ctx->gfx_pipeline_state.sample_locations_enabled;
|
||||||
if (zink_screen(ctx->base.screen)->info.dynamic_state2_feats.extendedDynamicState2PatchControlPoints)
|
if (zink_screen(ctx->base.screen)->info.dynamic_state2_feats.extendedDynamicState2PatchControlPoints)
|
||||||
VKCTX(CmdSetPatchControlPointsEXT)(ctx->batch.state->cmdbuf, ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch + 1);
|
VKCTX(CmdSetPatchControlPointsEXT)(ctx->batch.state->cmdbuf, ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch);
|
||||||
if (conditional_render_active)
|
if (conditional_render_active)
|
||||||
zink_start_conditional_render(ctx);
|
zink_start_conditional_render(ctx);
|
||||||
reapply_color_write(ctx);
|
reapply_color_write(ctx);
|
||||||
|
@ -4093,6 +4093,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||||
|
|
||||||
ctx->pipeline_changed[0] = ctx->pipeline_changed[1] = true;
|
ctx->pipeline_changed[0] = ctx->pipeline_changed[1] = true;
|
||||||
ctx->gfx_pipeline_state.dirty = true;
|
ctx->gfx_pipeline_state.dirty = true;
|
||||||
|
ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch = 1;
|
||||||
ctx->gfx_pipeline_state.uses_dynamic_stride = screen->info.have_EXT_extended_dynamic_state ||
|
ctx->gfx_pipeline_state.uses_dynamic_stride = screen->info.have_EXT_extended_dynamic_state ||
|
||||||
screen->info.have_EXT_vertex_input_dynamic_state;
|
screen->info.have_EXT_vertex_input_dynamic_state;
|
||||||
ctx->compute_pipeline_state.dirty = true;
|
ctx->compute_pipeline_state.dirty = true;
|
||||||
|
@ -4200,6 +4201,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||||
|
|
||||||
ctx->gfx_pipeline_state.shader_keys.last_vertex.key.vs_base.last_vertex_stage = true;
|
ctx->gfx_pipeline_state.shader_keys.last_vertex.key.vs_base.last_vertex_stage = true;
|
||||||
ctx->last_vertex_stage_dirty = true;
|
ctx->last_vertex_stage_dirty = true;
|
||||||
|
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_TESS_CTRL].key.tcs.patch_vertices = 1;
|
||||||
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_VERTEX].size = sizeof(struct zink_vs_key_base);
|
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_VERTEX].size = sizeof(struct zink_vs_key_base);
|
||||||
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_TESS_EVAL].size = sizeof(struct zink_vs_key_base);
|
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_TESS_EVAL].size = sizeof(struct zink_vs_key_base);
|
||||||
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_TESS_CTRL].size = sizeof(struct zink_tcs_key);
|
ctx->gfx_pipeline_state.shader_keys.key[PIPE_SHADER_TESS_CTRL].size = sizeof(struct zink_tcs_key);
|
||||||
|
|
|
@ -200,7 +200,7 @@ update_gfx_program(struct zink_context *ctx)
|
||||||
ctx->dirty_shader_stages |= prog->stages_present;
|
ctx->dirty_shader_stages |= prog->stages_present;
|
||||||
} else {
|
} else {
|
||||||
ctx->dirty_shader_stages |= bits;
|
ctx->dirty_shader_stages |= bits;
|
||||||
prog = zink_create_gfx_program(ctx, ctx->gfx_stages, ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch + 1);
|
prog = zink_create_gfx_program(ctx, ctx->gfx_stages, ctx->gfx_pipeline_state.dyn_state2.vertices_per_patch);
|
||||||
_mesa_hash_table_insert_pre_hashed(ht, hash, prog->shaders, prog);
|
_mesa_hash_table_insert_pre_hashed(ht, hash, prog->shaders, prog);
|
||||||
}
|
}
|
||||||
zink_update_gfx_program(ctx, prog);
|
zink_update_gfx_program(ctx, prog);
|
||||||
|
|
|
@ -338,7 +338,7 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
|
||||||
VkPipelineTessellationDomainOriginStateCreateInfo tdci = {0};
|
VkPipelineTessellationDomainOriginStateCreateInfo tdci = {0};
|
||||||
if (prog->shaders[PIPE_SHADER_TESS_CTRL] && prog->shaders[PIPE_SHADER_TESS_EVAL]) {
|
if (prog->shaders[PIPE_SHADER_TESS_CTRL] && prog->shaders[PIPE_SHADER_TESS_EVAL]) {
|
||||||
tci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
|
tci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
|
||||||
tci.patchControlPoints = state->dyn_state2.vertices_per_patch + 1;
|
tci.patchControlPoints = state->dyn_state2.vertices_per_patch;
|
||||||
pci.pTessellationState = &tci;
|
pci.pTessellationState = &tci;
|
||||||
tci.pNext = &tdci;
|
tci.pNext = &tdci;
|
||||||
tdci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO;
|
tdci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO;
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct zink_pipeline_dynamic_state1 {
|
||||||
struct zink_pipeline_dynamic_state2 {
|
struct zink_pipeline_dynamic_state2 {
|
||||||
bool primitive_restart;
|
bool primitive_restart;
|
||||||
bool rasterizer_discard;
|
bool rasterizer_discard;
|
||||||
uint32_t vertices_per_patch:5;
|
uint16_t vertices_per_patch; //5 bits
|
||||||
};
|
};
|
||||||
|
|
||||||
struct zink_gfx_pipeline_state {
|
struct zink_gfx_pipeline_state {
|
||||||
|
|
Loading…
Reference in New Issue