mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 20:29:15 +01:00
Use channel sequence number for TIC cache validity tracking
Fixes some OpenGL games which update a TIC with I2M but never end up triggering an execution otherwise.
This commit is contained in:
parent
34fddfccba
commit
1dd13e90b0
@ -243,11 +243,11 @@ namespace skyline::gpu::interconnect {
|
||||
std::fill(textureHeaderCache.begin(), textureHeaderCache.end(), CacheEntry{});
|
||||
} else if (textureHeaders.size() > index && textureHeaderCache[index].view) {
|
||||
auto &cached{textureHeaderCache[index]};
|
||||
if (cached.executionTag == ctx.executor.executionTag)
|
||||
if (cached.sequenceNumber == ctx.channelCtx.channelSequenceNumber)
|
||||
return cached.view;
|
||||
|
||||
if (cached.tic == textureHeaders[index] && !cached.view->texture->replaced) {
|
||||
cached.executionTag = ctx.executor.executionTag;
|
||||
cached.sequenceNumber = ctx.channelCtx.channelSequenceNumber;
|
||||
return cached.view;
|
||||
}
|
||||
}
|
||||
@ -346,18 +346,17 @@ namespace skyline::gpu::interconnect {
|
||||
|
||||
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(textureHeader.Iova(), guest.GetSize())};
|
||||
guest.mappings.assign(mappings.begin(), mappings.end());
|
||||
if (guest.mappings.empty() || !guest.mappings.front().valid()) {
|
||||
if (guest.mappings.empty() || !guest.mappings.front().valid() || guest.mappings.front().empty()) {
|
||||
Logger::Warn("Unmapped texture in pool: 0x{:X}", textureHeader.Iova());
|
||||
if (!nullTextureView)
|
||||
nullTextureView = CreateNullTexture(ctx);
|
||||
|
||||
return nullTextureView.get();
|
||||
}
|
||||
|
||||
texture = ctx.gpu.texture.FindOrCreate(guest, ctx.executor.tag);
|
||||
}
|
||||
|
||||
textureHeaderCache[index] = {textureHeader, texture.get(), ctx.executor.executionTag};
|
||||
textureHeaderCache[index] = {textureHeader, texture.get(), ctx.channelCtx.channelSequenceNumber};
|
||||
return texture.get();
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace skyline::gpu::interconnect {
|
||||
struct CacheEntry {
|
||||
TextureImageControl tic;
|
||||
TextureView *view;
|
||||
ContextTag executionTag;
|
||||
u64 sequenceNumber;
|
||||
};
|
||||
std::vector<CacheEntry> textureHeaderCache;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user