static int eval_pdev_score(VkPhysicalDevice dev)
{
+ int score = 0;
uint32_t i, num_fmt, num_qfam, num_ext;
VkQueueFamilyProperties *qfam;
VkExtensionProperties *ext;
for(i=0; i<num_qfam; i++) {
vkGetPhysicalDeviceSurfaceSupportKHR(dev, i, vksurf, &can_pres);
if(qfam[i].queueCount && (qfam[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) && can_pres) {
- free(ext);
- free(sfmt);
- free(qfam);
- return 1;
+ score = 1;
+ }
+ }
+
+ switch(prop.deviceType) {
+ case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
+ score++;
+ break;
+ case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
+ score += 2;
+ break;
+ case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
+ score += 4;
+ break;
+ default:
+ break;
+ }
+
+ if(initflags & VKINIT_RAY) {
+ if(have_ext(ext, num_ext, "VK_KHR_acceleration_structure") &&
+ have_ext(ext, num_ext, "VK_KHR_ray_tracing_pipeline")) {
+ score += 100;
}
}
free(ext);
free(sfmt);
free(qfam);
- return 0;
+ return score;
}
static int choose_pixfmt(void)