Class DirectXGpuDevice
Direct3D 11 hardware GPU device implementation. Provides hardware-accelerated shader compilation and rendering on Windows.
public sealed class DirectXGpuDevice : IGpuDevice, IDisposable
- Inheritance
-
DirectXGpuDevice
- Implements
- Inherited Members
Remarks
This backend uses D3D11 for rendering and D3DCompiler for HLSL compilation. Rendering is done off-screen to a texture that can be read back to CPU memory for display via the software/2D canvas pipeline.
Constructors
DirectXGpuDevice()
Creates a new Direct3D 11 GPU device.
public DirectXGpuDevice()
Exceptions
- InvalidOperationException
Thrown if device creation fails.
Properties
BackendName
Gets the name of this GPU backend (e.g., "D3D11", "Metal").
public string BackendName { get; }
Property Value
IsDisposed
Gets whether this device has been disposed.
public bool IsDisposed { get; }
Property Value
Methods
CompileFragmentShader(string, string)
Compiles a fragment (pixel) shader from native shader source code.
public IGpuFragmentShader CompileFragmentShader(string source, string entryPoint)
Parameters
sourcestringThe shader source (HLSL for D3D11, MSL for Metal).
entryPointstringThe name of the entry point function.
Returns
- IGpuFragmentShader
A compiled fragment shader.
CompileVertexShader(string, string)
Compiles a vertex shader from native shader source code.
public IGpuVertexShader CompileVertexShader(string source, string entryPoint)
Parameters
sourcestringThe shader source (HLSL for D3D11, MSL for Metal).
entryPointstringThe name of the entry point function.
Returns
- IGpuVertexShader
A compiled vertex shader.
CreateCommandList()
Creates a command list for recording rendering commands.
public IGpuCommandList CreateCommandList()
Returns
CreateRenderTarget(int, int)
Creates a render target texture.
public IGpuRenderTarget CreateRenderTarget(int width, int height)
Parameters
Returns
- IGpuRenderTarget
A render target that can be used with a command list.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()