Fix texture alpha when texturing from full-alpha textures.

Fixes #16875
This commit is contained in:
Henrik Rydgård 2023-02-02 16:12:28 +01:00
parent 5045d033ec
commit c11f7e3a5f
2 changed files with 6 additions and 2 deletions

View File

@ -199,7 +199,11 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool flipView
}
if (dirtyUniforms & DIRTY_TEX_ALPHA_MUL) {
ub->texNoAlpha = gstate.isTextureAlphaUsed() ? 0.0f : 1.0f;
bool doTextureAlpha = gstate.isTextureAlphaUsed();
if (gstate_c.textureFullAlpha && gstate.getTextureFunction() != GE_TEXFUNC_REPLACE) {
doTextureAlpha = false;
}
ub->texNoAlpha = doTextureAlpha ? 0.0f : 1.0f;
ub->texMul = gstate.isColorDoublingEnabled() ? 2.0f : 1.0f;
}

View File

@ -549,7 +549,7 @@ struct GPUStateCache {
void SetTextureFullAlpha(bool fullAlpha) {
if (fullAlpha != textureFullAlpha) {
textureFullAlpha = fullAlpha;
Dirty(DIRTY_FRAGMENTSHADER_STATE);
Dirty(DIRTY_FRAGMENTSHADER_STATE | DIRTY_TEX_ALPHA_MUL);
}
}
void SetNeedShaderTexclamp(bool need) {