Class VKTexture
This class represents a native texture object on Metal.
Inherited Members
Namespace: Evergine.Vulkan
Assembly: Evergine.Vulkan.dll
Syntax
public class VKTexture : Texture, ILoadable, IDisposable, IDependencyObject
Constructors
VKTexture(VKGraphicsContext, DataBox[], ref TextureDescription)
Initializes a new instance of the VKTexture class.
Declaration
public VKTexture(VKGraphicsContext context, DataBox[] data, ref TextureDescription description)
Parameters
Type | Name | Description |
---|---|---|
VKGraphicsContext | context | The graphics context. |
DataBox[] | data | The data pointer. |
TextureDescription | description | The texture description. |
VKTexture(VKGraphicsContext, DataBox[], ref TextureDescription, ref SamplerStateDescription)
Initializes a new instance of the VKTexture class.
Declaration
public VKTexture(VKGraphicsContext context, DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState)
Parameters
Type | Name | Description |
---|---|---|
VKGraphicsContext | context | The graphics context. |
DataBox[] | data | The data pointer. |
TextureDescription | description | The texture description. |
SamplerStateDescription | samplerState | the sampler state description for this texture. |
Fields
BufferMemory
The native buffer memory linked with native buffer.
Declaration
public VkDeviceMemory BufferMemory
Field Value
Type | Description |
---|---|
VkDeviceMemory |
Format
The native pixel format for this texture.
Declaration
public VkFormat Format
Field Value
Type | Description |
---|---|
VkFormat |
ImageLayouts
The native Image layouts for this texture.
Declaration
public VkImageLayout[] ImageLayouts
Field Value
Type | Description |
---|---|
VkImageLayout[] |
ImageMemory
The native vulkan memory linked with native image.
Declaration
public VkDeviceMemory ImageMemory
Field Value
Type | Description |
---|---|
VkDeviceMemory |
MemoryRequirements
The memory requirements for this texture.
Declaration
public VkMemoryRequirements MemoryRequirements
Field Value
Type | Description |
---|---|
VkMemoryRequirements |
NativeBuffer
The native Vulkan buffer object used for staging textures.
Declaration
public VkBuffer NativeBuffer
Field Value
Type | Description |
---|---|
VkBuffer |
NativeImage
The native Vulkan image object.
Declaration
public VkImage NativeImage
Field Value
Type | Description |
---|---|
VkImage |
Properties
ImageView
Gets the vulkan image view.
Declaration
public VkImageView ImageView { get; }
Property Value
Type | Description |
---|---|
VkImageView |
Name
Gets or sets a string identifying this instance. Can be used in graphics debuggers tools.
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
NativePointer
Gets the native pointer.
Declaration
public override IntPtr NativePointer { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Overrides
Methods
Blit(VkCommandBuffer, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint)
Copy a pixel region from source to destination texture with format conversion and preparing to present in swapchain.
Declaration
public void Blit(VkCommandBuffer commandBuffer, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBaseArray, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArray, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
VkCommandBuffer | commandBuffer | The commandbuffer where execute. |
uint | sourceX | U coord source texture. |
uint | sourceY | V coord source texture. |
uint | sourceZ | W coord source texture. |
uint | sourceMipLevel | Source mip level. |
uint | sourceBaseArray | Source array index. |
Texture | destination | Destination texture. |
uint | destinationX | U coord destination texture. |
uint | destinationY | V coord destination texture. |
uint | destinationZ | W coord destination texture. |
uint | destinationMipLevel | Destination mip level. |
uint | destinationBasedArray | Destination array index. |
uint | layerCount | Destination layer count. |
CopyTo(VkCommandBuffer, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)
Copy a pixel region from source to destination texture.
Declaration
public void CopyTo(VkCommandBuffer commandBuffer, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBaseArray, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArray, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
VkCommandBuffer | commandBuffer | The commandbuffer where execute. |
uint | sourceX | U coord source texture. |
uint | sourceY | V coord source texture. |
uint | sourceZ | W coord source texture. |
uint | sourceMipLevel | Source mip level. |
uint | sourceBaseArray | Source array index. |
Texture | destination | Destination texture. |
uint | destinationX | U coord destination texture. |
uint | destinationY | V coord destination texture. |
uint | destinationZ | W coord destination texture. |
uint | destinationMipLevel | Destination mip level. |
uint | destinationBasedArray | Destination array index. |
uint | width | Destination width. |
uint | height | Destination heigh. |
uint | depth | Destination depth. |
uint | layerCount | Destination layer count. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
FromVulkanImage(VKGraphicsContext, ref TextureDescription, VkImage)
Create a new texture from a VKImage.
Declaration
public static VKTexture FromVulkanImage(VKGraphicsContext context, ref TextureDescription description, VkImage image)
Parameters
Type | Name | Description |
---|---|---|
VKGraphicsContext | context | The graphics context. |
TextureDescription | description | The texture description. |
VkImage | image | The vulkan image already created. |
Returns
Type | Description |
---|---|
VKTexture | A new VKTexture. |
SetData(VkCommandBuffer, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public void SetData(VkCommandBuffer commandBuffer, IntPtr source, uint sourceSizeInBytes, uint subResource = 0)
Parameters
Type | Name | Description |
---|---|---|
VkCommandBuffer | commandBuffer | The commandbuffer. |
IntPtr | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | subResource | The subresource index. |
SetImageLayout(uint, VkImageLayout)
The a new image layout based on subResource.
Declaration
public void SetImageLayout(uint subResource, VkImageLayout layout)
Parameters
Type | Name | Description |
---|---|---|
uint | subResource | The subResource index. |
VkImageLayout | layout | The new layout state. |
SetImageLayout(uint, uint, VkImageLayout)
The a new image layout.
Declaration
public void SetImageLayout(uint mipLevel, uint arrayLevel, VkImageLayout layout)
Parameters
Type | Name | Description |
---|---|---|
uint | mipLevel | The mipLevel of this texture. |
uint | arrayLevel | The arraylelvel of this texture. |
VkImageLayout | layout | The new layout to set. |
TransitionImageLayout(VkCommandBuffer, VkImageLayout, uint, uint, uint, uint)
Transition the images linked with this texture to a VKImageLayout state.
Declaration
public void TransitionImageLayout(VkCommandBuffer command, VkImageLayout newLayout, uint baseMiplevel, uint levelCount, uint baseArrayLayer, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
VkCommandBuffer | command | The command buffer to execute. |
VkImageLayout | newLayout | The new state layout. |
uint | baseMiplevel | The start mip level. |
uint | levelCount | The number of mip levels. |
uint | baseArrayLayer | The start array layer. |
uint | layerCount | The number of array layers. |