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 | 
|---|---|
| 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 (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 | 
|---|---|---|
| IntPtr | data | Data pointer.  | 
      
| BufferDescription | 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 | 
|---|---|---|
| IntPtr | data | Data pointer.  | 
      
| BufferDescription | 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.  | 
      
| BufferDescription | 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.  | 
      
| BufferDescription | 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 CommandQueue instance.
Declaration
public CommandQueue CreateCommandQueue(CommandQueueType queueType = CommandQueueType.Graphics)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CommandQueueType | queueType | The commandQueue type, CommandQueueType.  | 
      
Returns
| Type | Description | 
|---|---|
| CommandQueue | The new commandQueue.  | 
      
CreateCommandQueueInternal(CommandQueueType)
Creates a CommandQueue instance.
Declaration
protected abstract CommandQueue CreateCommandQueueInternal(CommandQueueType queueType = CommandQueueType.Graphics)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CommandQueueType | queueType | The commandQueue type, CommandQueueType.  | 
      
Returns
| Type | Description | 
|---|---|
| CommandQueue | The new commandQueue.  | 
      
CreateComputePipeline(ref ComputePipelineDescription)
Creates a ComputePipelineState instance.
Declaration
public ComputePipelineState CreateComputePipeline(ref ComputePipelineDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ComputePipelineDescription | description | The compute pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| ComputePipelineState | The new pipelinestate.  | 
      
CreateComputePipelineInternal(ref ComputePipelineDescription)
Creates a ComputePipelineState instance.
Declaration
protected abstract ComputePipelineState CreateComputePipelineInternal(ref ComputePipelineDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ComputePipelineDescription | description | The compute pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| ComputePipelineState | The new pipelinestate.  | 
      
CreateFrameBuffer(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Create 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 DepthStencil flag.  | 
      
| FrameBufferAttachment[] | colorTargets | The array of color FrameBufferAttachment , all of which must have been created with RenderTarget flags.  | 
      
| bool | disposeAttachments | When this framebuffer is disposed, dispose the attachment textures too.  | 
      
Returns
| Type | Description | 
|---|---|
| FrameBuffer | The new framebuffer.  | 
      
CreateFrameBuffer(uint, uint, PixelFormat, PixelFormat, string)
Create 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 with 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 (Debug purposes).  | 
      
Returns
| Type | Description | 
|---|---|
| FrameBuffer | The new framebuffer.  | 
      
CreateFrameBufferInternal(FrameBufferAttachment?, FrameBufferAttachment[], bool)
Create 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 DepthStencil flag.  | 
      
| FrameBufferAttachment[] | colorTargets | The array of color FrameBufferAttachment , all of which must have been created with RenderTarget flags.  | 
      
| bool | disposeAttachments | When this framebuffer is disposed, dispose 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 pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| GraphicsPipelineState | The new pipelinestate.  | 
      
CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription)
Creates a GraphicsPipelineState instance.
Declaration
protected abstract GraphicsPipelineState CreateGraphicsPipelineInternal(ref GraphicsPipelineDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GraphicsPipelineDescription | description | The graphics pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| GraphicsPipelineState | The new pipelinestate.  | 
      
CreateQueryHeap(ref QueryHeapDescription)
Create 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 pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| RaytracingPipelineState | The new pipelinestate.  | 
      
CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription)
Creates a RaytracingPipelineState instance.
Declaration
protected abstract RaytracingPipelineState CreateRaytracingPipelineInternal(ref RaytracingPipelineDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RaytracingPipelineDescription | description | The raytracing pipelinestate description.  | 
      
Returns
| Type | Description | 
|---|---|
| RaytracingPipelineState | The new pipelinestate.  | 
      
CreateResourceLayout(ref ResourceLayoutDescription)
Create a new ResourceLayout.
Declaration
public ResourceLayout CreateResourceLayout(ref ResourceLayoutDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ResourceLayoutDescription | description | The descriptions for all elements in this new resourceLayout.  | 
      
Returns
| Type | Description | 
|---|---|
| ResourceLayout | A new resourceLayout object.  | 
      
CreateResourceLayoutInternal(ref ResourceLayoutDescription)
Create a new ResourceLayout.
Declaration
protected abstract ResourceLayout CreateResourceLayoutInternal(ref ResourceLayoutDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ResourceLayoutDescription | description | The descriptions for all elements in this new resourceLayout.  | 
      
Returns
| Type | Description | 
|---|---|
| ResourceLayout | A new resourceLayout object.  | 
      
CreateResourceSet(ref ResourceSetDescription)
Create a new ResourceSet.
Declaration
public ResourceSet CreateResourceSet(ref ResourceSetDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ResourceSetDescription | description | The descriptions for all elements in this new resourceSet.  | 
      
Returns
| Type | Description | 
|---|---|
| ResourceSet | A new resourceSet object.  | 
      
CreateResourceSetInternal(ref ResourceSetDescription)
Create a new ResourceSet.
Declaration
protected abstract ResourceSet CreateResourceSetInternal(ref ResourceSetDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ResourceSetDescription | description | The descriptions 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 samplerstate.  | 
      
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 samplerstate.  | 
      
CreateShader(ref ShaderDescription)
Create 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)
Create 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 SamplerStateDescription struct.  | 
      
| 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 | 
|---|---|---|
| DataBox[] | data | The texture data.  | 
      
| TextureDescription | 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 | 
|---|---|---|
| TextureDescription | 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 | 
|---|---|---|
| DataBox[] | data | The texture data.  | 
      
| TextureDescription | description | The texture description.  | 
      
| SamplerStateDescription | samplerState | The sampler state description SamplerStateDescription struct.  | 
      
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 | 
|---|---|---|
| IntPtr | texturePointer | The pointer of the texture.  | 
      
| TextureDescription | 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 | 
|---|---|---|
| IntPtr | texturePointer | The pointer of the texture.  | 
      
| TextureDescription | textureDescription | The texture description of the already created texture.  | 
      
Returns
| Type | Description | 
|---|---|
| Texture | The texture instance.  |