radv: do not reset query pool during creation

Submitted by Samuel Pitoiset on May 21, 2019, 11:40 a.m.

Details

Message ID 20190521114010.6772-1-samuel.pitoiset@gmail.com
State Accepted
Commit 32a0bc915a8d2ef2b94a3fd14296206046d01bba
Headers show
Series "radv: do not reset query pool during creation" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset May 21, 2019, 11:40 a.m.
From the Vulkan spec 1.1.108:
   "After query pool creation, each query must be reset before
    it is used."

So, the driver doesn't need to do this at creation time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_query.c | 3 ---
 1 file changed, 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index 520711e4864..be1cf589d63 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -1035,8 +1035,6 @@  VkResult radv_CreateQueryPool(
 	struct radv_query_pool *pool = vk_alloc2(&device->alloc, pAllocator,
 					       sizeof(*pool), 8,
 					       VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
-	uint32_t initial_value = pCreateInfo->queryType == VK_QUERY_TYPE_TIMESTAMP
-				 ? TIMESTAMP_NOT_READY : 0;
 
 	if (!pool)
 		return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -1082,7 +1080,6 @@  VkResult radv_CreateQueryPool(
 		vk_free2(&device->alloc, pAllocator, pool);
 		return vk_error(device->instance, VK_ERROR_OUT_OF_DEVICE_MEMORY);
 	}
-	memset(pool->ptr, initial_value, pool->size);
 
 	*pQueryPool = radv_query_pool_to_handle(pool);
 	return VK_SUCCESS;

Comments

r-b

On Tue, May 21, 2019 at 1:36 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> From the Vulkan spec 1.1.108:
>    "After query pool creation, each query must be reset before
>     it is used."
>
> So, the driver doesn't need to do this at creation time.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/vulkan/radv_query.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
> index 520711e4864..be1cf589d63 100644
> --- a/src/amd/vulkan/radv_query.c
> +++ b/src/amd/vulkan/radv_query.c
> @@ -1035,8 +1035,6 @@ VkResult radv_CreateQueryPool(
>         struct radv_query_pool *pool = vk_alloc2(&device->alloc, pAllocator,
>                                                sizeof(*pool), 8,
>                                                VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
> -       uint32_t initial_value = pCreateInfo->queryType == VK_QUERY_TYPE_TIMESTAMP
> -                                ? TIMESTAMP_NOT_READY : 0;
>
>         if (!pool)
>                 return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
> @@ -1082,7 +1080,6 @@ VkResult radv_CreateQueryPool(
>                 vk_free2(&device->alloc, pAllocator, pool);
>                 return vk_error(device->instance, VK_ERROR_OUT_OF_DEVICE_MEMORY);
>         }
> -       memset(pool->ptr, initial_value, pool->size);
>
>         *pQueryPool = radv_query_pool_to_handle(pool);
>         return VK_SUCCESS;
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev