IsValidationSupported()
Returns whether the current graphics backend exposes a validation implementation.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public static bool IsValidationSupported()
Returns
Type | Description |
|---|---|
| bool | true if the active GraphicsDeviceType has a validation implementation; otherwise false. |
Remarks
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.
Examples
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 ... }}