summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-07-13 17:24:23 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2013-07-13 17:24:23 -0500
commit737df2a68cd5c5cdfa1e73cede0dbf85bde01abc (patch)
treec1aae182867da795ce0016c46fa4b58accb15071 /Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
parent52cb398804a4f7f4e31e2040bbabd1bf90c581f6 (diff)
Patch from Degasus that removes the last of the the GL_TEXTURE_RECTANGLE usages. This is needed to have GLES3 support.
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
index 1da28f9cc5..1eed65a01e 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
@@ -509,7 +509,6 @@ void ProgramShaderCache::CreateHeader ( void )
snprintf(s_glsl_header, sizeof(s_glsl_header),
"#version %s\n"
"%s\n" // default precision
- "%s\n" // tex_rect
"%s\n" // ubo
"\n"// A few required defines and ones that will make our lives a lot easier
@@ -534,10 +533,14 @@ void ProgramShaderCache::CreateHeader ( void )
"%s\n"
"%s\n"
"#define COLOROUT(name) %s\n"
+
+ // texture2d hack
+ "%s\n"
+ "%s\n"
+ "%s\n"
, v==GLSLES3 ? "300 es" : v==GLSL_120 ? "120" : v==GLSL_130 ? "130" : "140"
, v==GLSLES3 ? "precision highp float;" : ""
- , v==GLSLES3 ? "" : 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" : ""
, v==GLSL_120 ? "attribute" : "in"
, v==GLSL_120 ? "attribute" : "out"
@@ -549,6 +552,9 @@ void ProgramShaderCache::CreateHeader ( void )
, v==GLSL_120 ? "#define ocol0 gl_FragColor" : ""
, v==GLSL_120 ? "#define ocol1 gl_FragColor" : "" //TODO: implement dual source blend
, v==GLSL_120 ? "" : "out vec4 name;"
+ , v==GLSL_120 ? "#extension GL_ARB_texture_rectangle : enable" : ""
+ , v==GLSL_120 ? "" : "#define texture2DRect(samp, uv) texelFetch(samp, ivec2(floor(uv)), 0)"
+ , v==GLSL_120 ? "" : "#define sampler2DRect sampler2D"
);
}