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

Make c++20 module use vulkan_hpp module #33

Open
qbojj opened this issue Oct 18, 2023 · 2 comments · May be fixed by #43
Open

Make c++20 module use vulkan_hpp module #33

qbojj opened this issue Oct 18, 2023 · 2 comments · May be fixed by #43

Comments

@qbojj
Copy link

qbojj commented Oct 18, 2023

Currently vk_mem_alloc.cppm includes vk_mem_alloc.hpp which in turn includes <vulkan/vulkan.hpp>, but it could import the vulkan_hpp module, as if you are using vma-hpp as module you are probably also using vulkan-hpp as a module.

@YaaZ
Copy link
Owner

YaaZ commented Feb 19, 2024

Not sure I got your idea. How could we import vulkan_hpp, instead of including <vulkan/vulkan.hpp> in vk_mem_alloc.hpp?

@qbojj
Copy link
Author

qbojj commented Feb 20, 2024

IDK if it is legal, by You could try

#ifdef VMA_USE_VULKAN_MODULE
import vulkan_hpp;
#else
#include <...>
#endif

I have posted it as a possibility and hadn't thought if it even is possible.

EDIT:
as stated in http://eel.is/c++draft/cpp#import-3:

If a pp-import is produced by source file inclusion (including by the rewrite produced when a #include directive names an importable header) while processing the group of a module-file, the program is ill-formed.

so imports in #included files are ill-formed

@qbojj qbojj linked a pull request Jul 10, 2024 that will close this issue
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 a pull request may close this issue.

2 participants