Vulkan-Tools icon indicating copy to clipboard operation
Vulkan-Tools copied to clipboard

vkcube with VK_KHR_display fails when acquirable displays are on not-the-first physical devices

Open jjulianoatnv opened this issue 5 years ago • 6 comments

The way that vkcube's support for VK_KHR_display is implemented, vkcube fails when no direct-to-display VkDisplayKHR can be acquired on the vkPhysicalDevice that is sorted first in the list of physical devices, even when additional physical devices do have displays that can be acquired.

This is an app bug. It prevents using vkcube to test some multi-GPU scenarios.

This bug happens because vkcube is "lazy" in how it selects a physical device. It always selects the first physical device, even if this physical device does not have any displays that can be acquired.

        VkPhysicalDevice *physical_devices = malloc(sizeof(VkPhysicalDevice) * gpu_count);
        err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, physical_devices);
        assert(!err);
        /* For cube demo we just grab the first physical device */
        demo->gpu = physical_devices[0];

demo->gpu is hard-coded to the first physical device without regard to the presence of an acquirable display on the physical device.

jjulianoatnv avatar Dec 13 '19 14:12 jjulianoatnv