From 9c0ed0f2c4182f3df543a54881e68bb12cf2ed68 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 18 Jul 2018 10:06:30 +0200 Subject: [PATCH] Don't use core profile GLSL shaders for OpenGLES --- .../gl_shaders/pipeline_snow.glsl.vert.h | 16 ++++++++++++++++ ....vert.h => pipeline_snow_core.glsl.vert.h} | 2 +- gfx/drivers_shader/shader_glsl.c | 19 ++++++++++--------- 3 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 gfx/drivers/gl_shaders/pipeline_snow.glsl.vert.h rename gfx/drivers/gl_shaders/{modern_pipeline_snow.glsl.vert.h => pipeline_snow_core.glsl.vert.h} (87%) diff --git a/gfx/drivers/gl_shaders/pipeline_snow.glsl.vert.h b/gfx/drivers/gl_shaders/pipeline_snow.glsl.vert.h new file mode 100644 index 0000000000..0ebbf254dd --- /dev/null +++ b/gfx/drivers/gl_shaders/pipeline_snow.glsl.vert.h @@ -0,0 +1,16 @@ +#include "shaders_common.h" + +/* Need to duplicate these to work around broken stuff on Android. + * Must enforce alpha = 1.0 or 32-bit games can potentially go black. */ +static const char *stock_vertex_xmb_snow = GLSL( + attribute vec2 TexCoord; + attribute vec2 VertexCoord; + attribute vec4 Color; + uniform mat4 MVPMatrix; + varying vec2 tex_coord; + + void main() { + gl_Position = MVPMatrix * vec4(VertexCoord, 0.0, 1.0); + tex_coord = TexCoord; + } +); diff --git a/gfx/drivers/gl_shaders/modern_pipeline_snow.glsl.vert.h b/gfx/drivers/gl_shaders/pipeline_snow_core.glsl.vert.h similarity index 87% rename from gfx/drivers/gl_shaders/modern_pipeline_snow.glsl.vert.h rename to gfx/drivers/gl_shaders/pipeline_snow_core.glsl.vert.h index 7e7719fdad..cae4002833 100644 --- a/gfx/drivers/gl_shaders/modern_pipeline_snow.glsl.vert.h +++ b/gfx/drivers/gl_shaders/pipeline_snow_core.glsl.vert.h @@ -2,7 +2,7 @@ /* Need to duplicate these to work around broken stuff on Android. * Must enforce alpha = 1.0 or 32-bit games can potentially go black. */ -static const char *stock_vertex_xmb_snow_modern = GLSL( +static const char *stock_vertex_xmb_snow_core = GLSL( in vec2 TexCoord; in vec2 VertexCoord; in vec4 Color; diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index 3a0683422d..8d8dbb4590 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -125,9 +125,10 @@ static const char *glsl_prefixes[] = { #include "../drivers/gl_shaders/core_pipeline_snowflake.glsl.frag.h" #include "../drivers/gl_shaders/legacy_pipeline_xmb_ribbon_simple.glsl.vert.h" #include "../drivers/gl_shaders/modern_pipeline_xmb_ribbon_simple.glsl.vert.h" -#include "../drivers/gl_shaders/modern_pipeline_snow.glsl.vert.h" #include "../drivers/gl_shaders/pipeline_xmb_ribbon_simple.glsl.frag.h" #include "../drivers/gl_shaders/pipeline_snow.glsl.frag.h" +#include "../drivers/gl_shaders/pipeline_snow.glsl.vert.h" +#include "../drivers/gl_shaders/pipeline_snow_core.glsl.vert.h" #include "../drivers/gl_shaders/pipeline_snow_simple.glsl.frag.h" #include "../drivers/gl_shaders/legacy_pipeline_snow.glsl.vert.h" #include "../drivers/gl_shaders/legacy_pipeline_xmb_ribbon.glsl.vert.h" @@ -843,10 +844,10 @@ static void gl_glsl_init_menu_shaders(void *data) &glsl->uniforms[VIDEO_SHADER_MENU_2]); #if defined(HAVE_OPENGLES) - shader_prog_info.vertex = stock_vertex_xmb_snow_modern; + shader_prog_info.vertex = stock_vertex_xmb_snow; shader_prog_info.fragment = stock_fragment_xmb_simple_snow; #else - shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy; + shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_core : stock_vertex_xmb_snow_legacy; shader_prog_info.fragment = glsl_core ? stock_fragment_xmb_simple_snow_core : stock_fragment_xmb_simple_snow; #endif @@ -860,10 +861,10 @@ static void gl_glsl_init_menu_shaders(void *data) &glsl->uniforms[VIDEO_SHADER_MENU_3]); #if defined(HAVE_OPENGLES) - shader_prog_info.vertex = stock_vertex_xmb_snow_modern; + shader_prog_info.vertex = stock_vertex_xmb_snow; shader_prog_info.fragment = stock_fragment_xmb_snow; #else - shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy; + shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_core : stock_vertex_xmb_snow_legacy; shader_prog_info.fragment = glsl_core ? stock_fragment_xmb_snow_core : stock_fragment_xmb_snow; #endif @@ -877,10 +878,10 @@ static void gl_glsl_init_menu_shaders(void *data) &glsl->uniforms[VIDEO_SHADER_MENU_4]); #if defined(HAVE_OPENGLES) - shader_prog_info.vertex = stock_vertex_xmb_snow_modern; + shader_prog_info.vertex = stock_vertex_xmb_snow; shader_prog_info.fragment = stock_fragment_xmb_bokeh; #else - shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy; + shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_core : stock_vertex_xmb_snow_legacy; shader_prog_info.fragment = glsl_core ? stock_fragment_xmb_bokeh_core : stock_fragment_xmb_bokeh; #endif @@ -894,10 +895,10 @@ static void gl_glsl_init_menu_shaders(void *data) &glsl->uniforms[VIDEO_SHADER_MENU_5]); #if defined(HAVE_OPENGLES) - shader_prog_info.vertex = stock_vertex_xmb_snow_modern; + shader_prog_info.vertex = stock_vertex_xmb_snow; shader_prog_info.fragment = stock_fragment_xmb_snowflake; #else - shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy; + shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_core : stock_vertex_xmb_snow_legacy; shader_prog_info.fragment = glsl_core ? stock_fragment_xmb_snowflake_core : stock_fragment_xmb_snowflake; #endif