Documentation

Unity Engine

Download Unity

Unity Engine

GetShaderMessages

Gets the errors and warnings that the shader compiler generated for a shader on all compiler platforms.
Read time 1 minuteLast updated 17 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

GetShaderMessages(Shader)

Gets the errors and warnings that the shader compiler generated for a shader on all compiler platforms.
public static ShaderMessage[] GetShaderMessages(Shader s)

Parameters

The Shader instance to check for messages.

Returns

Type

Description

ShaderMessage[]An array of ShaderMessage structs that contains the generated messages.

Remarks

Use this method to check whether a shader compiled without errors. The method returns the messages from every compiler platform. To get the messages for a single platform, use the overload that takes a ShaderCompilerPlatform.

GetShaderMessages(Shader, ShaderCompilerPlatform)

Gets the errors and warnings that the shader compiler generated for a shader on a specific compiler platform.
public static ShaderMessage[] GetShaderMessages(Shader s, ShaderCompilerPlatform platform)

Parameters

The Shader instance to check for messages.

The ShaderCompilerPlatform to get messages for.

Returns

Type

Description

ShaderMessage[]An array of ShaderMessage structs that contains the generated messages.

Remarks

Use this method to check whether a shader compiles without errors for a specific graphics API. The method returns only the messages that the compiler generated for
platform
. To get the messages for all platforms, use the overload without a platform.