summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-01-04 15:31:08 +0100
committerGitHub <noreply@github.com>2019-01-04 15:31:08 +0100
commit99c4faf83769f7016a8657ff6aa82ef26766fa14 (patch)
tree7efd2de44e7a797786bef13ef420c8312b5c20d0
parentd54894ffaed9c27c9f330b2675d2a907f74d2455 (diff)
parenta1160ff8e79252d33465aa615ae8f4a9a66971e5 (diff)
Merge pull request #24575 from nekomatata/android-curve-texture
Fixed CurveTexture with GLES3 on Android
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp21
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 315ecf46a3..076c33c8e9 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -632,6 +632,25 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_
p_flags &= ~VS::TEXTURE_FLAG_MIPMAPS; // no mipies for video
}
+#ifndef GLES_OVER_GL
+ switch (p_format) {
+ case Image::Format::FORMAT_RF:
+ case Image::Format::FORMAT_RGF:
+ case Image::Format::FORMAT_RGBF:
+ case Image::Format::FORMAT_RGBAF:
+ case Image::Format::FORMAT_RH:
+ case Image::Format::FORMAT_RGH:
+ case Image::Format::FORMAT_RGBH:
+ case Image::Format::FORMAT_RGBAH: {
+ if (!config.texture_float_linear_supported) {
+ // disable linear texture filtering when not supported for float format on some devices (issue #24295)
+ p_flags &= ~VS::TEXTURE_FLAG_FILTER;
+ }
+ } break;
+ default: {}
+ }
+#endif
+
Texture *texture = texture_owner.get(p_texture);
ERR_FAIL_COND(!texture);
texture->width = p_width;
@@ -7671,11 +7690,13 @@ void RasterizerStorageGLES3::initialize() {
config.etc2_supported = false;
config.s3tc_supported = true;
config.rgtc_supported = true; //RGTC - core since OpenGL version 3.0
+ config.texture_float_linear_supported = true;
#else
config.etc2_supported = true;
config.hdr_supported = false;
config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc") || config.extensions.has("EXT_texture_compression_rgtc");
+ config.texture_float_linear_supported = config.extensions.has("GL_OES_texture_float_linear");
#endif
config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc");
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index a08ae89ad3..6d2acbcf01 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -87,6 +87,8 @@ public:
bool srgb_decode_supported;
+ bool texture_float_linear_supported;
+
bool use_rgba_2d_shadows;
float anisotropic_level;