v3dv: only emit blend state if the pipeline is dirty

Except for blend constants, which can be dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga
2020-03-18 11:58:12 +01:00
committed by Marge Bot
parent 1e54b62a61
commit c525849d95
+14 -12
View File
@@ -2051,9 +2051,20 @@ emit_blend(struct v3dv_cmd_buffer *cmd_buffer)
v3dv_cl_ensure_space_with_branch(&job->bcl, blend_packets_size);
if (pipeline->blend.enables) {
cl_emit(&job->bcl, BLEND_ENABLES, enables) {
enables.mask = pipeline->blend.enables;
if (cmd_buffer->state.dirty & V3DV_CMD_DIRTY_PIPELINE) {
if (pipeline->blend.enables) {
cl_emit(&job->bcl, BLEND_ENABLES, enables) {
enables.mask = pipeline->blend.enables;
}
}
for (uint32_t i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (pipeline->blend.enables & (1 << i))
cl_emit_prepacked(&job->bcl, &pipeline->blend.cfg[i]);
}
cl_emit(&job->bcl, COLOR_WRITE_MASKS, mask) {
mask.mask = pipeline->blend.color_write_masks;
}
}
@@ -2061,15 +2072,6 @@ emit_blend(struct v3dv_cmd_buffer *cmd_buffer)
(cmd_buffer->state.dirty & V3DV_CMD_DIRTY_BLEND_CONSTANTS)) {
cl_emit_prepacked(&job->bcl, &pipeline->blend.constant_color);
}
for (uint32_t i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) {
if (pipeline->blend.enables & (1 << i))
cl_emit_prepacked(&job->bcl, &pipeline->blend.cfg[i]);
}
cl_emit(&job->bcl, COLOR_WRITE_MASKS, mask) {
mask.mask = pipeline->blend.color_write_masks;
}
}
static void