o3de / o3de-azslc

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

little fix: `static` in SRG caused double emission #74

Closed siliconvoodoo closed 1 year ago

siliconvoodoo commented 1 year ago

prohibit static SRG members emission, because static members don't participate in the resources, they are normal local variables. they will be taken care of by their normal emission path.

input:

ShaderResourceGroup S : slot1
{
    static Texture2D t;
};

result before:

static Texture2D S_t : register(t0, space0);
static Texture2D S_t;

result now:

static Texture2D S_t;
siliconvoodoo commented 1 year ago

@VickyAtAZ ping for review? The idea here is that shader programmers who use "static" in SRG scope (for example to store pseudo global states) had a bug that caused invalid HLSL. Now fixed.