mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Decode EFB copies used as paletted textures.
A number of games make an EFB copy in I4/I8 format, then use it as a texture in C4/C8 format. Detect when this happens, and decode the copy on the GPU using the specified palette. This has a few advantages: it allows using EFB2Tex for a few more games, it, it preserves the resolution of scaled EFB copies, and it's probably a bit faster. D3D only at the moment, but porting to OpenGL should be straightforward..
This commit is contained in:
@ -204,7 +204,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
|
||||
if (false == g_ActiveConfig.bCopyEFBToTexture)
|
||||
{
|
||||
int encoded_size = TextureConverter::EncodeToRamFromTexture(
|
||||
addr,
|
||||
dstAddr,
|
||||
read_texture,
|
||||
srcFormat == PEControl::Z24,
|
||||
isIntensity,
|
||||
@ -212,12 +212,12 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
|
||||
scaleByHalf,
|
||||
srcRect);
|
||||
|
||||
u8* dst = Memory::GetPointer(addr);
|
||||
u8* dst = Memory::GetPointer(dstAddr);
|
||||
u64 const new_hash = GetHash64(dst,encoded_size,g_ActiveConfig.iSafeTextureCache_ColorSamples);
|
||||
|
||||
size_in_bytes = (u32)encoded_size;
|
||||
|
||||
TextureCache::MakeRangeDynamic(addr,encoded_size);
|
||||
TextureCache::MakeRangeDynamic(dstAddr, encoded_size);
|
||||
|
||||
hash = new_hash;
|
||||
}
|
||||
@ -359,4 +359,10 @@ void TextureCache::DeleteShaders()
|
||||
s_DepthMatrixProgram.Destroy();
|
||||
}
|
||||
|
||||
void TextureCache::ConvertTexture(TextureCache::TCacheEntryBase* entry, TCacheEntryBase* unconverted, void* palette, TlutFormat format)
|
||||
{
|
||||
// TODO: Implement.
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user