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: Make Volk requirement explicit #992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lunarpapillo
Copy link
Contributor

See also:

Cannot build DEMOS.sln
https://gitlab.khronos.org/vulkan/Vulkan-SDK-Packaging/-/issues/1417

Volk requires that VK_NO_PROTOTYPES be defined before vulkan.h or vulkan.hpp is included. Currently, the various flavors of vkcube hide this definition in the cube/CMakeLists.txt file, which can confuse users who may copy the source for their own use, and may require investigation to figure out why it doesn't "just work".

This change makes the #define explicit in the cube.c and cube.cpp source files, which should both be clearer and be more similar to how most applications use Volk.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 181327.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 181327.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1443 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1443 failed.

@charles-lunarg
Copy link
Contributor

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 186219.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 186219.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1453 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1453 failed.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 186986.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 186986.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1455 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1455 passed.

See also:

    Cannot build DEMOS.sln
    https://gitlab.khronos.org/vulkan/Vulkan-SDK-Packaging/-/issues/1417

Volk requires that VK_NO_PROTOTYPES be defined before vulkan.h or vulkan.hpp is
included.  Currently, the various flavors of vkcube hide this definition in the
cube/CMakeLists.txt file, which can confuse users who may copy the source for their
own use, and may require investigation to figure out why it doesn't "just work".

This change makes the #define explicit in the cube.c and cube.cpp source files,
which should both be clearer and be more similar to how most applications use Volk.

cube/CMakeLists.txt:
- remove

- vulkaninfo already had a #VK_NO_PROTOTYPES somewhere
- macOS DemoViewController includes of mvk_vulkan.h are confusing Volk and don't seem to be necessary,
  since cube.c and cube.cpp #include vulkan.h and vulkan.hpp, respectively
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 187054.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Tools build queued with queue ID 187054.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1456 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Tools build # 1456 passed.

@lunarpapillo
Copy link
Contributor Author

Seems like the define needs to be added to these files as well: https://github.com/KhronosGroup/Vulkan-Tools/blob/main/cube/macOS/cube/DemoViewController.m https://github.com/KhronosGroup/Vulkan-Tools/blob/main/cube/macOS/cubepp/DemoViewController.mm

🤣 you figured this out before I did! Blast it, I didn't see your response here while I was working it out in the Vulkan-SDK-Packaging issue - would have saved me some time and kept me from pulling as much of my already sparse hair out...

@lunarpapillo
Copy link
Contributor Author

@charles-lunarg @mikes-lunarg I noted this in the issue, and am reiterating it here...

Is it better to remove the #include <MoltenVK/mvk_vulkan.h> line from DemoViewController, or better to keep it and just add a #define VK_NO_PROTOTYPES above it in that same file? (By "better", I think I mean: which demonstrates to the user the more correct usage?)

The point of doing this as a Vulkan-Tools change instead of an SDK change is to make the use of Volk more "proper". But I'm not sure which of the above is more "proper"...

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.

None yet

3 participants