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

cube: Support runtime selection of WSI platform #1029

Conversation

charles-lunarg
Copy link
Contributor

By changing the selection of a WSI platform from a build time choice to a runtime choice, this allows the removal of vkcube-wayland as a separate binary.

Use --wsi <xlib|xcb|wayland|display|directfb> to choose the WSI platform that vkcube will render with. The chosen platform must be one that vkcube was compiled with support for, so directfb will be unavailable without changing the build parameters to enable it.

These changes have been made to both vkcube and vkcubepp.

Platforms which do not have multiple WSI platforms, such as windows, android, and apple (metal is the only non-deprecated platform) do not have this option as there aren't any platforms to choose from.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 250359.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1516 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1516 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 9c86393 to 8927612 Compare September 5, 2024 20:43
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 250481.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1517 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1517 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 8927612 to 615c292 Compare September 5, 2024 22:05
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 250527.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1518 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1518 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 615c292 to 7dcae5f Compare September 6, 2024 18:45
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 251139.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1519 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1519 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 7dcae5f to 02cb94e Compare September 6, 2024 18:55
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 251170.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1520 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1520 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 02cb94e to b64c441 Compare September 6, 2024 20:19
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 251259.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1521 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1521 failed.

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from b64c441 to 1237a4c Compare September 9, 2024 19:48
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 252901.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1522 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1522 passed.

Copy link

@enunes enunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on x86_64 and aarch64 xlib, xcb, wayland and display, and this seems like a great improvement to me. Added a few comments for review. Thanks

cube/cube.cpp Show resolved Hide resolved
cube/cube.cpp Outdated Show resolved Hide resolved
cube/cube.c Outdated Show resolved Hide resolved
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 254274.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1524 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1524 passed.

Copy link

@enunes enunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from d2c9a47 to 9a4564e Compare October 15, 2024 16:20
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 279060.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 279076.

By changing the selection of a WSI platform from a build time choice to a
runtime choice, this allows the removal of vkcube-wayland as a separate
binary.

Use `--wsi <platform>` to choose the WSI platform that vkcube will render
with. The chosen platform must be one that vkcube was compiled with
support for, so directfb will be unavailable without changing the build
parameters to enable it.

These changes have been made to both vkcube and vkcubepp.

This includes enabling VK_KHR_display where applicable, which is supported
on linux and windows at the current time.
The docs lists 3.10 as a minimum required but only used 3.7 in github
actions.
@charles-lunarg charles-lunarg force-pushed the cube_enable_runtime_wsi_selection branch from 92e119e to 9cb3214 Compare October 15, 2024 16:25
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 279078.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1547 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1547 passed.

@charles-lunarg charles-lunarg merged commit 56eca74 into KhronosGroup:main Oct 15, 2024
18 checks passed
@charles-lunarg charles-lunarg deleted the cube_enable_runtime_wsi_selection branch October 15, 2024 20:28
@jjulianoatnv
Copy link
Contributor

jjulianoatnv commented Oct 16, 2024

This:

Platforms which do not have multiple WSI platforms, such as windows

is an incorrect assumption. Windows does have direct to display, as pointed out in the description of #307 .

From a quick skim of the changes that were committed, it appears that the changes to CMakeLists.txt preclude selecting direct display on Windows. @charles-lunarg , do you need me to file a new github issue for fixing that, or can a fix be included within the context of the existing issues?

@charles-lunarg
Copy link
Contributor Author

Platforms which do not have multiple WSI platforms, such as windows

Was such a big assumption that I found that out during development of the PR. Unfortunately, the commit message wasn't corrected after I changed the code to reflect the reality of DISPLAY being available on windows. Instead I will double check that the option is present on windows, and if not, rectify that with a subsequent PR.

@charles-lunarg
Copy link
Contributor Author

I just ran vkcube locally with the changes incorporated, both win32 and display were available as runtime options. The display option didn't work because I was running inside a VM with lavapipe as the sole driver, so if changes are needed to make display work on windows, let me know.

Otherwise I don't think there is any reasonable way to fix the git commit message without force pushing to main. That occurred because the initial version of the PR did preclude windows, but when it was addressed the commit message wasn't altered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vkcube should treat VK_KHR_display as runtime command-line switch, not as cmake option
4 participants