aboutsummaryrefslogtreecommitdiff
path: root/cube/cube.c
diff options
context:
space:
mode:
Diffstat (limited to 'cube/cube.c')
-rw-r--r--cube/cube.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cube/cube.c b/cube/cube.c
index 349bfc74..18fd5ec9 100644
--- a/cube/cube.c
+++ b/cube/cube.c
@@ -5073,12 +5073,15 @@ int main(int argc, char **argv) {
#endif
#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
case (WSI_PLATFORM_DISPLAY):
- // nothing to do here
+ // select physical device because display surface creation need gpu is selected.
+ demo_select_physical_device(&demo);
break;
#endif
}
demo_create_surface(&demo);
- demo_select_physical_device(&demo);
+ if (demo.wsi_platform != WSI_PLATFORM_DISPLAY) {
+ demo_select_physical_device(&demo);
+ }
demo_init_vk_swapchain(&demo);