Vookoo
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vku::GenericImage Class Reference

#include <vku.hpp>

Inheritance diagram for vku::GenericImage:
vku::ColorAttachmentImage vku::DepthStencilImage vku::TextureImage2D vku::TextureImageCube

Classes

struct  State
 

Public Member Functions

 GenericImage (vk::Device device, const vk::PhysicalDeviceMemoryProperties &memprops, const vk::ImageCreateInfo &info, vk::ImageViewType viewType, vk::ImageAspectFlags aspectMask, bool makeHostImage)
 
vk::Image image () const
 
vk::ImageView imageView () const
 
vk::DeviceMemory mem () const
 
void clear (vk::CommandBuffer cb, const std::array< float, 4 > colour={1, 1, 1, 1})
 Clear the colour of an image.
 
void update (vk::Device device, const void *data, vk::DeviceSize bytesPerPixel)
 Update the image with an array of pixels. (Currently 2D only)
 
void copy (vk::CommandBuffer cb, vku::GenericImage &srcImage)
 Copy another image to this one. This also changes the layout.
 
void copy (vk::CommandBuffer cb, vk::Buffer buffer, uint32_t mipLevel, uint32_t arrayLayer, uint32_t width, uint32_t height, uint32_t depth, uint32_t offset)
 Copy a subimage in a buffer to this image.
 
void upload (vk::Device device, std::vector< uint8_t > &bytes, vk::CommandPool commandPool, vk::PhysicalDeviceMemoryProperties memprops, vk::Queue queue)
 
void setLayout (vk::CommandBuffer cb, vk::ImageLayout newLayout, vk::ImageAspectFlags aspectMask=vk::ImageAspectFlagBits::eColor)
 Change the layout of this image using a memory barrier.
 
void setCurrentLayout (vk::ImageLayout oldLayout)
 Set what the image thinks is its current layout (ie. the old layout in an image barrier).
 
vk::Format format () const
 
vk::Extent3D extent () const
 
const vk::ImageCreateInfo & info () const
 

Protected Member Functions

void create (vk::Device device, const vk::PhysicalDeviceMemoryProperties &memprops, const vk::ImageCreateInfo &info, vk::ImageViewType viewType, vk::ImageAspectFlags aspectMask, bool hostImage)
 

Protected Attributes

State s
 

Detailed Description

Generic image with a view and memory object. Vulkan images need a memory object to hold the data and a view object for the GPU to access the data.


The documentation for this class was generated from the following file: