- fix depthstencil attachment not being attached when only stencil tests were enabled

This commit is contained in:
Magnus Norddahl 2019-03-04 01:49:27 +01:00
parent 99c3d72aa0
commit f04522c397

View file

@ -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(