Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Add GLSLES3 to the GLSL version enums. Add in the version a…
…nd precision qualifier to the shader header.
  • Loading branch information
Sonicadvance1 committed May 6, 2013
1 parent 028a1a4 commit cb5b9c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
Expand Up @@ -501,6 +501,7 @@ void ProgramShaderCache::CreateHeader ( void )
GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion;
snprintf(s_glsl_header, sizeof(s_glsl_header),
"#version %s\n"
"%s\n" // default precision
"%s\n" // tex_rect
"%s\n" // ubo

Expand Down Expand Up @@ -528,9 +529,10 @@ void ProgramShaderCache::CreateHeader ( void )
"%s\n"
"#define COLOROUT(name) %s\n"

, v==GLSL_120 ? "120" : v==GLSL_130 ? "130" : "140"
, v==GLSLES3 ? "300 es" : v==GLSL_120 ? "120" : v==GLSL_130 ? "130" : "140"
, v==GLSLES3 ? "precision highp float;" : ""
, v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture"
, g_ActiveConfig.backend_info.bSupportsGLSLUBO && v!=GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, g_ActiveConfig.backend_info.bSupportsGLSLUBO && v<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, v==GLSL_120 ? "attribute" : "in"
, v==GLSL_120 ? "attribute" : "out"
, v==GLSL_120 ? "varying" : "centroid in"
Expand Down
3 changes: 2 additions & 1 deletion Source/Plugins/Plugin_VideoOGL/Src/Render.h
Expand Up @@ -12,7 +12,8 @@ void ClearEFBCache();
enum GLSL_VERSION {
GLSL_120,
GLSL_130,
GLSL_140 // and above
GLSL_140, // and above
GLSLES3
};

// ogl-only config, so not in VideoConfig.h
Expand Down

0 comments on commit cb5b9c0

Please sign in to comment.