Class ResourceFactory
This Factory allows creating GPU device resources.
Inheritance
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 |
---|---|
Graphics |
Methods
CreateBuffer(ref BufferDescription, string)
Creates a Buffer instance.
Declaration
public Buffer CreateBuffer(ref BufferDescription description, string debugName = null)
Parameters
Type | Name | Description |
---|---|---|
Buffer |
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. |
Buffer |
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. |
Buffer |
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. |
Buffer |
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. |
Buffer |
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 Command
Declaration
public CommandQueue CreateCommandQueue(CommandQueueType queueType = CommandQueueType.Graphics)
Parameters
Type | Name | Description |
---|---|---|
Command |
queueType | The command queue type, Command |
Returns
Type | Description |
---|---|
Command |
The new command queue. |
CreateCommandQueueInternal(CommandQueueType)
Creates a Command
Declaration
protected abstract CommandQueue CreateCommandQueueInternal(CommandQueueType queueType = CommandQueueType.Graphics)
Parameters
Type | Name | Description |
---|---|---|
Command |
queueType | The command queue type, Command |
Returns
Type | Description |
---|---|
Command |
The new command queue. |
CreateComputePipeline(ref ComputePipelineDescription)
Creates a Compute
Declaration
public ComputePipelineState CreateComputePipeline(ref ComputePipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Compute |
description | The compute pipeline state description. |
Returns
Type | Description |
---|---|
Compute |
The new pipeline state. |
CreateComputePipelineInternal(ref ComputePipelineDescription)
Creates a Compute
Declaration
protected abstract ComputePipelineState CreateComputePipelineInternal(ref ComputePipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Compute |
description | The compute pipeline state description. |
Returns
Type | Description |
---|---|
Compute |
The new pipeline state. |
CreateFrameBuffer(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Creates a Frame
Declaration
public FrameBuffer CreateFrameBuffer(FrameBufferAttachment? depthTarget, FrameBufferAttachment[] colorTargets, bool disposeAttachments = true)
Parameters
Type | Name | Description |
---|---|---|
Frame |
depthTarget | The depth Frame |
Frame |
colorTargets | The array of color Frame |
bool | disposeAttachments | When this framebuffer is disposed, dispose of the attachment textures too. |
Returns
Type | Description |
---|---|
Frame |
The new framebuffer. |
CreateFrameBuffer(uint, uint, PixelFormat, PixelFormat, string)
Creates a Frame
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. |
Pixel |
colorTargetPixelFormat | The pixel format of the color target. |
Pixel |
depthTargetPixelFormat | The pixel format of the depth target. |
string | debugName | The framebuffer textures' names (for debugging purposes). |
Returns
Type | Description |
---|---|
Frame |
The new framebuffer. |
CreateFrameBufferInternal(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Creates a Frame
Declaration
protected abstract FrameBuffer CreateFrameBufferInternal(FrameBufferAttachment? depthTarget, FrameBufferAttachment[] colorTargets, bool disposeAttachments)
Parameters
Type | Name | Description |
---|---|---|
Frame |
depthTarget | The depth Frame |
Frame |
colorTargets | The array of color Frame |
bool | disposeAttachments | When this framebuffer is disposed, disposes the attachment textures too. |
Returns
Type | Description |
---|---|
Frame |
The new framebuffer. |
CreateGraphicsPipeline(ref GraphicsPipelineDescription)
Creates a Graphics
Declaration
public GraphicsPipelineState CreateGraphicsPipeline(ref GraphicsPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Graphics |
description | The graphics pipeline state description. |
Returns
Type | Description |
---|---|
Graphics |
The new pipeline state. |
CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription)
Creates a Graphics
Declaration
protected abstract GraphicsPipelineState CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Graphics |
description | The graphics pipeline state description. |
Returns
Type | Description |
---|---|
Graphics |
The new pipeline state. |
CreateQueryHeap(ref QueryHeapDescription)
Creates a Query
Declaration
public abstract QueryHeap CreateQueryHeap(ref QueryHeapDescription description)
Parameters
Type | Name | Description |
---|---|---|
Query |
description | The Query |
Returns
CreateRaytracingPipeline(ref RaytracingPipelineDescription)
Creates a Raytracing
Declaration
public RaytracingPipelineState CreateRaytracingPipeline(ref RaytracingPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Raytracing |
description | The raytracing pipeline state description. |
Returns
Type | Description |
---|---|
Raytracing |
The new pipeline state. |
CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription)
Creates a Raytracing
Declaration
protected abstract RaytracingPipelineState CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Raytracing |
description | The raytracing pipeline state description. |
Returns
Type | Description |
---|---|
Raytracing |
The new pipeline state. |
CreateResourceLayout(ref ResourceLayoutDescription)
Creates a new Resource
Declaration
public ResourceLayout CreateResourceLayout(ref ResourceLayoutDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The description for all elements in this new Resource |
Returns
Type | Description |
---|---|
Resource |
A new Resource |
CreateResourceLayoutInternal(ref ResourceLayoutDescription)
Creates a new Resource
Declaration
protected abstract ResourceLayout CreateResourceLayoutInternal(ref ResourceLayoutDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The description of all elements in this new Resource |
Returns
Type | Description |
---|---|
Resource |
A new ResourceLayout object. |
CreateResourceSet(ref ResourceSetDescription)
Creates a new Resource
Declaration
public ResourceSet CreateResourceSet(ref ResourceSetDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The description for all elements in this new Resource |
Returns
Type | Description |
---|---|
Resource |
A new Resource |
CreateResourceSetInternal(ref ResourceSetDescription)
Creates a new Resource
Declaration
protected abstract ResourceSet CreateResourceSetInternal(ref ResourceSetDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The description for all elements in this new Resource |
Returns
Type | Description |
---|---|
Resource |
A new Resource |
CreateSamplerState(ref SamplerStateDescription)
Creates a Sampler
Declaration
public SamplerState CreateSamplerState(ref SamplerStateDescription description)
Parameters
Type | Name | Description |
---|---|---|
Sampler |
description | The sampler state description. |
Returns
Type | Description |
---|---|
Sampler |
The new sampler state. |
CreateSamplerStateInternal(ref SamplerStateDescription)
Creates a Sampler
Declaration
protected abstract SamplerState CreateSamplerStateInternal(ref SamplerStateDescription description)
Parameters
Type | Name | Description |
---|---|---|
Sampler |
description | The sampler state description. |
Returns
Type | Description |
---|---|
Sampler |
The new sampler state. |
CreateShader(ref ShaderDescription)
Creates a Shader instance.
Declaration
public Shader CreateShader(ref ShaderDescription description)
Parameters
Type | Name | Description |
---|---|---|
Shader |
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 |
---|---|---|
Shader |
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 |
---|---|---|
Data |
data | The texture data. |
Texture |
description | The texture description. |
Sampler |
samplerState | The sampler state description in the Sampler |
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 |
---|---|---|
Data |
data | The texture data. |
Texture |
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 |
---|---|---|
Texture |
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 |
---|---|---|
Data |
data | The texture data. |
Texture |
description | The texture description. |
Sampler |
samplerState | The sampler state description of the Sampler |
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. |
Texture |
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. |
Texture |
textureDescription | The description of the already created texture. |
Returns
Type | Description |
---|---|
Texture | The texture instance. |