SPARK
0.1.0
A general purpose game engine written in C++.
|
Vulkan implementation of IImage. More...
#include <VulkanImage.h>
Classes | |
struct | Impl |
Public Member Functions | |
VulkanImage (const VulkanDevice &device, VkImage image, const math::Vector3< unsigned > &extent, Format format, ImageDimensions dimensions, unsigned levels, unsigned layers, MultiSamplingLevel samples, bool writable, ImageLayout initial_layout, VmaAllocator allocator=nullptr, VmaAllocation allocation=nullptr, const std::string &name="") | |
Initializes a new VulkanImage. | |
VulkanImage (const VulkanImage &other)=delete | |
VulkanImage (VulkanImage &&other) noexcept=delete | |
VulkanImage & | operator= (const VulkanImage &other)=delete |
VulkanImage & | operator= (VulkanImage &&other) noexcept=delete |
VkImageAspectFlags | aspectMask () const noexcept override |
Gets the image aspect mask for all sub-resources. | |
VkImageAspectFlags | aspectMask (unsigned plane) const override |
Gets the image aspect mask for all sub-resources. | |
const VkImageView & | imageView (unsigned plane=0) const override |
Gets an image view for the given sub-resource. | |
unsigned | elements () const noexcept override |
Get the number of sub-resources in the memory chunk. | |
std::size_t | size () const noexcept override |
Gets the size (in bytes) of the memory chunk. | |
std::size_t | elementSize () const noexcept override |
Gets the size (in bytes) of one element in the memory chunk. If there is only one element, this equals the result of IDeviceMemory::size(). | |
std::size_t | elementAlignment () const override |
Gets the alignment of one element in the memory chunk. | |
std::size_t | alignedElementSize () const noexcept override |
Gets the real size (in bytes) of the memory chunk. | |
bool | writable () const noexcept override |
Checks if the resource can be bound to a read/write descriptor. | |
std::size_t | size (unsigned level) const override |
Gets the size (in bytes) of the memory chunk. | |
math::Vector3< unsigned > | extent (unsigned level) const noexcept override |
Get the extent of the image at the specified mip-map level. | |
Format | format () const noexcept override |
Gets the internal format of the image. | |
ImageDimensions | dimensions () const noexcept override |
Gets the dimensions of the image. (1D, 2D, 3D, Cube) | |
unsigned | levels () const noexcept override |
Gets the number of mip-map levels of the image. | |
unsigned | layers () const noexcept override |
Gets the number of layers of the image. | |
unsigned | planes () const noexcept override |
Returns the number of planes of the image. | |
MultiSamplingLevel | samples () const noexcept override |
Gets the number of samples with which the image is sampled. | |
ImageLayout | layout (unsigned sub_resource) const override |
Gets the layout of the image. | |
![]() | |
virtual VkImageAspectFlags | aspectMask (unsigned int plane=0) const =0 |
Gets the image aspect mask for the given sub-resource. | |
virtual const VkImageView & | imageView (unsigned int plane=0) const =0 |
Gets an image view for the given sub-resource. | |
![]() | |
virtual std::size_t | size (unsigned int level) const =0 |
Get the size of the image (in bytes) at the specified mip-map level. | |
virtual ImageLayout | layout (unsigned int sub_resource=0) const =0 |
Gets the layout of the image. | |
virtual unsigned int | subResourceId (unsigned &level, unsigned &layer, unsigned &plane) const noexcept |
Returns the sub-resource ID for a combination of mip-map level , array layer and plane . | |
std::tuple< unsigned, unsigned, unsigned > | resolveSubresource (const unsigned subresource) const noexcept |
Returns the sub-resource ID for a combination of mip-map level , array layer and plane . | |
![]() | |
Resource (VkImage handle) noexcept | |
Initializes the managed resource with the given handle. | |
Resource (const Resource &other)=delete | |
Resource (Resource &&other) noexcept=delete | |
Resource & | operator= (const Resource &other)=delete |
Resource & | operator= (Resource &&other) noexcept=delete |
const VkImage & | handle () const final |
Gets the managed resource handle. | |
![]() | |
StateResource (std::string_view name) noexcept | |
Initializes a new StateResource instance. | |
StateResource (const StateResource &other)=delete | |
StateResource (StateResource &&other) noexcept | |
StateResource & | operator= (const StateResource &other)=delete |
StateResource & | operator= (StateResource &&other) noexcept |
const std::string & | name () const noexcept final |
Gets the name of the state resource. | |
Static Public Member Functions | |
static std::unique_ptr< VulkanImage > | Allocate (const VulkanDevice &device, const math::Vector3< unsigned > &extent, Format format, ImageDimensions dimensions, unsigned levels, unsigned layers, MultiSamplingLevel samples, bool writable, ImageLayout initial_layout, VmaAllocator &allocator, const VkImageCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr) |
static std::unique_ptr< VulkanImage > | Allocate (const std::string &name, const VulkanDevice &device, const math::Vector3< unsigned > &extent, Format format, ImageDimensions dimensions, unsigned levels, unsigned layers, MultiSamplingLevel samples, bool writable, ImageLayout initial_layout, VmaAllocator &allocator, const VkImageCreateInfo &create_info, const VmaAllocationCreateInfo &allocation_info, VmaAllocationInfo *allocation_result=nullptr) |
Additional Inherited Members | |
![]() | |
using | handle_type |
![]() | |
VkImage & | handle () final |
Gets the managed resource handle. | |
![]() | |
StateResource () noexcept | |
Initializes a new StateResource instance with an empty name. | |
std::string & | name () noexcept |
Gets the name of the state resource. | |
Vulkan implementation of IImage.
|
explicit |
Initializes a new VulkanImage.
device | |
image | |
extent | |
format | |
dimensions | |
levels | |
layers | |
samples | |
writable | |
initial_layout | |
allocator | |
allocation | |
name |
|
nodiscardoverridevirtualnoexcept |
Gets the real size (in bytes) of the memory chunk.
Implements spark::render::IDeviceMemory.
|
static |
name | |
device | |
extent | |
format | |
dimensions | |
levels | |
layers | |
samples | |
writable | |
initial_layout | |
allocator | |
create_info | |
allocation_info | |
allocation_result |
|
static |
device | |
extent | |
format | |
dimensions | |
levels | |
layers | |
samples | |
writable | |
initial_layout | |
allocator | |
create_info | |
allocation_info | |
allocation_result |
|
nodiscardoverridevirtualnoexcept |
Gets the image aspect mask for all sub-resources.
Implements spark::render::vk::IVulkanImage.
|
nodiscardoverride |
Gets the image aspect mask for all sub-resources.
|
nodiscardoverridevirtualnoexcept |
Gets the dimensions of the image. (1D, 2D, 3D, Cube)
Implements spark::render::IImage.
|
nodiscardoverridevirtual |
Gets the alignment of one element in the memory chunk.
Implements spark::render::IDeviceMemory.
|
nodiscardoverridevirtualnoexcept |
Get the number of sub-resources in the memory chunk.
Implements spark::render::IDeviceMemory.
|
nodiscardoverridevirtualnoexcept |
Gets the size (in bytes) of one element in the memory chunk. If there is only one element, this equals the result of IDeviceMemory::size().
Implements spark::render::IDeviceMemory.
|
nodiscardoverridevirtualnoexcept |
Get the extent of the image at the specified mip-map level.
level | The mip-map level for which to get the extent. |
0
if the mip-map level is invalid.x
component. See ImageDimensions. Implements spark::render::IImage.
|
nodiscardoverridevirtualnoexcept |
Gets the internal format of the image.
Implements spark::render::IImage.
|
nodiscardoverride |
Gets an image view for the given sub-resource.
plane | The sub-resource index to get the image view for. |
|
nodiscardoverridevirtualnoexcept |
Gets the number of layers of the image.
Implements spark::render::IImage.
|
nodiscardoverride |
Gets the layout of the image.
sub_resource | The sub-resource id for which to get the layout. |
|
nodiscardoverridevirtualnoexcept |
Gets the number of mip-map levels of the image.
Implements spark::render::IImage.
|
nodiscardoverridevirtualnoexcept |
Returns the number of planes of the image.
Implements spark::render::IImage.
|
nodiscardoverridevirtualnoexcept |
Gets the number of samples with which the image is sampled.
Implements spark::render::IImage.
|
nodiscardoverridevirtualnoexcept |
Gets the size (in bytes) of the memory chunk.
Reimplemented from spark::render::IImage.
|
nodiscardoverride |
Gets the size (in bytes) of the memory chunk.
|
nodiscardoverridevirtualnoexcept |
Checks if the resource can be bound to a read/write descriptor.
true
if the resource can be bound to a read/write descriptor, false
otherwise.Implements spark::render::IDeviceMemory.