radv: Don't emit framebuffer state if there is no renderpass active.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 28 Nov 2021 12:09:57 +0000 (13:09 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 2 Dec 2021 00:35:28 +0000 (00:35 +0000)
The framebuffer state could still be dirty from when the previous
renderpass was bound.

Fixes: 5632359959f ("radv: Remove the skipping of framebuffer emission if we don't have a framebuffer.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5702
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13969>

src/amd/vulkan/radv_cmd_buffer.c

index 5ce3356..ead1821 100644 (file)
@@ -5586,7 +5586,7 @@ radv_CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCou
       if (secondary->gds_needed)
          primary->gds_needed = true;
 
-      if (!secondary->state.framebuffer && (primary->state.dirty & RADV_CMD_DIRTY_FRAMEBUFFER)) {
+      if (!secondary->state.framebuffer && primary->state.pass && (primary->state.dirty & RADV_CMD_DIRTY_FRAMEBUFFER)) {
          /* Emit the framebuffer state from primary if secondary
           * has been recorded without a framebuffer, otherwise
           * fast color/depth clears can't work.