From dd2e2ba4e245dd0f2a9f55d283166b257e185b07 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 26 Jul 2021 15:17:38 +0000 Subject: [PATCH] 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 Reviewed-by: James Price Auto-Submit: Ben Clayton Kokoro: Kokoro Commit-Queue: James Price --- src/transform/renamer.cc | 6 ++++++ src/transform/renamer_test.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/transform/renamer.cc b/src/transform/renamer.cc index bf39211ee9..712f70ed84 100644 --- a/src/transform/renamer.cc +++ b/src/transform/renamer.cc @@ -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", diff --git a/src/transform/renamer_test.cc b/src/transform/renamer_test.cc index a78a8c1261..cfd77d519d 100644 --- a/src/transform/renamer_test.cc +++ b/src/transform/renamer_test.cc @@ -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