From e301d3bbd6e76e2709546d09be2e8869a6b7f86b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 28 Oct 2018 13:27:44 -0700 Subject: [PATCH] GLES: Detect ARB aniso and cull distance. --- ext/native/gfx_es2/gpu_features.cpp | 11 ++++++++++- ext/native/gfx_es2/gpu_features.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index fab660781d..0983cf93b3 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -345,9 +345,10 @@ void CheckGLExtensions() { gl_extensions.ARB_buffer_storage = g_set_gl_extensions.count("GL_ARB_buffer_storage") != 0; gl_extensions.ARB_vertex_array_object = g_set_gl_extensions.count("GL_ARB_vertex_array_object") != 0; gl_extensions.ARB_texture_float = g_set_gl_extensions.count("GL_ARB_texture_float") != 0; - gl_extensions.EXT_texture_filter_anisotropic = g_set_gl_extensions.count("GL_EXT_texture_filter_anisotropic") != 0; + gl_extensions.EXT_texture_filter_anisotropic = g_set_gl_extensions.count("GL_EXT_texture_filter_anisotropic") != 0 || g_set_gl_extensions.count("GL_ARB_texture_filter_anisotropic") != 0; gl_extensions.EXT_draw_instanced = g_set_gl_extensions.count("GL_EXT_draw_instanced") != 0; gl_extensions.ARB_draw_instanced = g_set_gl_extensions.count("GL_ARB_draw_instanced") != 0; + gl_extensions.ARB_cull_distance = g_set_gl_extensions.count("GL_ARB_cull_distance") != 0; if (gl_extensions.IsGLES) { gl_extensions.OES_texture_npot = g_set_gl_extensions.count("GL_OES_texture_npot") != 0; @@ -362,6 +363,7 @@ void CheckGLExtensions() { gl_extensions.ARM_shader_framebuffer_fetch = g_set_gl_extensions.count("GL_ARM_shader_framebuffer_fetch") != 0; gl_extensions.OES_texture_float = g_set_gl_extensions.count("GL_OES_texture_float") != 0; gl_extensions.EXT_buffer_storage = g_set_gl_extensions.count("GL_EXT_buffer_storage") != 0; + gl_extensions.EXT_clip_cull_distance = g_set_gl_extensions.count("GL_EXT_clip_cull_distance") != 0; #if defined(__ANDROID__) // On Android, incredibly, this is not consistently non-zero! It does seem to have the same value though. @@ -522,6 +524,13 @@ void CheckGLExtensions() { if (gl_extensions.VersionGEThan(4, 4)) { gl_extensions.ARB_buffer_storage = true; } + if (gl_extensions.VersionGEThan(4, 5)) { + gl_extensions.ARB_cull_distance = true; + } + if (gl_extensions.VersionGEThan(4, 6)) { + // Actually ARB, but they're basically the same. + gl_extensions.EXT_texture_filter_anisotropic = true; + } } #ifdef __APPLE__ diff --git a/ext/native/gfx_es2/gpu_features.h b/ext/native/gfx_es2/gpu_features.h index fc1c73a0fd..6764d08105 100644 --- a/ext/native/gfx_es2/gpu_features.h +++ b/ext/native/gfx_es2/gpu_features.h @@ -63,6 +63,7 @@ struct GLExtensions { bool ARB_texture_float; bool ARB_draw_instanced; bool ARB_buffer_storage; + bool ARB_cull_distance; // EXT bool EXT_swap_control_tear; @@ -78,6 +79,7 @@ struct GLExtensions { bool PBO_EXT; bool EXT_draw_instanced; bool EXT_buffer_storage; + bool EXT_clip_cull_distance; // NV bool NV_shader_framebuffer_fetch;