mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-03 07:04:02 +08:00
zink: move viewport count to zink_gfx_pipeline_state
this is part of the pipeline state (there's an extension for setting it dynamically but we don't supprot that atm Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349>
This commit is contained in:
parent
818bd61099
commit
09be30b9e4
@ -348,7 +348,9 @@ zink_set_viewport_states(struct pipe_context *pctx,
|
||||
ctx->viewport_states[start_slot + i] = state[i];
|
||||
ctx->viewports[start_slot + i] = viewport;
|
||||
}
|
||||
ctx->num_viewports = start_slot + num_viewports;
|
||||
if (ctx->gfx_pipeline_state.num_viewports != start_slot + num_viewports)
|
||||
ctx->gfx_pipeline_state.hash = 0;
|
||||
ctx->gfx_pipeline_state.num_viewports = start_slot + num_viewports;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -107,8 +107,6 @@ struct zink_context {
|
||||
struct pipe_scissor_state scissor_states[PIPE_MAX_VIEWPORTS];
|
||||
VkViewport viewports[PIPE_MAX_VIEWPORTS];
|
||||
VkRect2D scissors[PIPE_MAX_VIEWPORTS];
|
||||
unsigned num_viewports;
|
||||
|
||||
struct pipe_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
|
||||
uint32_t buffers_enabled_mask;
|
||||
|
||||
|
@ -393,9 +393,9 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
}
|
||||
}
|
||||
|
||||
vkCmdSetViewport(batch->cmdbuf, 0, ctx->num_viewports, ctx->viewports);
|
||||
vkCmdSetViewport(batch->cmdbuf, 0, ctx->gfx_pipeline_state.num_viewports, ctx->viewports);
|
||||
if (ctx->rast_state->base.scissor)
|
||||
vkCmdSetScissor(batch->cmdbuf, 0, ctx->num_viewports, ctx->scissors);
|
||||
vkCmdSetScissor(batch->cmdbuf, 0, ctx->gfx_pipeline_state.num_viewports, ctx->scissors);
|
||||
else if (ctx->fb_state.width && ctx->fb_state.height) {
|
||||
VkRect2D fb_scissor = {};
|
||||
fb_scissor.extent.width = ctx->fb_state.width;
|
||||
|
@ -54,6 +54,8 @@ struct zink_gfx_pipeline_state {
|
||||
VkSampleMask sample_mask;
|
||||
uint8_t rast_samples;
|
||||
|
||||
unsigned num_viewports;
|
||||
|
||||
bool primitive_restart;
|
||||
|
||||
/* Pre-hashed value for table lookup, invalid when zero.
|
||||
|
Loading…
Reference in New Issue
Block a user