docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ConstantBuffer<CBType>

    An instance of a constant buffer.

    Inheritance
    object
    ConstantBufferBase
    ConstantBuffer<CBType>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public class ConstantBuffer<CBType> : ConstantBufferBase where CBType : struct
    Type Parameters
    Name Description
    CBType

    The type of structure representing the constant buffer data.

    Constructors

    ConstantBuffer()

    Constant Buffer constructor.

    Declaration
    public ConstantBuffer()

    Methods

    PushGlobal(CommandBuffer, in CBType, int)

    Update the GPU data of the constant buffer and bind it globally via a command buffer.

    Declaration
    public void PushGlobal(CommandBuffer cmd, in CBType data, int shaderId)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command Buffer used to execute the graphic commands.

    CBType data

    Input data of the constant buffer.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    PushGlobal(in CBType, int)

    Update the GPU data of the constant buffer and bind it globally.

    Declaration
    public void PushGlobal(in CBType data, int shaderId)
    Parameters
    Type Name Description
    CBType data

    Input data of the constant buffer.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    Release()

    Release the constant buffers.

    Declaration
    public override void Release()
    Overrides
    ConstantBufferBase.Release()

    Set(ComputeShader, int)

    Bind the constant buffer to a compute shader.

    Declaration
    public void Set(ComputeShader cs, int shaderId)
    Parameters
    Type Name Description
    ComputeShader cs

    Compute shader to which the constant buffer should be bound.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    Set(Material, int)

    Bind the constant buffer to a material.

    Declaration
    public void Set(Material mat, int shaderId)
    Parameters
    Type Name Description
    Material mat

    Material to which the constant buffer should be bound.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    Set(MaterialPropertyBlock, int)

    Bind the constant buffer to a material property block.

    Declaration
    public void Set(MaterialPropertyBlock mpb, int shaderId)
    Parameters
    Type Name Description
    MaterialPropertyBlock mpb

    Material property block to which the constant buffer should be bound.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    Set(CommandBuffer, ComputeShader, int)

    Bind the constant buffer to a compute shader via a command buffer.

    Declaration
    public void Set(CommandBuffer cmd, ComputeShader cs, int shaderId)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command Buffer used to execute the graphic commands.

    ComputeShader cs

    Compute shader to which the constant buffer should be bound.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    SetGlobal(int)

    Bind the constant buffer globally.

    Declaration
    public void SetGlobal(int shaderId)
    Parameters
    Type Name Description
    int shaderId

    Shader porperty id to bind the constant buffer to.

    SetGlobal(CommandBuffer, int)

    Bind the constant buffer globally via a command buffer.

    Declaration
    public void SetGlobal(CommandBuffer cmd, int shaderId)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command Buffer used to execute the graphic commands.

    int shaderId

    Shader porperty id to bind the constant buffer to.

    UpdateData(CommandBuffer, in CBType)

    Update the GPU data of the constant buffer via a command buffer.

    Declaration
    public void UpdateData(CommandBuffer cmd, in CBType data)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Command Buffer used to execute the graphic commands.

    CBType data

    Input data of the constant buffer.

    UpdateData(in CBType)

    Update the GPU data of the constant buffer.

    Declaration
    public void UpdateData(in CBType data)
    Parameters
    Type Name Description
    CBType data

    Input data of the constant buffer.

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)