1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Correct combiners when cycleType == G_CYC_1CYCLE

but second stage of combiner is not the same as the first one.
Potentially dangerous!!!
This commit is contained in:
Sergey Lipskiy 2014-10-20 23:24:04 +07:00
parent b49e3f67fd
commit 0f14cd57f4
2 changed files with 9 additions and 4 deletions

View File

@ -161,8 +161,11 @@ ShaderCombiner * CombinerInfo::_compile(u64 mux) const
alpha.numStages = 2;
} else {
numCycles = 1;
color.numStages = 1;
alpha.numStages = 1;
if (combine.saRGB0 != combine.saRGB1 || combine.sbRGB0 != combine.sbRGB1 || combine.mRGB0 != combine.mRGB1 || combine.aRGB0 != combine.aRGB1 ||
combine.saA0 != combine.saA1 || combine.sbA0 != combine.sbA1 || combine.mA0 != combine.mA1 || combine.aA0 != combine.aA1)
numCycles = 2;
color.numStages = numCycles;
alpha.numStages = numCycles;
}
CombineCycle cc[2];

View File

@ -377,13 +377,15 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo
strcat(strCombiner, " combined_color = vec4(color1, alpha1); \n");
if (_alpha.numStages == 2) {
strcat(strCombiner, " alpha2 = ");
CorrectSecondStageParams(_alpha.stage[1]);
if (gDP.otherMode.cycleType == G_CYC_2CYCLE)
CorrectSecondStageParams(_alpha.stage[1]);
m_nInputs |= CompileCombiner(_alpha.stage[1], AlphaInput, strCombiner);
} else
strcat(strCombiner, " alpha2 = alpha1; \n");
if (_color.numStages == 2) {
strcat(strCombiner, " color2 = ");
CorrectSecondStageParams(_color.stage[1]);
if (gDP.otherMode.cycleType == G_CYC_2CYCLE)
CorrectSecondStageParams(_color.stage[1]);
m_nInputs |= CompileCombiner(_color.stage[1], ColorInput, strCombiner);
} else
strcat(strCombiner, " color2 = color1; \n");