static VkPhysicalDevice *pdev_list;
static uint32_t num_pdev;
-static int have_debug_report;
+static int have_raytrace, have_debug_report;
#define ARRSZ(arr) (sizeof arr / sizeof *arr)
static const char *known_layer_list[] = {
for(i=0; i<inst_ext_count; i++) {
printf(" - %s\n", inst_ext[i].extensionName);
}
+
+ have_raytrace = have_inst_ext("VK_KHR_ray_tracing_pipeline");
have_debug_report = have_inst_ext("VK_KHR_debug_report");
for(i=0; i<ARRSZ(known_layer_list); i++) {
{
int i;
VkPhysicalDeviceProperties2 pdevprop2;
+ VkPhysicalDeviceRayTracingPipelinePropertiesKHR raypipe_prop;
VkPhysicalDeviceAccelerationStructurePropertiesKHR rayacc_prop;
vkEnumeratePhysicalDevices(vk, &num_pdev, 0);
printf("Found %d physical devices\n", num_pdev);
for(i=0; i<num_pdev; i++) {
- memset(&rayacc_prop, 0, sizeof rayacc_prop);
- rayacc_prop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR;
+ if(have_raytrace) {
+ memset(&rayacc_prop, 0, sizeof rayacc_prop);
+ rayacc_prop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR;
+
+ memset(&raypipe_prop, 0, sizeof raypipe_prop);
+ raypipe_prop.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR;
+ raypipe_prop.pNext = &rayacc_prop;
+ }
memset(&pdevprop2, 0, sizeof pdevprop2);
pdevprop2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
- pdevprop2.pNext = &rayacc_prop;
+ pdevprop2.pNext = have_raytrace ? &raypipe_prop : 0;
vkGetPhysicalDeviceProperties2(pdev_list[i], &pdevprop2);
printf(" %d: %s\n", i, pdevprop2.properties.deviceName);
+ if(have_raytrace) {
+ printf(" Raytracing properties:\n");
+ printf(" max ray recursion: %u\n", raypipe_prop.maxRayRecursionDepth);
+ printf(" max ray dispatch: %u\n", raypipe_prop.maxRayDispatchInvocationCount);
+ printf(" max leaf geometry: %llu\n", (unsigned long long)rayacc_prop.maxGeometryCount);
+ printf(" max leaf primitves: %llu\n", (unsigned long long)rayacc_prop.maxPrimitiveCount);
+ printf(" max instances: %llu\n", (unsigned long long)rayacc_prop.maxInstanceCount);
+ }
}
return 0;