Class BaseCommandBuffer
Render graph command buffer types inherit from this base class. It provides some shared functionality for all command buffer types.
Inherited Members
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
Declaration
public string name { get; }
Property Value
Type | Description |
---|---|
string |
sizeInBytes
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. |