radv: re-mit streamout buffers to unbind them when NGG streamout is disabled

A buffer size as 0 acts like if streamout is disabled with NGG.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19801>
(cherry picked from commit 6a2bcce882)
This commit is contained in:
Samuel Pitoiset 2022-11-17 10:43:21 +01:00 committed by Eric Engestrom
parent 562e8a17d5
commit 654d0cebb8
2 changed files with 12 additions and 6 deletions

View file

@ -373,7 +373,7 @@
"description": "radv: re-mit streamout buffers to unbind them when NGG streamout is disabled",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -4118,11 +4118,12 @@ radv_flush_streamout_descriptors(struct radv_cmd_buffer *cmd_buffer)
*/
uint32_t size = 0xffffffff;
/* Set the correct buffer size for NGG streamout because it's used to determine the max
* emit per buffer.
*/
if (cmd_buffer->device->physical_device->use_ngg_streamout)
size = sb[i].size;
if (cmd_buffer->device->physical_device->use_ngg_streamout) {
/* With NGG streamout, the buffer size is used to determine the max emit per buffer and
* also acts as a disable bit when it's 0.
*/
size = radv_is_streamout_enabled(cmd_buffer) ? sb[i].size : 0;
}
uint32_t rsrc_word3 =
S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) | S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |
@ -9870,6 +9871,11 @@ radv_set_streamout_enable(struct radv_cmd_buffer *cmd_buffer, bool enable)
if (cmd_buffer->device->physical_device->use_ngg_streamout) {
cmd_buffer->gds_needed = true;
cmd_buffer->gds_oa_needed = true;
if (!enable) {
/* Re-emit streamout buffers to unbind them. */
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_STREAMOUT_BUFFER;
}
}
}