Xui.GPU.Backends.Metal

Assembly: Xui.Core · C# declarations · Assembly overview

Types

class MslCodeGenerator

Metal Shading Language (MSL) code generator for Apple platforms (macOS, iOS). Translates IR to MSL shader code compatible with the Metal framework.

MSL maps closely to C++14 with Metal-specific extensions. Key differences from HLSL: - Vertex/fragment functions use [[attribute(n)]] instead of semantics - Built-ins use [[position]], [[color(n)]], etc. - Resource bindings use [[buffer(n)]], [[texture(n)]], [[sampler(n)]] - Entry points are marked with [[vertex]] and [[fragment]] attributes - Structs use attribute annotations directly on fields

public class MslCodeGenerator : IShaderBackend
{
    public string Name { get; }

    public string GenerateCode(IrShaderModule module);
}

string MslCodeGenerator.GenerateCode(IrShaderModule module)

public string GenerateCode(IrShaderModule module);

Generates MSL shader code from an IR module.

string MslCodeGenerator.Name

public string Name { get; }

Gets the name of this backend (e.g., "HLSL", "MSL", "GLSL").