v3dv: store the clip window in the command buffer state

We will need this so we can match a render area for a new render pass
against the current clip rect and decide if we need to make adjustments.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga
2020-04-01 10:17:22 +02:00
committed by Marge Bot
parent d6d8bfbb4a
commit e5642a36a0
2 changed files with 11 additions and 7 deletions
+5 -7
View File
@@ -2059,8 +2059,6 @@ emit_scissor(struct v3dv_cmd_buffer *cmd_buffer)
* since the hardware does guardband clipping, meaning
* primitives would rasterize outside of the view volume."
*/
VkRect2D clip_window;
uint32_t minx, miny, maxx, maxy;
/* From the Vulkan spec:
@@ -2100,12 +2098,12 @@ emit_scissor(struct v3dv_cmd_buffer *cmd_buffer)
if (miny > maxy)
maxy = miny;
clip_window.offset.x = minx;
clip_window.offset.y = miny;
clip_window.extent.width = maxx - minx;
clip_window.extent.height = maxy - miny;
cmd_buffer->state.clip_window.offset.x = minx;
cmd_buffer->state.clip_window.offset.y = miny;
cmd_buffer->state.clip_window.extent.width = maxx - minx;
cmd_buffer->state.clip_window.extent.height = maxy - miny;
emit_clip_window(cmd_buffer->state.job, &clip_window);
emit_clip_window(cmd_buffer->state.job, &cmd_buffer->state.clip_window);
cmd_buffer->state.dirty &= ~V3DV_CMD_DIRTY_SCISSOR;
}
+6
View File
@@ -690,6 +690,12 @@ struct v3dv_cmd_buffer_state {
struct v3dv_dynamic_state dynamic;
uint32_t dirty;
/* Current clip window. We use this to check whether we have an active
* scissor, since in that case we can't use TLB clears and need to fallback
* to drawing rects.
*/
VkRect2D clip_window;
uint32_t attachment_count;
struct v3dv_cmd_buffer_attachment_state *attachments;