mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-27 12:47:55 +03: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{});
|
std::fill(textureHeaderCache.begin(), textureHeaderCache.end(), CacheEntry{});
|
||||||
} else if (textureHeaders.size() > index && textureHeaderCache[index].view) {
|
} else if (textureHeaders.size() > index && textureHeaderCache[index].view) {
|
||||||
auto &cached{textureHeaderCache[index]};
|
auto &cached{textureHeaderCache[index]};
|
||||||
if (cached.executionTag == ctx.executor.executionTag)
|
if (cached.sequenceNumber == ctx.channelCtx.channelSequenceNumber)
|
||||||
return cached.view;
|
return cached.view;
|
||||||
|
|
||||||
if (cached.tic == textureHeaders[index] && !cached.view->texture->replaced) {
|
if (cached.tic == textureHeaders[index] && !cached.view->texture->replaced) {
|
||||||
cached.executionTag = ctx.executor.executionTag;
|
cached.sequenceNumber = ctx.channelCtx.channelSequenceNumber;
|
||||||
return cached.view;
|
return cached.view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -346,18 +346,17 @@ namespace skyline::gpu::interconnect {
|
|||||||
|
|
||||||
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(textureHeader.Iova(), guest.GetSize())};
|
auto mappings{ctx.channelCtx.asCtx->gmmu.TranslateRange(textureHeader.Iova(), guest.GetSize())};
|
||||||
guest.mappings.assign(mappings.begin(), mappings.end());
|
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());
|
Logger::Warn("Unmapped texture in pool: 0x{:X}", textureHeader.Iova());
|
||||||
if (!nullTextureView)
|
if (!nullTextureView)
|
||||||
nullTextureView = CreateNullTexture(ctx);
|
nullTextureView = CreateNullTexture(ctx);
|
||||||
|
|
||||||
return nullTextureView.get();
|
return nullTextureView.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
texture = ctx.gpu.texture.FindOrCreate(guest, ctx.executor.tag);
|
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();
|
return texture.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace skyline::gpu::interconnect {
|
|||||||
struct CacheEntry {
|
struct CacheEntry {
|
||||||
TextureImageControl tic;
|
TextureImageControl tic;
|
||||||
TextureView *view;
|
TextureView *view;
|
||||||
ContextTag executionTag;
|
u64 sequenceNumber;
|
||||||
};
|
};
|
||||||
std::vector<CacheEntry> textureHeaderCache;
|
std::vector<CacheEntry> textureHeaderCache;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user