|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/RenderAPI/Vulkan/VKImage.hpp>
Public Types | |
| using | Allocator = VKObjectAllocator |
An allocator type used to allocate new VKImage instances from a memory pool. | |
Public Types inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource > | |
| using | Descriptor = GPUImageDescriptor |
| An type-alias to the descriptor struct type. | |
Static Public Member Functions | |
| static Allocator & | getAllocator () noexcept |
Returns the allocator for VKImage. | |
| static void * | operator new (size_t size) noexcept |
Allocates memory for a new instance of VKImage. | |
| static void | operator delete (void *p, std::size_t size) noexcept |
Deletes memory for an instance of VKImage. | |
Static Public Member Functions inherited from CeresEngine::GPUImage | |
| static UInt32 | numMipLevels (UInt32 width, UInt32 height=1, UInt32 depth=1) noexcept |
| Returns the number of MIP-map levels for a image with the specified size. | |
| static UInt32 | numMipLevels (const GPUImageDescriptor &imageDesc) noexcept |
| Returns the number of MIP-map levels for the specified image descriptor. | |
| static UInt32 | bufferSize (Format format, UInt32 numTexels) noexcept |
| Returns the required buffer size (in bytes) of a image with the specified hardware format and number of texels. | |
| static UInt32 | size (const GPUImageDescriptor &imageDesc) noexcept |
| static bool | isMipMapped (const GPUImageDescriptor &imageDesc) noexcept |
| Returns true if the specified image descriptor describes a image with MIP-mapping enabled. | |
| static bool | isArray (GPUImageType type) noexcept |
| Returns true if the specified image type is an array image. | |
| static bool | isMultiSample (GPUImageType type) noexcept |
| Returns true if the specified image type is a multi-sample image. | |
| static bool | isCube (GPUImageType type) noexcept |
| Returns true if the specified image type is a cube image. | |
Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType > | |
| static RC< ChildTypeName > | cast (const RC< ParentType > &ptr) |
Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName. | |
| static ChildTypeName & | cast (ParentType &object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static const ChildTypeName & | cast (const ParentType &object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static ChildTypeName * | cast (ParentType *object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static const ChildTypeName * | cast (const ParentType *object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
Static Public Member Functions inherited from CeresEngine::VKObjectBase | |
| static void * | operator new (size_t size) noexcept |
| static void | operator delete (void *p, std::size_t sz) noexcept |
Private Types | |
| using | super = GPUImage |
Private Member Functions | |
| void | transitionImageLayout (VkCommandBuffer commandBuffer, VkImageLayout oldLayout, VkImageLayout newLayout, UInt32 mipLevel, UInt32 layer) |
Private Attributes | |
| const GPUImageDescriptor | mDescriptor |
| A structure that describes the and it's properties. | |
| VkImage | mImage = VK_NULL_HANDLE |
| The Vulkan image object. | |
| VKMemoryAllocation | mImageMemory |
| The allocated memory. | |
| VkDeviceSize | mSize = 0 |
| The image size. | |
| VkFormat | mFormat |
| The Vulkan image format. | |
| bool | mOwns = true |
A flag indicating if the VKImage objects owns the mImage instance. | |
| VKImageViewCache | mImageViews |
| A cache of all active image views. | |
| SmallVector< VkImageLayout, 10 > | mLayouts |
| VKSwapchain * | mSwapchain = nullptr |
| If the image belongs to a swapchain, points to the owning swapchain. | |
Friends | |
| class | VKImageView |
Additional Inherited Members | |
Public Attributes inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource > | |
| const Descriptor & | descriptor |
| A structure that describes the object and it's properties. | |
Public Attributes inherited from CeresEngine::GPUDeviceObject | |
| GPUDevice & | device |
| The owning device this object was created from. | |
Public Attributes inherited from CeresEngine::VKDeviceObjectBase | |
| VKDevice & | deviceVK |
The owning VKDevice instance. | |
Protected Member Functions inherited from CeresEngine::GPUObject | |
| virtual void | destroy () noexcept |
| A internal method called by the system when the object reference count reaches zero. | |
Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKImage, GPUImage > | |
| VKDeviceObject (VKDevice &device) noexcept | |
Creates a new VKDeviceObject from the given device. | |
An allocator type used to allocate new VKImage instances from a memory pool.
|
private |
| CeresEngine::VKImage::VKImage | ( | VKDevice & | device, |
| const GPUImageDescriptor & | descriptor | ||
| ) |
| CeresEngine::VKImage::VKImage | ( | VKDevice & | device, |
| const GPUImageDescriptor & | descriptor, | ||
| VkImage | existingImage, | ||
| VKSwapchain * | swapchain | ||
| ) |
|
final |
|
finalvirtual |
Implements CeresEngine::GPUImage.
| void CeresEngine::VKImage::generateMips | ( | VkCommandBuffer | commandBuffer | ) |
Generates the whole mipmap chain.
| commandBuffer | The command buffer to execute the operation on |
Returns the allocator for VKImage.
| VkImageLayout CeresEngine::VKImage::getLayout | ( | UInt32 | mipLevel, |
| UInt32 | layer = 0 |
||
| ) | const |
| UInt32 CeresEngine::VKImage::getMipLevels | ( | ) | const |
|
inlinenoexcept |
If the image belongs to a swapchain, points to the owning swapchain.
Deletes memory for an instance of VKImage.
Allocates memory for a new instance of VKImage.
|
inlinenoexcept |
The Vulkan image object.
| void CeresEngine::VKImage::setLayout | ( | VkImageLayout | newLayout, |
| const GPUImageSubresource & | subresource | ||
| ) |
| void CeresEngine::VKImage::setLayout | ( | VkImageLayout | newLayout, |
| UInt32 | mipLevel, | ||
| UInt32 | layer = 0 |
||
| ) |
|
inline |
|
inline |
| void CeresEngine::VKImage::transitionImageLayout | ( | VkCommandBuffer | commandBuffer, |
| VkImageLayout | newLayout, | ||
| const GPUImageSubresource & | subresource | ||
| ) |
|
private |
|
friend |
|
private |
A structure that describes the and it's properties.
|
private |
The Vulkan image format.
|
private |
The Vulkan image object.
|
private |
The allocated memory.
|
private |
A cache of all active image views.
|
private |
A flag indicating if the VKImage objects owns the mImage instance.
If not owned, the VkImage is not freed on the destructor. Generally, this should only be used for swapchain images.
|
private |
The image size.
|
private |
If the image belongs to a swapchain, points to the owning swapchain.