From 1fa3f8df514ceaa2e3efb49cdc351bdf8c96bd7f Mon Sep 17 00:00:00 2001 From: Kun Lin <1669598897@qq.com> Date: Mon, 19 Jul 2021 12:47:11 +0800 Subject: [PATCH] Fix for sampleCounts calculation (#3734) Fix the bug that the sampleCounts is wrong when the renderpass only has color attachment --- native/cocos/renderer/gfx-vulkan/VKCommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp index 7364c37268..d08642b6dc 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp @@ -372,8 +372,8 @@ void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRende : VK_IMAGE_ASPECT_DEPTH_BIT; VkImageLayout layout = isGeneralLayout ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; attachmentReferences.push_back({VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, nullptr, subpassInfo.depthStencil, layout, aspect}); - gpuRenderPass->sampleCounts.push_back(sampleCount); } + gpuRenderPass->sampleCounts.push_back(sampleCount); if (subpassInfo.depthStencilResolve != INVALID_BINDING) { const ColorAttachment &desc = gpuRenderPass->colorAttachments[subpassInfo.depthStencilResolve];