summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_storage_gles2.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-10 17:16:40 +0100
committerGitHub <noreply@github.com>2019-12-10 17:16:40 +0100
commit435cced7d8fbc80e6842d7c171a87d4db1e64fe4 (patch)
tree4ce46be5967a49c0ed6287c405ddf55d7389f495 /drivers/gles2/rasterizer_storage_gles2.cpp
parentec30c8bc25d75fadf1d82b8ad85d3c0f8d1b64aa (diff)
parentfd31cebcbeebd2084ccd2d795895ad9c728d859d (diff)
Merge pull request #34238 from clayjohn/GLES2-use-renderbuffer-post-process
Use renderbuffer depth for post-process buffers when appropriate
Diffstat (limited to 'drivers/gles2/rasterizer_storage_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 4040d94f10..388a8423a0 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;
}