@@ -48,7 +48,7 @@ enum class FREE_ORDER { FORWARD, BACKWARD, RANDOM, COUNT };
4848static const char * CODE_DESCRIPTION = " D3D12MA Tests" ;
4949static constexpr UINT64 KILOBYTE = 1024 ;
5050static constexpr UINT64 MEGABYTE = 1024 * KILOBYTE;
51- static constexpr CONFIG_TYPE ConfigType = CONFIG_TYPE_SMALL ;
51+ static constexpr CONFIG_TYPE ConfigType = CONFIG_TYPE_AVERAGE ;
5252static const char * FREE_ORDER_NAMES[] = { " FORWARD" , " BACKWARD" , " RANDOM" , };
5353
5454static void CurrentTimeToStr (std::string& out)
@@ -1596,17 +1596,35 @@ static void TestStats(const TestContext& ctx)
15961596 CheckStatistics (endStats.HeapType [1 ]);
15971597 CheckStatistics (endStats.HeapType [2 ]);
15981598
1599- D3D12MA::Budget gpuBudget = {}, cpuBudget = {};
1600- ctx.allocator ->GetBudget (&gpuBudget, &cpuBudget);
1601-
1602- CHECK_BOOL (gpuBudget.Stats .AllocationBytes <= gpuBudget.Stats .BlockBytes );
1603- CHECK_BOOL (gpuBudget.Stats .AllocationBytes == endStats.HeapType [0 ].Stats .AllocationBytes );
1604- CHECK_BOOL (gpuBudget.Stats .BlockBytes == endStats.HeapType [0 ].Stats .BlockBytes );
1599+ D3D12MA::Budget localBudget = {}, nonLocalBudget = {};
1600+ ctx.allocator ->GetBudget (&localBudget, &nonLocalBudget);
1601+
1602+ CHECK_BOOL (localBudget.Stats .AllocationBytes <= localBudget.Stats .BlockBytes );
1603+ CHECK_BOOL (endStats.HeapType [3 ].Stats .BlockCount == 0 ); // No allocation from D3D12_HEAP_TYPE_CUSTOM in this test.
1604+ if (!ctx.allocator ->IsUMA ())
1605+ {
1606+ // Discrete GPU
1607+ CHECK_BOOL (localBudget.Stats .AllocationBytes == endStats.HeapType [0 ].Stats .AllocationBytes );
1608+ CHECK_BOOL (localBudget.Stats .BlockBytes == endStats.HeapType [0 ].Stats .BlockBytes );
16051609
1606- CHECK_BOOL (cpuBudget.Stats .AllocationBytes <= cpuBudget.Stats .BlockBytes );
1607- CHECK_BOOL (cpuBudget.Stats .AllocationBytes == endStats.HeapType [1 ].Stats .AllocationBytes + endStats.HeapType [2 ].Stats .AllocationBytes );
1608- CHECK_BOOL (cpuBudget.Stats .BlockBytes ==
1609- endStats.HeapType [1 ].Stats .BlockBytes + endStats.HeapType [2 ].Stats .BlockBytes );
1610+ CHECK_BOOL (nonLocalBudget.Stats .AllocationBytes <= nonLocalBudget.Stats .BlockBytes );
1611+ CHECK_BOOL (nonLocalBudget.Stats .AllocationBytes == endStats.HeapType [1 ].Stats .AllocationBytes + endStats.HeapType [2 ].Stats .AllocationBytes );
1612+ CHECK_BOOL (nonLocalBudget.Stats .BlockBytes ==
1613+ endStats.HeapType [1 ].Stats .BlockBytes + endStats.HeapType [2 ].Stats .BlockBytes );
1614+ }
1615+ else
1616+ {
1617+ // Integrated GPU - all memory is local
1618+ CHECK_BOOL (localBudget.Stats .AllocationBytes == endStats.HeapType [0 ].Stats .AllocationBytes +
1619+ endStats.HeapType [1 ].Stats .AllocationBytes +
1620+ endStats.HeapType [2 ].Stats .AllocationBytes );
1621+ CHECK_BOOL (localBudget.Stats .BlockBytes == endStats.HeapType [0 ].Stats .BlockBytes +
1622+ endStats.HeapType [1 ].Stats .BlockBytes +
1623+ endStats.HeapType [2 ].Stats .BlockBytes );
1624+
1625+ CHECK_BOOL (nonLocalBudget.Stats .AllocationBytes == 0 );
1626+ CHECK_BOOL (nonLocalBudget.Stats .BlockBytes == 0 );
1627+ }
16101628}
16111629
16121630static void TestTransfer (const TestContext& ctx)
0 commit comments