docs.unity.cn
    Show / Hide Table of Contents

    Struct TextureHandle

    An abstract handle representing a texture resource as known by one particular record + execute of the render graph. TextureHandles should not be used outside of the context of a render graph execution.

    A render graph needs to do additional state tracking on texture resources (lifetime, how is it used,...) to enable this all textures relevant to the render graph need to be make known to it. A texture handle specifies such a texture as known to the render graph.

    It is important to understand that a render graph texture handle does not necessarily represent an actual texture. For example textures could be created the render graph that are only referenced by passes that are later culled when executing the graph. Such textures would never be allocated as actual RenderTextures.

    Texture handles are only relevant to one particular record+execute phase of the render graph. After execution all texture handles are invalidated. The system will catch texture handles from a different execution of RenderGraph.RecordAndExecute but still users should be careful to avoid keeping texture handles around from other render graph executions.

    Texture handles do not need to be disposed/freed (they are auto-invalidated at the end of graph execution). The RenderTextures they represent are either freed by the render graph internally (when the handle was acquired through RenderGraph.CreateTexture) or explicitly managed by some external system (when acquired through RenderGraph.ImportTexture).

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.Experimental.Rendering.RenderGraphModule
    Syntax
    public struct TextureHandle

    Properties

    nullHandle

    Returns a null texture handle

    Declaration
    public static readonly TextureHandle nullHandle { get; }
    Property Value
    Type Description
    TextureHandle

    A null texture handle.

    Methods

    IsValid()

    Return true if the handle is valid.

    Declaration
    public bool IsValid()
    Returns
    Type Description
    Boolean

    True if the handle is valid.

    Operators

    Implicit(TextureHandle to RenderTargetIdentifier)

    Cast to RenderTargetIdentifier

    Declaration
    public static implicit operator RenderTargetIdentifier(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Input TextureHandle.

    Returns
    Type Description
    RenderTargetIdentifier

    Resource as a RenderTargetIdentifier.

    Implicit(TextureHandle to RTHandle)

    Cast to RTHandle

    Declaration
    public static implicit operator RTHandle(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Input TextureHandle.

    Returns
    Type Description
    RTHandle

    Resource as a RTHandle.

    Implicit(TextureHandle to RenderTexture)

    Cast to RenderTexture

    Declaration
    public static implicit operator RenderTexture(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Input TextureHandle.

    Returns
    Type Description
    RenderTexture

    Resource as a RenderTexture.

    Implicit(TextureHandle to Texture)

    Cast to Texture

    Declaration
    public static implicit operator Texture(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Input TextureHandle.

    Returns
    Type Description
    Texture

    Resource as a Texture.

    Extension Methods

    AnalyticsUtils.ToNestedColumn<T>(T, Boolean)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, Boolean)
    ReflectionUtils.Invoke(Object, String, Object[])
    ReflectionUtils.SetField(Object, String, Object)
    ReflectionUtils.GetField(Object, String)
    ReflectionUtils.GetFields(Object)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 08 September 2023