mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
vulkan: add helpers to work with executable statistics
this is a lot of boilerplate in each driver. add helpers for it instead. the common framework will use these internally, but drivers that don't want the framework for whatever reason could use these themselves too. 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/33814>
This commit is contained in:
parent
682723c0c4
commit
2a44266d57
1 changed files with 23 additions and 0 deletions
|
|
@ -412,6 +412,29 @@ vk_descriptor_type_is_dynamic(VkDescriptorType type)
|
|||
memset(field + len, 0, sizeof(field) - len); \
|
||||
} while(0)
|
||||
|
||||
#define vk_add_exec_statistic(out, name_, description_, format_enum, \
|
||||
format_member, value_) \
|
||||
vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &(out), stat) \
|
||||
{ \
|
||||
VK_COPY_STR(stat->name, name_); \
|
||||
VK_COPY_STR(stat->description, description_); \
|
||||
stat->format = \
|
||||
VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_##format_enum##_KHR; \
|
||||
stat->value.format_member = (value_); \
|
||||
}
|
||||
|
||||
#define vk_add_exec_statistic_i64(out, name, description, value) \
|
||||
vk_add_exec_statistic(out, name, description, INT64, i64, value)
|
||||
|
||||
#define vk_add_exec_statistic_u64(out, name, description, value) \
|
||||
vk_add_exec_statistic(out, name, description, UINT64, u64, value)
|
||||
|
||||
#define vk_add_exec_statistic_f64(out, name, description, value) \
|
||||
vk_add_exec_statistic(out, name, description, FLOAT64, f64, value)
|
||||
|
||||
#define vk_add_exec_statistic_bool(out, name, description, value) \
|
||||
vk_add_exec_statistic(out, name, description, BOOL32, b32, value)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue