Add code to allow for depth buffer query (Fixes #18)

This commit is contained in:
Georg Hagen
2024-08-01 10:29:07 +02:00
parent 579c4bcca1
commit e54404ec61
8 changed files with 171 additions and 16 deletions

View File

@@ -57,7 +57,7 @@ namespace OpenVulkano::Vulkan
if (m_frameBuffer->UseDepthBuffer())
{ // Depth attachment
attachments.emplace_back(vk::AttachmentDescriptionFlags(), m_frameBuffer->GetDepthFormat(), vk::SampleCountFlagBits::e1,
m_useClearDepth ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad, vk::AttachmentStoreOp::eDontCare, m_useClearDepth ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
m_useClearDepth ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad, vk::AttachmentStoreOp::eStore, m_useClearDepth ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
vk::AttachmentStoreOp::eDontCare, vk::ImageLayout::eDepthStencilAttachmentOptimal, vk::ImageLayout::eDepthStencilAttachmentOptimal);
depthReference = new vk::AttachmentReference(1, vk::ImageLayout::eDepthStencilAttachmentOptimal);
}
@@ -87,4 +87,4 @@ namespace OpenVulkano::Vulkan
{
renderPass = m_device.createRenderPass(renderPassCreateInfo);
}
}
}