nvk: Fix depth/stencil render pass clears
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:11:54 +0000 (20:11 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:58 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/vulkan/nvk_cmd_draw.c

index 7c6e30c..5d3a822 100644 (file)
@@ -556,17 +556,17 @@ nvk_CmdBeginRendering(VkCommandBuffer commandBuffer,
    clear_att[clear_count] = (VkClearAttachment) { .aspectMask = 0, };
    if (pRenderingInfo->pDepthAttachment != NULL &&
        pRenderingInfo->pDepthAttachment->imageView != VK_NULL_HANDLE &&
-       pRenderingInfo->pDepthAttachment->loadOp != VK_ATTACHMENT_LOAD_OP_CLEAR) {
+       pRenderingInfo->pDepthAttachment->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) {
       clear_att[clear_count].aspectMask |= VK_IMAGE_ASPECT_DEPTH_BIT;
       clear_att[clear_count].clearValue.depthStencil.depth =
          pRenderingInfo->pDepthAttachment->clearValue.depthStencil.depth;
    }
    if (pRenderingInfo->pStencilAttachment != NULL &&
        pRenderingInfo->pStencilAttachment->imageView != VK_NULL_HANDLE &&
-       pRenderingInfo->pStencilAttachment->loadOp != VK_ATTACHMENT_LOAD_OP_CLEAR) {
+       pRenderingInfo->pStencilAttachment->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR) {
       clear_att[clear_count].aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
       clear_att[clear_count].clearValue.depthStencil.stencil =
-         pRenderingInfo->pStencilAttachment->clearValue.depthStencil.depth;
+         pRenderingInfo->pStencilAttachment->clearValue.depthStencil.stencil;
    }
    if (clear_att[clear_count].aspectMask != 0)
       clear_count++;