tu: Fix assert in FDM state emission

Making the sub_cs not writeable switches the BO we're emitting to, which
causes an assert failure in tu_cs_end_sub_stream() because it looks like
we have a mismatched start/end. Just make it not writeable later.

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25225>
(cherry picked from commit 64ed357699)
This commit is contained in:
Connor Abbott 2023-09-14 16:24:22 +02:00 committed by Dylan Baker
parent 8ddfe6b743
commit d86619a498
2 changed files with 2 additions and 2 deletions

View file

@ -2124,7 +2124,7 @@
"description": "tu: Fix assert in FDM state emission",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "97da0a7734188f4b666bc38833bfadc8b4c53f84",
"notes": null

View file

@ -4627,9 +4627,9 @@ tu_emit_draw_state(struct tu_cmd_buffer *cmd)
if (cmd->state.pipeline_has_fdm) { \
tu_cs_set_writeable(&cmd->sub_cs, true); \
tu6_emit_##name##_fdm(&cs, cmd, __VA_ARGS__); \
tu_cs_set_writeable(&cmd->sub_cs, false); \
cmd->state.dynamic_state[id] = \
tu_cs_end_draw_state(&cmd->sub_cs, &cs); \
tu_cs_set_writeable(&cmd->sub_cs, false); \
} else { \
unsigned size = tu6_##name##_size(cmd->device, __VA_ARGS__); \
if (size > 0) { \