mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 00:49:04 +02:00
zink: fixup scissoring
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
c4446098cf
commit
f26eab3175
2 changed files with 12 additions and 35 deletions
|
|
@ -415,7 +415,6 @@ zink_set_scissor_states(struct pipe_context *pctx,
|
|||
ctx->scissor_states[start_slot + i] = states[i];
|
||||
ctx->scissors[start_slot + i] = scissor;
|
||||
}
|
||||
ctx->num_scissors = start_slot + num_scissors;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -788,33 +787,14 @@ zink_clear(struct pipe_context *pctx,
|
|||
++num_attachments;
|
||||
}
|
||||
|
||||
unsigned num_layers = util_framebuffer_get_num_layers(fb);
|
||||
VkClearRect rects[PIPE_MAX_VIEWPORTS];
|
||||
uint32_t num_rects;
|
||||
if (ctx->num_scissors) {
|
||||
for (unsigned i = 0 ; i < ctx->num_scissors; ++i) {
|
||||
rects[i].rect = ctx->scissors[i];
|
||||
rects[i].rect.extent.width = MIN2(rects[i].rect.extent.width,
|
||||
fb->width);
|
||||
rects[i].rect.extent.height = MIN2(rects[i].rect.extent.height,
|
||||
fb->height);
|
||||
rects[i].baseArrayLayer = 0;
|
||||
rects[i].layerCount = num_layers;
|
||||
}
|
||||
num_rects = ctx->num_scissors;
|
||||
} else {
|
||||
rects[0].rect.offset.x = 0;
|
||||
rects[0].rect.offset.y = 0;
|
||||
rects[0].rect.extent.width = fb->width;
|
||||
rects[0].rect.extent.height = fb->height;
|
||||
rects[0].baseArrayLayer = 0;
|
||||
rects[0].layerCount = num_layers;
|
||||
num_rects = 1;
|
||||
}
|
||||
|
||||
vkCmdClearAttachments(batch->cmdbuf,
|
||||
num_attachments, attachments,
|
||||
num_rects, rects);
|
||||
VkClearRect cr;
|
||||
cr.rect.offset.x = 0;
|
||||
cr.rect.offset.y = 0;
|
||||
cr.rect.extent.width = fb->width;
|
||||
cr.rect.extent.height = fb->height;
|
||||
cr.baseArrayLayer = 0;
|
||||
cr.layerCount = util_framebuffer_get_num_layers(fb);
|
||||
vkCmdClearAttachments(batch->cmdbuf, num_attachments, attachments, 1, &cr);
|
||||
}
|
||||
|
||||
VkShaderStageFlagBits
|
||||
|
|
@ -1088,9 +1068,8 @@ zink_draw_vbo(struct pipe_context *pctx,
|
|||
}
|
||||
|
||||
vkCmdSetViewport(batch->cmdbuf, 0, ctx->num_viewports, ctx->viewports);
|
||||
|
||||
if (ctx->num_scissors)
|
||||
vkCmdSetScissor(batch->cmdbuf, 0, ctx->num_scissors, ctx->scissors);
|
||||
if (ctx->rast_state->base.scissor)
|
||||
vkCmdSetScissor(batch->cmdbuf, 0, ctx->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;
|
||||
|
|
|
|||
|
|
@ -90,12 +90,10 @@ struct zink_context {
|
|||
struct zink_framebuffer *framebuffer;
|
||||
|
||||
struct pipe_viewport_state viewport_states[PIPE_MAX_VIEWPORTS];
|
||||
VkViewport viewports[PIPE_MAX_VIEWPORTS];
|
||||
unsigned num_viewports;
|
||||
|
||||
struct pipe_scissor_state scissor_states[PIPE_MAX_VIEWPORTS];
|
||||
VkViewport viewports[PIPE_MAX_VIEWPORTS];
|
||||
VkRect2D scissors[PIPE_MAX_VIEWPORTS];
|
||||
unsigned num_scissors;
|
||||
unsigned num_viewports;
|
||||
|
||||
struct pipe_vertex_buffer buffers[PIPE_MAX_ATTRIBS];
|
||||
uint32_t buffers_enabled_mask;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue