docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class STPUpscalerContext

    Per-camera context for STP upscaling. Wraps the STP.HistoryContext and tracks the display resolution it was created for.

    Inheritance
    object
    STPUpscalerContext
    Implements
    IUpscalerContext
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Global Namespace
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public class STPUpscalerContext : IUpscalerContext

    Constructors

    STPUpscalerContext(Vector2Int)

    Creates a context holding fresh STP history for the given display resolution.

    Declaration
    public STPUpscalerContext(Vector2Int displayResolution)
    Parameters
    Type Name Description
    Vector2Int displayResolution

    The display (post-upscale) resolution this context is created for.

    Properties

    createdForDisplayResolution

    The display resolution this context was created for. Upscaler authors set this at creation time. The context manager reads it to detect resolution and options changes that require context recreation.

    Declaration
    public Vector2Int createdForDisplayResolution { get; }
    Property Value
    Type Description
    Vector2Int

    historyContext

    The STP history state this context owns, carried across frames so STP can reproject previous frames.

    Declaration
    public STP.HistoryContext historyContext { get; }
    Property Value
    Type Description
    STP.HistoryContext

    lastUsedFrame

    The frame number when this context was last used. Set automatically by the context manager each frame to track when unused contexts should be cleaned up.

    Declaration
    public int lastUsedFrame { get; set; }
    Property Value
    Type Description
    int

    Methods

    Cleanup(CommandBuffer)

    Releases native resources associated with this context. Called automatically by the context manager when the context expires, needs recreation, or the upscaling system is disposed.

    Declaration
    public void Cleanup(CommandBuffer cmd)
    Parameters
    Type Name Description
    CommandBuffer cmd

    The command buffer used to record cleanup commands into. The caller executes it.

    Remarks

    A command buffer is taken rather than this being a plain managed Dispose because some upscalers own native resources that must be released on the render thread. Implementations may record a render-thread signal here instead of GPU work, and the release may complete asynchronously.

    IsValidForOptions(UpscalerOptions)

    Checks if this context is still valid for the given options. Upscaler authors implement the validation logic. The context manager calls this each frame to determine if the context needs recreation.

    Declaration
    public bool IsValidForOptions(UpscalerOptions options)
    Parameters
    Type Name Description
    UpscalerOptions options

    The current upscaler options to validate against.

    Returns
    Type Description
    bool

    True if the context is still valid, false if it needs to be recreated.

    Implements

    IUpscalerContext

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    In This Article
    Back to top
    Copyright © 2026 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)