o3de / o3de-azslc

Amazon Shader Language (AZSL) Compiler
Other
23 stars 14 forks source link

[ATOM-2430] Better Error Message For Unknown SRG Field #4

Closed galibzon closed 3 years ago

galibzon commented 3 years ago

With this fix, AZSLc fails when undefined SRG variables or functions are detected during code emission.

BEFORE: The shader pipeline would rely on DXC to detect the error, which would be a non-informative error like: """ shadersource:561:23: error: use of undeclared identifier 'MaterialSrg'" """

NOW: AZSLc itself detects the error and the message looks like: """ StandardPBR_ForwardPass.azslin(1031,24) : Emitter error #267: Undefined ShaderResourceGroup symbol 'MaterialSrg::m_specularF0Factor' """

Added a couple of test cases where the error is expected to occur.

Signed-off-by: garrieta garrieta@amazon.com