RDShaderSource
Individual shader-stage source code for RenderingDevice.
RDShaderSource holds source strings and the selected language. For compute, set SourceCompute and explicitly call ShaderCompileSpirVFromSource; the string is not a compiled GPU resource. GLSL is the default language.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
RDShaderSourceConstructor
public RDShaderSource();Creates an object with all ten stage strings empty and Language=Glsl. Runs no compiler and creates no GPU shader. Set the required stage source before compiling; empty stages are skipped.
Properties11
LanguageProperty
public RenderingDevice.ShaderLanguage Language { get; set; }Source-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.
SourceAnyHitProperty
public string SourceAnyHit { get; set; }Source for any-hit: intersection-candidate processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.AnyHit). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceClosestHitProperty
public string SourceClosestHit { get; set; }Source for closest-hit: closest-intersection processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.ClosestHit). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceComputeProperty
public string SourceCompute { get; set; }Compute-stage source code. For GLSL provide #version and kernel code without the #[compute] import marker; assigning the string does not compile the shader.
SourceFragmentProperty
public string SourceFragment { get; set; }Source for fragment: fragment output, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Fragment). One stage, not a file containing all sections. Call ShaderCompileSpirVFromSource separately; the setter creates no GPU shader.
SourceIntersectionProperty
public string SourceIntersection { get; set; }Source for intersection: custom procedural-geometry intersection, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Intersection). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceMissProperty
public string SourceMiss { get; set; }Source for miss: processing a ray without a hit, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Miss). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceRaygenProperty
public string SourceRaygen { get; set; }Source for ray generation: launching rays, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Raygen). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceTesselationControlProperty
public string SourceTesselationControl { get; set; }Source for tessellation control: patch control, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.TesselationControl). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceTesselationEvaluationProperty
public string SourceTesselationEvaluation { get; set; }Source for tessellation evaluation: evaluating a tessellated patch, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.TesselationEvaluation). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.
SourceVertexProperty
public string SourceVertex { get; set; }Source for vertex: vertex processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Vertex). One stage, not a file containing all sections. Call ShaderCompileSpirVFromSource separately; the setter creates no GPU shader.
Methods4
GetLanguageRenderingDevice.ShaderLanguage
public RenderingDevice.ShaderLanguage GetLanguage();Returns stored Language, initially Glsl. Checks no compiler backend and establishes no match between the text and selected language.
RenderingDevice.ShaderLanguageStored ShaderLanguage, initially Glsl; not a language-support check.
GetStageSourcestring
public string GetStageSource(RenderingDevice.ShaderStage stage);Returns one stage’s stored text, initially empty. Equivalent to the corresponding Source-property getter; reads no file and returns no generated SPIR-V. Use a ShaderStage index, not a …Bit value.
| Name | Type | Default |
|---|---|---|
stage | RenderingDevice.ShaderStage | — |
stageStage index, such as ShaderStage.Compute or ShaderStage.Vertex. Do not pass ComputeBit/VertexBit, a mask or Max: these are not the requested stage index and can select another stage or emit a native error.
stringStored selected-stage string; empty when no source is set.
SetLanguagevoid
public void SetLanguage(RenderingDevice.ShaderLanguage language);Source-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.
| Name | Type | Default |
|---|---|---|
language | RenderingDevice.ShaderLanguage | — |
languageSource-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.
SetStageSourcevoid
public void SetStageSource(RenderingDevice.ShaderStage stage, string source);Replaces one stage’s text without compiling or changing other stages. Supply actual stage code, such as GLSL with #version, without a #[compute] file-section marker or shader_type spatial. …Bit values are not stage indices for this method. Source edits change no earlier RDShaderSpirV or GPU shader.
| Name | Type | Default |
|---|---|---|
stage | RenderingDevice.ShaderStage | — |
source | string | — |
stageStage index, such as ShaderStage.Compute or ShaderStage.Vertex. Do not pass ComputeBit/VertexBit, a mask or Max: these are not the requested stage index and can select another stage or emit a native error.
sourceFull source for one stage in the selected Language, without a #[compute] file-section marker. Not a path or high-level spatial Shader source.