Repository: shader-slang/slang
File: source/slang/slang-diagnostic-defs.h (C/C++)

Code before:

DIAGNOSTIC(56003, Fatal, useOfUninitializedOpaqueHandle, "use of uninitialized opaque handle '$0'.")

// Metal
DIAGNOSTIC(
    56100,
    Error,
    constantBufferInParameterBlockNotAllowedOnMetal,
    "nested 'ConstantBuffer' inside a 'ParameterBlock' is not supported on Metal, use "
    "'ParameterBlock' instead.")
DIAGNOSTIC(
    56101,
    Error,
    resourceTypesInConstantBufferInParameterBlockNotAllowedOnMetal,
    "nesting a 'ConstantBuffer' containing resource types inside a 'ParameterBlock' is not "
    "supported on Metal, please use 'ParameterBlock' instead.")
DIAGNOSTIC(
    56102,
    Error,
    divisionByMatrixNotSupported,
    "division by matrix is not supported for Metal and WGSL targets.")
DIAGNOSTIC(
    56103,
    Error,
    assignToRefNotSupported,
    "assignment to mesh output member via reference not supported for Metal target.")

DIAGNOSTIC(
    56103,
    Error,
    int16NotSupportedInWGSL,
    "16-bit integer type '$0' is not supported by the WGSL backend.")

DIAGNOSTIC(57001, Warning, spirvOptFailed, "spirv-opt failed. $0")
DIAGNOSTIC(57002, Error, unknownPatchConstantParameter, "unknown patch constant parameter '$0'.")
DIAGNOSTIC(57003, Error, unknownTessPartitioning, "unknown tessellation partitioning '$0'.")
DIAGNOSTIC(
    57004,
    Error,
    outputSpvIsEmpty,
    "output SPIR-V contains no exported symbols. Please make sure to specify at least one "
    "entrypoint.")

// GLSL Compatibility
DIAGNOSTIC(
    58001,
    Error,
    entryPointMustReturnVoidWhenGlobalOutputPresent,
    "entry point must return 'void' when global output variables are present.")
DIAGNOSTIC(
    58002,

Review comment (suggestion):
I am not sure if this error message is good enough for the end-users to fix the problem to use `set` method rather than `ref`.

Code after:

DIAGNOSTIC(56003, Fatal, useOfUninitializedOpaqueHandle, "use of uninitialized opaque handle '$0'.")

// Metal
DIAGNOSTIC(
    56100,
    Error,
    constantBufferInParameterBlockNotAllowedOnMetal,
    "nested 'ConstantBuffer' inside a 'ParameterBlock' is not supported on Metal, use "
    "'ParameterBlock' instead.")
DIAGNOSTIC(
    56101,
    Error,
    resourceTypesInConstantBufferInParameterBlockNotAllowedOnMetal,
    "nesting a 'ConstantBuffer' containing resource types inside a 'ParameterBlock' is not "
    "supported on Metal, please use 'ParameterBlock' instead.")
DIAGNOSTIC(
    56102,
    Error,
    divisionByMatrixNotSupported,
    "division by matrix is not supported for Metal and WGSL targets.")
DIAGNOSTIC(
    56103,
    Error,
    int16NotSupportedInWGSL,
    "16-bit integer type '$0' is not supported by the WGSL backend.")
DIAGNOSTIC(
    56104,
    Error,
    assignToRefNotSupported,
    "whole struct must be assiged to mesh output at once for Metal target.")

DIAGNOSTIC(57001, Warning, spirvOptFailed, "spirv-opt failed. $0")
DIAGNOSTIC(57002, Error, unknownPatchConstantParameter, "unknown patch constant parameter '$0'.")
DIAGNOSTIC(57003, Error, unknownTessPartitioning, "unknown tessellation partitioning '$0'.")
DIAGNOSTIC(
    57004,
    Error,
    outputSpvIsEmpty,
    "output SPIR-V contains no exported symbols. Please make sure to specify at least one "
    "entrypoint.")

// GLSL Compatibility
DIAGNOSTIC(
    58001,
    Error,
    entryPointMustReturnVoidWhenGlobalOutputPresent,
    "entry point must return 'void' when global output variables are present.")
DIAGNOSTIC(
    58002,
    Error,