mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
zink: don't pick a cpu device ever.
This goes down the list and picks the first non-cpu device, when
we merge the CI patch we should add a forcing env var in here.
Fixes: 8d46e35d1 ("zink: introduce opengl over vulkan")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8845>
This commit is contained in:
parent
586f139713
commit
e41b0202c9
1 changed files with 5 additions and 3 deletions
|
|
@ -709,7 +709,7 @@ static VkPhysicalDevice
|
|||
choose_pdev(const VkInstance instance)
|
||||
{
|
||||
uint32_t i, pdev_count;
|
||||
VkPhysicalDevice *pdevs, pdev;
|
||||
VkPhysicalDevice *pdevs, pdev = NULL;
|
||||
vkEnumeratePhysicalDevices(instance, &pdev_count, NULL);
|
||||
assert(pdev_count > 0);
|
||||
|
||||
|
|
@ -717,11 +717,10 @@ choose_pdev(const VkInstance instance)
|
|||
vkEnumeratePhysicalDevices(instance, &pdev_count, pdevs);
|
||||
assert(pdev_count > 0);
|
||||
|
||||
pdev = pdevs[0];
|
||||
for (i = 0; i < pdev_count; ++i) {
|
||||
VkPhysicalDeviceProperties props;
|
||||
vkGetPhysicalDeviceProperties(pdevs[i], &props);
|
||||
if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) {
|
||||
if (props.deviceType != VK_PHYSICAL_DEVICE_TYPE_CPU) {
|
||||
pdev = pdevs[i];
|
||||
break;
|
||||
}
|
||||
|
|
@ -1095,6 +1094,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
debug_printf("ZINK: failed to setup debug utils\n");
|
||||
|
||||
screen->pdev = choose_pdev(screen->instance);
|
||||
if (!screen->pdev)
|
||||
goto fail;
|
||||
|
||||
update_queue_props(screen);
|
||||
|
||||
screen->have_X8_D24_UNORM_PACK32 = zink_is_depth_format_supported(screen,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue