summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_query.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-02-28 20:22:29 +0100
committerSamuel Pitoiset <[email protected]>2018-03-01 09:53:39 +0100
commit2fe07933bd5385f731b490ba22ee2086bfccfe63 (patch)
treefe37cf09a735f2fda87549763e686302e1628a40 /src/amd/vulkan/radv_query.c
parentc956d0f4069cf39d8d3c57ebed8d905575e9ea34 (diff)
radv: keep track of the query pool size
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_query.c')
-rw-r--r--src/amd/vulkan/radv_query.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index b1393a2ec77..ff2782bae89 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -748,7 +748,6 @@ VkResult radv_CreateQueryPool(
VkQueryPool* pQueryPool)
{
RADV_FROM_HANDLE(radv_device, device, _device);
- uint64_t size;
struct radv_query_pool *pool = vk_alloc2(&device->alloc, pAllocator,
sizeof(*pool), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
@@ -774,12 +773,12 @@ VkResult radv_CreateQueryPool(
pool->type = pCreateInfo->queryType;
pool->pipeline_stats_mask = pCreateInfo->pipelineStatistics;
pool->availability_offset = pool->stride * pCreateInfo->queryCount;
- size = pool->availability_offset;
+ pool->size = pool->availability_offset;
if (pCreateInfo->queryType == VK_QUERY_TYPE_TIMESTAMP ||
pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS)
- size += 4 * pCreateInfo->queryCount;
+ pool->size += 4 * pCreateInfo->queryCount;
- pool->bo = device->ws->buffer_create(device->ws, size,
+ pool->bo = device->ws->buffer_create(device->ws, pool->size,
64, RADEON_DOMAIN_GTT, RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!pool->bo) {
@@ -794,7 +793,7 @@ VkResult radv_CreateQueryPool(
vk_free2(&device->alloc, pAllocator, pool);
return vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY);
}
- memset(pool->ptr, 0, size);
+ memset(pool->ptr, 0, pool->size);
*pQueryPool = radv_query_pool_to_handle(pool);
return VK_SUCCESS;