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

unresolved external for the vkCmdTraceRaysKHR function on windows when VK_ENABLE_BETA_EXTENSIONS is defined #46

Closed
multisample opened this issue Apr 14, 2020 · 3 comments

Comments

@multisample
Copy link

When defining VK_ENABLE_BETA_EXTENSIONS and including volk.h, we get unresolved externals function error for vkCmdTraceRaysKHR. I believe volk.c needs to define VK_ENABLE_BETA_EXTENSIONS before including the volk.h header in case users of the lib decide to define it.

@zeux
Copy link
Owner

zeux commented Apr 14, 2020

Are you building volk using CMake?

@multisample
Copy link
Author

no, so i guess that answers that :)

@zeux
Copy link
Owner

zeux commented Apr 14, 2020

I should have been more specific I guess :)

If you're building volk as part of your project, I'd recommend setting VK_ENABLE_BETA_EXTENSIONS on the entire project.
If you're building volk as a separate static library, through CMake or otherwise, you should add the define there - with CMake it's possible using VOLK_STATIC_DEFINES variable.

The reason why it's incorrect to just define this in volk.c is that it would introduce new fields into VolkDeviceTable interface, so for people who use that interface and don't use beta extensions there's going to be issues because the layout of the struct will be inconsistent.

So the defines need to be set consistently between the header and the implementation, and the best way to do that is to set them externally.

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

2 participants