From 5e5a783530aba5c65e9d08683c905fb4cfd329c5 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 3 Aug 2015 01:18:09 -0700 Subject: [PATCH] vk: Add and use an anv_block_pool_size() helper --- src/vulkan/anv_cmd_buffer.c | 3 ++- src/vulkan/anv_private.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 3b9e67fdd0f..9ee5cf8b247 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -136,7 +136,8 @@ anv_cmd_buffer_emit_state_base_address(struct anv_cmd_buffer *cmd_buffer) struct anv_device *device = cmd_buffer->device; struct anv_bo *scratch_bo = NULL; - cmd_buffer->state.scratch_size = device->scratch_block_pool.size; + cmd_buffer->state.scratch_size = + anv_block_pool_size(&device->scratch_block_pool); if (cmd_buffer->state.scratch_size > 0) scratch_bo = &device->scratch_block_pool.bo; diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 563d7a573bd..b30dd7d51ad 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -253,6 +253,12 @@ struct anv_block_pool { union anv_free_list free_list; }; +static inline uint32_t +anv_block_pool_size(struct anv_block_pool *pool) +{ + return pool->size; +} + struct anv_block_state { union { struct { -- 2.30.2