Skip to content

Commit

Permalink
Select physical device before create surface is platform is WSI Display
Browse files Browse the repository at this point in the history
  • Loading branch information
water-chika committed Dec 16, 2024
1 parent 2744de9 commit 411d3e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cube/cube.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 5 additions & 2 deletions cube/cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3826,14 +3826,17 @@ int main(int argc, char **argv) {
#endif
#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
case (WsiPlatform::display):
// nothing to do here
// select physical device because display surface creation need gpu is selected.
demo.select_physical_device();
break;
#endif
}

demo.create_surface();

demo.select_physical_device();
if (demo.wsi_platform != WsiPlatform::display) {
demo.select_physical_device();
}

demo.init_vk_swapchain();

Expand Down

0 comments on commit 411d3e7

Please sign in to comment.