From 8a6f7474088eb24e2f5875708ffc7f47ac996e24 Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 19 Jan 2013 11:07:06 +0100 Subject: [PATCH] glsl: remove usage of old texture2D* function --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 2 +- Source/Core/VideoCommon/Src/TextureConversionShader.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h | 4 ++-- Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp | 4 ++-- Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index cd6903af39..31aecfdc85 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -1294,7 +1294,7 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con if (ApiType == API_D3D11) WRITE(p, "%s=Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, texmap,texmap, texcoords, texmap, texswap); else - WRITE(p, "%s=%s(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, ApiType == API_OPENGL ? "texture2D" : "tex2D", texmap, texcoords, texmap, texswap); + WRITE(p, "%s=%s(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, ApiType == API_OPENGL ? "texture" : "tex2D", texmap, texcoords, texmap, texswap); } static const char *tevAlphaFuncsTable[] = diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index 3dbb3aaa38..750f673d40 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -247,7 +247,7 @@ void WriteSampleColor(char*& p, const char* colorComp, const char* dest, API_TYP else if (ApiType == API_D3D11) texSampleOpName = "tex0.Sample"; else - texSampleOpName = "texture2DRect"; + texSampleOpName = "texture"; // the increment of sampleUv.x is delayed, so we perform it here. see WriteIncrementSampleX. const char* texSampleIncrementUnit; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index 937102f4e9..1183c5b3b5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -33,12 +33,12 @@ #define TEX2D GL_TEXTURE_2D #define PREC "highp" #define TEXTYPE "sampler2D" -#define TEXFUNC "texture2D" +#define TEXFUNC "texture" #else #define TEX2D GL_TEXTURE_RECTANGLE_ARB #define PREC #define TEXTYPE "sampler2DRect" -#define TEXFUNC "texture2DRect" +#define TEXFUNC "texture" #endif diff --git a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp index 95ca3f202d..95a87c821b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp @@ -146,7 +146,7 @@ static const char *s_fragmentShaderSrc = "in vec2 uv0;\n" "out vec4 ocol0;\n" "void main(void) {\n" - " ocol0 = texture2D(samp8,uv0) * color;\n" + " ocol0 = texture(samp8,uv0) * color;\n" "}\n"; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index cb67c7220c..346df96483 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -484,7 +484,7 @@ TextureCache::TextureCache() "void main(){\n" " vec4 Temp0, Temp1;\n" " vec4 K0 = vec4(0.5, 0.5, 0.5, 0.5);\n" - " Temp0 = texture2DRect(samp9, uv0);\n" + " Temp0 = texture(samp9, uv0);\n" " Temp0 = Temp0 * colmat[5];\n" " Temp0 = Temp0 + K0;\n" " Temp0 = floor(Temp0);\n" @@ -513,7 +513,7 @@ TextureCache::TextureCache() " vec4 R0, R1, R2;\n" " vec4 K0 = vec4(255.99998474121, 0.003921568627451, 256.0, 0.0);\n" " vec4 K1 = vec4(15.0, 0.066666666666, 0.0, 0.0);\n" - " R2 = texture2DRect(samp9, uv0);\n" + " R2 = texture(samp9, uv0);\n" " R0.x = R2.x * K0.x;\n" " R0.x = floor(R0).x;\n" " R0.yzw = (R0 - R0.x).yzw;\n" diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index 97b53552a9..970fa637ff 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -78,8 +78,8 @@ void CreatePrograms() "out vec4 ocol0;\n" "void main()\n" "{\n" - " vec3 c0 = texture2DRect(samp9, uv0).rgb;\n" - " vec3 c1 = texture2DRect(samp9, uv0 + vec2(1.0, 0.0)).rgb;\n" + " vec3 c0 = texture(samp9, uv0).rgb;\n" + " vec3 c1 = texture(samp9, uv0 + vec2(1.0, 0.0)).rgb;\n" " vec3 c01 = (c0 + c1) * 0.5;\n" " vec3 y_const = vec3(0.257,0.504,0.098);\n" " vec3 u_const = vec3(-0.148,-0.291,0.439);\n" @@ -98,7 +98,7 @@ void CreatePrograms() "out vec4 ocol0;\n" "void main()\n" "{\n" - " vec4 c0 = texture2DRect(samp9, uv0).rgba;\n" + " vec4 c0 = texture(samp9, uv0).rgba;\n" " float f = step(0.5, fract(uv0.x));\n" " float y = mix(c0.b, c0.r, f);\n" " float yComp = 1.164f * (y - 0.0625f);\n"