diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-23 11:14:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-23 11:14:09 +0100 |
commit | d747e3014039c2002262abbde6d5465674a3de07 (patch) | |
tree | b50cb743db65b90a33c0a35de982b3ed3379de52 /drivers/gles3/rasterizer_storage_gles3.cpp | |
parent | a0581cca1f7c8e5a1bd9b14d5b09861bbf69c674 (diff) | |
parent | cab45f2f2653afe4bcfd3217c903a2241bf24acb (diff) |
Merge pull request #25242 from BastiaanOlij/fix_ios_issues
Fix errors on iOS
Diffstat (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp')
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 24673c8755..4818fd4927 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -6931,7 +6931,12 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) { glGenTextures(1, &rt->exposure.color); glBindTexture(GL_TEXTURE_2D, rt->exposure.color); +#ifdef IPHONE_ENABLED + ///@TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures... + glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, 1, 1, 0, GL_RED, GL_FLOAT, NULL); +#else glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1, 1, 0, GL_RED, GL_FLOAT, NULL); +#endif glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->exposure.color, 0); status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -7163,7 +7168,12 @@ RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) { if (config.use_rgba_2d_shadows) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); } else { +#ifdef IPHONE_ENABLED + ///@TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures... + glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, NULL); +#else glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, NULL); +#endif } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |