ドキュメント

Unity Engine

Unity Engine

SetValidationErrorLoggingSuppressed(bool)

Controls whether graphics API validation errors are logged immediately as the debug layer reports them.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

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); } }}