libcl/vk: add common query copy write routine
every VK driver ends up wanting this. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32721>
This commit is contained in:
committed by
Marge Bot
parent
db4d7a3032
commit
c51a2e85d8
@@ -42,6 +42,19 @@ typedef enum VkQueryResultFlagBits {
|
||||
VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
|
||||
} VkQueryResultFlagBits;
|
||||
|
||||
static inline void
|
||||
vk_write_query(uintptr_t dst_addr, int32_t idx, VkQueryResultFlagBits flags,
|
||||
uint64_t result)
|
||||
{
|
||||
if (flags & VK_QUERY_RESULT_64_BIT) {
|
||||
global uint64_t *out = (global uint64_t *)dst_addr;
|
||||
out[idx] = result;
|
||||
} else {
|
||||
global uint32_t *out = (global uint32_t *)dst_addr;
|
||||
out[idx] = result;
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum VkIndexType {
|
||||
VK_INDEX_TYPE_UINT16 = 0,
|
||||
VK_INDEX_TYPE_UINT32 = 1,
|
||||
|
||||
Reference in New Issue
Block a user