Open moradin opened 9 years ago
The simplest shader I could find to illustrate this is:
vec3 SampleTexture( Texture2D texture, float param ) { vec3 result = lerp(Func(texture), Func(texture), param ); return result; } struct VS_INPUT { float4 pos : POSITION0 ; }; struct VS_OUTPUT { float4 pos : SV_Position ; }; float4 ps_main ( VS_OUTPUT i ) : SV_Target0 { return float4(0,0,0,0); }
after the first Func() is parsed correctly the second one will be parsed as a declaration which leaves the parser in some weird, probably invalid state and the parsing of the VS_INPUT will result in the following code:
struct VS_INPUT { POSITION0; };
It is very possible that the parser is not reset correctly after the function. I'll look into that.
The simplest shader I could find to illustrate this is:
after the first Func() is parsed correctly the second one will be parsed as a declaration which leaves the parser in some weird, probably invalid state and the parsing of the VS_INPUT will result in the following code: