Permalink
Browse files

GLSL: Set extension flags for elided core exts.

So that we know we have them, i.e. on Apple.
  • Loading branch information...
unknownbrackets committed Sep 20, 2017
1 parent e754cca commit 1802d7a45ea192cc2477d6637a6e13bc85352f9d
Showing with 42 additions and 1 deletion.
  1. +42 −1 ext/native/gfx_es2/gpu_features.cpp
@@ -394,7 +394,7 @@ void CheckGLExtensions() {
#endif
// This is probably a waste of time, implementations lie.
if (gl_extensions.IsGLES || strstr(extString, "GL_ARB_ES2_compatibility")) {
if (gl_extensions.IsGLES || strstr(extString, "GL_ARB_ES2_compatibility") || gl_extensions.VersionGEThan(4, 1)) {
const GLint precisions[6] = {
GL_LOW_FLOAT, GL_MEDIUM_FLOAT, GL_HIGH_FLOAT,
GL_LOW_INT, GL_MEDIUM_INT, GL_HIGH_INT
@@ -419,6 +419,47 @@ void CheckGLExtensions() {
gl_extensions.ARB_vertex_array_object = true;
gl_extensions.ARB_framebuffer_object = true;
}
// Add any extensions that are included in core. May be elided.
if (!gl_extensions.IsGLES) {
if (gl_extensions.VersionGEThan(3, 0)) {
gl_extensions.ARB_texture_float = true;
}
if (gl_extensions.VersionGEThan(3, 1)) {
gl_extensions.ARB_draw_instanced = true;
// ARB_uniform_buffer_object = true;
}
if (gl_extensions.VersionGEThan(3, 2)) {
// ARB_depth_clamp = true;
}
if (gl_extensions.VersionGEThan(3, 3)) {
gl_extensions.ARB_blend_func_extended = true;
// ARB_explicit_attrib_location = true;
}
if (gl_extensions.VersionGEThan(4, 0)) {
// ARB_gpu_shader5 = true;
}
if (gl_extensions.VersionGEThan(4, 1)) {
// ARB_get_program_binary = true;
// ARB_separate_shader_objects = true;
// ARB_shader_precision = true;
// ARB_viewport_array = true;
}
if (gl_extensions.VersionGEThan(4, 2)) {
// ARB_texture_storage = true;
}
if (gl_extensions.VersionGEThan(4, 3)) {
gl_extensions.ARB_copy_image = true;
// ARB_explicit_uniform_location = true;
// ARB_stencil_texturing = true;
// ARB_texture_view = true;
// ARB_vertex_attrib_binding = true;
}
if (gl_extensions.VersionGEThan(4, 4)) {
// ARB_buffer_storage = true;
}
}
#ifdef __APPLE__
if (!gl_extensions.IsGLES && !gl_extensions.IsCoreContext) {
// Apple doesn't allow OpenGL 3.x+ in compatibility contexts.

0 comments on commit 1802d7a

Please sign in to comment.