transform: Add more HLSL keywords

List taken from https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords

Change-Id: I2ef8cae85159d9a5d941c4a2e6e77cdbebaa9f1f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59620
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton 2021-07-26 15:17:38 +00:00 committed by Tint LUCI CQ
parent 64dfcd2c32
commit dd2e2ba4e2
2 changed files with 12 additions and 0 deletions

View File

@ -108,6 +108,7 @@ const char* kReservedKeywordsHLSL[] = {
"RWByteAddressBuffer", "RWByteAddressBuffer",
"RWStructuredBuffer", "RWStructuredBuffer",
"RWTexture1D", "RWTexture1D",
"RWTexture1DArray",
"RWTexture2D", "RWTexture2D",
"RWTexture2DArray", "RWTexture2DArray",
"RWTexture3D", "RWTexture3D",
@ -144,6 +145,8 @@ const char* kReservedKeywordsHLSL[] = {
"Sampler2D", "Sampler2D",
"Sampler3D", "Sampler3D",
"SamplerCUBE", "SamplerCUBE",
"SamplerComparisonState",
"SamplerState",
"StructuredBuffer", "StructuredBuffer",
"TANGENT", "TANGENT",
"TESSFACTOR", "TESSFACTOR",
@ -151,6 +154,7 @@ const char* kReservedKeywordsHLSL[] = {
"Texcoord", "Texcoord",
"Texture", "Texture",
"Texture1D", "Texture1D",
"Texture1DArray",
"Texture2D", "Texture2D",
"Texture2DArray", "Texture2DArray",
"Texture2DMS", "Texture2DMS",
@ -203,6 +207,7 @@ const char* kReservedKeywordsHLSL[] = {
"class", "class",
"clip", "clip",
"column_major", "column_major",
"compile",
"compile_fragment", "compile_fragment",
"const", "const",
"const_cast", "const_cast",
@ -214,6 +219,7 @@ const char* kReservedKeywordsHLSL[] = {
"ddy", "ddy",
"ddy_coarse", "ddy_coarse",
"ddy_fine", "ddy_fine",
"default",
"degrees", "degrees",
"delete", "delete",
"discard", "discard",

View File

@ -316,6 +316,7 @@ INSTANTIATE_TEST_SUITE_P(RenamerTestHlsl,
"RWByteAddressBuffer", "RWByteAddressBuffer",
"RWStructuredBuffer", "RWStructuredBuffer",
"RWTexture1D", "RWTexture1D",
"RWTexture1DArray",
"RWTexture2D", "RWTexture2D",
"RWTexture2DArray", "RWTexture2DArray",
"RWTexture3D", "RWTexture3D",
@ -352,6 +353,8 @@ INSTANTIATE_TEST_SUITE_P(RenamerTestHlsl,
"Sampler2D", "Sampler2D",
"Sampler3D", "Sampler3D",
"SamplerCUBE", "SamplerCUBE",
"SamplerComparisonState",
"SamplerState",
"StructuredBuffer", "StructuredBuffer",
"TANGENT", "TANGENT",
"TESSFACTOR", "TESSFACTOR",
@ -359,6 +362,7 @@ INSTANTIATE_TEST_SUITE_P(RenamerTestHlsl,
"Texcoord", "Texcoord",
"Texture", "Texture",
"Texture1D", "Texture1D",
"Texture1DArray",
"Texture2D", "Texture2D",
"Texture2DArray", "Texture2DArray",
"Texture2DMS", "Texture2DMS",
@ -420,6 +424,7 @@ INSTANTIATE_TEST_SUITE_P(RenamerTestHlsl,
"class", "class",
"clip", "clip",
"column_major", "column_major",
"compile",
"compile_fragment", "compile_fragment",
// "const", // WGSL keyword // "const", // WGSL keyword
"const_cast", "const_cast",
@ -434,6 +439,7 @@ INSTANTIATE_TEST_SUITE_P(RenamerTestHlsl,
"ddy", "ddy",
"ddy_coarse", "ddy_coarse",
"ddy_fine", "ddy_fine",
// "default", // WGSL keyword
"degrees", "degrees",
"delete", "delete",
// "determinant", // WGSL intrinsic // "determinant", // WGSL intrinsic