diff options
-rw-r--r-- | pipeline.cpp | 6 | ||||
-rw-r--r-- | video.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/pipeline.cpp b/pipeline.cpp index c31ef69..8867a8d 100644 --- a/pipeline.cpp +++ b/pipeline.cpp @@ -93,8 +93,10 @@ void Pipeline_Builder::validate_rp() { d.fmt == texture_format_d24s8 || d.fmt == texture_format_d32 ); - assert(d.w == w); - assert(d.h == h); + if (c) { + assert(d.w == w); + assert(d.h == h); + } } } @@ -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; |