tu/cs: Assert that the CS is not writeable when resetting

Leaving writeable on probably means that we forgot to disable
writeable somewhere, which is a bad idea. The existing code couldn't
handle this and would subtly crash somewhere else due to start not being
saved, but just assert instead to make the problem more clear.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35993>
This commit is contained in:
Connor Abbott 2025-07-07 18:58:21 -04:00 committed by Marge Bot
parent 336839bcd8
commit 5d7e4ab405

View file

@ -510,7 +510,7 @@ tu_cs_reset(struct tu_cs *cs)
tu_bo_finish(cs->device, cs->read_write.bos[i]);
}
cs->writeable = false;
assert(!cs->writeable);
if (cs->read_only.bo_count) {
cs->read_only.bos[0] = cs->read_only.bos[cs->read_only.bo_count - 1];