diff options
author | clayjohn <claynjohn@gmail.com> | 2019-12-09 22:19:11 -0800 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2019-12-09 22:19:11 -0800 |
commit | fd31cebcbeebd2084ccd2d795895ad9c728d859d (patch) | |
tree | 7beb26e34442da9aebe506f3444138cc06bfeda2 | |
parent | 269145a346bddae5cbbf00fd17b6c8eac4cd4665 (diff) |
Use renderbuffer depth for post-process buffers when appropriate
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 40e7f0c441..6eec17bacf 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -4914,7 +4914,11 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) { bool used_depth = false; 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; } |