From f04522c397ba709163c246fed381bc14109d5866 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 4 Mar 2019 01:49:27 +0100 Subject: [PATCH] - fix depthstencil attachment not being attached when only stencil tests were enabled --- src/rendering/vulkan/renderer/vk_renderpass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/vulkan/renderer/vk_renderpass.cpp b/src/rendering/vulkan/renderer/vk_renderpass.cpp index 12b65b1d24..6cbd6c49d0 100644 --- a/src/rendering/vulkan/renderer/vk_renderpass.cpp +++ b/src/rendering/vulkan/renderer/vk_renderpass.cpp @@ -171,11 +171,11 @@ void VkRenderPassSetup::CreateRenderPass(const VkRenderPassKey &key) { RenderPassBuilder builder; builder.addRgba16fAttachment(false, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - if (key.DepthTest || key.DepthWrite) + if (key.DepthTest || key.DepthWrite || key.StencilTest) builder.addDepthStencilAttachment(false, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); builder.addSubpass(); builder.addSubpassColorAttachmentRef(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - if (key.DepthTest || key.DepthWrite) + if (key.DepthTest || key.DepthWrite || key.StencilTest) { builder.addSubpassDepthStencilAttachmentRef(1, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); builder.addExternalSubpassDependency(