UnityVulkanInterfaceFunctions.cpp 646 B

1234567891011121314151617181920
  1. #include "pch.h"
  2. #include "UnityVulkanInterfaceFunctions.h"
  3. namespace unity
  4. {
  5. namespace webrtc
  6. {
  7. std::unique_ptr<UnityGraphicsVulkan> UnityGraphicsVulkan::Get(IUnityInterfaces* unityInterfaces)
  8. {
  9. IUnityGraphicsVulkanV2* vulkanV2 = unityInterfaces->Get<IUnityGraphicsVulkanV2>();
  10. if (vulkanV2)
  11. return std::make_unique<UnityGraphicsVulkanImpl<IUnityGraphicsVulkanV2>>(vulkanV2);
  12. IUnityGraphicsVulkan* vulkan = unityInterfaces->Get<IUnityGraphicsVulkan>();
  13. if (vulkan)
  14. return std::make_unique<UnityGraphicsVulkanImpl<IUnityGraphicsVulkan>>(vulkan);
  15. return nullptr;
  16. }
  17. }
  18. }