Use usagetracker to determine if pushbuffers need to flush the GPU

This commit is contained in:
Billy Laws 2023-03-04 20:16:37 +00:00
parent 090151f0c3
commit 4bb2a41594
1 changed files with 4 additions and 4 deletions

View File

@ -156,10 +156,6 @@ namespace skyline::soc::gm20b {
}
void ChannelGpfifo::Process(GpEntry gpEntry) {
// Submit if required by the GpEntry, this is needed as some games dynamically generate pushbuffer contents
if (gpEntry.sync == GpEntry::Sync::Wait)
channelCtx.executor.Submit({}, *state.settings->useDirectMemoryImport);
if (!gpEntry.size) {
// This is a GPFIFO control entry, all control entries have a zero length and contain no pushbuffers
switch (gpEntry.opcode) {
@ -172,6 +168,10 @@ namespace skyline::soc::gm20b {
}
auto pushBufferMappedRanges{channelCtx.asCtx->gmmu.TranslateRange(gpEntry.Address(), gpEntry.size * sizeof(u32))};
for (auto range : pushBufferMappedRanges) {
if (channelCtx.executor.usageTracker.dirtyIntervals.Intersect(range))
channelCtx.executor.Submit({}, true);
auto pushBuffer{[&]() -> span<u32> {
if (pushBufferMappedRanges.size() == 1) {
return pushBufferMappedRanges.front().cast<u32>();