Class GPUTextureVulkan
Texture object for Vulkan backend.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.h
Syntax
public class GPUTextureVulkan : public GPUResourceVulkan, public ResourceOwnerVulkan, public DescriptorOwnerResourceVulkan
Constructors
GPUTextureVulkan(GPUDeviceVulkan* device, const StringView& name)
Initializes a new instance of the GPUTextureVulkan class.
Declaration
public GPUTextureVulkan(GPUDeviceVulkan* device, const StringView& name)
Parameters
GPUDeviceVulkan
device
The device. |
StringView
name
The resource name. |
Fields
DefaultAspectMask
The default aspect mask flags for the texture (all planes).
Declaration
public VkImageAspectFlags DefaultAspectMask
Field Value
VkImageAspectFlags
|
StagingBuffer
The Vulkan staging buffer (used by the staging textures for memory transfers).
Declaration
public GPUBufferVulkan* StagingBuffer = nullptr
Field Value
GPUBufferVulkan
|
Methods
AsGPUResource()
Gets resource owner object as a GPUResource type or returns null if cannot perform cast.
Declaration
public virtual GPUResource* AsGPUResource() const override
Returns
GPUResource
GPU Resource or null if cannot cast. |
Overrides
DescriptorAsStorageImage(GPUContextVulkan* context, VkImageView& imageView, VkImageLayout& layout)
Gets the storage image descriptor (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE).
Declaration
public virtual void DescriptorAsStorageImage(GPUContextVulkan* context, VkImageView& imageView, VkImageLayout& layout) override
Parameters
GPUContextVulkan
context
The GPU context. Can be used to add memory barriers to the pipeline before binding the descriptor to the pipeline. |
VkImageView
imageView
The image view. |
VkImageLayout
layout
The image layout. |
Overrides
GetData(int32 arrayIndex, int32 mipMapIndex, TextureMipData& data, uint32 mipRowPitch)
Gets texture mipmap data (raw bytes). Can be used only with textures created with Staging flag.
Declaration
public virtual bool GetData(int32 arrayIndex, int32 mipMapIndex, TextureMipData& data, uint32 mipRowPitch) override
Parameters
int32
arrayIndex
Array slice index. |
int32
mipMapIndex
Mip map index. |
TextureMipData
data
Output mip data. |
uint32
mipRowPitch
Output mip data row pitch to use. Use 0 to use the pitch from the internal GPU storage. |
Returns
bool
True if failed, otherwise false. |
Overrides
GetHandle()
Gets the Vulkan image handle.
Declaration
public VkImage GetHandle() const
Returns
VkImage
|
GetNativePtr()
Gets the native pointer to the underlying resource. It's a low-level platform-specific handle.
Declaration
public virtual void* GetNativePtr() const override
Returns
void
The pointer. |
Overrides
OnInit()
OnReleaseGPU()
Releases GPU resource data (implementation).
Declaration
protected virtual void OnReleaseGPU() override
Overrides
OnResidentMipsChanged()
Declaration
protected virtual void OnResidentMipsChanged() override
Overrides
View(int32 arrayOrDepthIndex)
Gets the view to the surface at index in an array.
To use per depth/array slice view you need to specify the GPUTextureFlags.PerSliceViews when creating the resource.
Declaration
public virtual GPUTextureView* View(int32 arrayOrDepthIndex) const override
Parameters
int32
arrayOrDepthIndex
The index of the surface in an array (or depth slice index). |
Returns
GPUTextureView
The view to the surface at index in an array. |
Overrides
View(int32 arrayOrDepthIndex, int32 mipMapIndex)
Gets the view to the mip map surface at index in an array.
To use per mip map view you need to specify the GPUTextureFlags.PerMipViews when creating the resource.
Declaration
public virtual GPUTextureView* View(int32 arrayOrDepthIndex, int32 mipMapIndex) const override
Parameters
int32
arrayOrDepthIndex
The index of the surface in an array (or depth slice index). |
int32
mipMapIndex
Index of the mip level. |
Returns
GPUTextureView
The view to the surface at index in an array. |
Overrides
ViewArray()
Gets the view to the array of surfaces
To use array texture view you need to create render target as an array.
Declaration
public virtual GPUTextureView* ViewArray() const override
Returns
GPUTextureView
The view to the array of surfaces. |
Overrides
ViewReadOnlyDepth()
Gets the view to the texture as read-only depth/stencil buffer. Valid only if graphics device supports it and the texture uses depth/stencil.
Declaration
public virtual GPUTextureView* ViewReadOnlyDepth() const override
Returns
GPUTextureView
The view to the depth-stencil resource descriptor as read-only depth. |
Overrides
ViewVolume()
Gets the view to the volume texture (3D).
To use volume texture view you need to create render target as a volume resource (3D texture with Depth> 1).
Declaration
public virtual GPUTextureView* ViewVolume() const override
Returns
GPUTextureView
The view to the volume texture. |