o3de / o3de-azslc

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

fixup of inconvenience in emission: over-generation of sharp-line directives #73

Closed siliconvoodoo closed 1 year ago

siliconvoodoo commented 2 years ago

before:

// HLSL emission by AZSL Compiler 1.8.11 Win64
#line 1 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
#line 8 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
struct SRG_CB
{
    float4 color;
};

#line 6 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
/* Generated code from  ShaderResourceGroup SRG*/
ConstantBuffer <::SRG_CB> SRG_m_uniforms : register(b0, space0);

#line 13 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
#line 16 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
float4 MainPS( float2 uv :TEXCOORD0) :SV_Target0
{
return ::SRG_m_uniforms . color ;
} 

after:

// HLSL emission by AZSL Compiler 1.8.12 Win64
#line 8 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
struct SRG_CB
{
    float4 color;
};

#line 6 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
/* Generated code from  ShaderResourceGroup SRG*/
ConstantBuffer <::SRG_CB> SRG_m_uniforms : register(b0, space0);

#line 16 "C:/Users/VIVIEN~1.ODD/AppData/Local/Temp/tmp-20816yhxILeM5tXWl"
float4 MainPS( float2 uv :TEXCOORD0) :SV_Target0
{
return ::SRG_m_uniforms . color ;
} 
siliconvoodoo commented 1 year ago

@galibzon ping? 5 lines + the test addition :p