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
This commit is contained in:
18
Test/hlsl.identifier.sample.frag
Normal file
18
Test/hlsl.identifier.sample.frag
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user