Class GenerateHLSL
Attribute specifying that HLSL code should be generated.
Namespace: UnityEngine.Rendering
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum)]
public class GenerateHLSL : Attribute, _Attribute
Constructors
GenerateHLSL(PackingRules, Boolean, Boolean, Boolean, Int32, Boolean, Boolean, Boolean, Int32, String)
GenerateHLSL attribute constructor.
Declaration
public GenerateHLSL(PackingRules rules = PackingRules.Exact, bool needAccessors = true, bool needSetters = false, bool needParamDebug = false, int paramDefinesStart = 1, bool omitStructDeclaration = false, bool containsPackedFields = false, bool generateCBuffer = false, int constantRegister = -1, string sourcePath = null)
Parameters
Type | Name | Description |
---|---|---|
PackingRules | rules | Packing rules. |
Boolean | needAccessors | Need accessors. |
Boolean | needSetters | Need setters. |
Boolean | needParamDebug | Need debug defines. |
Int32 | paramDefinesStart | Start value of debug defines. |
Boolean | omitStructDeclaration | Omit structure declaration. |
Boolean | containsPackedFields | Contains packed fields. |
Boolean | generateCBuffer | Generate a constant buffer. |
Int32 | constantRegister | When generating a constant buffer, specify the optional constant register. |
String | sourcePath | Location of the source file defining the C# type. (Automatically filled by compiler) |
Fields
constantRegister
If specified, when generating a constant buffer, use this explicit register.
Declaration
public int constantRegister
Field Value
Type | Description |
---|---|
Int32 |
containsPackedFields
Structure contains packed fields.
Declaration
public bool containsPackedFields
Field Value
Type | Description |
---|---|
Boolean |
generateCBuffer
Generate constant buffer declaration or not.
Declaration
public bool generateCBuffer
Field Value
Type | Description |
---|---|
Boolean |
needAccessors
Structure needs generated accessors.
Declaration
public bool needAccessors
Field Value
Type | Description |
---|---|
Boolean |
needParamDebug
Structure needs generated debug defines and functions.
Declaration
public bool needParamDebug
Field Value
Type | Description |
---|---|
Boolean |
needSetters
Structure needs generated setters.
Declaration
public bool needSetters
Field Value
Type | Description |
---|---|
Boolean |
omitStructDeclaration
Generate structure declaration or not.
Declaration
public bool omitStructDeclaration
Field Value
Type | Description |
---|---|
Boolean |
packingRules
Packing rules for the struct.
Declaration
public PackingRules packingRules
Field Value
Type | Description |
---|---|
PackingRules |
paramDefinesStart
Start value of generated defines.
Declaration
public int paramDefinesStart
Field Value
Type | Description |
---|---|
Int32 |
sourcePath
Path of the generated file
Declaration
public string sourcePath
Field Value
Type | Description |
---|---|
String |