Xui.GPU.Backends.Glsl

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

Types

class GlslCodeGenerator

Emits GLSL ES 3.00 for WebGL 2 from the shared shader IR.

Define XUI_VERTEX or XUI_FRAGMENT immediately after the version line when compiling a stage. Both stages use main. Bind XuiBindings as a std140 uniform block; matrices are row-major in that buffer, matching Xui's CPU matrices. Vertex clip depth is converted from Xui's [0,w] convention to OpenGL's [-w,w]. Texture/sampler pairs become combined sampler uniforms named x_texture_TextureField_SamplerField. Unsupported IR fails explicitly; this backend does not provide a GPU device.

public sealed class GlslCodeGenerator : IShaderBackend
{
    public string Name { get; }

    public string GenerateCode(IrShaderModule module);
}

string GlslCodeGenerator.GenerateCode(IrShaderModule module)

public string GenerateCode(IrShaderModule module);

Generates a source bundle containing both compile-time-selected stages.

string GlslCodeGenerator.Name

public string Name { get; }

Gets the source-generator backend selector.