o3de / o3de-azslc

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

attribute before SRG mixes up inside comment #69

Open siliconvoodoo opened 2 years ago

siliconvoodoo commented 2 years ago

source:

ShaderResourceGroupSemantic ExampleBinding 
{
    FrequencyId = 0; 
    ShaderVariantFallback = 128;
};

[[verbatim("#include \"header.azsli\"")]]

ShaderResourceGroup ExampleSRG : ExampleBinding
{
    float4 exampleColor;
};

output:

// HLSL emission by AZSL Compiler 1.8.11 Win64
#line 7 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-24300NAm7hfF3AICj"
#line 15 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-24300NAm7hfF3AICj"
/* Generated code from #include "header.azsli"
 ShaderResourceGroup ExampleSRG*/
struct ExampleSRG_SRGConstantsStruct
{
    float4 ExampleSRG_exampleColor;
    uint4 ExampleSRG_m_SHADER_VARIANT_KEY_NAME_[1];
};

ConstantBuffer<::ExampleSRG_SRGConstantsStruct> ExampleSRG_SRGConstantBuffer : register(b0, space0);