diff --git a/app/src/main/cpp/skyline/gpu/interconnect/common/textures.cpp b/app/src/main/cpp/skyline/gpu/interconnect/common/textures.cpp index 60b4c50b..b6d57a07 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/common/textures.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/common/textures.cpp @@ -225,7 +225,8 @@ namespace skyline::gpu::interconnect { if (textureHeaderCache.size() != textureHeaders.size()) { textureHeaderCache.resize(textureHeaders.size()); std::fill(textureHeaderCache.begin(), textureHeaderCache.end(), CacheEntry{}); - } else if (auto &cached{textureHeaderCache[index]}; cached.view) { + } else if (textureHeaders.size() > index && textureHeaderCache[index].view) { + auto &cached{textureHeaderCache[index]}; if (cached.executionTag == ctx.executor.executionTag) return cached.view; @@ -235,6 +236,13 @@ namespace skyline::gpu::interconnect { } } + if (index >= textureHeaders.size()) { + if (!nullTextureView) + nullTextureView = CreateNullTexture(ctx); + + return nullTextureView.get(); + } + TextureImageControl &textureHeader{textureHeaders[index]}; auto &texture{textureHeaderStore[textureHeader]};