o3de / o3de-azslc

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

[ATOM-16433] AZSLc: Revert Matrix3x3 padding. #7

Closed galibzon closed 2 years ago

galibzon commented 2 years ago

[ATOM-16433] AZSLc: Revert Matrix3x3 padding. Trigger Error When identifying alignment issues. Provide option to bypass error.

This is v1.7.29

This is the exhaustive solution to validate the struct/class/SRG Layout data alignment problem when: 1- There are float or float2 variables preceded by matrices or structs that end in matrices of type: float2x2, float3x2, float4x2 In such case the "float" or "float2" should be prepadded by a float3 variable and the solution is describbed in the error produced by AZSLc.

2- The other cases are when "float" type variables are preceded by matrices or structs that end in matrices of type: float2x3, float3x3, float4x3 In such case the "float" must be prepadded by a float2 variables. This solution is describbed in the error produced by AZSLc.

Alternatively the user can skip this aligment error validation with '--no-aligment-validation' command line option.

Error message example:

tests\Emission\AsError\matRC_padding.azsl(,) : IR error #131: Detected potential alignment issues related with DXC flag '-fvk-use-dx-layout':

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

[ATOM-16433] AZSLc: Revert Matrix3x3 padding. Trigger Error When identifying alignment issues. Provide option to bypass error.

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