diff options
author | x2048 <codeforsmile@gmail.com> | 2022-10-04 21:02:42 +0200 |
---|---|---|
committer | x2048 <codeforsmile@gmail.com> | 2022-10-04 21:02:42 +0200 |
commit | 1e9640395468beb53f70303ef6b7aa72e395b7b4 (patch) | |
tree | af26003a433458feafc70be4e7ec048aaad2bcd1 /src/client/render/pipeline.cpp | |
parent | 579fc93c24b030e33a6255d96e773706f6e99c93 (diff) | |
download | minetest-1e9640395468beb53f70303ef6b7aa72e395b7b4.tar.xz |
Use legacy call when rendering to a single texture
Fixes depth buffer in when undersampling > 1
Diffstat (limited to 'src/client/render/pipeline.cpp')
-rw-r--r-- | src/client/render/pipeline.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp index eb38adbad..13898f8a4 100644 --- a/src/client/render/pipeline.cpp +++ b/src/client/render/pipeline.cpp @@ -168,6 +168,13 @@ void TextureBufferOutput::activate(PipelineContext &context) size = texture->getSize(); } + // Use legacy call when there's single texture without depth texture + // This binds default depth buffer to the FBO + if (textures.size() == 1 && depth_stencil == NO_DEPTH_TEXTURE) { + driver->setRenderTarget(textures[0], m_clear, m_clear, context.clear_color); + return; + } + video::ITexture *depth_texture = nullptr; if (depth_stencil != NO_DEPTH_TEXTURE) depth_texture = buffer->getTexture(depth_stencil); |