Plasma Engine  2.0
Loading...
Searching...
No Matches
plGALTextureVulkan Class Reference
Inheritance diagram for plGALTextureVulkan:

Classes

struct  SubResourceOffset
 

Public Types

enum class  StagingMode : plUInt8 { None , Buffer , Texture , TextureAndBuffer }
 

Public Member Functions

PL_ALWAYS_INLINE vk::Image GetImage () const
 
PL_ALWAYS_INLINE vk::Format GetImageFormat () const
 
PL_ALWAYS_INLINE vk::ImageLayout GetPreferredLayout () const
 
PL_ALWAYS_INLINE vk::ImageLayout GetPreferredLayout (vk::ImageLayout targetLayout) const
 
PL_ALWAYS_INLINE vk::PipelineStageFlags GetUsedByPipelineStage () const
 
PL_ALWAYS_INLINE vk::AccessFlags GetAccessMask () const
 
PL_ALWAYS_INLINE plVulkanAllocation GetAllocation () const
 
PL_ALWAYS_INLINE const plVulkanAllocationInfoGetAllocationInfo () const
 
PL_ALWAYS_INLINE bool IsLinearLayout () const
 
vk::Extent3D GetMipLevelSize (plUInt32 uiMipLevel) const
 
vk::ImageSubresourceRange GetFullRange () const
 
vk::ImageAspectFlags GetAspectMask () const
 
PL_ALWAYS_INLINE StagingMode GetStagingMode () const
 
PL_ALWAYS_INLINE plGALTextureHandle GetStagingTexture () const
 
PL_ALWAYS_INLINE plGALBufferHandle GetStagingBuffer () const
 
plUInt32 ComputeSubResourceOffsets (plDynamicArray< SubResourceOffset > &out_subResourceOffsets) const
 
- Public Member Functions inherited from plGALResource< plGALTextureCreationDescription >
PL_ALWAYS_INLINE plGALResource (const plGALTextureCreationDescription &description)
 
PL_ALWAYS_INLINE const plGALTextureCreationDescriptionGetDescription () const
 
- Public Member Functions inherited from plGALResourceBase
void SetDebugName (const char *szName) const
 
virtual const plGALResourceBaseGetParentResource () const
 
- Public Member Functions inherited from plRefCounted
virtual ~plRefCounted ()=default
 Adds a virtual destructor.
 
- Public Member Functions inherited from plRefCountingImpl
 plRefCountingImpl ()=default
 Constructor.
 
 plRefCountingImpl (const plRefCountingImpl &rhs)
 
void operator= (const plRefCountingImpl &rhs)
 
plInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
 
plInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.
 
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
 
plInt32 GetRefCount () const
 Returns the current reference count.
 

Protected Member Functions

 plGALTextureVulkan (const plGALTextureCreationDescription &Description, bool bLinearCPU, bool bStaging)
 
virtual plResult InitPlatform (plGALDevice *pDevice, plArrayPtr< plGALSystemMemoryDescription > pInitialData) override
 
virtual plResult DeInitPlatform (plGALDevice *pDevice) override
 
virtual void SetDebugNamePlatform (const char *szName) const override
 
plResult CreateStagingBuffer (const vk::ImageCreateInfo &createInfo)
 
- Protected Member Functions inherited from plGALTexture
 plGALTexture (const plGALTextureCreationDescription &Description)
 

Static Protected Member Functions

static vk::Format ComputeImageFormat (plGALDeviceVulkan *pDevice, plEnum< plGALResourceFormat > galFormat, vk::ImageCreateInfo &ref_createInfo, vk::ImageFormatListCreateInfo &ref_imageFormats, bool bStaging)
 
static void ComputeCreateInfo (plGALDeviceVulkan *pDevice, const plGALTextureCreationDescription &description, vk::ImageCreateInfo &ref_createInfo, vk::PipelineStageFlags &ref_stages, vk::AccessFlags &ref_access, vk::ImageLayout &ref_preferredLayout)
 
static void ComputeCreateInfoLinear (vk::ImageCreateInfo &ref_createInfo, vk::PipelineStageFlags &ref_stages, vk::AccessFlags &ref_access)
 
static void ComputeAllocInfo (bool bLinearCPU, plVulkanAllocationCreateInfo &ref_allocInfo)
 
static StagingMode ComputeStagingMode (plGALDeviceVulkan *pDevice, const plGALTextureCreationDescription &description, const vk::ImageCreateInfo &createInfo)
 

Protected Attributes

vk::Image m_image
 
vk::Format m_imageFormat = vk::Format::eUndefined
 
vk::ImageLayout m_preferredLayout = vk::ImageLayout::eUndefined
 
vk::PipelineStageFlags m_stages = {}
 
vk::AccessFlags m_access = {}
 
plVulkanAllocation m_alloc = nullptr
 
plVulkanAllocationInfo m_allocInfo
 
plGALDeviceVulkanm_pDevice = nullptr
 
bool m_bLinearCPU = false
 
bool m_bStaging = false
 
StagingMode m_stagingMode = StagingMode::None
 
plGALTextureHandle m_hStagingTexture
 
plGALBufferHandle m_hStagingBuffer
 
- Protected Attributes inherited from plGALTexture
plGALTextureResourceViewHandle m_hDefaultResourceView
 
plGALRenderTargetViewHandle m_hDefaultRenderTargetView
 
plHashTable< plUInt32, plGALTextureResourceViewHandlem_ResourceViews
 
plHashTable< plUInt32, plGALRenderTargetViewHandlem_RenderTargetViews
 
plHashTable< plUInt32, plGALTextureUnorderedAccessViewHandlem_UnorderedAccessViews
 
- Protected Attributes inherited from plGALResource< plGALTextureCreationDescription >
const plGALTextureCreationDescription m_Description
 

Friends

class plGALDeviceVulkan
 
class plMemoryUtils
 

Member Enumeration Documentation

◆ StagingMode

enum class plGALTextureVulkan::StagingMode : plUInt8
strong
Enumerator
Buffer 

We can use vkCopyImageToBuffer to a CPU buffer.

Texture 

Formats differ and we need to render to a linear CPU texture to do the conversion.

TextureAndBuffer 

Formats differ and linear texture can't be rendered to. Render to optimal layout GPU texture and then use vkCopyImageToBuffer to CPU buffer.

Member Function Documentation

◆ DeInitPlatform()

plResult plGALTextureVulkan::DeInitPlatform ( plGALDevice * pDevice)
overrideprotectedvirtual

Implements plGALTexture.

◆ InitPlatform()

plResult plGALTextureVulkan::InitPlatform ( plGALDevice * pDevice,
plArrayPtr< plGALSystemMemoryDescription > pInitialData )
overrideprotectedvirtual

Implements plGALTexture.

◆ SetDebugNamePlatform()

void plGALTextureVulkan::SetDebugNamePlatform ( const char * szName) const
overrideprotectedvirtual

Implements plGALResourceBase.


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