From 3a19dea7c7aed106dfd4e4cd63f0dd5185efa718 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 15 Jun 2022 12:09:17 +0200 Subject: [PATCH] tests: Ensure we try to allocate some larger buffers as well. The suballocation test should also try to allocate >= 2 MiB buffers so we can verify VRAM clear behavior for dedicated allocations as well. Signed-off-by: Hans-Kristian Arntzen --- tests/d3d12_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/d3d12_resource.c b/tests/d3d12_resource.c index d0ac13ac..dcc6667e 100644 --- a/tests/d3d12_resource.c +++ b/tests/d3d12_resource.c @@ -2638,7 +2638,8 @@ void test_stress_suballocation_thread(void *userdata) { /* Randomly allocate heaps and place a buffer on top of it. */ alloc_heap = rand_r(&seed) % 2 == 0; - alloc_size = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT * (1 + rand_r(&seed) % 20); + /* Ensures we sometimes hit dedicated allocation paths. (2 MiB limit). */ + alloc_size = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT * (1 + rand_r(&seed) % 40); keep_alive = rand_r(&seed) % 2 == 0; if (buffers[i] && keep_alive)