Merge pull request #4496 from Kikoarl/perf/agc-gds-dma-and-completion-label-sync

perf(agc): disambiguate completion label overlaps in CopyBuffer
This commit is contained in:
Dean 2026-10-13 23:42:11 +13:00 committed by GitHub
commit 1d7b075610
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -2172,7 +2172,7 @@ VulkanDevice::CopyOutcome VulkanDevice::CopyBuffer(std::uint64_t destination, st
// a completion-deferred label): it lands only when that batch is reaped, whatever its fence.
const auto completionStoreOverlaps = [&](std::uint64_t address) {
if (alwaysSync || state->CopiedWriterOverlaps(address, bytes)) return true;
return Graphics::Recorder::PendingCompletionLabels() != 0 && recorder.PendingLabelIn(address, bytes);
return Graphics::Recorder::PendingCompletionLabels() != 0 && recorder.CompletionLabelIn(address, bytes);
};
// The CPU decision (see the header): pure queries, in the order that makes the first failing
// test the reason; a signaled writer of the source is fine (its in-place stores are final in

View File

@ -1,6 +1,7 @@
#include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp"
#include "prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp"
#include "prx/libSceAgcDriver/Graphics/include/Draw.hpp"
#include "prx/libSceAgcDriver/Graphics/include/Recorder.hpp"
#include "prx/libc/include/GuestAllocations.hpp"
#include "Recompiler.hpp"
#include "VulkanTestDevice.hpp"
@ -109,6 +110,11 @@ int main() {
const GuestBlock output;
const GuestBlock destination;
RecordDispatch(*device, input, output);
auto* recorder = AgcDriver::Graphics::Recorder::Active();
Require(recorder != nullptr, "copied writer: no active recorder");
constexpr std::array<std::byte, 4> labelValue{std::byte{1}, std::byte{0}, std::byte{0}, std::byte{0}};
recorder->NoteLabel(output.Address(), labelValue, 1, 0);
Require(recorder->AfterRecordedWork([] {}), "copied writer: completion action was not recorded");
AgcDriver::VulkanDevice::CopyOutcome outcome{};
{
std::lock_guard gpu(AgcDriver::GuestMemory::GpuMutex());