mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-10 16:10:26 +01:00
tu: Use dirty bit for scissor state
This will make patching it on-demand easier. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
This commit is contained in:
parent
f3ffd963f5
commit
2668ba0ecd
2 changed files with 10 additions and 6 deletions
|
|
@ -2908,13 +2908,11 @@ tu_CmdSetScissor(VkCommandBuffer commandBuffer,
|
|||
const VkRect2D *pScissors)
|
||||
{
|
||||
TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
|
||||
struct tu_cs cs;
|
||||
|
||||
memcpy(&cmd->state.scissor[firstScissor], pScissors, scissorCount * sizeof(*pScissors));
|
||||
cmd->state.max_scissor = MAX2(cmd->state.max_scissor, firstScissor + scissorCount);
|
||||
|
||||
cs = tu_cmd_dynamic_state(cmd, VK_DYNAMIC_STATE_SCISSOR, 1 + 2 * cmd->state.max_scissor);
|
||||
tu6_emit_scissor(&cs, cmd->state.scissor, cmd->state.max_scissor);
|
||||
cmd->state.dirty |= TU_CMD_DIRTY_SCISSORS;
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
|
|
@ -5044,6 +5042,11 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
|
|||
cmd->state.z_negative_one_to_one);
|
||||
}
|
||||
|
||||
if (dirty & TU_CMD_DIRTY_SCISSORS) {
|
||||
struct tu_cs cs = tu_cmd_dynamic_state(cmd, VK_DYNAMIC_STATE_SCISSOR, 1 + 2 * cmd->state.max_scissor);
|
||||
tu6_emit_scissor(&cs, cmd->state.scissor, cmd->state.max_scissor);
|
||||
}
|
||||
|
||||
if (dirty & TU_CMD_DIRTY_BLEND) {
|
||||
struct tu_cs cs = tu_cmd_dynamic_state(cmd, TU_DYNAMIC_STATE_BLEND,
|
||||
8 + 3 * cmd->state.pipeline->blend.num_rts);
|
||||
|
|
|
|||
|
|
@ -65,10 +65,11 @@ enum tu_cmd_dirty_bits
|
|||
TU_CMD_DIRTY_VS_PARAMS = BIT(9),
|
||||
TU_CMD_DIRTY_PC_RASTER_CNTL = BIT(10),
|
||||
TU_CMD_DIRTY_VIEWPORTS = BIT(11),
|
||||
TU_CMD_DIRTY_BLEND = BIT(12),
|
||||
TU_CMD_DIRTY_PATCH_CONTROL_POINTS = BIT(13),
|
||||
TU_CMD_DIRTY_SCISSORS = BIT(12),
|
||||
TU_CMD_DIRTY_BLEND = BIT(13),
|
||||
TU_CMD_DIRTY_PATCH_CONTROL_POINTS = BIT(14),
|
||||
/* all draw states were disabled and need to be re-enabled: */
|
||||
TU_CMD_DIRTY_DRAW_STATE = BIT(14)
|
||||
TU_CMD_DIRTY_DRAW_STATE = BIT(15)
|
||||
};
|
||||
|
||||
/* There are only three cache domains we have to care about: the CCU, or
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue