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

GraphicsApiValidation.GetValidationError

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 string GetValidationError(int index);

Parameters

Parameter Description
index The zero-based index of the error to retrieve. Valid values are in the range [0, GetValidationErrorCount()).

Returns

string The error message at the requested index, or null if the index is out of range.

Description

Returns a specific graphics API validation error message by index.

Call GraphicsApiValidation.GetValidationErrorCount first to determine the valid index range. Indices are stable for a given accumulation window and become invalid after a call to GraphicsApiValidation.ClearValidationErrors.

using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour { void LogFirstError() { if (GraphicsApiValidation.GetValidationErrorCount() == 0) return;

string firstError = GraphicsApiValidation.GetValidationError(0); Debug.LogError($"First graphics API validation error: {firstError}"); } }