glslang/Test/hlsl.identifier.sample.frag
steve-lunarg 75fd223f03 HLSL: allow "sample" as a valid identifier.
HLSL has keywords for various interpolation modifiers such as "linear",
"centroid", "sample", etc.  Of these, "sample" appears to be special,
as it is also accepted as an identifier string, where the others are not.

This PR adds this ability, so the construct "int sample = 42;" no longer
produces a compilation error.

New test = hlsl.identifier.sample.frag
2016-11-16 13:22:11 -07:00

19 lines
419 B
GLSL

struct MyStruct {
sample float a;
noperspective float b;
linear float c;
centroid float d;
};
int sample(int x) { return x; } // HLSL allows this as an identifier as well.
float4 main() : SV_Target0
{
// HLSL allows this as an identifier as well.
// However, this is not true of other qualifier keywords such as "linear".
int sample = 3;
return float4(0,0,0,0);
}