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
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public static void SetValidationErrorLoggingSuppressed(bool suppressed)
Parameters
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.
Additional Resources: GraphicsApiValidation.IsValidationErrorLoggingSuppressed.
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); } }}