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

View File

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