Show / Hide Table of Contents

Class ResourceFactory

A device object responsible for the creation of graphics resources.

Inheritance
System.Object
ResourceFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Veldrid
Assembly: cs.temp.dll.dll
Syntax
public abstract class ResourceFactory

Constructors

ResourceFactory(GraphicsDeviceFeatures)

Declaration
protected ResourceFactory(GraphicsDeviceFeatures features)
Parameters
Type Name Description
GraphicsDeviceFeatures features

Properties

BackendType

Gets the GraphicsBackend of this instance.

Declaration
public abstract GraphicsBackend BackendType { get; }
Property Value
Type Description
GraphicsBackend

Features

Gets the GraphicsDeviceFeatures this instance was created with.

Declaration
public GraphicsDeviceFeatures Features { get; }
Property Value
Type Description
GraphicsDeviceFeatures

Methods

CreateBuffer(BufferDescription)

Creates a new DeviceBuffer.

Declaration
public DeviceBuffer CreateBuffer(BufferDescription description)
Parameters
Type Name Description
BufferDescription description

The desired properties of the created object.

Returns
Type Description
DeviceBuffer

A new DeviceBuffer.

CreateBuffer(ref BufferDescription)

Creates a new DeviceBuffer.

Declaration
public DeviceBuffer CreateBuffer(ref BufferDescription description)
Parameters
Type Name Description
BufferDescription description

The desired properties of the created object.

Returns
Type Description
DeviceBuffer

A new DeviceBuffer.

CreateBufferCore(ref BufferDescription)

Declaration
protected abstract DeviceBuffer CreateBufferCore(ref BufferDescription description)
Parameters
Type Name Description
BufferDescription description
Returns
Type Description
DeviceBuffer

CreateCommandList()

Creates a new CommandList.

Declaration
public CommandList CreateCommandList()
Returns
Type Description
CommandList

A new CommandList.

CreateCommandList(CommandListDescription)

Creates a new CommandList.

Declaration
public CommandList CreateCommandList(CommandListDescription description)
Parameters
Type Name Description
CommandListDescription description

The desired properties of the created object.

Returns
Type Description
CommandList

A new CommandList.

CreateCommandList(ref CommandListDescription)

Creates a new CommandList.

Declaration
public abstract CommandList CreateCommandList(ref CommandListDescription description)
Parameters
Type Name Description
CommandListDescription description

The desired properties of the created object.

Returns
Type Description
CommandList

A new CommandList.

CreateComputePipeline(ComputePipelineDescription)

Creates a new compute Pipeline object.

Declaration
public Pipeline CreateComputePipeline(ComputePipelineDescription description)
Parameters
Type Name Description
ComputePipelineDescription description

The desirede properties of the created object.

Returns
Type Description
Pipeline

A new Pipeline which, when bound to a CommandList, is used to dispatch compute commands.

CreateComputePipeline(ref ComputePipelineDescription)

Creates a new compute Pipeline object.

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

The desirede properties of the created object.

Returns
Type Description
Pipeline

A new Pipeline which, when bound to a CommandList, is used to dispatch compute commands.

CreateFence(Boolean)

Creates a new Fence in the given state.

Declaration
public abstract Fence CreateFence(bool signaled)
Parameters
Type Name Description
System.Boolean signaled

A value indicating whether the Fence should be in the signaled state when created.

Returns
Type Description
Fence

A new Fence.

CreateFramebuffer(FramebufferDescription)

Creates a new Framebuffer.

Declaration
public Framebuffer CreateFramebuffer(FramebufferDescription description)
Parameters
Type Name Description
FramebufferDescription description

The desired properties of the created object.

Returns
Type Description
Framebuffer

A new Framebuffer.

CreateFramebuffer(ref FramebufferDescription)

Creates a new Framebuffer.

Declaration
public abstract Framebuffer CreateFramebuffer(ref FramebufferDescription description)
Parameters
Type Name Description
FramebufferDescription description

The desired properties of the created object.

Returns
Type Description
Framebuffer

A new Framebuffer.

CreateGraphicsPipeline(GraphicsPipelineDescription)

Creates a new Pipeline.

Declaration
public Pipeline CreateGraphicsPipeline(GraphicsPipelineDescription description)
Parameters
Type Name Description
GraphicsPipelineDescription description

The desired properties of the created object.

Returns
Type Description
Pipeline

A new Pipeline.

CreateGraphicsPipeline(ref GraphicsPipelineDescription)

Creates a new Pipeline object.

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

The desired properties of the created object.

Returns
Type Description
Pipeline

A new Pipeline which, when bound to a CommandList, is used to dispatch draw commands.

CreateGraphicsPipelineCore(ref GraphicsPipelineDescription)

Declaration
protected abstract Pipeline CreateGraphicsPipelineCore(ref GraphicsPipelineDescription description)
Parameters
Type Name Description
GraphicsPipelineDescription description
Returns
Type Description
Pipeline

CreateResourceLayout(ResourceLayoutDescription)

Creates a new ResourceLayout.

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

The desired properties of the created object.

Returns
Type Description
ResourceLayout

A new ResourceLayout.

CreateResourceLayout(ref ResourceLayoutDescription)

Creates a new ResourceLayout.

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

The desired properties of the created object.

Returns
Type Description
ResourceLayout

A new ResourceLayout.

CreateResourceSet(ResourceSetDescription)

Creates a new ResourceSet.

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

The desired properties of the created object.

Returns
Type Description
ResourceSet

A new ResourceSet.

CreateResourceSet(ref ResourceSetDescription)

Creates a new ResourceSet.

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

The desired properties of the created object.

Returns
Type Description
ResourceSet

A new ResourceSet.

CreateSampler(SamplerDescription)

Creates a new Sampler.

Declaration
public Sampler CreateSampler(SamplerDescription description)
Parameters
Type Name Description
SamplerDescription description

The desired properties of the created object.

Returns
Type Description
Sampler

A new Sampler.

CreateSampler(ref SamplerDescription)

Creates a new Sampler.

Declaration
public Sampler CreateSampler(ref SamplerDescription description)
Parameters
Type Name Description
SamplerDescription description

The desired properties of the created object.

Returns
Type Description
Sampler

A new Sampler.

CreateSamplerCore(ref SamplerDescription)

Declaration
protected abstract Sampler CreateSamplerCore(ref SamplerDescription description)
Parameters
Type Name Description
SamplerDescription description
Returns
Type Description
Sampler

CreateShader(ShaderDescription)

Creates a new Shader.

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

The desired properties of the created object.

Returns
Type Description
Shader

A new Shader.

CreateShader(ref ShaderDescription)

Creates a new Shader.

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

The desired properties of the created object.

Returns
Type Description
Shader

A new Shader.

CreateShaderCore(ref ShaderDescription)

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

CreateSwapchain(SwapchainDescription)

Creates a new Swapchain.

Declaration
public Swapchain CreateSwapchain(SwapchainDescription description)
Parameters
Type Name Description
SwapchainDescription description

The desired properties of the created object.

Returns
Type Description
Swapchain

A new Swapchain.

CreateSwapchain(ref SwapchainDescription)

Creates a new Swapchain.

Declaration
public abstract Swapchain CreateSwapchain(ref SwapchainDescription description)
Parameters
Type Name Description
SwapchainDescription description

The desired properties of the created object.

Returns
Type Description
Swapchain

A new Swapchain.

CreateTexture(UInt64, TextureDescription)

Creates a new Texture from an existing native texture.

Declaration
public Texture CreateTexture(ulong nativeTexture, TextureDescription description)
Parameters
Type Name Description
System.UInt64 nativeTexture

A backend-specific handle identifying an existing native texture. See remarks.

TextureDescription description

The properties of the existing Texture.

Returns
Type Description
Texture

A new Texture wrapping the existing native texture.

Remarks

The nativeTexture parameter is backend-specific, and the type of data passed in depends on which graphics API is being used. When using the Vulkan backend, nativeTexture must be a valid VkImage handle. When using the Metal backend, nativeTexture must be a valid MTLTexture pointer. When using the D3D11 backend, nativeTexture must be a valid pointer to an ID3D11Texture1D, ID3D11Texture2D, or ID3D11Texture3D. When using the OpenGL backend, nativeTexture must be a valid OpenGL texture name. The properties of the Texture will be determined from the TextureDescription passed in. These properties must match the true properties of the existing native texture.

CreateTexture(UInt64, ref TextureDescription)

Creates a new Texture from an existing native texture.

Declaration
public Texture CreateTexture(ulong nativeTexture, ref TextureDescription description)
Parameters
Type Name Description
System.UInt64 nativeTexture

A backend-specific handle identifying an existing native texture. See remarks.

TextureDescription description

The properties of the existing Texture.

Returns
Type Description
Texture

A new Texture wrapping the existing native texture.

Remarks

The nativeTexture parameter is backend-specific, and the type of data passed in depends on which graphics API is being used. When using the Vulkan backend, nativeTexture must be a valid VkImage handle. When using the Metal backend, nativeTexture must be a valid MTLTexture pointer. When using the D3D11 backend, nativeTexture must be a valid pointer to an ID3D11Texture1D, ID3D11Texture2D, or ID3D11Texture3D. When using the OpenGL backend, nativeTexture must be a valid OpenGL texture name. The properties of the Texture will be determined from the TextureDescription passed in. These properties must match the true properties of the existing native texture.

CreateTexture(TextureDescription)

Creates a new Texture.

Declaration
public Texture CreateTexture(TextureDescription description)
Parameters
Type Name Description
TextureDescription description

The desired properties of the created object.

Returns
Type Description
Texture

A new Texture.

CreateTexture(ref TextureDescription)

Creates a new Texture.

Declaration
public Texture CreateTexture(ref TextureDescription description)
Parameters
Type Name Description
TextureDescription description

The desired properties of the created object.

Returns
Type Description
Texture

A new Texture.

CreateTextureCore(UInt64, ref TextureDescription)

Declaration
protected abstract Texture CreateTextureCore(ulong nativeTexture, ref TextureDescription description)
Parameters
Type Name Description
System.UInt64 nativeTexture
TextureDescription description
Returns
Type Description
Texture

CreateTextureCore(ref TextureDescription)

Declaration
protected abstract Texture CreateTextureCore(ref TextureDescription description)
Parameters
Type Name Description
TextureDescription description
Returns
Type Description
Texture

CreateTextureView(Texture)

Creates a new TextureView.

Declaration
public TextureView CreateTextureView(Texture target)
Parameters
Type Name Description
Texture target

The target Texture used in the new view.

Returns
Type Description
TextureView

A new TextureView.

CreateTextureView(TextureViewDescription)

Creates a new TextureView.

Declaration
public TextureView CreateTextureView(TextureViewDescription description)
Parameters
Type Name Description
TextureViewDescription description

The desired properties of the created object.

Returns
Type Description
TextureView

A new TextureView.

CreateTextureView(ref TextureViewDescription)

Creates a new TextureView.

Declaration
public TextureView CreateTextureView(ref TextureViewDescription description)
Parameters
Type Name Description
TextureViewDescription description

The desired properties of the created object.

Returns
Type Description
TextureView

A new TextureView.

CreateTextureViewCore(ref TextureViewDescription)

Declaration
protected abstract TextureView CreateTextureViewCore(ref TextureViewDescription description)
Parameters
Type Name Description
TextureViewDescription description
Returns
Type Description
TextureView
Back to top