From c5f8a3ff22717970dfd06faee90399afc233f178 Mon Sep 17 00:00:00 2001 From: MarcZX100 Date: Sun, 18 Oct 2026 17:20:32 +0000 Subject: [PATCH] test(agc): isolate allocation budget query counts --- core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp b/core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp index 5260042166..d1eb0e310b 100644 --- a/core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp @@ -791,21 +791,25 @@ void AllocationFailureReportsHeapBudgets() { mock = MockDevice{}; diagnosticBudgetQueries = 0; std::string failure; + std::uint64_t allocationPathBudgetQueries = 0; { auto context = mockContext(); context.physical = reinterpret_cast(std::uintptr_t{1}); context.memoryProperties2 = mockDiagnosticMemoryProperties2; context.memory.memoryHeapCount = 2; + context.bufferPool = std::make_shared(context); + const auto beforeAllocation = diagnosticBudgetQueries; mock.results = {VK_ERROR_DEVICE_LOST}; try { DeviceBuffer buffer(context, 4 * MiB, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); } catch (const std::exception& error) { failure = error.what(); } + allocationPathBudgetQueries = diagnosticBudgetQueries - beforeAllocation; } Expect(failure.find("heap 0 1500/2000 MiB") != std::string::npos, "allocation failure omitted the first heap's memory budget"); Expect(failure.find("heap 1 2500/3000 MiB") != std::string::npos, "allocation failure omitted a later heap's memory budget"); - Expect(diagnosticBudgetQueries == 2, "allocation failure did not query the memory budget for both type selection and its diagnostic"); + Expect(allocationPathBudgetQueries == 2, "allocation failure did not query the memory budget for both type selection and its diagnostic"); mock = MockDevice{}; diagnosticBudgetQueries = 0;