Utility functions.
More...
|
| uint32_t | FindMemoryType (VkPhysicalDevice physicalDevice, uint32_t typeFilter, VkMemoryPropertyFlags properties) |
| | Find the memory type to use for a certain allocation. More...
|
| |
| void | CreateBuffer (VkDevice device, VkPhysicalDevice physicalDevice, unsigned int size, VkBufferUsageFlags usage, VkMemoryPropertyFlags memoryProperties, VkBuffer *buffer, VkDeviceMemory *deviceMemory) |
| | Create a buffer. More...
|
| |
| void | CreateImage2D (VkDevice device, VkPhysicalDevice physicalDevice, const glm::uvec2 &size, uint32_t mipLevels, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags memoryProperties, VkImage *image, VkDeviceMemory *deviceMemory) |
| | Create a 2D image, allocate and bind device memory to it. More...
|
| |
| void | TransitionImage (VkCommandBuffer commandBuffer, VkImage image, VkImageLayout oldLayout, VkImageLayout newLayout) |
| | Record transitioning an image into a command buffer. More...
|
| |
◆ CreateBuffer()
| void Video::Utility::CreateBuffer |
( |
VkDevice |
device, |
|
|
VkPhysicalDevice |
physicalDevice, |
|
|
unsigned int |
size, |
|
|
VkBufferUsageFlags |
usage, |
|
|
VkMemoryPropertyFlags |
memoryProperties, |
|
|
VkBuffer * |
buffer, |
|
|
VkDeviceMemory * |
deviceMemory |
|
) |
| |
Create a buffer.
- Parameters
-
| device | The Vulkan device. |
| physicalDevice | The physical device from which to allocate memory. |
| size | The size of the buffer. |
| usage | How the buffer will be used. |
| memoryProperties | Memory properties. |
| buffer | The output buffer. |
| deviceMemory | The output device memory. |
◆ CreateImage2D()
| void Video::Utility::CreateImage2D |
( |
VkDevice |
device, |
|
|
VkPhysicalDevice |
physicalDevice, |
|
|
const glm::uvec2 & |
size, |
|
|
uint32_t |
mipLevels, |
|
|
VkFormat |
format, |
|
|
VkImageTiling |
tiling, |
|
|
VkImageUsageFlags |
usage, |
|
|
VkMemoryPropertyFlags |
memoryProperties, |
|
|
VkImage * |
image, |
|
|
VkDeviceMemory * |
deviceMemory |
|
) |
| |
Create a 2D image, allocate and bind device memory to it.
- Parameters
-
| device | The Vulkan device. |
| physicalDevice | The physical device from which to allocate memory. |
| size | The image dimensions. |
| mipLevels | The number of mip levels in the image. |
| format | The format of the image. |
| tiling | Image tiling. |
| usage | How the image will be used. |
| memoryProperties | Memory properties. |
| image | The output image. |
| deviceMemory | The output device memory. |
◆ FindMemoryType()
| uint32_t Video::Utility::FindMemoryType |
( |
VkPhysicalDevice |
physicalDevice, |
|
|
uint32_t |
typeFilter, |
|
|
VkMemoryPropertyFlags |
properties |
|
) |
| |
Find the memory type to use for a certain allocation.
- Parameters
-
| physicalDevice | The physical device. |
| typeFilter | Filter of suitable memory types. |
| properties | Memory properties. |
- Returns
- The memory type to use.
◆ TransitionImage()
| void Video::Utility::TransitionImage |
( |
VkCommandBuffer |
commandBuffer, |
|
|
VkImage |
image, |
|
|
VkImageLayout |
oldLayout, |
|
|
VkImageLayout |
newLayout |
|
) |
| |
Record transitioning an image into a command buffer.
- Parameters
-
| commandBuffer | The command buffer to record the transition into. |
| image | The image to transition. |
| oldLayout | The old layout of the image. |
| newLayout | The new layout of the image. |