Xui.GPU.Hardware.D3D11
Assembly: Xui.Runtime.Windows · C# declarations · Assembly overview
Types
class DirectXGpuDevice
Direct3D 11 hardware GPU device implementation. Provides hardware-accelerated shader compilation and rendering on Windows.
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.
public sealed class DirectXGpuDevice : IGpuDevice
{
public string BackendName { get; }
public bool IsDisposed { get; }
public unsafe DirectXGpuDevice();
public unsafe IGpuVertexShader CompileVertexShader(string source, string entryPoint);
public unsafe IGpuFragmentShader CompileFragmentShader(string source, string entryPoint);
public unsafe IGpuRenderTarget CreateRenderTarget(int width, int height);
public unsafe IGpuCommandList CreateCommandList();
public unsafe void Dispose();
}
DirectXGpuDevice.DirectXGpuDevice()
public unsafe DirectXGpuDevice();
Creates a new Direct3D 11 GPU device.
Throws Thrown if device creation fails.: Thrown if device creation fails.
string DirectXGpuDevice.BackendName
public string BackendName { get; }
Gets the name of this GPU backend (e.g., "D3D11", "Metal").
IGpuFragmentShader DirectXGpuDevice.CompileFragmentShader(string source, string entryPoint)
public unsafe IGpuFragmentShader CompileFragmentShader(string source, string entryPoint);
Compiles a fragment (pixel) shader from native shader source code.
source— The shader source (HLSL for D3D11, MSL for Metal).entryPoint— The name of the entry point function.
Returns: A compiled fragment shader.
IGpuVertexShader DirectXGpuDevice.CompileVertexShader(string source, string entryPoint)
public unsafe IGpuVertexShader CompileVertexShader(string source, string entryPoint);
Compiles a vertex shader from native shader source code.
source— The shader source (HLSL for D3D11, MSL for Metal).entryPoint— The name of the entry point function.
Returns: A compiled vertex shader.
IGpuCommandList DirectXGpuDevice.CreateCommandList()
public unsafe IGpuCommandList CreateCommandList();
Creates a command list for recording rendering commands.
IGpuRenderTarget DirectXGpuDevice.CreateRenderTarget(int width, int height)
public unsafe IGpuRenderTarget CreateRenderTarget(int width, int height);
Creates a render target texture.
width— Width in pixels.height— Height in pixels.
Returns: A render target that can be used with a command list.
void DirectXGpuDevice.Dispose()
public unsafe void Dispose();
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
bool DirectXGpuDevice.IsDisposed
public bool IsDisposed { get; }
Gets whether this device has been disposed.