Table of Contents

Class SkslConversion

Namespace
ShadowDusk.Compiler.Sksl
Assembly
ShadowDusk.Compiler.dll

The successful product: SkSL text plus its runtime contract.

public sealed record SkslConversion : IEquatable<SkslConversion>
Inheritance
SkslConversion
Implements
Inherited Members

Constructors

SkslConversion(string, IReadOnlyList<ShaderError>, IReadOnlyList<string>, IReadOnlyList<string>)

The successful product: SkSL text plus its runtime contract.

public SkslConversion(string SkslText, IReadOnlyList<ShaderError> Warnings, IReadOnlyList<string> ChildShaders, IReadOnlyList<string> SynthesizedUniforms)

Parameters

SkslText string

The runtime-effect source for SKRuntimeEffect.CreateShader.

Warnings IReadOnlyList<ShaderError>

Non-fatal findings — every synthesized uniform carries one.

ChildShaders IReadOnlyList<string>

The uniform shader children to bind, in order, named after the HLSL textures.

SynthesizedUniforms IReadOnlyList<string>

Uniforms the consumer must set each draw (see SynthesizedUniforms): ShadowDusk_Color (the sprite's tint, for a shader that reads COLOR0) and ShadowDusk_Resolution (pixel size of the drawn element, also the child size, for a shader that uses its UV arithmetically or samples at a computed coordinate).

Properties

ChildShaders

The uniform shader children to bind, in order, named after the HLSL textures.

public IReadOnlyList<string> ChildShaders { get; init; }

Property Value

IReadOnlyList<string>

SkslText

The runtime-effect source for SKRuntimeEffect.CreateShader.

public string SkslText { get; init; }

Property Value

string

SynthesizedUniforms

Uniforms the consumer must set each draw (see SynthesizedUniforms): ShadowDusk_Color (the sprite's tint, for a shader that reads COLOR0) and ShadowDusk_Resolution (pixel size of the drawn element, also the child size, for a shader that uses its UV arithmetically or samples at a computed coordinate).

public IReadOnlyList<string> SynthesizedUniforms { get; init; }

Property Value

IReadOnlyList<string>

Uniforms

Every uniform SkslText declares except the uniform shader children (ChildShaders), in declaration order, each with the default its HLSL declaration gives it (DefaultValue, issue #435). The SkSL text declares every uniform WITHOUT a value, so a uniform the caller does not set reads as zero in Skia; set each one whose DefaultValue is not null to that value to get the effect the .fx author declared. The synthesized uniforms (SynthesizedUniforms) are listed too, with a null default.

public IReadOnlyList<SkslUniform> Uniforms { get; init; }

Property Value

IReadOnlyList<SkslUniform>

Warnings

Non-fatal findings — every synthesized uniform carries one.

public IReadOnlyList<ShaderError> Warnings { get; init; }

Property Value

IReadOnlyList<ShaderError>