mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
TextureCache: Don't partial copy to non-existant texture layers
This commit is contained in:
@ -416,7 +416,10 @@ TextureCacheBase::DoPartialTextureUpdates(TCacheEntry* entry_to_update, u8* pale
|
|||||||
dstrect.top = dst_y;
|
dstrect.top = dst_y;
|
||||||
dstrect.right = (dst_x + copy_width);
|
dstrect.right = (dst_x + copy_width);
|
||||||
dstrect.bottom = (dst_y + copy_height);
|
dstrect.bottom = (dst_y + copy_height);
|
||||||
for (u32 layer = 0; layer < entry->texture->GetConfig().layers; layer++)
|
|
||||||
|
// If one copy is stereo, and the other isn't... not much we can do here :/
|
||||||
|
const u32 layers_to_copy = std::min(entry->GetNumLayers(), entry_to_update->GetNumLayers());
|
||||||
|
for (u32 layer = 0; layer < layers_to_copy; layer++)
|
||||||
{
|
{
|
||||||
entry_to_update->texture->CopyRectangleFromTexture(entry->texture.get(), srcrect, layer,
|
entry_to_update->texture->CopyRectangleFromTexture(entry->texture.get(), srcrect, layer,
|
||||||
0, dstrect, layer, 0);
|
0, dstrect, layer, 0);
|
||||||
@ -1414,7 +1417,9 @@ TextureCacheBase::GetTextureFromOverlappingTextures(const TextureLookupInformati
|
|||||||
dstrect.right = (dst_x + copy_width);
|
dstrect.right = (dst_x + copy_width);
|
||||||
dstrect.bottom = (dst_y + copy_height);
|
dstrect.bottom = (dst_y + copy_height);
|
||||||
|
|
||||||
for (u32 layer = 0; layer < entry->texture->GetConfig().layers; layer++)
|
// If one copy is stereo, and the other isn't... not much we can do here :/
|
||||||
|
const u32 layers_to_copy = std::min(entry->GetNumLayers(), stitched_entry->GetNumLayers());
|
||||||
|
for (u32 layer = 0; layer < layers_to_copy; layer++)
|
||||||
{
|
{
|
||||||
stitched_entry->texture->CopyRectangleFromTexture(entry->texture.get(), srcrect, layer, 0,
|
stitched_entry->texture->CopyRectangleFromTexture(entry->texture.get(), srcrect, layer, 0,
|
||||||
dstrect, layer, 0);
|
dstrect, layer, 0);
|
||||||
|
Reference in New Issue
Block a user