zink: remove 'scissors' member of viewport state
this is the vulkan-transformed value, but we can just apply it at draw time and save ourselves some memory Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9153>
This commit is contained in:

committed by
Marge Bot

parent
547e982e8e
commit
bc37d882fc
@@ -532,16 +532,8 @@ zink_set_scissor_states(struct pipe_context *pctx,
|
||||
{
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
|
||||
for (unsigned i = 0; i < num_scissors; i++) {
|
||||
VkRect2D scissor;
|
||||
|
||||
scissor.offset.x = states[i].minx;
|
||||
scissor.offset.y = states[i].miny;
|
||||
scissor.extent.width = states[i].maxx - states[i].minx;
|
||||
scissor.extent.height = states[i].maxy - states[i].miny;
|
||||
for (unsigned i = 0; i < num_scissors; i++)
|
||||
ctx->vp_state.scissor_states[start_slot + i] = states[i];
|
||||
ctx->vp_state.scissors[start_slot + i] = scissor;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -93,7 +93,6 @@ zink_so_target(struct pipe_stream_output_target *so_target)
|
||||
struct zink_viewport_state {
|
||||
struct pipe_viewport_state viewport_states[PIPE_MAX_VIEWPORTS];
|
||||
struct pipe_scissor_state scissor_states[PIPE_MAX_VIEWPORTS];
|
||||
VkRect2D scissors[PIPE_MAX_VIEWPORTS];
|
||||
uint8_t num_viewports;
|
||||
};
|
||||
|
||||
|
@@ -761,9 +761,14 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
else
|
||||
vkCmdSetViewport(batch->cmdbuf, 0, ctx->vp_state.num_viewports, viewports);
|
||||
VkRect2D scissors[PIPE_MAX_VIEWPORTS] = {};
|
||||
if (ctx->rast_state->base.scissor)
|
||||
memcpy(scissors, ctx->vp_state.scissors, sizeof(scissors));
|
||||
else if (ctx->fb_state.width && ctx->fb_state.height) {
|
||||
if (ctx->rast_state->base.scissor) {
|
||||
for (unsigned i = 0; i < ctx->vp_state.num_viewports; i++) {
|
||||
scissors[i].offset.x = ctx->vp_state.scissor_states[i].minx;
|
||||
scissors[i].offset.y = ctx->vp_state.scissor_states[i].miny;
|
||||
scissors[i].extent.width = ctx->vp_state.scissor_states[i].maxx - ctx->vp_state.scissor_states[i].minx;
|
||||
scissors[i].extent.height = ctx->vp_state.scissor_states[i].maxy - ctx->vp_state.scissor_states[i].miny;
|
||||
}
|
||||
} else if (ctx->fb_state.width && ctx->fb_state.height) {
|
||||
for (unsigned i = 0; i < ctx->vp_state.num_viewports; i++) {
|
||||
scissors[i].extent.width = ctx->fb_state.width;
|
||||
scissors[i].extent.height = ctx->fb_state.height;
|
||||
|
Reference in New Issue
Block a user