Table of Contents

Class IOSGpuDevice

Namespace
Xui.GPU.Hardware.Metal
Assembly
Xui.Runtime.IOS.dll

Apple Metal hardware GPU device implementation. Provides hardware-accelerated shader compilation and rendering on macOS and iOS.

public sealed class IOSGpuDevice : IGpuDevice, IDisposable
Inheritance
IOSGpuDevice
Implements
Inherited Members

Remarks

This backend uses the Metal framework for rendering and the Metal shader compiler for MSL shader compilation. Rendering is done off-screen to a texture that can be read back to CPU memory for display via the 2D canvas pipeline.

Constructors

IOSGpuDevice()

Creates a new Metal GPU device using the system default device.

public IOSGpuDevice()

Exceptions

InvalidOperationException

Thrown if no Metal device is available.

Properties

BackendName

Gets the name of this GPU backend (e.g., "D3D11", "Metal").

public string BackendName { get; }

Property Value

string

IsDisposed

Gets whether this device has been disposed.

public bool IsDisposed { get; }

Property Value

bool

Methods

CompileFragmentShader(string, string)

Compiles a fragment (pixel) shader from native shader source code.

public IGpuFragmentShader CompileFragmentShader(string source, string entryPoint)

Parameters

source string

The shader source (HLSL for D3D11, MSL for Metal).

entryPoint string

The 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

source string

The shader source (HLSL for D3D11, MSL for Metal).

entryPoint string

The 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

IGpuCommandList

CreateRenderTarget(int, int)

Creates a render target texture.

public IGpuRenderTarget CreateRenderTarget(int width, int height)

Parameters

width int

Width in pixels.

height int

Height in pixels.

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()