From c41a63370e54cc1e6e0c1b1dc20e219f3cac2845 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 13:39:33 +1100 Subject: fix depth only render passes --- video.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video.cpp') diff --git a/video.cpp b/video.cpp index ba6fd7c..5d88d0c 100644 --- a/video.cpp +++ b/video.cpp @@ -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; -- cgit v1.2.3-54-g00ecf