diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 5b7e2c4fb0..62ec9796bc 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -299,8 +299,10 @@ void GPU_GLES::CheckGPUFeatures() { if (gl_extensions.EXT_texture_filter_anisotropic) features |= GPU_SUPPORTS_ANISOTROPY; - if (gl_extensions.GLES3 || gl_extensions.EXT_gpu_shader4 - || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 1)/*GLSL 1.4*/)) + bool canUseInstanceID = gl_extensions.EXT_draw_instanced || gl_extensions.ARB_draw_instanced; + bool canDefInstanceID = gl_extensions.GLES3 || gl_extensions.EXT_gpu_shader4 + || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 1)/*GLSL 1.4*/); + if (canUseInstanceID && canDefInstanceID) features |= GPU_SUPPORTS_INSTANCE_RENDERING; int maxVertexTextureImageUnits; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 248e18af9d..b7658dbc46 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -91,8 +91,12 @@ bool CheckSupportInstancedTessellationGLES() { int maxVertexTextureImageUnits; glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &maxVertexTextureImageUnits); bool vertexTexture = maxVertexTextureImageUnits >= 3; // At least 3 for hardware tessellation - bool instanceRendering = gl_extensions.GLES3 || gl_extensions.EXT_gpu_shader4 + + bool canUseInstanceID = gl_extensions.EXT_draw_instanced || gl_extensions.ARB_draw_instanced; + bool canDefInstanceID = gl_extensions.GLES3 || gl_extensions.EXT_gpu_shader4 || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 1)/*GLSL 1.4*/); + bool instanceRendering = canUseInstanceID && canDefInstanceID; + bool textureFloat = gl_extensions.ARB_texture_float || gl_extensions.OES_texture_float; return instanceRendering && vertexTexture && textureFloat; diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index c57eb996af..a31ba9a8c2 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -278,6 +278,8 @@ void CheckGLExtensions() { gl_extensions.ARB_vertex_array_object = strstr(extString, "GL_ARB_vertex_array_object") != 0; gl_extensions.ARB_texture_float = strstr(extString, "GL_ARB_texture_float") != 0; gl_extensions.EXT_texture_filter_anisotropic = strstr(extString, "GL_EXT_texture_filter_anisotropic") != 0; + gl_extensions.EXT_draw_instanced = strstr(extString, "GL_EXT_draw_instanced") != 0; + gl_extensions.ARB_draw_instanced = strstr(extString, "GL_ARB_draw_instanced") != 0; if (gl_extensions.IsGLES) { gl_extensions.OES_texture_npot = strstr(extString, "GL_OES_texture_npot") != 0; diff --git a/ext/native/gfx_es2/gpu_features.h b/ext/native/gfx_es2/gpu_features.h index 3e7908dd4d..d8ea0de803 100644 --- a/ext/native/gfx_es2/gpu_features.h +++ b/ext/native/gfx_es2/gpu_features.h @@ -59,6 +59,7 @@ struct GLExtensions { bool ARB_copy_image; bool ARB_vertex_array_object; bool ARB_texture_float; + bool ARB_draw_instanced; // EXT bool EXT_swap_control_tear; @@ -72,6 +73,7 @@ struct GLExtensions { bool EXT_copy_image; bool EXT_texture_filter_anisotropic; bool PBO_EXT; + bool EXT_draw_instanced; // NV bool NV_shader_framebuffer_fetch;