Determine alpha test texture after texture.

Because, of course, this reads texture alpha parameters for blending
optimizations.

Fixes #8970.
This commit is contained in:
Unknown W. Brackets 2016-09-11 11:03:03 -07:00
parent f77ba7ba3a
commit 26809c1d7a
2 changed files with 7 additions and 6 deletions

View file

@ -306,8 +306,6 @@ void DrawEngineDX9::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()) {
// TODO: Test texture?
textureCache_->ApplyTexture();
if (fboTexNeedBind_) {
@ -319,6 +317,8 @@ void DrawEngineDX9::ApplyDrawStateLate() {
fboTexBound_ = true;
fboTexNeedBind_ = false;
}
// TODO: Test texture?
}
}

View file

@ -373,10 +373,6 @@ void DrawEngineGLES::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);
}
if (fboTexNeedBind_) {
// Note that this is positions, not UVs, that we need the copy from.
framebufferManager_->BindFramebufferColor(GL_TEXTURE1, gstate.getFrameBufRawAddress(), nullptr, BINDFBCOLOR_MAY_COPY);
@ -394,5 +390,10 @@ void DrawEngineGLES::ApplyDrawStateLate() {
// Apply the texture after the FBO tex, since it might unbind the texture.
// TODO: Could use a separate texture unit to be safer?
textureCache_->ApplyTexture();
// Apply last, once we know the alpha params of the texture.
if (gstate.isAlphaTestEnabled() || gstate.isColorTestEnabled()) {
fragmentTestCache_->BindTestTexture(GL_TEXTURE2);
}
}
}