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

<vulkan/vulkan_hash.hpp> included in vulkan.cppm but std::hash specializations are not exported. #1943

Open
stripe2933 opened this issue Aug 19, 2024 · 4 comments

Comments

@stripe2933
Copy link

Looks like Clang can use them, but MSVC can't. Is it intended behavior?

@sharadhr
Copy link
Contributor

sharadhr commented Sep 4, 2024

I suppose we need to explicitly export the template specialisations. I haven't quite tested them; if you've got a minimum example that'd be great.

@asuessenbach
Copy link
Contributor

@sharadhr If you're looking for some usage of the vk-hash functions, please have a look at the Hash test (Vulkan-Hpp\tests\Hash\Hash.cpp).

@asuessenbach
Copy link
Contributor

@sharadhr Are you working on resolving this issue? Or could you give me some hint how I could do that?

@sharadhr
Copy link
Contributor

sharadhr commented Oct 3, 2024

I've been looking at it but I am not certain how to proceed. What I've done is write the following in CppStdModule.cpp (essentially copied the contents of Hash.cpp but replaced the #include lines with import), and try to compile it (assuming all CMake options are set correctly).

CppStdModule.cpp.txt

I then see, with cl.exe:

  C:\PROGRA~1\MIB055~1\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DCLANG_FORMAT_EXECUTABLE=\"R:/Vulkan-Hpp/clang-format.exe\" -DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR -DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 -DVULKAN_HPP_ENABLE_STD_MODULE -IR:\Vulkan-Hpp -IR:\Vulkan-Hpp\Vulkan-Headers\include -IR:\Vulkan-Hpp\glm -external:IR:\Vulkan-Hpp\vcpkg\installed\x64-windows\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /O2 /Ob1 /DNDEBUG -std:c++latest -MD -Zi /W4 /WX /showIncludes @tests\CppStdModule\CMakeFiles\CppStdModule.dir\CppStdModule.cpp.obj.modmap /Fotests\CppStdModule\CMakeFiles\CppStdModule.dir\CppStdModule.cpp.obj /Fdtests\CppStdModule\CMakeFiles\CppStdModule.dir\ /FS -c R:\Vulkan-Hpp\tests\CppStdModule\CppStdModule.cpp
R:\Vulkan-Hpp\tests\CppStdModule\CppStdModule.cpp(41): error C2512: 'std::hash<vk::Instance>': no appropriate default constructor available
  R:\Vulkan-Hpp\tests\CppStdModule\CppStdModule.cpp(41): note: Invalid aggregate initialization
R:\Vulkan-Hpp\tests\CppStdModule\CppStdModule.cpp(52): error C2512: 'std::hash<vk::FormatFeatureFlags>': no appropriate default constructor available
  R:\Vulkan-Hpp\tests\CppStdModule\CppStdModule.cpp(52): note: Invalid aggregate initialization
  ninja: build stopped: subcommand failed.

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

No branches or pull requests

3 participants