mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
TextureCacheBase: Remove vertical scaling from EFB path and have copy checks only check EFBs
This commit is contained in:
parent
1a1c3560ce
commit
ada37ec642
@ -376,19 +376,18 @@ TextureCacheBase::DoPartialTextureUpdates(TCacheEntry* entry_to_update, u8* pale
|
|||||||
u32 copy_width =
|
u32 copy_width =
|
||||||
std::min(entry->native_width - src_x, entry_to_update->native_width - dst_x);
|
std::min(entry->native_width - src_x, entry_to_update->native_width - dst_x);
|
||||||
u32 copy_height =
|
u32 copy_height =
|
||||||
std::min((entry->native_height * entry->y_scale) - src_y,
|
std::min(entry->native_height - src_y, entry_to_update->native_height - dst_y);
|
||||||
(entry_to_update->native_height * entry_to_update->y_scale) - dst_y);
|
|
||||||
|
|
||||||
// If one of the textures is scaled, scale both with the current efb scaling factor
|
// If one of the textures is scaled, scale both with the current efb scaling factor
|
||||||
if (entry_to_update->native_width != entry_to_update->GetWidth() ||
|
if (entry_to_update->native_width != entry_to_update->GetWidth() ||
|
||||||
entry_to_update->native_height != entry_to_update->GetHeight() ||
|
entry_to_update->native_height != entry_to_update->GetHeight() ||
|
||||||
entry->native_width != entry->GetWidth() || entry->native_height != entry->GetHeight())
|
entry->native_width != entry->GetWidth() || entry->native_height != entry->GetHeight())
|
||||||
{
|
{
|
||||||
ScaleTextureCacheEntryTo(
|
ScaleTextureCacheEntryTo(entry_to_update,
|
||||||
entry_to_update, g_renderer->EFBToScaledX(entry_to_update->native_width),
|
g_renderer->EFBToScaledX(entry_to_update->native_width),
|
||||||
g_renderer->EFBToScaledY(entry_to_update->native_height * entry_to_update->y_scale));
|
g_renderer->EFBToScaledY(entry_to_update->native_height));
|
||||||
ScaleTextureCacheEntryTo(entry, g_renderer->EFBToScaledX(entry->native_width),
|
ScaleTextureCacheEntryTo(entry, g_renderer->EFBToScaledX(entry->native_width),
|
||||||
g_renderer->EFBToScaledY(entry->native_height * entry->y_scale));
|
g_renderer->EFBToScaledY(entry->native_height));
|
||||||
|
|
||||||
src_x = g_renderer->EFBToScaledX(src_x);
|
src_x = g_renderer->EFBToScaledX(src_x);
|
||||||
src_y = g_renderer->EFBToScaledY(src_y);
|
src_y = g_renderer->EFBToScaledY(src_y);
|
||||||
@ -794,8 +793,7 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
|
|||||||
|
|
||||||
// Do not load strided EFB copies, they are not meant to be used directly.
|
// Do not load strided EFB copies, they are not meant to be used directly.
|
||||||
// Also do not directly load EFB copies, which were partly overwritten.
|
// Also do not directly load EFB copies, which were partly overwritten.
|
||||||
if (entry->IsCopy() && entry->native_width == nativeW &&
|
if (entry->IsEfbCopy() && entry->native_width == nativeW && entry->native_height == nativeH &&
|
||||||
static_cast<unsigned int>(entry->native_height * entry->y_scale) == nativeH &&
|
|
||||||
entry->memory_stride == entry->BytesPerRow() && !entry->may_have_overlapping_textures)
|
entry->memory_stride == entry->BytesPerRow() && !entry->may_have_overlapping_textures)
|
||||||
{
|
{
|
||||||
// EFB copies have slightly different rules as EFB copy formats have different
|
// EFB copies have slightly different rules as EFB copy formats have different
|
||||||
@ -830,7 +828,7 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// For normal textures, all texture parameters need to match
|
// For normal textures, all texture parameters need to match
|
||||||
if (!entry->IsCopy() && entry->hash == full_hash && entry->format == full_format &&
|
if (!entry->IsEfbCopy() && entry->hash == full_hash && entry->format == full_format &&
|
||||||
entry->native_levels >= tex_levels && entry->native_width == nativeW &&
|
entry->native_levels >= tex_levels && entry->native_width == nativeW &&
|
||||||
entry->native_height == nativeH)
|
entry->native_height == nativeH)
|
||||||
{
|
{
|
||||||
@ -846,7 +844,7 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
|
|||||||
// Example: Sonic the Fighters (inside Sonic Gems Collection)
|
// Example: Sonic the Fighters (inside Sonic Gems Collection)
|
||||||
// Skip EFB copies here, so they can be used for partial texture updates
|
// Skip EFB copies here, so they can be used for partial texture updates
|
||||||
if (entry->frameCount != FRAMECOUNT_INVALID && entry->frameCount < temp_frameCount &&
|
if (entry->frameCount != FRAMECOUNT_INVALID && entry->frameCount < temp_frameCount &&
|
||||||
!entry->IsCopy() && !(isPaletteTexture && entry->base_hash == base_hash))
|
!entry->IsEfbCopy() && !(isPaletteTexture && entry->base_hash == base_hash))
|
||||||
{
|
{
|
||||||
temp_frameCount = entry->frameCount;
|
temp_frameCount = entry->frameCount;
|
||||||
oldest_entry = iter;
|
oldest_entry = iter;
|
||||||
@ -881,8 +879,7 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
|
|||||||
TCacheEntry* entry = hash_iter->second;
|
TCacheEntry* entry = hash_iter->second;
|
||||||
// All parameters, except the address, need to match here
|
// All parameters, except the address, need to match here
|
||||||
if (entry->format == full_format && entry->native_levels >= tex_levels &&
|
if (entry->format == full_format && entry->native_levels >= tex_levels &&
|
||||||
entry->native_width == nativeW &&
|
entry->native_width == nativeW && entry->native_height == nativeH)
|
||||||
static_cast<unsigned int>(entry->native_height * entry->y_scale) == nativeH)
|
|
||||||
{
|
{
|
||||||
entry = DoPartialTextureUpdates(hash_iter->second, &texMem[tlutaddr], tlutfmt);
|
entry = DoPartialTextureUpdates(hash_iter->second, &texMem[tlutaddr], tlutfmt);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user