mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Bind the alphatest tex after we know vert alpha.
Before we sometimes thought alpha test was trivially true when it wasn't.
This commit is contained in:
parent
2e0df244bc
commit
33ac30218a
@ -639,10 +639,6 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
} else {
|
||||
glstate.stencilTest.disable();
|
||||
}
|
||||
|
||||
if (gstate.isAlphaTestEnabled() || gstate.isColorTestEnabled()) {
|
||||
fragmentTestCache_->BindTestTexture(GL_TEXTURE2);
|
||||
}
|
||||
}
|
||||
|
||||
bool throughmode = gstate.isModeThrough();
|
||||
@ -755,3 +751,13 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
glstate.depthRange.set(depthRangeMin, depthRangeMax);
|
||||
}
|
||||
}
|
||||
|
||||
void TransformDrawEngine::ApplyDrawStateLate() {
|
||||
// At this point, we know if the vertices are full alpha or not.
|
||||
// TODO: Set the nearest/linear here (since we correctly know if alpha/color tests are needed)?
|
||||
if (!gstate.isModeClear()) {
|
||||
if (gstate.isAlphaTestEnabled() || gstate.isColorTestEnabled()) {
|
||||
fragmentTestCache_->BindTestTexture(GL_TEXTURE2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -723,6 +723,7 @@ rotateVBO:
|
||||
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
|
||||
}
|
||||
|
||||
ApplyDrawStateLate();
|
||||
LinkedShader *program = shaderManager_->ApplyFragmentShader(vshader, prim, lastVType_);
|
||||
SetupDecFmtForDraw(program, dec_->GetDecVtxFmt(), vbo ? 0 : decoded);
|
||||
|
||||
@ -748,6 +749,7 @@ rotateVBO:
|
||||
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
|
||||
}
|
||||
|
||||
ApplyDrawStateLate();
|
||||
LinkedShader *program = shaderManager_->ApplyFragmentShader(vshader, prim, lastVType_);
|
||||
gpuStats.numUncachedVertsDrawn += indexGen.VertexCount();
|
||||
prim = indexGen.Prim();
|
||||
|
@ -179,6 +179,7 @@ private:
|
||||
void DoFlush();
|
||||
void SoftwareTransformAndDraw(int prim, u8 *decoded, LinkedShader *program, int vertexCount, u32 vertexType, void *inds, int indexType, const DecVtxFormat &decVtxFormat, int maxIndex);
|
||||
void ApplyDrawState(int prim);
|
||||
void ApplyDrawStateLate();
|
||||
void ApplyBlendState();
|
||||
void ApplyStencilReplaceOnly();
|
||||
bool ApplyShaderBlending();
|
||||
|
Loading…
Reference in New Issue
Block a user