Search Results for

    Show / Hide Table of Contents

    Class WGPUTexture

    This class represents a native texture object on WebGPU.

    Inheritance
    object
    GraphicsResource
    Texture
    WGPUTexture
    Implements
    ILoadable
    IDependencyObject
    Inherited Members
    Texture.Id
    Texture.Description
    Texture.ReaderVersion
    Texture.Invalidated
    Texture.Dependencies
    Texture.Sampler
    Texture.CouldBeAttachedToFramebuffer
    Texture.Invalidate(ILoadable)
    Texture.ReleaseUnusedMemory()
    GraphicsResource.Context
    GraphicsResource.Disposed
    GraphicsResource.Dispose()
    GraphicsResource.Dispose(bool)
    Namespace: Evergine.WebGPU
    Assembly: Evergine.WebGPU.dll
    Syntax
    public class WGPUTexture : Texture, ILoadable, IDependencyObject

    Constructors

    WGPUTexture(WGPUGraphicsContext, DataBox[], ref TextureDescription)

    Initializes a new instance of the WGPUTexture class.

    Declaration
    public WGPUTexture(WGPUGraphicsContext context, DataBox[] data, ref TextureDescription description)
    Parameters
    Type Name Description
    WGPUGraphicsContext context

    The graphics context.

    DataBox[] data

    The data pointer.

    TextureDescription description

    The texture description.

    WGPUTexture(WGPUGraphicsContext, DataBox[], ref TextureDescription, ref SamplerStateDescription)

    Initializes a new instance of the WGPUTexture class.

    Declaration
    public WGPUTexture(WGPUGraphicsContext context, DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState)
    Parameters
    Type Name Description
    WGPUGraphicsContext context

    The graphics context.

    DataBox[] data

    The data pointer.

    TextureDescription description

    The texture description.

    SamplerStateDescription samplerState

    the sampler state description for this texture.

    Fields

    NativeBuffer

    The native buffer object for staging textures.

    Declaration
    public WGPUBuffer NativeBuffer
    Field Value
    Type Description
    WGPUBuffer

    NativeTexture

    The native texture object.

    Declaration
    public WGPUTexture NativeTexture
    Field Value
    Type Description
    WGPUTexture

    PixelFormat

    The native pixelformat of this texture.

    Declaration
    public WGPUTextureFormat PixelFormat
    Field Value
    Type Description
    WGPUTextureFormat

    Properties

    Name

    Gets or sets a string identifying this instance. Can be used in graphics debugger tools.

    Declaration
    public override string Name { get; set; }
    Property Value
    Type Description
    string
    Overrides
    Texture.Name

    NativePointer

    Gets the native pointer.

    Declaration
    public override nint NativePointer { get; }
    Property Value
    Type Description
    nint
    Overrides
    GraphicsResource.NativePointer

    TextureView

    Gets a generic texture view of this texture.

    Declaration
    public WGPUTextureView TextureView { get; }
    Property Value
    Type Description
    WGPUTextureView

    Methods

    CopyTo(WGPUCommandEncoder, 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(WGPUCommandEncoder commandEncoder, 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
    WGPUCommandEncoder commandEncoder

    The copy commandbuffer.

    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.

    Destroy()

    Destroy graphics native resources.

    Declaration
    protected override void Destroy()
    Overrides
    Texture.Destroy()

    FromWebGPUImage(WGPUGraphicsContext, ref TextureDescription, WGPUTexture)

    Create a new texture from a WGPUTexture.

    Declaration
    public static WGPUTexture FromWebGPUImage(WGPUGraphicsContext context, ref TextureDescription description, WGPUTexture image)
    Parameters
    Type Name Description
    WGPUGraphicsContext context

    The graphics context.

    TextureDescription description

    The texture description.

    WGPUTexture image

    The metal image already created.

    Returns
    Type Description
    WGPUTexture

    A new WGPUTexture.

    SetData(WGPUCommandEncoder, nint, uint, uint)

    Fill the buffer from a pointer.

    Declaration
    public void SetData(WGPUCommandEncoder commandBuffer, nint source, uint sourceSizeInBytes, uint subResource = 0)
    Parameters
    Type Name Description
    WGPUCommandEncoder commandBuffer

    The copy commandbuffer.

    nint source

    The data pointer.

    uint sourceSizeInBytes

    The size in bytes.

    uint subResource

    The subresource index.

    ToStaging()

    Return a new Buffer with ResourceUsage set to staging.

    Declaration
    public WGPUTexture ToStaging()
    Returns
    Type Description
    WGPUTexture

    New staging Buffer.

    Implements

    ILoadable
    IDependencyObject

    Extension Methods

    TextureExtension.SaveToFile(Texture, GraphicsContext, string)
    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX