• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #include "vkr_query_pool.h"
7 
8 #include "vkr_query_pool_gen.h"
9 
10 static void
vkr_dispatch_vkCreateQueryPool(struct vn_dispatch_context * dispatch,struct vn_command_vkCreateQueryPool * args)11 vkr_dispatch_vkCreateQueryPool(struct vn_dispatch_context *dispatch,
12                                struct vn_command_vkCreateQueryPool *args)
13 {
14    vkr_query_pool_create_and_add(dispatch->data, args);
15 }
16 
17 static void
vkr_dispatch_vkDestroyQueryPool(struct vn_dispatch_context * dispatch,struct vn_command_vkDestroyQueryPool * args)18 vkr_dispatch_vkDestroyQueryPool(struct vn_dispatch_context *dispatch,
19                                 struct vn_command_vkDestroyQueryPool *args)
20 {
21    vkr_query_pool_destroy_and_remove(dispatch->data, args);
22 }
23 
24 static void
vkr_dispatch_vkGetQueryPoolResults(UNUSED struct vn_dispatch_context * dispatch,struct vn_command_vkGetQueryPoolResults * args)25 vkr_dispatch_vkGetQueryPoolResults(UNUSED struct vn_dispatch_context *dispatch,
26                                    struct vn_command_vkGetQueryPoolResults *args)
27 {
28    vn_replace_vkGetQueryPoolResults_args_handle(args);
29    args->ret = vkGetQueryPoolResults(args->device, args->queryPool, args->firstQuery,
30                                      args->queryCount, args->dataSize, args->pData,
31                                      args->stride, args->flags);
32 }
33 
34 static void
vkr_dispatch_vkResetQueryPool(UNUSED struct vn_dispatch_context * dispatch,struct vn_command_vkResetQueryPool * args)35 vkr_dispatch_vkResetQueryPool(UNUSED struct vn_dispatch_context *dispatch,
36                               struct vn_command_vkResetQueryPool *args)
37 {
38    struct vkr_device *dev = vkr_device_from_handle(args->device);
39 
40    vn_replace_vkResetQueryPool_args_handle(args);
41    dev->ResetQueryPool(args->device, args->queryPool, args->firstQuery, args->queryCount);
42 }
43 
44 void
vkr_context_init_query_pool_dispatch(struct vkr_context * ctx)45 vkr_context_init_query_pool_dispatch(struct vkr_context *ctx)
46 {
47    struct vn_dispatch_context *dispatch = &ctx->dispatch;
48 
49    dispatch->dispatch_vkCreateQueryPool = vkr_dispatch_vkCreateQueryPool;
50    dispatch->dispatch_vkDestroyQueryPool = vkr_dispatch_vkDestroyQueryPool;
51    dispatch->dispatch_vkGetQueryPoolResults = vkr_dispatch_vkGetQueryPoolResults;
52    dispatch->dispatch_vkResetQueryPool = vkr_dispatch_vkResetQueryPool;
53 }
54