Skip over textures in cache which have been replaced with a layer/mip match

This commit is contained in:
Billy Laws 2022-11-06 19:23:52 +00:00
parent 88cc696c7f
commit e7fda28ac6
3 changed files with 12 additions and 4 deletions

View File

@ -192,7 +192,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
if (cached.executionNumber == ctx.executor.executionNumber)
return cached.view;
if (cached.tic == textureHeaders[index]) {
if (cached.tic == textureHeaders[index] && !cached.view->texture->replaced) {
cached.executionNumber = ctx.executor.executionNumber;
return cached.view;
}
@ -201,7 +201,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
TextureImageControl &textureHeader{textureHeaders[index]};
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
GuestTexture guest{};
if (auto format{ConvertTicFormat(textureHeader.formatWord, textureHeader.isSrgb)}) {

View File

@ -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 surfaceSize{}; //!< The size of the entire surface given linear tiling, this contains all mip levels and layers
vk::SampleCountFlagBits sampleCount;
bool replaced{};
/**
* @brief Creates a texture object wrapping the supplied backing with the supplied attributes

View File

@ -40,7 +40,7 @@ namespace skyline::gpu {
while (hostMapping != textures.begin() && (--hostMapping)->end() > guestMapping.begin()) {
auto &hostMappings{hostMapping->texture->guest->mappings};
if (!hostMapping->contains(guestMapping))
if (!hostMapping->contains(guestMapping) || hostMapping->texture->replaced)
continue;
// We need to check that all corresponding mappings in the candidate texture and the guest texture match up
@ -96,8 +96,15 @@ namespace skyline::gpu {
layerMemOffset += matchGuestTexture.GetLayerStride();
}
if (matched)
if (matched) {
if (layerMipMatch)
layerMipMatch->replaced = true;
if (fullMatch)
fullMatch->replaced = true;
layerMipMatch = hostMapping->texture;
}
}
}
}