diff options
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 10 |
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" ); } |
