Permalink
Browse files

GLES: Detect ARB aniso and cull distance.

  • Loading branch information...
unknownbrackets committed Oct 28, 2018
1 parent 5ea935f commit e301d3bbd6e76e2709546d09be2e8869a6b7f86b
Showing with 12 additions and 1 deletion.
  1. +10 −1 ext/native/gfx_es2/gpu_features.cpp
  2. +2 −0 ext/native/gfx_es2/gpu_features.h
@@ -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__
@@ -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;

0 comments on commit e301d3b

Please sign in to comment.