diff options
Diffstat (limited to 'src/renderer/prerendered_texture.cpp')
-rw-r--r-- | src/renderer/prerendered_texture.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/renderer/prerendered_texture.cpp b/src/renderer/prerendered_texture.cpp index adb7a59105..2514efaf2f 100644 --- a/src/renderer/prerendered_texture.cpp +++ b/src/renderer/prerendered_texture.cpp @@ -49,8 +49,12 @@ void PrerenderedTexture::bindFramebuffer() { // Create depth/stencil buffer glGenRenderbuffers(1, &fbo_depth_stencil); glBindRenderbuffer(GL_RENDERBUFFER, fbo_depth_stencil); +#ifdef GL_ES_VERSION_2_0 + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, properties.size, properties.size); +#else glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, properties.size, properties.size); - glBindRenderbuffer(GL_RENDERBUFFER, 0); +#endif + glBindRenderbuffer(GL_RENDERBUFFER, 0); } if (fbo == 0) { @@ -117,7 +121,7 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) { for (int i = 0; i < passes; i++) { // Render horizontal glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, secondary_texture, 0); -#if GL_EXT_discard_framebuffer +#if GL_EXT_discard_framebuffer && !__ANDROID__ const GLenum discards[] = { GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards); #endif @@ -132,7 +136,7 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) { // Render vertical glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, original_texture, 0); -#if GL_EXT_discard_framebuffer +#if GL_EXT_discard_framebuffer && !__ANDROID__ glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards); #endif glClear(GL_COLOR_BUFFER_BIT); |