LoadVulkanFunctions.h 890 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <IUnityGraphicsVulkan.h>
  3. #include <vulkan/vulkan.h>
  4. #ifdef _WIN32
  5. #include <windef.h>
  6. #define LIBRARY_TYPE HMODULE
  7. #elif defined __linux
  8. #define LIBRARY_TYPE void*
  9. #endif
  10. namespace unity
  11. {
  12. namespace webrtc
  13. {
  14. #define EXPORTED_VULKAN_FUNCTION(func) extern PFN_##func func;
  15. #define GLOBAL_VULKAN_FUNCTION(func) extern PFN_##func func;
  16. #define INSTANCE_VULKAN_FUNCTION(func) extern PFN_##func func;
  17. #define DEVICE_VULKAN_FUNCTION(func) extern PFN_##func func;
  18. #include "ListOfVulkanFunctions.inl"
  19. bool LoadVulkanFunctions(UnityVulkanInstance& instance);
  20. bool LoadVulkanLibrary(LIBRARY_TYPE& library);
  21. bool LoadExportedVulkanFunction(LIBRARY_TYPE const& library);
  22. bool LoadGlobalVulkanFunction();
  23. bool LoadInstanceVulkanFunction(VkInstance instance);
  24. bool LoadDeviceVulkanFunction(VkDevice device);
  25. } // namespace webrtc
  26. } // namespace unity