summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-02-13 18:01:06 +0100
committerdegasus <wickmarkus@web.de>2013-02-13 18:01:06 +0100
commit33925625013c03b8d95a0940a6fdd06828f6bf0a (patch)
treeeb98cb9e3bf8a04eb0fafa9c27df14932ecdc56e /Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
parent21b83b436ca98a246e96c8aca20c373c71bcc0c7 (diff)
rewrite efb copy shader, copied from dx11
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp41
1 files changed, 7 insertions, 34 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
index 0aa47430dc..9a6f2c85ec 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp
@@ -484,18 +484,9 @@ TextureCache::TextureCache()
"out vec4 ocol0;\n"
"\n"
"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 = Temp0 * colmat[5];\n"
- " Temp0 = Temp0 + K0;\n"
- " Temp0 = floor(Temp0);\n"
- " Temp0 = Temp0 * colmat[6];\n"
- " Temp1.x = dot(Temp0, colmat[0]);\n"
- " Temp1.y = dot(Temp0, colmat[1]);\n"
- " Temp1.z = dot(Temp0, colmat[2]);\n"
- " Temp1.w = dot(Temp0, colmat[3]);\n"
- " ocol0 = Temp1 + colmat[4];\n"
+ " vec4 texcol = texture2DRect(samp9, uv0);\n"
+ " texcol = round(texcol * colmat[5]) * colmat[6];\n"
+ " ocol0 = mat4(colmat[0], colmat[1], colmat[2], colmat[3]) * texcol + colmat[4];\n"
"}\n";
const char *pDepthMatrixProg =
@@ -507,28 +498,10 @@ TextureCache::TextureCache()
"out vec4 ocol0;\n"
"\n"
"void main(){\n"
- " 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"
- " R0.x = R2.x * K0.x;\n"
- " R0.x = floor(R0).x;\n"
- " R0.yzw = (R0 - R0.x).yzw;\n"
- " R0.yzw = (R0 * K0.z).yzw;\n"
- " R0.y = floor(R0).y;\n"
- " R0.zw = (R0 - R0.y).zw;\n"
- " R0.zw = (R0 * K0.z).zw;\n"
- " R0.z = floor(R0).z;\n"
- " R0.w = R0.x;\n"
- " R0 = R0 * K0.y;\n"
- " R0.w = (R0 * K1.x).w;\n"
- " R0.w = floor(R0).w;\n"
- " R0.w = (R0 * K1.y).w;\n"
- " R1.x = dot(R0, colmat[0]);\n"
- " R1.y = dot(R0, colmat[1]);\n"
- " R1.z = dot(R0, colmat[2]);\n"
- " R1.w = dot(R0, colmat[3]);\n"
- " ocol0 = R1 * colmat[4];\n"
+ " vec4 texcol = texture2DRect(samp9, uv0);\n"
+ " vec4 EncodedDepth = fract((texcol.r * (16777215.0f/16777216.0f)) * vec4(1.0f,256.0f,256.0f*256.0f,1.0f));\n"
+ " texcol = round(EncodedDepth * (16777216.0f/16777215.0f) * vec4(255.0f,255.0f,255.0f,15.0f)) / vec4(255.0f,255.0f,255.0f,15.0f);\n"
+ " ocol0 = mat4(colmat[0], colmat[1], colmat[2], colmat[3]) * texcol + colmat[4];"
"}\n";