summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorMarkus Wick <markus@selfnet.de>2015-09-02 13:27:09 +0200
committerMarkus Wick <markus@selfnet.de>2015-09-02 13:27:09 +0200
commit66e9395d5d7b149f8081d137dc45a745357863ce (patch)
tree22fdb20209c8ae9d8711e58aa48117752be6813f /Source/Core/VideoCommon/PixelShaderGen.cpp
parent0aba5a62fcc40ce7c8fb8e15a100368865e5e545 (diff)
parent71ef0a02451393b32fc2304008f87d5b29b61444 (diff)
Merge pull request #2937 from lioncash/enums
VideoCommon: Convert some defines into enums
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp38
1 files changed, 28 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 50691a82db..5aa62b54b1 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -18,6 +18,24 @@
#include "VideoCommon/VideoConfig.h"
#include "VideoCommon/XFMemory.h" // for texture projection mode
+// TODO: Get rid of these
+enum : u32
+{
+ C_COLORMATRIX = 0, // 0
+ C_COLORS = 0, // 0
+ C_KCOLORS = C_COLORS + 4, // 4
+ C_ALPHA = C_KCOLORS + 4, // 8
+ C_TEXDIMS = C_ALPHA + 1, // 9
+ C_ZBIAS = C_TEXDIMS + 8, // 17
+ C_INDTEXSCALE = C_ZBIAS + 2, // 19
+ C_INDTEXMTX = C_INDTEXSCALE + 2, // 21
+ C_FOGCOLOR = C_INDTEXMTX + 6, // 27
+ C_FOGI = C_FOGCOLOR + 1, // 28
+ C_FOGF = C_FOGI + 1, // 29
+ C_ZSLOPE = C_FOGF + 2, // 31
+ C_EFBSCALE = C_ZSLOPE + 1, // 32
+ C_PENVCONST_END = C_EFBSCALE + 1
+};
static const char *tevKSelTableC[] =
{
@@ -931,7 +949,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, AP
out.Write("\t// color combine\n");
out.Write("\t%s = clamp(", tevCOutputTable[cc.dest]);
- if (cc.bias != TevBias_COMPARE)
+ if (cc.bias != TEVBIAS_COMPARE)
{
WriteTevRegular(out, "rgb", cc.bias, cc.op, cc.clamp, cc.shift);
}
@@ -961,7 +979,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, AP
out.Write("\t// alpha combine\n");
out.Write("\t%s = clamp(", tevAOutputTable[ac.dest]);
- if (ac.bias != TevBias_COMPARE)
+ if (ac.bias != TEVBIAS_COMPARE)
{
WriteTevRegular(out, "a", ac.bias, ac.op, ac.clamp, ac.shift);
}
@@ -1082,14 +1100,14 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs
static const char *tevAlphaFuncsTable[] =
{
- "(false)", // NEVER
- "(prev.a < %s)", // LESS
- "(prev.a == %s)", // EQUAL
- "(prev.a <= %s)", // LEQUAL
- "(prev.a > %s)", // GREATER
- "(prev.a != %s)", // NEQUAL
- "(prev.a >= %s)", // GEQUAL
- "(true)" // ALWAYS
+ "(false)", // NEVER
+ "(prev.a < %s)", // LESS
+ "(prev.a == %s)", // EQUAL
+ "(prev.a <= %s)", // LEQUAL
+ "(prev.a > %s)", // GREATER
+ "(prev.a != %s)", // NEQUAL
+ "(prev.a >= %s)", // GEQUAL
+ "(true)" // ALWAYS
};
static const char *tevAlphaFunclogicTable[] =