Class ShaderDescription
- Namespace
- HelixToolkit.SharpDX.Shaders
- Assembly
- HelixToolkit.SharpDX.dll
[DataContract]
public sealed class ShaderDescription
- Inheritance
-
ShaderDescription
- Inherited Members
Constructors
ShaderDescription()
Create a empty description
public ShaderDescription()
ShaderDescription(string, ShaderStage, IShaderReflector, byte[]?)
Create shader using reflector to get buffer mapping directly from shader codes.
Actual creation happened when calling CreateShader(Device, IConstantBufferPool)
public ShaderDescription(string name, ShaderStage type, IShaderReflector reflector, byte[]? byteCode)
Parameters
namestringtypeShaderStagereflectorIShaderReflectorbyteCodebyte[]
ShaderDescription(string, ShaderStage, IShaderReflector, string?, IShaderByteCodeReader?)
Initializes a new instance of the ShaderDescription class. Pass IShaderByteCodeReader to read external custom shader bytecodes.
public ShaderDescription(string name, ShaderStage type, IShaderReflector reflector, string? byteCodeName, IShaderByteCodeReader? byteCodeReader = null)
Parameters
namestringThe name.
typeShaderStageThe type.
reflectorIShaderReflectorThe reflector.
byteCodeNamestringName of the byte code.
byteCodeReaderIShaderByteCodeReaderUsed to read external custom shader byte codes
ShaderDescription(string, ShaderStage, FeatureLevel, byte[]?, ConstantBufferMapping[]?, TextureMapping[]?, SamplerMapping[]?)
Manually specifiy buffer mappings.
public ShaderDescription(string name, ShaderStage type, FeatureLevel featureLevel, byte[]? byteCode, ConstantBufferMapping[]? constantBuffers = null, TextureMapping[]? textures = null, SamplerMapping[]? samplers = null)
Parameters
namestringtypeShaderStagefeatureLevelFeatureLevelbyteCodebyte[]constantBuffersConstantBufferMapping[]texturesTextureMapping[]samplersSamplerMapping[]
ShaderDescription(string, ShaderStage, byte[]?)
public ShaderDescription(string name, ShaderStage type, byte[]? byteCode)
Parameters
namestringtypeShaderStagebyteCodebyte[]
Properties
ByteCode
Gets or sets the byte code.
[DataMember]
public byte[]? ByteCode { get; set; }
Property Value
- byte[]
The byte code.
ByteCodeName
Gets or sets the name of the byte code.
[IgnoreDataMember]
public string? ByteCodeName { get; }
Property Value
- string
The name of the byte code.
ConstantBufferMappings
Gets or sets the constant buffer mappings.
[IgnoreDataMember]
public ConstantBufferMapping[]? ConstantBufferMappings { get; }
Property Value
- ConstantBufferMapping[]
The constant buffer mappings.
GSSOElement
Gets or sets the gs stream output element.
[DataMember]
public StreamOutputElement[]? GSSOElement { get; set; }
Property Value
- StreamOutputElement[]
The gsso element.
GSSORasterized
Gets or sets the gs stream output rasterized stream index.
[DataMember]
public int GSSORasterized { get; set; }
Property Value
- int
The gsso rasterized stream index.
GSSOStrides
Gets or sets the gs stream output strides.
[DataMember]
public int[]? GSSOStrides { get; set; }
Property Value
- int[]
The gsso strides.
IsGSStreamOut
Gets or sets a value indicating whether this instance is gs stream out.
[DataMember]
public bool IsGSStreamOut { get; set; }
Property Value
- bool
trueif this instance is gs stream out; otherwise,false.
Level
Gets or sets the level.
[IgnoreDataMember]
public FeatureLevel Level { get; }
Property Value
- FeatureLevel
The level.
Name
Gets or sets the name.
[DataMember]
public string Name { get; set; }
Property Value
- string
The name.
SamplerMappings
Gets or sets the sampler mappings.
[IgnoreDataMember]
public SamplerMapping[]? SamplerMappings { get; }
Property Value
- SamplerMapping[]
The sampler mappings.
ShaderReflector
Gets or sets the shader reflector.
[IgnoreDataMember]
public IShaderReflector ShaderReflector { get; }
Property Value
- IShaderReflector
The shader reflector.
ShaderType
Gets or sets the type of the shader.
[DataMember]
public ShaderStage ShaderType { get; set; }
Property Value
- ShaderStage
The type of the shader.
TextureMappings
Gets or sets the texture mappings.
[IgnoreDataMember]
public TextureMapping[]? TextureMappings { get; }
Property Value
- TextureMapping[]
The texture mappings.
UAVMappings
Gets or sets the uav mappings.
[IgnoreDataMember]
public UAVMapping[]? UAVMappings { get; }
Property Value
- UAVMapping[]
The uav mappings.
Methods
Clone()
Clones this instance.
public ShaderDescription Clone()
Returns
CreateShader(Device, IConstantBufferPool)
Create Shader.
All constant buffers for all shaders are created here./>
public ShaderBase? CreateShader(Device device, IConstantBufferPool pool)
Parameters
deviceDevicepoolIConstantBufferPool