zink: never create a sw context unless sw is requested
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 3 May 2022 23:14:00 +0000 (19:14 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 18 May 2022 01:55:55 +0000 (21:55 -0400)
this otherwise makes it impossible to accurately do hardware driver
fallback, as zink will create a sw context instead of failing, superceding
the actual sw driver priorities

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16572>

src/gallium/drivers/zink/zink_screen.c

index 35a8f7e..01741a7 100644 (file)
@@ -1336,7 +1336,7 @@ choose_pdev(struct zink_screen *screen)
       }
    }
    is_cpu = cur_prio == prio_map[VK_PHYSICAL_DEVICE_TYPE_CPU];
-   if (cpu && !is_cpu)
+   if (cpu != is_cpu)
       goto out;
 
    screen->pdev = pdevs[idx];