Search Results for

    Show / Hide Table of Contents

    Class ResourceFactory

    This Factory allows creating GPU device resources.

    Inheritance
    object
    ResourceFactory
    DX11ResourceFactory
    DX12ResourceFactory
    MTLResourceFactory
    GLResourceFactory
    VKResourceFactory
    WGPUResourceFactory
    Namespace: Evergine.Common.Graphics
    Assembly: Evergine.Common.dll
    Syntax
    public abstract class ResourceFactory

    Properties

    GraphicsContext

    Gets the generic graphics context.

    Declaration
    protected abstract GraphicsContext GraphicsContext { get; }
    Property Value
    Type Description
    GraphicsContext

    Methods

    CreateBuffer(ref BufferDescription, string)

    Creates a Buffer instance.

    Declaration
    public Buffer CreateBuffer(ref BufferDescription description, string debugName = null)
    Parameters
    Type Name Description
    BufferDescription description

    The index buffer description.

    string debugName

    The buffer name (for debug purposes).

    Returns
    Type Description
    Buffer

    The new buffer.

    CreateBuffer(nint, ref BufferDescription, string)

    Creates a Buffer instance.

    Declaration
    public Buffer CreateBuffer(nint data, ref BufferDescription description, string debugName = null)
    Parameters
    Type Name Description
    nint data

    Pointer to the data.

    BufferDescription description

    The index buffer description.

    string debugName

    The buffer name for debugging purposes.

    Returns
    Type Description
    Buffer

    The new buffer.

    CreateBufferInternal(nint, ref BufferDescription)

    Creates a Buffer instance.

    Declaration
    protected abstract Buffer CreateBufferInternal(nint data, ref BufferDescription description)
    Parameters
    Type Name Description
    nint data

    Pointer to the data.

    BufferDescription description

    The description of the index buffer.

    Returns
    Type Description
    Buffer

    The new buffer.

    CreateBuffer<T>(ref T, ref BufferDescription, string)

    Creates a Buffer instance.

    Declaration
    public Buffer CreateBuffer<T>(ref T data, ref BufferDescription description, string debugName = null) where T : struct
    Parameters
    Type Name Description
    T data

    The data reference.

    BufferDescription description

    The index buffer description.

    string debugName

    The buffer name (for debugging purposes).

    Returns
    Type Description
    Buffer

    The new buffer.

    Type Parameters
    Name Description
    T

    The data type.

    CreateBuffer<T>(T[], ref BufferDescription, string)

    Creates a Buffer instance.

    Declaration
    public Buffer CreateBuffer<T>(T[] data, ref BufferDescription description, string debugName = null) where T : struct
    Parameters
    Type Name Description
    T[] data

    The data array.

    BufferDescription description

    The index buffer description.

    string debugName

    The buffer name (for debugging purposes).

    Returns
    Type Description
    Buffer

    The new buffer.

    Type Parameters
    Name Description
    T

    The data type.

    CreateCommandQueue(CommandQueueType)

    Creates a CommandQueue instance.

    Declaration
    public CommandQueue CreateCommandQueue(CommandQueueType queueType = CommandQueueType.Graphics)
    Parameters
    Type Name Description
    CommandQueueType queueType

    The command queue type, CommandQueueType.

    Returns
    Type Description
    CommandQueue

    The new command queue.

    CreateCommandQueueInternal(CommandQueueType)

    Creates a CommandQueue instance.

    Declaration
    protected abstract CommandQueue CreateCommandQueueInternal(CommandQueueType queueType = CommandQueueType.Graphics)
    Parameters
    Type Name Description
    CommandQueueType queueType

    The command queue type, CommandQueueType.

    Returns
    Type Description
    CommandQueue

    The new command queue.

    CreateComputePipeline(ref ComputePipelineDescription)

    Creates a ComputePipelineState instance.

    Declaration
    public ComputePipelineState CreateComputePipeline(ref ComputePipelineDescription description)
    Parameters
    Type Name Description
    ComputePipelineDescription description

    The compute pipeline state description.

    Returns
    Type Description
    ComputePipelineState

    The new pipeline state.

    CreateComputePipelineInternal(ref ComputePipelineDescription)

    Creates a ComputePipelineState instance.

    Declaration
    protected abstract ComputePipelineState CreateComputePipelineInternal(ref ComputePipelineDescription description)
    Parameters
    Type Name Description
    ComputePipelineDescription description

    The compute pipeline state description.

    Returns
    Type Description
    ComputePipelineState

    The new pipeline state.

    CreateFrameBuffer(FrameBufferAttachment?, FrameBufferAttachment[], bool)

    Creates a FrameBuffer instance.

    Declaration
    public FrameBuffer CreateFrameBuffer(FrameBufferAttachment? depthTarget, FrameBufferAttachment[] colorTargets, bool disposeAttachments = true)
    Parameters
    Type Name Description
    FrameBufferAttachment? depthTarget

    The depth FrameBufferAttachment which must have been created with the DepthStencil flag.

    FrameBufferAttachment[] colorTargets

    The array of color FrameBufferAttachment, all of which must have been created with the RenderTarget flags.

    bool disposeAttachments

    When this framebuffer is disposed, dispose of the attachment textures too.

    Returns
    Type Description
    FrameBuffer

    The new framebuffer.

    CreateFrameBuffer(uint, uint, PixelFormat, PixelFormat, string)

    Creates a FrameBuffer instance.

    Declaration
    public FrameBuffer CreateFrameBuffer(uint width, uint height, PixelFormat colorTargetPixelFormat = PixelFormat.R8G8B8A8_UNorm, PixelFormat depthTargetPixelFormat = PixelFormat.D24_UNorm_S8_UInt, string debugName = null)
    Parameters
    Type Name Description
    uint width

    The width of the underlying textures.

    uint height

    The height of the underlying textures.

    PixelFormat colorTargetPixelFormat

    The pixel format of the color target.

    PixelFormat depthTargetPixelFormat

    The pixel format of the depth target.

    string debugName

    The framebuffer textures' names (for debugging purposes).

    Returns
    Type Description
    FrameBuffer

    The new framebuffer.

    CreateFrameBufferInternal(FrameBufferAttachment?, FrameBufferAttachment[], bool)

    Creates a FrameBuffer instance.

    Declaration
    protected abstract FrameBuffer CreateFrameBufferInternal(FrameBufferAttachment? depthTarget, FrameBufferAttachment[] colorTargets, bool disposeAttachments)
    Parameters
    Type Name Description
    FrameBufferAttachment? depthTarget

    The depth FrameBufferAttachment which must have been created with the DepthStencil flag.

    FrameBufferAttachment[] colorTargets

    The array of color FrameBufferAttachment, all of which must have been created with the RenderTarget flags.

    bool disposeAttachments

    When this framebuffer is disposed, disposes the attachment textures too.

    Returns
    Type Description
    FrameBuffer

    The new framebuffer.

    CreateGraphicsPipeline(ref GraphicsPipelineDescription)

    Creates a GraphicsPipelineState instance.

    Declaration
    public GraphicsPipelineState CreateGraphicsPipeline(ref GraphicsPipelineDescription description)
    Parameters
    Type Name Description
    GraphicsPipelineDescription description

    The graphics pipeline state description.

    Returns
    Type Description
    GraphicsPipelineState

    The new pipeline state.

    CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription)

    Creates a GraphicsPipelineState instance.

    Declaration
    protected abstract GraphicsPipelineState CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription description)
    Parameters
    Type Name Description
    GraphicsPipelineDescription description

    The graphics pipeline state description.

    Returns
    Type Description
    GraphicsPipelineState

    The new pipeline state.

    CreateQueryHeap(ref QueryHeapDescription)

    Creates a QueryHeap instance.

    Declaration
    public abstract QueryHeap CreateQueryHeap(ref QueryHeapDescription description)
    Parameters
    Type Name Description
    QueryHeapDescription description

    The QueryHeap description.

    Returns
    Type Description
    QueryHeap

    The new QueryHeap.

    CreateRaytracingPipeline(ref RaytracingPipelineDescription)

    Creates a RaytracingPipelineState instance.

    Declaration
    public RaytracingPipelineState CreateRaytracingPipeline(ref RaytracingPipelineDescription description)
    Parameters
    Type Name Description
    RaytracingPipelineDescription description

    The raytracing pipeline state description.

    Returns
    Type Description
    RaytracingPipelineState

    The new pipeline state.

    CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription)

    Creates a RaytracingPipelineState instance.

    Declaration
    protected abstract RaytracingPipelineState CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription description)
    Parameters
    Type Name Description
    RaytracingPipelineDescription description

    The raytracing pipeline state description.

    Returns
    Type Description
    RaytracingPipelineState

    The new pipeline state.

    CreateResourceLayout(ref ResourceLayoutDescription)

    Creates a new ResourceLayout.

    Declaration
    public ResourceLayout CreateResourceLayout(ref ResourceLayoutDescription description)
    Parameters
    Type Name Description
    ResourceLayoutDescription description

    The description for all elements in this new ResourceLayout.

    Returns
    Type Description
    ResourceLayout

    A new ResourceLayout object.

    CreateResourceLayoutInternal(ref ResourceLayoutDescription)

    Creates a new ResourceLayout.

    Declaration
    protected abstract ResourceLayout CreateResourceLayoutInternal(ref ResourceLayoutDescription description)
    Parameters
    Type Name Description
    ResourceLayoutDescription description

    The description of all elements in this new ResourceLayout.

    Returns
    Type Description
    ResourceLayout

    A new ResourceLayout object.

    CreateResourceSet(ref ResourceSetDescription)

    Creates a new ResourceSet.

    Declaration
    public ResourceSet CreateResourceSet(ref ResourceSetDescription description)
    Parameters
    Type Name Description
    ResourceSetDescription description

    The description for all elements in this new ResourceSet.

    Returns
    Type Description
    ResourceSet

    A new ResourceSet object.

    CreateResourceSetInternal(ref ResourceSetDescription)

    Creates a new ResourceSet.

    Declaration
    protected abstract ResourceSet CreateResourceSetInternal(ref ResourceSetDescription description)
    Parameters
    Type Name Description
    ResourceSetDescription description

    The description for all elements in this new ResourceSet.

    Returns
    Type Description
    ResourceSet

    A new ResourceSet object.

    CreateSamplerState(ref SamplerStateDescription)

    Creates a SamplerState instance.

    Declaration
    public SamplerState CreateSamplerState(ref SamplerStateDescription description)
    Parameters
    Type Name Description
    SamplerStateDescription description

    The sampler state description.

    Returns
    Type Description
    SamplerState

    The new sampler state.

    CreateSamplerStateInternal(ref SamplerStateDescription)

    Creates a SamplerState instance.

    Declaration
    protected abstract SamplerState CreateSamplerStateInternal(ref SamplerStateDescription description)
    Parameters
    Type Name Description
    SamplerStateDescription description

    The sampler state description.

    Returns
    Type Description
    SamplerState

    The new sampler state.

    CreateShader(ref ShaderDescription)

    Creates a Shader instance.

    Declaration
    public Shader CreateShader(ref ShaderDescription description)
    Parameters
    Type Name Description
    ShaderDescription description

    The shader description.

    Returns
    Type Description
    Shader

    The new shader.

    CreateShaderInternal(ref ShaderDescription)

    Creates a Shader instance.

    Declaration
    protected abstract Shader CreateShaderInternal(ref ShaderDescription description)
    Parameters
    Type Name Description
    ShaderDescription description

    The shader description.

    Returns
    Type Description
    Shader

    The new shader.

    CreateTexture(DataBox[], ref TextureDescription, ref SamplerStateDescription, string)

    Creates a Texture instance.

    Declaration
    public Texture CreateTexture(DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState, string debugName = null)
    Parameters
    Type Name Description
    DataBox[] data

    The texture data.

    TextureDescription description

    The texture description.

    SamplerStateDescription samplerState

    The sampler state description in the SamplerStateDescription struct.

    string debugName

    The texture name (for debugging purposes).

    Returns
    Type Description
    Texture

    The new texture.

    CreateTexture(DataBox[], ref TextureDescription, string)

    Creates a Texture instance.

    Declaration
    public Texture CreateTexture(DataBox[] data, ref TextureDescription description, string debugName = null)
    Parameters
    Type Name Description
    DataBox[] data

    The texture data.

    TextureDescription description

    The texture description.

    string debugName

    The texture name (for debug purposes).

    Returns
    Type Description
    Texture

    The new Texture1D instance.

    CreateTexture(ref TextureDescription, string)

    Creates a Texture instance.

    Declaration
    public Texture CreateTexture(ref TextureDescription description, string debugName = null)
    Parameters
    Type Name Description
    TextureDescription description

    The texture description.

    string debugName

    The texture name (for debug purposes).

    Returns
    Type Description
    Texture

    The new texture.

    CreateTextureInternal(DataBox[], ref TextureDescription, ref SamplerStateDescription)

    Creates a Texture instance.

    Declaration
    protected abstract Texture CreateTextureInternal(DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState)
    Parameters
    Type Name Description
    DataBox[] data

    The texture data.

    TextureDescription description

    The texture description.

    SamplerStateDescription samplerState

    The sampler state description of the SamplerStateDescription struct.

    Returns
    Type Description
    Texture

    The new texture.

    GetTextureFromNativePointer(nint, ref TextureDescription)

    Gets a Texture instance from an existing texture using the specified native pointer.

    Declaration
    public Texture GetTextureFromNativePointer(nint texturePointer, ref TextureDescription textureDescription)
    Parameters
    Type Name Description
    nint texturePointer

    The pointer to the texture.

    TextureDescription textureDescription

    The description of the already created texture.

    Returns
    Type Description
    Texture

    The texture instance.

    GetTextureFromNativePointerInternal(nint, ref TextureDescription)

    Gets a Texture instance from an existing texture using the specified native pointer.

    Declaration
    protected abstract Texture GetTextureFromNativePointerInternal(nint texturePointer, ref TextureDescription textureDescription)
    Parameters
    Type Name Description
    nint texturePointer

    The pointer to the texture.

    TextureDescription textureDescription

    The description of the already created texture.

    Returns
    Type Description
    Texture

    The texture instance.

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX