|
VulkanEngine 0.1
Graphics engine using Vulkan
|
#include <Image.h>
Public Member Functions | |
| Image (vk::ImageLayout initial_layout, vk::ImageUsageFlags usage_flags, VmaMemoryUsage vma_memory_usage, uint32_t _width, uint32_t _height, uint32_t _depth, size_t pixel_size, bool generate_mip_maps) | |
| virtual | ~Image () |
| Destructor. | |
| void | setImageData (const void *data) |
| void | createImageView (vk::ImageViewType image_view_type, vk::ImageAspectFlags image_aspect_flags) |
| void | transitionImageLayout (vk::ImageLayout new_layout, const vk::CommandBuffer &command_buffer=nullptr) |
| const vk::Format | getVkFormat () const |
| Get the vk::Format of the image. | |
| const vk::SampleCountFlagBits | getVkSampleCountFlags () const |
| Get vk::SampleCountFlagBits. | |
| virtual vk::Image | getVkImage () const |
| Get the interal vulkan image. | |
| virtual vk::ImageView | getVkImageView () const |
| Get the vk::ImageView. | |
Public Member Functions inherited from VulkanEngine::BufferBase | |
| virtual void | updateBuffer (const void *_data, size_t _data_size) |
Public Member Functions inherited from VulkanEngine::ImageBase | |
| ImageBase () | |
| Contructor. | |
| virtual | ~ImageBase () |
| Destructor. | |
| virtual vk::Image | getVkImage () const =0 |
| Get the interal vulkan image. | |
| virtual vk::ImageView | getVkImageView () const =0 |
| Get the internal vulkan image view. | |
Protected Member Functions | |
| virtual void | insertTransferCommand (const vk::CommandBuffer &command_buffer, const vk::Buffer &source_buffer) |
| virtual size_t | getStagingBufferSize () const |
Protected Member Functions inherited from VulkanEngine::SingleUsageCommandBuffer | |
| void | beginSingleUsageCommandBuffer () |
| Creates and starts recording the command buffer. | |
| void | endSingleUsageCommandBuffer () |
| Stops recording and submits the command buffer. | |
Protected Attributes | |
| uint32_t | width |
| The width of the Image. | |
| uint32_t | height |
| The height of the Image. | |
| uint32_t | depth |
| The depth of the Image. | |
| size_t | data_size |
| The total size of Image's data. | |
| uint32_t | mipmap_levels |
| The number of mipmap images to generate. | |
| vk::ImageLayout | vk_image_layout |
| The current vk::ImageLayout. | |
| vk::Image | vk_image |
| Internal vk_image. | |
| vk::ImageView | vk_image_view |
| The vk::ImageView created in createImageView(). | |
| VkImageCreateInfo | image_create_info |
| VkImageCreateInfo. | |
Protected Attributes inherited from VulkanEngine::BufferBase | |
| VmaAllocation | vma_allocation |
Protected Attributes inherited from VulkanEngine::SingleUsageCommandBuffer | |
| vk::CommandBuffer | single_use_command_buffer |
| The single use command buffer. | |
Represents an image.
| format | The vk::Format of the pixels in the image. |
| image_type | The vk::ImageType specifying the dimensions of the image. |
| tiling | The vk::ImageTiling option to use. |
| sample_count_flags | vk::SampleCountFlagBits option to use for the image. |
| VulkanEngine::Image< format, image_type, tiling, sample_count_flags >::Image | ( | vk::ImageLayout | initial_layout, |
| vk::ImageUsageFlags | usage_flags, | ||
| VmaMemoryUsage | vma_memory_usage, | ||
| uint32_t | _width, | ||
| uint32_t | _height, | ||
| uint32_t | _depth, | ||
| size_t | pixel_size, | ||
| bool | generate_mip_maps | ||
| ) |
Constructor.
| initial_layout | The initial vk::ImageLayout of the Image. |
| usage_flags | vk::ImageUsageFlags specifying how the image will be used. |
| vma_memory_usage | VmaMemoryUsage flags to pass to the Vulkan memory allocator library when allocating the image. |
| _width | The width of the image. |
| _height | The height of the image. |
| _depth | The depth of the image. |
| pixel_size | The data size of a single pixel in the image. |
| void VulkanEngine::Image< format, image_type, tiling, sample_count_flags >::createImageView | ( | vk::ImageViewType | image_view_type, |
| vk::ImageAspectFlags | image_aspect_flags | ||
| ) |
Create vk::ImageView.
| image_view_type | The type of image view. |
| image_aspect_flags | Image aspect flags. |
|
protectedvirtual |
Implements VulkanEngine::StagedBufferDestination.
|
virtual |
Get the interal vulkan image.
Implements VulkanEngine::ImageBase.
|
virtual |
Get the vk::ImageView.
Implements VulkanEngine::ImageBase.
|
protectedvirtual |
Overridden to handle tranferring data from a StagedBuffer to this Image.
| command_buffers | The command buffer to insert the command into. |
| source_buffer | The source vk::Buffer in the StagedBuffer. |
Implements VulkanEngine::StagedBufferDestination.
| void VulkanEngine::Image< format, image_type, tiling, sample_count_flags >::setImageData | ( | const void * | data | ) |
Sets the image data from the given pointer.
| data | Pointer to the image data. |
| void VulkanEngine::Image< format, image_type, tiling, sample_count_flags >::transitionImageLayout | ( | vk::ImageLayout | new_layout, |
| const vk::CommandBuffer & | command_buffer = nullptr |
||
| ) |
Transition the image from one vk::ImageLayout to another given by new layout by adding a vk::ImageMemoryBarrier to the command_buffer.
| new_layout | The new layout to transition to. |
| command_buffer | The command buffer to add the command to. One will be created and added to the graphics queue if not specified. |
|
protected |
The current vk::ImageLayout.