a/vk: Fill in timestamp feature information

This commit is contained in:
Jakob Bornecrantz 2022-04-23 23:46:46 +01:00
parent 3aa4fdb096
commit 599527fe01
3 changed files with 30 additions and 4 deletions

View file

@ -151,6 +151,16 @@ vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *e
*
*/
static void
fill_in_device_features(struct vk_bundle *vk)
{
VkPhysicalDeviceProperties pdp;
vk->vkGetPhysicalDeviceProperties(vk->physical_device, &pdp);
vk->features.timestamp_compute_and_graphics = pdp.limits.timestampComputeAndGraphics;
vk->features.timestamp_period = pdp.limits.timestampPeriod;
}
static bool
is_fence_bit_supported(struct vk_bundle *vk, VkExternalFenceHandleTypeFlagBits handle_type)
{
@ -871,6 +881,9 @@ vk_create_device(struct vk_bundle *vk,
return ret;
}
// Fill in the device features we are interested in.
fill_in_device_features(vk);
// We fill in these here as we want to be sure we have selected the physical device fully.
fill_in_external_object_properties(vk);
@ -985,6 +998,9 @@ vk_init_from_given(struct vk_bundle *vk,
}
#endif
// Fill in the device features we are interested in.
fill_in_device_features(vk);
// Fill in external object properties.
fill_in_external_object_properties(vk);

View file

@ -95,6 +95,12 @@ struct vk_bundle
struct
{
//! Are timestamps available for compute and graphics queues?
bool timestamp_compute_and_graphics;
//! Nanoseconds per gpu tick.
float timestamp_period;
//! Were timeline semaphore requested, available, and enabled?
bool timeline_semaphore;
} features;

View file

@ -35,10 +35,14 @@ vk_print_device_info(struct vk_bundle *vk,
void
vk_print_features_info(struct vk_bundle *vk, enum u_logging_level log_level)
{
U_LOG_IFL(log_level, vk->log_level, //
"Features:" //
"\n\ttimeline_semaphore: %s", //
vk->features.timeline_semaphore ? "true" : "false"); //
U_LOG_IFL(log_level, vk->log_level, //
"Features:" //
"\n\ttimestamp_compute_and_graphics: %s" //
"\n\ttimestamp_period: %f" //
"\n\ttimeline_semaphore: %s", //
vk->features.timestamp_compute_and_graphics ? "true" : "false", //
vk->features.timestamp_period, //
vk->features.timeline_semaphore ? "true" : "false"); //
}
void