summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/tests
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-04-26 00:49:40 -0700
committerJason Ekstrand <[email protected]>2017-05-04 19:07:54 -0700
commit12043ca6968f53970669586eca2f97baf8ea264a (patch)
treea52b85039b59a65fa9d6dd8a69c8e88d80f9a32c /src/intel/vulkan/tests
parent01170df262d63c7a67150f21a646d5d34d84782d (diff)
anv/allocator: Add the capability to allocate blocks of different sizes
Reviewed-by: Juan A. Suarez Romero <[email protected]>
Diffstat (limited to 'src/intel/vulkan/tests')
-rw-r--r--src/intel/vulkan/tests/block_pool_no_free.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c
index ac2b7801f7f..4ddbbb24bbf 100644
--- a/src/intel/vulkan/tests/block_pool_no_free.c
+++ b/src/intel/vulkan/tests/block_pool_no_free.c
@@ -25,7 +25,6 @@
#include "anv_private.h"
-#define BLOCK_SIZE 16
#define NUM_THREADS 16
#define BLOCKS_PER_THREAD 1024
#define NUM_RUNS 64
@@ -42,16 +41,18 @@ struct job {
static void *alloc_blocks(void *_job)
{
struct job *job = _job;
+ uint32_t job_id = job - jobs;
+ uint32_t block_size = 16 * ((job_id % 4) + 1);
int32_t block, *data;
for (unsigned i = 0; i < BLOCKS_PER_THREAD; i++) {
- block = anv_block_pool_alloc(job->pool, BLOCK_SIZE);
+ block = anv_block_pool_alloc(job->pool, block_size);
data = job->pool->map + block;
*data = block;
assert(block >= 0);
job->blocks[i] = block;
- block = anv_block_pool_alloc_back(job->pool, BLOCK_SIZE);
+ block = anv_block_pool_alloc_back(job->pool, block_size);
data = job->pool->map + block;
*data = block;
assert(block < 0);