From 73a898df2a37a1c7ad29732ed97d1c0339094d26 Mon Sep 17 00:00:00 2001 From: xebra Date: Tue, 28 Mar 2017 19:49:37 +0900 Subject: [PATCH 1/2] GLES:Fix again compatibility for instanced rendering. --- GPU/GLES/GPU_GLES.cpp | 5 ++--- UI/GameSettingsScreen.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 62ec9796b..e7bbb9946 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -300,9 +300,8 @@ void GPU_GLES::CheckGPUFeatures() { features |= GPU_SUPPORTS_ANISOTROPY; 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) + bool canDefInstanceID = gl_extensions.IsGLES || gl_extensions.EXT_gpu_shader4; + bool instanceRendering = gl_extensions.GLES3 || (canUseInstanceID && canDefInstanceID); features |= GPU_SUPPORTS_INSTANCE_RENDERING; int maxVertexTextureImageUnits; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index b7658dbc4..af28b05f4 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -93,9 +93,8 @@ bool CheckSupportInstancedTessellationGLES() { bool vertexTexture = maxVertexTextureImageUnits >= 3; // At least 3 for hardware tessellation 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 canDefInstanceID = gl_extensions.IsGLES || gl_extensions.EXT_gpu_shader4; + bool instanceRendering = gl_extensions.GLES3 || (canUseInstanceID && canDefInstanceID); bool textureFloat = gl_extensions.ARB_texture_float || gl_extensions.OES_texture_float; From a7c3b2f599dbe227c34353a00f44fcfc8f77a07d Mon Sep 17 00:00:00 2001 From: xebra Date: Tue, 28 Mar 2017 19:51:25 +0900 Subject: [PATCH 2/2] Add warning "experimental" to hardware tessellation because may cause crash with GLES. --- UI/GameSettingsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index af28b05f4..d1f25ddfe 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -327,7 +327,7 @@ void GameSettingsScreen::CreateViews() { bezierChoiceDisable_ = g_Config.bSoftwareRendering || g_Config.bHardwareTessellation; beziersChoice->SetDisabledPtr(&bezierChoiceDisable_); - CheckBox *tessellationHW = graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTessellation, gr->T("Hardware Tessellation"))); + CheckBox *tessellationHW = graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTessellation, gr->T("Hardware Tessellation", "Hardware tessellation (experimental)"))); tessellationHW->OnClick.Add([=](EventParams &e) { bezierChoiceDisable_ = g_Config.bSoftwareRendering || g_Config.bHardwareTessellation; settingInfo_->Show(gr->T("HardwareTessellation Tip", "Uses hardware to make curves, always uses a fixed quality"), e.v);