docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ShaderWarningCollector

    Collects shader warnings from the Unity log during builds and test runs. When enabled via -shader-warnings-as-errors, captured warnings are written to a ShaderWarnings.log artifact and can be used to fail the job.

    Inheritance
    object
    ShaderWarningCollector
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    public static class ShaderWarningCollector

    Properties

    CollectedWarnings

    The deduplicated, sorted list of collected warnings. Only valid after StopAndReport().

    Declaration
    public static IReadOnlyList<string> CollectedWarnings { get; }
    Property Value
    Type Description
    IReadOnlyList<string>

    HasWarnings

    Whether any shader warnings have been collected.

    Declaration
    public static bool HasWarnings { get; }
    Property Value
    Type Description
    bool

    IsCollecting

    Whether the collector is currently listening for shader warnings.

    Declaration
    public static bool IsCollecting { get; }
    Property Value
    Type Description
    bool

    OutputFilePath

    The file path where collected warnings will be written when StopAndReport() is called.

    Declaration
    public static string OutputFilePath { get; set; }
    Property Value
    Type Description
    string

    Methods

    StartCollecting()

    Starts listening for shader warnings on UnityEngine.Application.logMessageReceivedThreaded. Clears any previously collected warnings.

    Declaration
    public static void StartCollecting()

    StopAndReport()

    Stops listening, writes collected warnings to a file, and publishes the file as a test artifact.

    Declaration
    public static void StopAndReport()
    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)