DXGL r470 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r469‎ | r470 | r471 >
Date:19:21, 26 July 2014
Author:admin
Status:new
Tags:
Comment:
Adjust shader samplers to fix a regression on GeForce 6200 cards.
Modified paths:
  • /ddraw/ShaderGen2D.cpp (modified) (history)

Diff [purge]

Index: ddraw/ShaderGen2D.cpp
@@ -174,12 +174,12 @@
175175 static const char var_patternst[] = "vec2 patternst;\n";
176176
177177 // Operations
178 -static const char op_src[] = "pixel = ivec4(texture2D(srctex,gl_TexCoord[0].st)*255.0);\n";
179 -static const char op_color[] = "pixel = ivec4(gl_Color*255.0);\n";
180 -static const char op_dest[] = "dest = ivec4(texture2D(desttex,gl_TexCoord[1].st)*255.0);\n";
 178+static const char op_src[] = "pixel = ivec4(texture2D(srctex,gl_TexCoord[0].st)*255.5);\n";
 179+static const char op_color[] = "pixel = ivec4(gl_Color*255.5);\n";
 180+static const char op_dest[] = "dest = ivec4(texture2D(desttex,gl_TexCoord[1].st)*255.5);\n";
181181 static const char op_pattern[] = "patternst = vec2(mod(gl_FragCoord.x,float(patternsize.x))/float(patternsize.x),\n\
182182 mod(gl_FragCoord.y, float(patternsize.y)) / float(patternsize.y));\n\
183 -pattern = ivec4(texture2D(patterntex,patternst)*255.0);\n";
 183+pattern = ivec4(texture2D(patterntex,patternst)*255.5);\n";
184184 static const char op_destout[] = "gl_FragColor = vec4(pixel)/255.0;\n";
185185 static const char op_vertex[] = "vec4 xyzw = vec4(xy[0],xy[1],0,1);\n\
186186 mat4 proj = mat4(\n\