Class ResourceFactory
This Factory allow create GPU device resources.
Inheritance
Inherited Members
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public abstract class ResourceFactory
Properties
GraphicsContext
Gets the generic graphicsContext.
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 (Debug purposes). |
Returns
Type | Description |
---|---|
Buffer | The new buffer. |
CreateBuffer(IntPtr, ref BufferDescription, string)
Creates a Buffer instance.
Declaration
public Buffer CreateBuffer(IntPtr data, ref BufferDescription description, string debugName = null)
Parameters
Type | Name | Description |
---|---|---|
Int |
data | Data pointer. |
Buffer |
description | The index buffer description. |
string | debugName | The buffer name (Debug purposes). |
Returns
Type | Description |
---|---|
Buffer | The new buffer. |
CreateBufferInternal(IntPtr, ref BufferDescription)
Creates a Buffer instance.
Declaration
protected abstract Buffer CreateBufferInternal(IntPtr data, ref BufferDescription description)
Parameters
Type | Name | Description |
---|---|---|
Int |
data | Data pointer. |
Buffer |
description | The index buffer description. |
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 (Debug 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 (Debug 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 commandQueue type, Command |
Returns
Type | Description |
---|---|
Command |
The new commandQueue. |
CreateCommandQueueInternal(CommandQueueType)
Creates a Command
Declaration
protected abstract CommandQueue CreateCommandQueueInternal(CommandQueueType queueType = CommandQueueType.Graphics)
Parameters
Type | Name | Description |
---|---|---|
Command |
queueType | The commandQueue type, Command |
Returns
Type | Description |
---|---|
Command |
The new commandQueue. |
CreateComputePipeline(ref ComputePipelineDescription)
Creates a Compute
Declaration
public ComputePipelineState CreateComputePipeline(ref ComputePipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Compute |
description | The compute pipelinestate description. |
Returns
Type | Description |
---|---|
Compute |
The new pipelinestate. |
CreateComputePipelineInternal(ref ComputePipelineDescription)
Creates a Compute
Declaration
protected abstract ComputePipelineState CreateComputePipelineInternal(ref ComputePipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Compute |
description | The compute pipelinestate description. |
Returns
Type | Description |
---|---|
Compute |
The new pipelinestate. |
CreateFrameBuffer(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Create 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 the attachment textures too. |
Returns
Type | Description |
---|---|
Frame |
The new framebuffer. |
CreateFrameBuffer(uint, uint, PixelFormat, PixelFormat, string)
Create 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 with 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 (Debug purposes). |
Returns
Type | Description |
---|---|
Frame |
The new framebuffer. |
CreateFrameBufferInternal(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Create 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, dispose 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 pipelinestate description. |
Returns
Type | Description |
---|---|
Graphics |
The new pipelinestate. |
CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription)
Creates a Graphics
Declaration
protected abstract GraphicsPipelineState CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Graphics |
description | The graphics pipelinestate description. |
Returns
Type | Description |
---|---|
Graphics |
The new pipelinestate. |
CreateQueryHeap(ref QueryHeapDescription)
Create a Query
Declaration
public abstract QueryHeap CreateQueryHeap(ref QueryHeapDescription description)
Parameters
Type | Name | Description |
---|---|---|
Query |
description | The queryheap description. |
Returns
Type | Description |
---|---|
Query |
The new queryheap. |
CreateRaytracingPipeline(ref RaytracingPipelineDescription)
Creates a Raytracing
Declaration
public RaytracingPipelineState CreateRaytracingPipeline(ref RaytracingPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Raytracing |
description | The raytracing pipelinestate description. |
Returns
Type | Description |
---|---|
Raytracing |
The new pipelinestate. |
CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription)
Creates a Raytracing
Declaration
protected abstract RaytracingPipelineState CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription description)
Parameters
Type | Name | Description |
---|---|---|
Raytracing |
description | The raytracing pipelinestate description. |
Returns
Type | Description |
---|---|
Raytracing |
The new pipelinestate. |
CreateResourceLayout(ref ResourceLayoutDescription)
Create a new Resource
Declaration
public ResourceLayout CreateResourceLayout(ref ResourceLayoutDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The descriptions for all elements in this new resourceLayout. |
Returns
Type | Description |
---|---|
Resource |
A new resourceLayout object. |
CreateResourceLayoutInternal(ref ResourceLayoutDescription)
Create a new Resource
Declaration
protected abstract ResourceLayout CreateResourceLayoutInternal(ref ResourceLayoutDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The descriptions for all elements in this new resourceLayout. |
Returns
Type | Description |
---|---|
Resource |
A new resourceLayout object. |
CreateResourceSet(ref ResourceSetDescription)
Create a new Resource
Declaration
public ResourceSet CreateResourceSet(ref ResourceSetDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The descriptions for all elements in this new resourceSet. |
Returns
Type | Description |
---|---|
Resource |
A new resourceSet object. |
CreateResourceSetInternal(ref ResourceSetDescription)
Create a new Resource
Declaration
protected abstract ResourceSet CreateResourceSetInternal(ref ResourceSetDescription description)
Parameters
Type | Name | Description |
---|---|---|
Resource |
description | The descriptions for all elements in this new resourceSet. |
Returns
Type | Description |
---|---|
Resource |
A new resourceSet object. |
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 samplerstate. |
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 samplerstate. |
CreateShader(ref ShaderDescription)
Create 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)
Create 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 Sampler |
string | debugName | The texture name (Debug pruposes). |
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 (Debug purposes). |
Returns
Type | Description |
---|---|
Texture | The new texture1D. |
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 (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 Sampler |
Returns
Type | Description |
---|---|
Texture | The new texture. |
GetTextureFromNativePointer(IntPtr, ref TextureDescription)
Gets a Texture instance from an existing texture using the specified native pointer.
Declaration
public Texture GetTextureFromNativePointer(IntPtr texturePointer, ref TextureDescription textureDescription)
Parameters
Type | Name | Description |
---|---|---|
Int |
texturePointer | The pointer of the texture. |
Texture |
textureDescription | The texture description of the already created texture. |
Returns
Type | Description |
---|---|
Texture | The texture instance. |
GetTextureFromNativePointerInternal(IntPtr, ref TextureDescription)
Gets a Texture instance from an existing texture using the specified native pointer.
Declaration
protected abstract Texture GetTextureFromNativePointerInternal(IntPtr texturePointer, ref TextureDescription textureDescription)
Parameters
Type | Name | Description |
---|---|---|
Int |
texturePointer | The pointer of the texture. |
Texture |
textureDescription | The texture description of the already created texture. |
Returns
Type | Description |
---|---|
Texture | The texture instance. |