summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2011-11-01 01:37:54 +0100
committerPierre Bourdon <delroth@gmail.com>2011-11-01 01:37:54 +0100
commit8f31968466fb3cbb1ca033cf3baf5ba843640f6f (patch)
tree28bb0b5e35c7492d120e72bb3e4e367dcf5c5990 /Source/Core/VideoCommon
parentdd551814c9c160c1dd33ed0f29e722e73fb43eca (diff)
Revert "Merge branch 'zcomploc-support'"
This reverts commit 9dad9ebe899b4f2c36923c9721a09ff45b4e573c, reversing changes made to e76bc71efe8c3c724e14a2f741fe4f34669d1bea.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index f9aa7fd551..1726855d54 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -143,6 +143,8 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
if (bpmem.tevind[i].IsActive() && bpmem.tevind[i].bt < bpmem.genMode.numindstages)
indirectStagesUsed |= (1 << bpmem.tevind[i].bt);
+ assert(indirectStagesUsed == (indirectStagesUsed & 0xF));
+
uid->values[1] |= indirectStagesUsed << 5; // 4;
for (unsigned int i = 0; i < bpmem.genMode.numindstages; ++i)
@@ -169,10 +171,10 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
if (alphaPreTest == 0 || alphaPreTest == 2)
{
ptr[0] |= bpmem.fog.c_proj_fsel.fsel << 8; // 3
- ptr[0] |= bpmem.zcontrol.zcomploc << 11; // 1
if (DepthTextureEnable)
{
- ptr[0] |= bpmem.ztex2.op << 12; // 2
+ ptr[0] |= bpmem.ztex2.op << 11; // 2
+ ptr[0] |= bpmem.zcontrol.zcomploc << 13; // 1
ptr[0] |= bpmem.zmode.testenable << 14; // 1
ptr[0] |= bpmem.zmode.updateenable << 15; // 1
}
@@ -1179,21 +1181,10 @@ static bool WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
compindex = bpmem.alphaFunc.comp1 % 8;
WRITE(p, tevAlphaFuncsTable[compindex],alphaRef[1]);//lookup the second component from the alpha function table
- WRITE(p, ")) {\n");
-
- WRITE(p, "ocol0 = 0;\n");
- if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
- WRITE(p, "ocol1 = 0;\n");
- if (DepthTextureEnable)
- WRITE(p, "depth = 1.f;\n");
- if (!bpmem.zcontrol.zcomploc)
- {
- WRITE(p, "discard;\n");
- if (ApiType != API_D3D11)
- WRITE(p, "return;\n");
- }
-
- WRITE(p, "}\n");
+ WRITE(p, ")){ocol0 = 0;%s%s discard;%s}\n",
+ dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND ? "ocol1 = 0;" : "",
+ DepthTextureEnable ? "depth = 1.f;" : "",
+ (ApiType != API_D3D11) ? "return;" : "");
return true;
}
@@ -1251,4 +1242,4 @@ static void WriteFog(char *&p)
WRITE(p, " prev.rgb = lerp(prev.rgb,"I_FOG"[0].rgb,fog);\n");
-}
+} \ No newline at end of file