docs.unity3d.com
    Show / Hide Table of Contents

    Class GenerateHLSL

    Attribute specifying that HLSL code should be generated.

    Inheritance
    Object
    Attribute
    GenerateHLSL
    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

    Extension Methods

    ReflectionUtils.Invoke(Object, String, Object[])
    ReflectionUtils.SetField(Object, String, Object)
    ReflectionUtils.GetField(Object, String)
    ReflectionUtils.GetFields(Object)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023