BsVulkanPrerequisites.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #define WIN32_LEAN_AND_MEAN
  6. #if !defined(NOMINMAX) && defined(_MSC_VER)
  7. # define NOMINMAX // Required to stop windows.h messing up std::min
  8. #endif
  9. #if BS_PLATFORM == BS_PLATFORM_WIN32
  10. #define VK_USE_PLATFORM_WIN32_KHR
  11. #endif
  12. #include "vulkan/vulkan.h"
  13. /** @addtogroup Plugins
  14. * @{
  15. */
  16. /** @defgroup Vulkan BansheeVulkanRenderAPI
  17. * Wrapper around the Vulkan render API.
  18. */
  19. /** @} */
  20. namespace BansheeEngine
  21. {
  22. class VulkanRenderAPI;
  23. class Win32RenderWindow;
  24. class VulkanTextureCore;
  25. class Win32VideoMode;
  26. class VulkanIndexBuffer;
  27. class VulkanVertexDeclaration;
  28. class VulkanHardwareBuffer;
  29. class VulkanDevice;
  30. class VulkanGLSLProgramFactory;
  31. class VulkanSwapChain;
  32. class VulkanDescriptorLayout;
  33. class VulkanDescriptorSet;
  34. class VulkanDescriptorManager;
  35. class VulkanCmdBufferPool;
  36. class VulkanCmdBuffer;
  37. class VulkanCommandBuffer;
  38. class VulkanQueue;
  39. class VulkanResourceManager;
  40. class VulkanGpuParamBlockBufferCore;
  41. class VulkanBuffer;
  42. class VulkanDescriptorPool;
  43. class VulkanGpuParams;
  44. VkAllocationCallbacks* gVulkanAllocator = nullptr;
  45. /** Vulkan specific types to track resource statistics for. */
  46. enum VulkanRenderStatResourceType
  47. {
  48. RenderStatObject_PipelineState = 100
  49. };
  50. /** Contains lists of images and buffers that require pipeline barrier transitions. */
  51. struct TransitionInfo
  52. {
  53. Vector<VkImageMemoryBarrier> imageBarriers;
  54. Vector<VkBufferMemoryBarrier> bufferBarriers;
  55. };
  56. }
  57. /** Macro to get a procedure address based on a Vulkan instance. */
  58. #define GET_INSTANCE_PROC_ADDR(instance, name) \
  59. vk##name = reinterpret_cast<PFN_vk##name>(vkGetInstanceProcAddr(instance, "vk"#name));
  60. /** Macro to get a procedure address based on a Vulkan device. */
  61. #define GET_DEVICE_PROC_ADDR(device, name) \
  62. vk##name = reinterpret_cast<PFN_vk##name>(vkGetDeviceProcAddr(device, "vk"#name));