mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 00:59:41 +01:00
Merge pull request #9506 from xebra/fix_hwtess_gles
GLES:Fix compatibility checks for instanced rendering.
This commit is contained in:
commit
c1b37bd2ad
4 files changed
+13
-3
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user