From 3c61fd029b0ff9c4604a66b891794ae9b697cc5f Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 19 Sep 2023 15:47:34 +0200 Subject: [PATCH] radv: fix re-emitting streamout descriptors for NGG streamout In a scenario like: CmdBindTransformFeedbackBuffers() BeginTransformFeedback() CmdDraw() --> streamout descriptors emitted EndTransformFeedback() --> streamout descriptors emitted as 0 (disabled) CmdDraw() BeginTransformFeedback() CmdDraw() --> streamout descriptor not re-emitted EndTransformFeedback() Fix this by re-emitting streamout descriptors when streamout is enabled/disabled because a buffer size of 0 acts like a disable bit. This fixes dEQP-VK.transform_feedback.simple.backward_dependency_indirect* on NAVI31. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index f6f99c8..471aa6a 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -10884,11 +10884,10 @@ radv_set_streamout_enable(struct radv_cmd_buffer *cmd_buffer, bool enable) radv_emit_streamout_enable(cmd_buffer); if (cmd_buffer->device->physical_device->use_ngg_streamout) { - cmd_buffer->state.dirty |= RADV_CMD_DIRTY_SHADER_QUERY; - - /* Re-emit streamout buffers to unbind them. */ - if (!enable) - cmd_buffer->state.dirty |= RADV_CMD_DIRTY_STREAMOUT_BUFFER; + /* Re-emit streamout desciptors because with NGG streamout, a buffer size of 0 acts like a + * disable bit and this is needed when streamout needs to be ignored in shaders. + */ + cmd_buffer->state.dirty |= RADV_CMD_DIRTY_SHADER_QUERY | RADV_CMD_DIRTY_STREAMOUT_BUFFER; } } -- 2.7.4