mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 14:45:28 +03:00
Skip over textures in cache which have been replaced with a layer/mip match
This commit is contained in:
parent
88cc696c7f
commit
e7fda28ac6
@ -192,7 +192,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
if (cached.executionNumber == ctx.executor.executionNumber)
|
if (cached.executionNumber == ctx.executor.executionNumber)
|
||||||
return cached.view;
|
return cached.view;
|
||||||
|
|
||||||
if (cached.tic == textureHeaders[index]) {
|
if (cached.tic == textureHeaders[index] && !cached.view->texture->replaced) {
|
||||||
cached.executionNumber = ctx.executor.executionNumber;
|
cached.executionNumber = ctx.executor.executionNumber;
|
||||||
return cached.view;
|
return cached.view;
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
|||||||
TextureImageControl &textureHeader{textureHeaders[index]};
|
TextureImageControl &textureHeader{textureHeaders[index]};
|
||||||
auto &texture{textureHeaderStore[textureHeader]};
|
auto &texture{textureHeaderStore[textureHeader]};
|
||||||
|
|
||||||
if (!texture) {
|
if (!texture || texture->texture->replaced) {
|
||||||
// If the entry didn't exist prior then we need to convert the TIC to a GuestTexture
|
// If the entry didn't exist prior then we need to convert the TIC to a GuestTexture
|
||||||
GuestTexture guest{};
|
GuestTexture guest{};
|
||||||
if (auto format{ConvertTicFormat(textureHeader.formatWord, textureHeader.isSrgb)}) {
|
if (auto format{ConvertTicFormat(textureHeader.formatWord, textureHeader.isSrgb)}) {
|
||||||
|
@ -470,6 +470,7 @@ namespace skyline::gpu {
|
|||||||
size_t deswizzledSurfaceSize{}; //!< The size of the guest surface with linear tiling, calculated with the guest format which may differ from the host format
|
size_t deswizzledSurfaceSize{}; //!< The size of the guest surface with linear tiling, calculated with the guest format which may differ from the host format
|
||||||
size_t surfaceSize{}; //!< The size of the entire surface given linear tiling, this contains all mip levels and layers
|
size_t surfaceSize{}; //!< The size of the entire surface given linear tiling, this contains all mip levels and layers
|
||||||
vk::SampleCountFlagBits sampleCount;
|
vk::SampleCountFlagBits sampleCount;
|
||||||
|
bool replaced{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a texture object wrapping the supplied backing with the supplied attributes
|
* @brief Creates a texture object wrapping the supplied backing with the supplied attributes
|
||||||
|
@ -40,7 +40,7 @@ namespace skyline::gpu {
|
|||||||
|
|
||||||
while (hostMapping != textures.begin() && (--hostMapping)->end() > guestMapping.begin()) {
|
while (hostMapping != textures.begin() && (--hostMapping)->end() > guestMapping.begin()) {
|
||||||
auto &hostMappings{hostMapping->texture->guest->mappings};
|
auto &hostMappings{hostMapping->texture->guest->mappings};
|
||||||
if (!hostMapping->contains(guestMapping))
|
if (!hostMapping->contains(guestMapping) || hostMapping->texture->replaced)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// We need to check that all corresponding mappings in the candidate texture and the guest texture match up
|
// We need to check that all corresponding mappings in the candidate texture and the guest texture match up
|
||||||
@ -96,11 +96,18 @@ namespace skyline::gpu {
|
|||||||
layerMemOffset += matchGuestTexture.GetLayerStride();
|
layerMemOffset += matchGuestTexture.GetLayerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched)
|
if (matched) {
|
||||||
|
if (layerMipMatch)
|
||||||
|
layerMipMatch->replaced = true;
|
||||||
|
|
||||||
|
if (fullMatch)
|
||||||
|
fullMatch->replaced = true;
|
||||||
|
|
||||||
layerMipMatch = hostMapping->texture;
|
layerMipMatch = hostMapping->texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (layerMipMatch) {
|
if (layerMipMatch) {
|
||||||
ContextLock textureLock{tag, *layerMipMatch};
|
ContextLock textureLock{tag, *layerMipMatch};
|
||||||
|
Loading…
Reference in New Issue
Block a user