Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

GraphicsApiValidation.IsValidationErrorLoggingSuppressed

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool IsValidationErrorLoggingSuppressed();

Returns

bool true if immediate logging is suppressed; otherwise false.

Description

Returns whether immediate logging of graphics API validation errors is currently suppressed.

Use this to check the current logging state before changing it, for example so you can restore it after a temporary scope. Logging isn't suppressed by default; the value only changes when something calls GraphicsApiValidation.SetValidationErrorLoggingSuppressed.

Additional resources: GraphicsApiValidation.SetValidationErrorLoggingSuppressed.

using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour { // When logging is suppressed, accumulated errors haven't been written // to the log yet, so the caller is responsible for emitting them. void ReportAccumulatedErrors() { if (GraphicsApiValidation.IsValidationErrorLoggingSuppressed()) { int count = GraphicsApiValidation.GetValidationErrorCount(); for (int i = 0; i < count; i++) { Debug.LogError(GraphicsApiValidation.GetValidationError(i)); } } } }