Video backends: fix behavior of "konst" TEV inputs.

Also fixes TEVCOLORARG_HALF.

Values verified to match hardwarere.
This commit is contained in:
magumagu 2014-05-14 13:27:00 -07:00
parent fee6efc4dc
commit 8b82cea704
2 changed files with 39 additions and 29 deletions

View File

@ -23,10 +23,10 @@
void Tev::Init()
{
FixedConstants[0] = 0;
FixedConstants[1] = 31;
FixedConstants[2] = 63;
FixedConstants[3] = 95;
FixedConstants[4] = 127;
FixedConstants[1] = 32;
FixedConstants[2] = 64;
FixedConstants[3] = 96;
FixedConstants[4] = 128;
FixedConstants[5] = 159;
FixedConstants[6] = 191;
FixedConstants[7] = 223;
@ -74,10 +74,20 @@ void Tev::Init()
m_KonstLUT[6][comp] = &FixedConstants[2];
m_KonstLUT[7][comp] = &FixedConstants[1];
m_KonstLUT[12][comp] = &KonstantColors[0][comp];
m_KonstLUT[13][comp] = &KonstantColors[1][comp];
m_KonstLUT[14][comp] = &KonstantColors[2][comp];
m_KonstLUT[15][comp] = &KonstantColors[3][comp];
// These are "invalid" values, not meant to be used. On hardware,
// they all output zero.
for (int i = 8; i < 16; ++i)
{
m_KonstLUT[i][comp] = &FixedConstants[0];
}
if (comp != ALP_C)
{
m_KonstLUT[12][comp] = &KonstantColors[0][comp];
m_KonstLUT[13][comp] = &KonstantColors[1][comp];
m_KonstLUT[14][comp] = &KonstantColors[2][comp];
m_KonstLUT[15][comp] = &KonstantColors[3][comp];
}
m_KonstLUT[16][comp] = &KonstantColors[0][RED_C];
m_KonstLUT[17][comp] = &KonstantColors[1][RED_C];

View File

@ -24,14 +24,14 @@ static const char *tevKSelTableC[] =
"223,223,223", // 7_8 = 0x01
"191,191,191", // 3_4 = 0x02
"159,159,159", // 5_8 = 0x03
"127,127,127", // 1_2 = 0x04
"95,95,95", // 3_8 = 0x05
"63,63,63", // 1_4 = 0x06
"31,31,31", // 1_8 = 0x07
"ERROR1", // 0x08
"ERROR2", // 0x09
"ERROR3", // 0x0a
"ERROR4", // 0x0b
"128,128,128", // 1_2 = 0x04
"96,96,96", // 3_8 = 0x05
"64,64,64", // 1_4 = 0x06
"32,32,32", // 1_8 = 0x07
"0,0,0", // INVALID = 0x08
"0,0,0", // INVALID = 0x09
"0,0,0", // INVALID = 0x0a
"0,0,0", // INVALID = 0x0b
I_KCOLORS"[0].rgb", // K0 = 0x0C
I_KCOLORS"[1].rgb", // K1 = 0x0D
I_KCOLORS"[2].rgb", // K2 = 0x0E
@ -60,18 +60,18 @@ static const char *tevKSelTableA[] =
"223", // 7_8 = 0x01
"191", // 3_4 = 0x02
"159", // 5_8 = 0x03
"127", // 1_2 = 0x04
"95", // 3_8 = 0x05
"63", // 1_4 = 0x06
"31", // 1_8 = 0x07
"ERROR5", // 0x08
"ERROR6", // 0x09
"ERROR7", // 0x0a
"ERROR8", // 0x0b
"ERROR9", // 0x0c
"ERROR10", // 0x0d
"ERROR11", // 0x0e
"ERROR12", // 0x0f
"128", // 1_2 = 0x04
"96", // 3_8 = 0x05
"64", // 1_4 = 0x06
"32", // 1_8 = 0x07
"0", // INVALID = 0x08
"0", // INVALID = 0x09
"0", // INVALID = 0x0a
"0", // INVALID = 0x0b
"0", // INVALID = 0x0c
"0", // INVALID = 0x0d
"0", // INVALID = 0x0e
"0", // INVALID = 0x0f
I_KCOLORS"[0].r", // K0_R = 0x10
I_KCOLORS"[1].r", // K1_R = 0x11
I_KCOLORS"[2].r", // K2_R = 0x12
@ -105,7 +105,7 @@ static const char *tevCInputTable[] =
"rastemp.rgb", // RASC,
"rastemp.aaa", // RASA,
"int3(255,255,255)", // ONE
"int3(127,127,127)", // HALF
"int3(128,128,128)", // HALF
"konsttemp.rgb", // KONST
"int3(0,0,0)", // ZERO
};