Use renderbuffer depth for post-process buffers when appropriate

This commit is contained in:
clayjohn 2019-12-09 22:19:11 -08:00
parent 269145a346
commit fd31cebcbe
1 changed files with 5 additions and 1 deletions

View File

@ -4914,7 +4914,11 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
bool used_depth = false; bool used_depth = false;
if (j == 0 && i == 0) { //use always if (j == 0 && i == 0) { //use always
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0); if (config.support_depth_texture) {
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
} else {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
}
used_depth = true; used_depth = true;
} }