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

GraphicsApiValidation.IsValidationSupported

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 IsValidationSupported();

Returns

bool true if the active GraphicsDeviceType has a validation implementation; otherwise false.

Description

Returns whether the current graphics backend exposes a validation implementation.

Use this as the first gate before calling any other GraphicsApiValidation member. On backends that don't implement validation, all other members are no-ops and return default values.

A return value of true doesn't guarantee that validation is actually running, only that it can be requested. Use GraphicsApiValidation.IsValidationActive to confirm the debug layer initialized successfully.

using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour { void Start() { if (!GraphicsApiValidation.IsValidationSupported()) { Debug.Log("Graphics validation isn't available on the current backend."); return; }

// ... continue with validation-aware code ... } }