Skip to content

Commit 7b67d62

Browse files
committed
[General] fix
1 parent 43a3f57 commit 7b67d62

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎include/openminecraft/renderer/common/wrap/om_renderer_temptarget.hpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class OMRendererTempTarget
5252
if (!target)
5353
{
5454
target = renderer->createRenderTarget();
55+
target->clearDepth = clearDepth;
5556
target->attachTarget(colorTexture);
5657
target->attachTarget(depthTexture);
5758
target->build();

‎src/openminecraft-core/renderer/common/wrap/om_renderer_voxel_manager.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ auto OMVoxelManager::update(basics::OMCamera &camera) -> void
384384
auto OMVoxelManager::submit(OMRendererTask *task, OMRendererTempTarget *resolveTarget) -> OMRendererTask *
385385
{
386386
cutoutTargetMS->construct(renderer->getExtent(), 4);
387+
translucentTargetMS->clearDepth = false;
387388
translucentTargetMS->constructWithDepth(cutoutTargetMS->depthTexture, renderer->getExtent(), 4);
388389
cutoutTarget->construct(renderer->getExtent());
389390
translucentTarget->construct(renderer->getExtent());

‎src/openminecraft-core/renderer/vk/om_renderer_layer_vk_rendertarget.cpp‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "openminecraft/renderer/vk/om_renderer_layer_vk.hpp"
77
#include "openminecraft/renderer/vk/om_renderer_layer_vk_texture.hpp"
88
#include "vulkan/vulkan.hpp"
9+
#include "vulkan/vulkan_enums.hpp"
910
#include <algorithm>
1011

1112
using namespace ::vk;
@@ -104,15 +105,16 @@ void OMRendererRenderTargetVk::build()
104105
{
105106
if (tt->arr == common::OMTextureArrangement::Depth)
106107
{
107-
attachDesc.push_back({{},
108-
reinterpret_cast<OMRendererTextureVk *>(tt)->format,
109-
reinterpret_cast<OMRendererTextureVk *>(tt)->sampleCount,
110-
clearDepth ? AttachmentLoadOp::eClear : AttachmentLoadOp::eLoad,
111-
AttachmentStoreOp::eStore,
112-
AttachmentLoadOp::eDontCare,
113-
AttachmentStoreOp::eDontCare,
114-
ImageLayout::eUndefined,
115-
ImageLayout::eDepthStencilAttachmentOptimal});
108+
attachDesc.push_back(
109+
{{},
110+
reinterpret_cast<OMRendererTextureVk *>(tt)->format,
111+
reinterpret_cast<OMRendererTextureVk *>(tt)->sampleCount,
112+
clearDepth ? AttachmentLoadOp::eClear : AttachmentLoadOp::eLoad,
113+
AttachmentStoreOp::eStore,
114+
AttachmentLoadOp::eDontCare,
115+
AttachmentStoreOp::eDontCare,
116+
clearDepth ? ImageLayout::eUndefined : ImageLayout::eDepthStencilAttachmentOptimal,
117+
ImageLayout::eDepthStencilAttachmentOptimal});
116118
depthAttach.emplace_back(a, ImageLayout::eDepthStencilAttachmentOptimal);
117119
}
118120
else

0 commit comments

Comments
 (0)