VkApplicationInfo appinf = {0};
VkLayerProperties *lprop = 0;
VkExtensionProperties *iext;
- uint32_t i, j, num_inst_layers, num_inst_ext, lprop_count, iext_count;
+ uint32_t i, j, num_inst_layers, num_inst_ext, lprop_count, iext_count, pdev_count;
char **inst_layers = 0, **inst_ext = 0;
+ VkPhysicalDevice *pdev;
+ VkPhysicalDeviceProperties pdevp;
static const char *debug_layers[] = {
"VK_LAYER_LUNARG_device_limits",
static const char *extensions[] = {
"VK_KHR_surface",
"VK_KHR_xlib_surface",
+ "VK_KHR_win32_surface",
0
};
return -1;
}
+ if(vkEnumeratePhysicalDevices(vk, &pdev_count, 0) != 0 || !pdev_count) {
+ fprintf(stderr, "ggfx_init: failed to enumerate physical devices\n");
+ return -1;
+ }
+ if(!(pdev = malloc(pdev_count * sizeof *pdev))) {
+ perror("ggfx_init: failed to allocate memory for physical devices");
+ return -1;
+ }
+ vkEnumeratePhysicalDevices(vk, &pdev_count, pdev);
+
+ printf("Found %d physical devices\n", pdev_count);
+ for(i=0; i<pdev_count; i++) {
+ vkGetPhysicalDeviceProperties(pdev[i], &pdevp);
+ printf(" - %s\n", pdevp.deviceName);
+ }
+
return 0;
}