Fix #112289: Workbench: Always clear depth_in_front

This commit is contained in:
Miguel Pozo
2023-09-13 16:35:28 +02:00
parent 6c98cb73ac
commit 6e24ecac03
2 changed files with 7 additions and 3 deletions

View File

@@ -470,6 +470,10 @@ class Instance {
GPU_DEPTH24_STENCIL8,
GPU_TEXTURE_USAGE_SHADER_READ |
GPU_TEXTURE_USAGE_ATTACHMENT);
fb.ensure(GPU_ATTACHMENT_TEXTURE(resources.depth_in_front_tx));
fb.bind();
GPU_framebuffer_clear_depth_stencil(fb, 1.0f, 0x00);
}
opaque_ps.draw(

View File

@@ -172,10 +172,10 @@ void OpaquePass::draw(Manager &manager,
opaque_fb.bind();
manager.submit(gbuffer_in_front_ps_, view);
}
if (resources.depth_in_front_tx.is_valid()) {
GPU_texture_copy(resources.depth_in_front_tx, resources.depth_tx);
if (resources.depth_in_front_tx.is_valid()) {
GPU_texture_copy(resources.depth_in_front_tx, resources.depth_tx);
}
}
if (!gbuffer_ps_.is_empty()) {