Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
VulkanUtils.hpp
1#pragma once
2
3#include <Common/Graphics/Formats.hpp>
4#include <vulkan/vulkan.h>
5#include <stdint.h>
6
7namespace Grindstone::GraphicsAPI::Vulkan {
8 VkImageView CreateImageView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags, uint32_t mipLevels);
9 VkImageView CreateCubemapView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags, uint32_t mipLevels);
10 void CreateImage(uint32_t width, uint32_t height, uint32_t mipLevels, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage& image, VkDeviceMemory& imageMemory, uint32_t layerCount = 1, VkImageCreateFlags flags = 0);
11 void CreateBuffer(const char* debugName, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer, VkDeviceMemory& bufferMemory);
12 VkCommandBuffer BeginSingleTimeCommands();
13 void EndSingleTimeCommands(VkCommandBuffer commandBuffer);
14 VkShaderStageFlags TranslateShaderStageBits(ShaderStageBit shaderStageBits);
15 void CopyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size);
16 void TransitionImageLayout(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags, VkImageLayout oldLayout, VkImageLayout newLayout, uint32_t mipLevels, uint32_t layerCount);
17 void CopyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height);
18}