mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Detect if framebuffer clut uses alpha.
It's not a perfect check but it may allow skipping alphatests sometimes.
This commit is contained in:
parent
bf788e278d
commit
238bdce2b8
1 changed files with 8 additions and 2 deletions
|
@ -951,8 +951,14 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry) {
|
|||
glstate.Restore();
|
||||
framebufferManager_->RebindFramebuffer();
|
||||
|
||||
gstate_c.textureFullAlpha = false;
|
||||
gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha;
|
||||
const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat();
|
||||
const u32 clutBase = gstate.getClutIndexStartPos();
|
||||
const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16);
|
||||
const u32 clutExtendedColors = (clutTotalBytes_ / bytesPerColor) + clutBase;
|
||||
|
||||
TexCacheEntry::Status alphaStatus = CheckAlpha(clutBuf_, getClutDestFormat(gstate.getClutPaletteFormat()), clutExtendedColors, clutExtendedColors, 1);
|
||||
gstate_c.textureFullAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL;
|
||||
gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE;
|
||||
} else {
|
||||
entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE;
|
||||
framebufferManager_->BindFramebufferColor(entry->framebuffer);
|
||||
|
|
Loading…
Add table
Reference in a new issue