diff options
author | quou <quou@disroot.org> | 2024-12-29 13:39:33 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-29 13:40:12 +1100 |
commit | c41a63370e54cc1e6e0c1b1dc20e219f3cac2845 (patch) | |
tree | 7a472534cd53c1cfb7f7160e4de6b5de68492224 /video.cpp | |
parent | dfd95c6e29c25c3ad9acc3e63a790da866339015 (diff) |
fix depth only render passes
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1522,17 +1522,17 @@ void Renderpass_Vk::init( ad.storeOp = VK_ATTACHMENT_STORE_OP_STORE; ad.stencilLoadOp = ad.loadOp; ad.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; - if (rpk.is_first) + if (rpk.is_first || rp.depth.mode == Clear_Mode::clear) ad.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; else - ad.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + ad.initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; ad.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; dar.attachment = i; dar.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; } sd.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; - sd.colorAttachmentCount = 1; + sd.colorAttachmentCount = rp.colour_count; sd.pColorAttachments = &car; sd.pDepthStencilAttachment = has_depth? &dar: 0; |