SW/Tev: Replace Tev::SetRegColor with Tev::SetKonstColors

This commit is contained in:
Pokechu22 2021-12-26 13:24:47 -08:00
parent 3b9a048291
commit ae0fcd9a9f
5 changed files with 13 additions and 16 deletions

View File

@ -140,9 +140,9 @@ static inline int iround(float x)
return t;
}
void SetTevReg(int reg, int comp, s16 color)
void SetTevKonstColors()
{
tev.SetRegColor(reg, comp, color);
tev.SetKonstColors();
}
static void Draw(s32 x, s32 y, s32 xi, s32 yi)

View File

@ -17,7 +17,7 @@ void UpdateZSlope(const OutputVertexData* v0, const OutputVertexData* v1,
void DrawTriangleFrontFace(const OutputVertexData* v0, const OutputVertexData* v1,
const OutputVertexData* v2);
void SetTevReg(int reg, int comp, s16 color);
void SetTevKonstColors();
struct RasterBlockPixel
{

View File

@ -67,15 +67,7 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_
g_renderer->BBoxFlush();
m_setup_unit.Init(primitive_type);
// set all states with are stored within video sw
for (int i = 0; i < 4; i++)
{
Rasterizer::SetTevReg(i, Tev::RED_C, PixelShaderManager::constants.kcolors[i][0]);
Rasterizer::SetTevReg(i, Tev::GRN_C, PixelShaderManager::constants.kcolors[i][1]);
Rasterizer::SetTevReg(i, Tev::BLU_C, PixelShaderManager::constants.kcolors[i][2]);
Rasterizer::SetTevReg(i, Tev::ALP_C, PixelShaderManager::constants.kcolors[i][3]);
}
Rasterizer::SetTevKonstColors();
for (u32 i = 0; i < m_index_generator.GetIndexLen(); i++)
{

View File

@ -740,7 +740,13 @@ void Tev::Draw()
EfbInterface::BlendTev(Position[0], Position[1], output);
}
void Tev::SetRegColor(int reg, int comp, s16 color)
void Tev::SetKonstColors()
{
KonstantColors[reg][comp] = color;
for (int i = 0; i < 4; i++)
{
KonstantColors[i].r = PixelShaderManager::constants.kcolors[i][0];
KonstantColors[i].g = PixelShaderManager::constants.kcolors[i][1];
KonstantColors[i].b = PixelShaderManager::constants.kcolors[i][2];
KonstantColors[i].a = PixelShaderManager::constants.kcolors[i][3];
}
}

View File

@ -226,7 +226,6 @@ public:
RED_C
};
void SetKonstColors();
void Draw();
void SetRegColor(int reg, int comp, s16 color);
};