| 1 |
/* |
| 2 |
* Copyright © 2022 Imagination Technologies Ltd. |
| 3 |
* |
| 4 |
* based in part on anv driver which is: |
| 5 |
* Copyright © 2015 Intel Corporation |
| 6 |
* |
| 7 |
* based in part on radv driver which is: |
| 8 |
* Copyright © 2016 Red Hat. |
| 9 |
* Copyright © 2016 Bas Nieuwenhuizen |
| 10 |
* |
| 11 |
* SPDX-License-Identifier: MIT |
| 12 |
*/ |
| 13 |
|
| 14 |
#ifndef PVR_QUERY_H |
| 15 |
#define PVR_QUERY_H |
| 16 |
|
| 17 |
#include "vk_object.h" |
| 18 |
|
| 19 |
#include "pvr_common.h" |
| 20 |
|
| 21 |
struct pvr_device; |
| 22 |
|
| 23 |
struct pvr_query_pool { |
| 24 |
struct vk_object_base base; |
| 25 |
|
| 26 |
/* Stride of result_buffer to get to the start of the results for the next |
| 27 |
* Phantom. |
| 28 |
*/ |
| 29 |
uint32_t result_stride; |
| 30 |
|
| 31 |
uint32_t query_count; |
| 32 |
|
| 33 |
struct pvr_suballoc_bo *result_buffer; |
| 34 |
struct pvr_suballoc_bo *availability_buffer; |
| 35 |
}; |
| 36 |
|
| 37 |
struct pvr_query_info { |
| 38 |
enum pvr_query_type type; |
| 39 |
|
| 40 |
struct { |
| 41 |
bool is_dynamic_render : 1; |
| 42 |
bool is_suspend : 1; |
| 43 |
}; |
| 44 |
|
| 45 |
union { |
| 46 |
struct { |
| 47 |
uint32_t num_query_indices; |
| 48 |
struct pvr_suballoc_bo *index_bo; |
| 49 |
uint32_t num_queries; |
| 50 |
struct pvr_suballoc_bo *availability_bo; |
| 51 |
} availability_write; |
| 52 |
|
| 53 |
struct { |
| 54 |
VkQueryPool query_pool; |
| 55 |
uint32_t first_query; |
| 56 |
uint32_t query_count; |
| 57 |
} reset_query_pool; |
| 58 |
|
| 59 |
struct { |
| 60 |
VkQueryPool query_pool; |
| 61 |
uint32_t first_query; |
| 62 |
uint32_t query_count; |
| 63 |
VkBuffer dst_buffer; |
| 64 |
VkDeviceSize dst_offset; |
| 65 |
VkDeviceSize stride; |
| 66 |
VkQueryResultFlags flags; |
| 67 |
} copy_query_results; |
| 68 |
}; |
| 69 |
}; |
| 70 |
|
| 71 |
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_query_pool, |
| 72 |
base, |
| 73 |
VkQueryPool, |
| 74 |
VK_OBJECT_TYPE_QUERY_POOL) |
| 75 |
|
| 76 |
#ifdef PVR_PER_ARCH |
| 77 |
|
| 78 |
VkResult PVR_PER_ARCH(device_create_compute_query_programs)( |
| 79 |
struct pvr_device *device); |
| 80 |
|
| 81 |
# define pvr_arch_device_create_compute_query_programs \ |
| 82 |
PVR_PER_ARCH(device_create_compute_query_programs) |
| 83 |
|
| 84 |
void PVR_PER_ARCH(device_destroy_compute_query_programs)( |
| 85 |
struct pvr_device *device); |
| 86 |
|
| 87 |
# define pvr_arch_device_destroy_compute_query_programs \ |
| 88 |
PVR_PER_ARCH(device_destroy_compute_query_programs) |
| 89 |
|
| 90 |
#endif |
| 91 |
|
| 92 |
#endif /* PVR_QUERY_H*/ |