BsVulkanPrerequisites.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #define BS_NUM_BACK_BUFFERS 1
  13. #include "vulkan/vulkan.h"
  14. /** @addtogroup Plugins
  15. * @{
  16. */
  17. /** @defgroup Vulkan BansheeVulkanRenderAPI
  18. * Wrapper around the Vulkan render API.
  19. */
  20. /** @} */
  21. namespace BansheeEngine
  22. {
  23. class VulkanRenderAPI;
  24. class Win32RenderWindow;
  25. class VulkanTextureCore;
  26. class Win32VideoMode;
  27. class VulkanIndexBuffer;
  28. class VulkanVertexDeclaration;
  29. class VulkanHardwareBuffer;
  30. class VulkanDevice;
  31. class VulkanGLSLProgramFactory;
  32. class VulkanSwapChain;
  33. class VulkanFramebuffer;
  34. class VulkanDescriptorLayout;
  35. class VulkanDescriptorSet;
  36. class VulkanDescriptorManager;
  37. class VulkanCmdBufferPool;
  38. class VulkanCmdBuffer;
  39. class VulkanCommandBuffer;
  40. class VulkanQueue;
  41. class VulkanResourceManager;
  42. class VulkanGpuParamBlockBufferCore;
  43. class VulkanBuffer;
  44. class VulkanImage;
  45. class VulkanDescriptorPool;
  46. class VulkanGpuParams;
  47. VkAllocationCallbacks* gVulkanAllocator = nullptr;
  48. /** Vulkan specific types to track resource statistics for. */
  49. enum VulkanRenderStatResourceType
  50. {
  51. RenderStatObject_PipelineState = 100
  52. };
  53. /** Contains lists of images and buffers that require pipeline barrier transitions. */
  54. struct TransitionInfo
  55. {
  56. Vector<VkImageMemoryBarrier> imageBarriers;
  57. Vector<VkBufferMemoryBarrier> bufferBarriers;
  58. };
  59. }
  60. /** Macro to get a procedure address based on a Vulkan instance. */
  61. #define GET_INSTANCE_PROC_ADDR(instance, name) \
  62. vk##name = reinterpret_cast<PFN_vk##name>(vkGetInstanceProcAddr(instance, "vk"#name));
  63. /** Macro to get a procedure address based on a Vulkan device. */
  64. #define GET_DEVICE_PROC_ADDR(device, name) \
  65. vk##name = reinterpret_cast<PFN_vk##name>(vkGetDeviceProcAddr(device, "vk"#name));