Skip to content

Commit

Permalink
Use legacy call when rendering to a single texture
Browse files Browse the repository at this point in the history
Fixes depth buffer in when undersampling > 1
  • Loading branch information
x2048 committed Oct 4, 2022
1 parent 579fc93 commit 1e96403
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/client/render/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e96403

Please sign in to comment.