Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetValidationErrorLoggingSuppressed(bool)

Controls whether graphics API validation errors are logged immediately as the debug layer reports them.
Read time 1 minuteLast updated 13 days ago

Definition

public static void SetValidationErrorLoggingSuppressed(bool suppressed)

Parameters

suppressed

Whether to suppress immediate logging of validation errors.

Remarks

When suppressed, errors are still accumulated and can be retrieved with GraphicsApiValidation.GetValidationErrorCount and GraphicsApiValidation.GetValidationError, but the caller is responsible for logging them. Test frameworks typically suppress logging to avoid race conditions between asynchronous validation callbacks and test teardown.

Examples

using UnityEngine;using UnityEngine.Rendering;public class Example : MonoBehaviour{ void RunWithSuppressedLogging() { bool wasSuppressed = GraphicsApiValidation.IsValidationErrorLoggingSuppressed(); GraphicsApiValidation.SetValidationErrorLoggingSuppressed(true); try { // ... run code that issues graphics commands ... } finally { GraphicsApiValidation.SetValidationErrorLoggingSuppressed(wasSuppressed); } }}