Skip to content

Instantly share code, notes, and snippets.

@x2048
Last active October 4, 2022 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x2048/bec7b282fcebb6852aa734ecdbe55023 to your computer and use it in GitHub Desktop.
Save x2048/bec7b282fcebb6852aa734ecdbe55023 to your computer and use it in GitHub Desktop.
Fix undersampling
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment