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

Don't add blending to shaders for COPY and FILL cycle modes.

This commit is contained in:
Sergey Lipskiy 2016-05-13 18:09:24 +06:00
parent de388cbc56
commit 71caf75b7a
3 changed files with 19 additions and 14 deletions

View File

@ -330,15 +330,17 @@ void ShaderCombiner::updateFogMode(bool _bForce)
void ShaderCombiner::updateBlendMode(bool _bForce)
{
m_uniforms.uBlendMux1.set(gDP.otherMode.c1_m1a,
gDP.otherMode.c1_m1b,
gDP.otherMode.c1_m2a,
gDP.otherMode.c1_m2b,
_bForce);
if (gDP.otherMode.cycleType <= G_CYC_2CYCLE) {
m_uniforms.uBlendMux1.set(gDP.otherMode.c1_m1a,
gDP.otherMode.c1_m1b,
gDP.otherMode.c1_m2a,
gDP.otherMode.c1_m2b,
_bForce);
}
int forceBlend1 = gDP.otherMode.cycleType == G_CYC_2CYCLE ? 1 : 0;
int forceBlend2 = 0;
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType < G_CYC_COPY) {
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType <= G_CYC_2CYCLE) {
forceBlend1 = 1;
if (gDP.otherMode.cycleType == G_CYC_2CYCLE) {
forceBlend2 = 1;

View File

@ -635,15 +635,17 @@ void ShaderCombiner::updateFogMode(bool _bForce)
void ShaderCombiner::updateBlendMode(bool _bForce)
{
m_uniforms.uBlendMux1.set(gDP.otherMode.c1_m1a,
gDP.otherMode.c1_m1b,
gDP.otherMode.c1_m2a,
gDP.otherMode.c1_m2b,
_bForce);
if (gDP.otherMode.cycleType <= G_CYC_2CYCLE) {
m_uniforms.uBlendMux1.set(gDP.otherMode.c1_m1a,
gDP.otherMode.c1_m1b,
gDP.otherMode.c1_m2a,
gDP.otherMode.c1_m2b,
_bForce);
}
int forceBlend1 = gDP.otherMode.cycleType == G_CYC_2CYCLE ? 1 : 0;
int forceBlend2 = 0;
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType < G_CYC_COPY) {
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType <= G_CYC_2CYCLE) {
forceBlend1 = 1;
if (gDP.otherMode.cycleType == G_CYC_2CYCLE) {
forceBlend2 = 1;

View File

@ -308,13 +308,14 @@ int compileCombiner(Combiner & _color, Combiner & _alpha, std::string & _strShad
}
#endif
_strShader.append(fragment_shader_blender1);
if (gDP.otherMode.cycleType <= G_CYC_2CYCLE)
_strShader.append(fragment_shader_blender1);
if (gDP.otherMode.cycleType == G_CYC_2CYCLE)
_strShader.append(fragment_shader_blender2);
_strShader.append(
" fragColor = vec4(color2, alpha2); \n"
);
);
return nInputs;
}