lavapipe: undo fb remapping before poisoning memory at end of renderpass

in a scenario like:
* begin_rendering(cbuf1:store=DONTCARE, cbuf2)
* draw
* remap(cbuf2, NULL)
* draw
* end_rendering

cbuf1 will be poisoned at the end of the renderpass, but the corresponding
clear call to trigger the poisoning will not be able to detect that this
texture is being written by an async fs, causing a write hazard

unremapping the fb here ensures that all attachments are fb-referenced
as expected in order to guarantee threads sync before memory is poisoned

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35319>
This commit is contained in:
Mike Blumenkrantz
2025-06-03 13:40:47 -04:00
committed by Marge Bot
parent 723a1fabac
commit d8a6ec5985

View File

@@ -1771,6 +1771,12 @@ static void handle_end_rendering(struct vk_cmd_queue_entry *cmd,
if (!state->poison_mem)
return;
/* ensure that textures are correctly framebuffer-referenced in llvmpipe */
if (state->fb_remapped) {
state->fb_remapped = false;
emit_fb_state(state);
}
union pipe_color_union color_clear_val;
memset(color_clear_val.ui, rand() % UINT8_MAX, sizeof(color_clear_val.ui));