docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BaseCommandBuffer

    Render graph command buffer types inherit from this base class. It provides some shared functionality for all command buffer types.

    Inheritance
    object
    BaseCommandBuffer
    ComputeCommandBuffer
    RasterCommandBuffer
    UnsafeCommandBuffer
    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 BaseCommandBuffer

    Fields

    m_WrappedCommandBuffer

    The instance of Unity's CommandBuffer that this class encapsulates, providing access to lower-level rendering commands.

    Declaration
    protected CommandBuffer m_WrappedCommandBuffer
    Field Value
    Type Description
    CommandBuffer

    Properties

    name

    See (https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer-name.html)

    Declaration
    public string name { get; }
    Property Value
    Type Description
    string

    sizeInBytes

    See (https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer-sizeInBytes.html)

    Declaration
    public int sizeInBytes { get; }
    Property Value
    Type Description
    int

    Methods

    ThrowIfGlobalStateNotAllowed()

    Checks if modifying the global state is permitted by the currently executing render graph pass. If such modifications are not allowed, an InvalidOperationException is thrown.

    Declaration
    [Conditional("DEVELOPMENT_BUILD")]
    [Conditional("UNITY_EDITOR")]
    protected void ThrowIfGlobalStateNotAllowed()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the current render graph pass does not permit modifications to global state.

    ThrowIfRasterNotAllowed()

    Checks if the Raster Command Buffer has set a valid render target.

    Declaration
    [Conditional("DEVELOPMENT_BUILD")]
    [Conditional("UNITY_EDITOR")]
    protected void ThrowIfRasterNotAllowed()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the there are no active render targets.

    ValidateTextureHandle(TextureHandle)

    Ensures that the texture handle being used is valid for the currently executing render graph pass. This includes checks to ensure that the texture handle is registered for read or write access and is not being used incorrectly as a render target attachment.

    Declaration
    [Conditional("DEVELOPMENT_BUILD")]
    [Conditional("UNITY_EDITOR")]
    protected void ValidateTextureHandle(TextureHandle h)
    Parameters
    Type Name Description
    TextureHandle h

    The TextureHandle to validate for the current pass.

    Exceptions
    Type Condition
    Exception

    Throws an exception if the texture handle is not properly registered for the pass or being used incorrectly.

    ValidateTextureHandleRead(TextureHandle)

    Validates that the specified texture handle is registered for read access within the context of the current executing render graph pass. Throws an exception if the texture is not registered for reading or is used incorrectly as a render target attachment.

    Declaration
    [Conditional("DEVELOPMENT_BUILD")]
    [Conditional("UNITY_EDITOR")]
    protected void ValidateTextureHandleRead(TextureHandle h)
    Parameters
    Type Name Description
    TextureHandle h

    The TextureHandle to validate for read access.

    Exceptions
    Type Condition
    Exception

    Throws an exception if the texture handle is either not registered as a readable resource or misused as both an attachment and a regular texture.

    ValidateTextureHandleWrite(TextureHandle)

    Validates that the specified texture handle is registered for write access within the context of the current executing render graph pass. Additionally, it checks that built-in textures are not being written to, and that the texture is not incorrectly used as a render target attachment. An exception is thrown if any of these checks fail.

    Declaration
    [Conditional("DEVELOPMENT_BUILD")]
    [Conditional("UNITY_EDITOR")]
    protected void ValidateTextureHandleWrite(TextureHandle h)
    Parameters
    Type Name Description
    TextureHandle h

    The TextureHandle to validate for write access.

    Exceptions
    Type Condition
    Exception

    Throws an exception if the texture handle is not registered for writing, attempts to write to a built-in texture, or is misused as both a writeable resource and a render target attachment.

    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, 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)