Class SkslConversion
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
SkslTextstringThe runtime-effect source for
SKRuntimeEffect.CreateShader.WarningsIReadOnlyList<ShaderError>Non-fatal findings — every synthesized uniform carries one.
ChildShadersIReadOnlyList<string>The
uniform shaderchildren to bind, in order, named after the HLSL textures.SynthesizedUniformsIReadOnlyList<string>Uniforms the consumer must set each draw (see SynthesizedUniforms):
ShadowDusk_Color(the sprite's tint, for a shader that readsCOLOR0) andShadowDusk_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
SkslText
The runtime-effect source for SKRuntimeEffect.CreateShader.
public string SkslText { get; init; }
Property Value
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
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
Warnings
Non-fatal findings — every synthesized uniform carries one.
public IReadOnlyList<ShaderError> Warnings { get; init; }