| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsVulkanPrerequisites.h"
- #include "BsPixelUtil.h"
- #include "BsVertexDeclaration.h"
- namespace BansheeEngine
- {
- /** @addtogroup Vulkan
- * @{
- */
- /** Contains various helper methods for dealing with Vulkan. */
- class VulkanUtility
- {
- public:
- /** Converts between Banshee and Vulkan pixel format. */
- static VkFormat getPixelFormat(PixelFormat format, bool sRGB = false);
- /** Converts between Banshee and Vulkan buffer element format. */
- static VkFormat getBufferFormat(GpuBufferFormat format);
- /** Converts between Banshee and Vulkan vertex element types. */
- static VkFormat getVertexType(VertexElementType type);
- /** Converts between Banshee and Vulkan texture addressing mode. */
- static VkSamplerAddressMode getAddressingMode(TextureAddressingMode mode);
- /** Converts between Banshee and Vulkan blend factor. */
- static VkBlendFactor getBlendFactor(BlendFactor factor);
- /** Converts between Banshee and Vulkan blend operation. */
- static VkBlendOp getBlendOp(BlendOperation op);
- /** Converts between Banshee and Vulkan comparison operation. */
- static VkCompareOp getCompareOp(CompareFunction op);
- /** Converts between Banshee and Vulkan cull mode. */
- static VkCullModeFlagBits getCullMode(CullingMode mode);
- /** Converts between Banshee and Vulkan polygon mode. */
- static VkPolygonMode getPolygonMode(PolygonMode mode);
- /** Converts between Banshee and Vulkan stencil op. */
- static VkStencilOp getStencilOp(StencilOperation op);
- /** Converts between Banshee and Vulkan index type. */
- static VkIndexType getIndexType(IndexType op);
- /** Converts between Banshee and Vulkan draw operation (i.e. primitive topology). */
- static VkPrimitiveTopology getDrawOp(DrawOperationType op);
- /** Gets Vulkan flags representing the number of samples in an image. Sample count must be a power of 2. */
- static VkSampleCountFlagBits getSampleFlags(UINT32 numSamples);
- /** Converts between a command buffer type and a Vulkan queue type. */
- static VulkanQueueType getQueueType(CommandBufferType type);
- /**
- * Populates the provided array with Vulkan devices that correspond to provided flags. Sets null in unused slots.
- */
- static void getDevices(const VulkanRenderAPI& rapi, GpuDeviceFlags flags, VulkanDevice* (&devices)[BS_MAX_LINKED_DEVICES]);
- };
- /** @} */
- }
|