Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vkcube & vkcubepp: Select physical device before create surface if platform is WSI Display #1060

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
water-chika marked this conversation as resolved.
Show resolved Hide resolved
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.
water-chika marked this conversation as resolved.
Show resolved Hide resolved
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
Loading