]> git.lizzy.rs Git - minetest.git/commitdiff
Use legacy call when rendering to a single texture
authorx2048 <codeforsmile@gmail.com>
Tue, 4 Oct 2022 19:02:42 +0000 (21:02 +0200)
committerx2048 <codeforsmile@gmail.com>
Tue, 4 Oct 2022 19:02:42 +0000 (21:02 +0200)
Fixes depth buffer in when undersampling > 1

src/client/render/pipeline.cpp

index eb38adbad0f315af1ad43dcc0a04654cf966d1e8..13898f8a41f078bbe7beb97db2404218fe7e6a36 100644 (file)
@@ -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);