Fix in tests for AMD APU with DEVICE_LOCAL heap of only 256 MB
This commit is contained in:
parent
a9a458c7d1
commit
7e56c486fa
2 changed files with 19 additions and 5 deletions
|
@ -532,6 +532,8 @@ SparseBindingImage::~SparseBindingImage()
|
||||||
|
|
||||||
void TestSparseBinding()
|
void TestSparseBinding()
|
||||||
{
|
{
|
||||||
|
wprintf(L"TESTING SPARSE BINDING:");
|
||||||
|
|
||||||
struct ImageInfo
|
struct ImageInfo
|
||||||
{
|
{
|
||||||
std::unique_ptr<BaseImage> image;
|
std::unique_ptr<BaseImage> image;
|
||||||
|
|
|
@ -4408,12 +4408,14 @@ static void TestPool_Benchmark(
|
||||||
TEST(0);
|
TEST(0);
|
||||||
|
|
||||||
VmaPoolCreateInfo poolCreateInfo = {};
|
VmaPoolCreateInfo poolCreateInfo = {};
|
||||||
poolCreateInfo.memoryTypeIndex = 0;
|
|
||||||
poolCreateInfo.minBlockCount = 1;
|
poolCreateInfo.minBlockCount = 1;
|
||||||
poolCreateInfo.maxBlockCount = 1;
|
poolCreateInfo.maxBlockCount = 1;
|
||||||
poolCreateInfo.blockSize = config.PoolSize;
|
poolCreateInfo.blockSize = config.PoolSize;
|
||||||
poolCreateInfo.frameInUseCount = 1;
|
poolCreateInfo.frameInUseCount = 1;
|
||||||
|
|
||||||
|
const VkPhysicalDeviceMemoryProperties* memProps = nullptr;
|
||||||
|
vmaGetMemoryProperties(g_hAllocator, &memProps);
|
||||||
|
|
||||||
VmaPool pool = VK_NULL_HANDLE;
|
VmaPool pool = VK_NULL_HANDLE;
|
||||||
VkResult res;
|
VkResult res;
|
||||||
// Loop over memory types because we sometimes allocate a big block here,
|
// Loop over memory types because we sometimes allocate a big block here,
|
||||||
|
@ -4424,9 +4426,15 @@ static void TestPool_Benchmark(
|
||||||
dummyAllocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
|
dummyAllocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
|
||||||
vmaFindMemoryTypeIndex(g_hAllocator, memoryTypeBits, &dummyAllocCreateInfo, &poolCreateInfo.memoryTypeIndex);
|
vmaFindMemoryTypeIndex(g_hAllocator, memoryTypeBits, &dummyAllocCreateInfo, &poolCreateInfo.memoryTypeIndex);
|
||||||
|
|
||||||
|
const uint32_t heapIndex = memProps->memoryTypes[poolCreateInfo.memoryTypeIndex].heapIndex;
|
||||||
|
// Protection against validation layer error when trying to allocate a block larger than entire heap size,
|
||||||
|
// which may be only 256 MB on some platforms.
|
||||||
|
if(poolCreateInfo.blockSize * poolCreateInfo.minBlockCount < memProps->memoryHeaps[heapIndex].size)
|
||||||
|
{
|
||||||
res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool);
|
res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool);
|
||||||
if(res == VK_SUCCESS)
|
if(res == VK_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
memoryTypeBits &= ~(1u << poolCreateInfo.memoryTypeIndex);
|
memoryTypeBits &= ~(1u << poolCreateInfo.memoryTypeIndex);
|
||||||
}
|
}
|
||||||
TEST(pool);
|
TEST(pool);
|
||||||
|
@ -5704,6 +5712,8 @@ static void PerformCustomPoolTest(FILE* file)
|
||||||
|
|
||||||
static void PerformMainTests(FILE* file)
|
static void PerformMainTests(FILE* file)
|
||||||
{
|
{
|
||||||
|
wprintf(L"MAIN TESTS:\n");
|
||||||
|
|
||||||
uint32_t repeatCount = 1;
|
uint32_t repeatCount = 1;
|
||||||
if(ConfigType >= CONFIG_TYPE_MAXIMUM) repeatCount = 3;
|
if(ConfigType >= CONFIG_TYPE_MAXIMUM) repeatCount = 3;
|
||||||
|
|
||||||
|
@ -5969,6 +5979,8 @@ static void PerformMainTests(FILE* file)
|
||||||
|
|
||||||
static void PerformPoolTests(FILE* file)
|
static void PerformPoolTests(FILE* file)
|
||||||
{
|
{
|
||||||
|
wprintf(L"POOL TESTS:\n");
|
||||||
|
|
||||||
const size_t AVG_RESOURCES_PER_POOL = 300;
|
const size_t AVG_RESOURCES_PER_POOL = 300;
|
||||||
|
|
||||||
uint32_t repeatCount = 1;
|
uint32_t repeatCount = 1;
|
||||||
|
@ -6503,7 +6515,7 @@ void Test()
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
wprintf(L"Done.\n");
|
wprintf(L"Done, all PASSED.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #ifdef _WIN32
|
#endif // #ifdef _WIN32
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue