diff options
| author | Tony Wasserka <NeoBrainX@gmail.com> | 2013-08-14 18:54:43 +0200 |
|---|---|---|
| committer | Tony Wasserka <NeoBrainX@gmail.com> | 2014-03-14 22:30:16 +0100 |
| commit | e7a42d884f22c1242234a0fe5a6de7cca3acbc06 (patch) | |
| tree | 1eccab2af4da9bb0331138602aee5f061769719e /Source/Core | |
| parent | cb1514e0821e21ed3e05802e4161a31a1b7d82ba (diff) | |
PixelShaderGen: prev should be initialized to the proper value; tev output needs to be clamped between -1024 and 1023.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 12b42afebc..02a5e7831c 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -382,7 +382,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write(" ) {\n"); } - out.Write(" int4 ic0 = int4(round(" I_COLORS"[1] * 255.0)), ic1 = int4(round(" I_COLORS"[2] * 255.0)), ic2 = int4(round(" I_COLORS"[3] * 255.0)), iprev = int4(0, 0, 0, 0);\n" + out.Write(" int4 ic0 = int4(round(" I_COLORS"[1] * 255.0)), ic1 = int4(round(" I_COLORS"[2] * 255.0)), ic2 = int4(round(" I_COLORS"[3] * 255.0)), iprev = int4(round(" I_COLORS"[0] * 255.0));\n" " int4 irastemp = int4(0, 0, 0, 0), itextemp = int4(0, 0, 0, 0), ikonsttemp = int4(0, 0, 0, 0);\n" " int3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);\n" " int alphabump=0;\n" @@ -846,10 +846,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP out.SetConstantsUsed(C_COLORS+ac.dest, C_COLORS+ac.dest); out.Write("// color combine\n"); - if (cc.clamp) - out.Write("%s = clamp(", tevCOutputTable[cc.dest]); - else - out.Write("%s = ", tevCOutputTable[cc.dest]); + out.Write("%s = clamp(", tevCOutputTable[cc.dest]); // combine the color channel if (cc.bias != TevBias_COMPARE) // if not compare @@ -879,13 +876,12 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP } if (cc.clamp) out.Write(", int3(0,0,0), int3(255,255,255))"); + else + out.Write(", int3(-1024,-1024,-1024), int3(1023,1023,1023))"); out.Write(";\n"); - out.Write("// alpha combine\n"); - if (ac.clamp) - out.Write("%s = clamp(", tevAOutputTable[ac.dest]); - else - out.Write("%s = ", tevAOutputTable[ac.dest]); + out.Write("\t// alpha combine\n"); + out.Write("\t%s = clamp(", tevAOutputTable[ac.dest]); if (ac.bias != TevBias_COMPARE) // if not compare { @@ -916,6 +912,9 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP } if (ac.clamp) out.Write(", 0, 255)"); + else + out.Write(", -1024, 1023)"); + out.Write(";\n\n"); out.Write("// TEV done\n"); } |
