tint->dawn: Move src/dawn_native -> src/dawn/native

Bug: dawn:1275
Change-Id: Ic60a00107a015bc677ff929c492f1085ffc38482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
diff --git a/generator/BUILD.gn b/generator/BUILD.gn
index 9d0023b..a1d954a 100644
--- a/generator/BUILD.gn
+++ b/generator/BUILD.gn
@@ -21,7 +21,7 @@
 # autogenerated sources there.
 _stale_dirs = [
   "dawn",
-  "dawn_native",
+  "dawn/native",
   "dawn/wire",
   "mock",
   "src",
diff --git a/generator/dawn_generator.gni b/generator/dawn_generator.gni
index f407735..c1eb5b9 100644
--- a/generator/dawn_generator.gni
+++ b/generator/dawn_generator.gni
@@ -26,7 +26,7 @@
 #  2. src/include and dawn_gen_root/src/include has to match the structure of
 #    the source tree too.
 #  3. Dawn files must use include relative to src/ or src/include such as
-#    "dawn/dawn.h" or "dawn_native/backend/BackendStuff.h".
+#    "dawn/dawn.h" or "dawn/native/backend/BackendStuff.h".
 #
 # The allowed list below ensure 1). Include directory rules for Dawn ensure 3)
 # and 2) is something we need to enforce in code review.
@@ -39,8 +39,8 @@
 
 dawn_allowed_gen_output_dirs = [
   "src/dawn/",
-  "src/dawn_native/",
-  "src/dawn_native/opengl/",
+  "src/dawn/native/",
+  "src/dawn/native/opengl/",
   "src/dawn/wire/client/",
   "src/dawn/wire/server/",
   "src/dawn/wire/",
diff --git a/generator/dawn_json_generator.py b/generator/dawn_json_generator.py
index cc181aa..4151f27 100644
--- a/generator/dawn_json_generator.py
+++ b/generator/dawn_json_generator.py
@@ -764,7 +764,7 @@
     def add_commandline_arguments(self, parser):
         allowed_targets = [
             'dawn_headers', 'dawncpp_headers', 'dawncpp', 'dawn_proc',
-            'mock_api', 'wire', "dawn_native_utils"
+            'mock_api', 'wire', "native_utils"
         ]
 
         parser.add_argument('--dawn-json',
@@ -832,8 +832,8 @@
 
         if 'webgpu_dawn_native_proc' in targets:
             renders.append(
-                FileRender('dawn_native/api_dawn_native_proc.cpp',
-                           'src/dawn_native/webgpu_dawn_native_proc.cpp',
+                FileRender('dawn/native/api_dawn_native_proc.cpp',
+                           'src/dawn/native/webgpu_dawn_native_proc.cpp',
                            [RENDER_PARAMS_BASE, params_dawn]))
 
         if 'dawncpp' in targets:
@@ -882,7 +882,7 @@
                 FileRender('mock_api.cpp', 'src/dawn/mock_' + api + '.cpp',
                            mock_params))
 
-        if 'dawn_native_utils' in targets:
+        if 'native_utils' in targets:
             frontend_params = [
                 RENDER_PARAMS_BASE,
                 params_dawn,
@@ -895,53 +895,53 @@
             ]
 
             impl_dir = metadata.impl_dir + '/' if metadata.impl_dir else ''
-            native_dir = impl_dir + Name(metadata.native_namespace).snake_case()
+            native_dir = impl_dir + Name(metadata.native_namespace).Dirs()
             namespace = metadata.namespace
             renders.append(
-                FileRender('dawn_native/ValidationUtils.h',
+                FileRender('dawn/native/ValidationUtils.h',
                            'src/' + native_dir + '/ValidationUtils_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/ValidationUtils.cpp',
+                FileRender('dawn/native/ValidationUtils.cpp',
                            'src/' + native_dir + '/ValidationUtils_autogen.cpp',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/dawn_platform.h',
+                FileRender('dawn/native/dawn_platform.h',
                            'src/' + native_dir + '/' + prefix + '_platform_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/api_structs.h',
+                FileRender('dawn/native/api_structs.h',
                            'src/' + native_dir + '/' + namespace + '_structs_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/api_structs.cpp',
+                FileRender('dawn/native/api_structs.cpp',
                            'src/' + native_dir + '/' + namespace + '_structs_autogen.cpp',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/ProcTable.cpp',
+                FileRender('dawn/native/ProcTable.cpp',
                            'src/' + native_dir + '/ProcTable.cpp', frontend_params))
             renders.append(
-                FileRender('dawn_native/ChainUtils.h',
+                FileRender('dawn/native/ChainUtils.h',
                            'src/' + native_dir + '/ChainUtils_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/ChainUtils.cpp',
+                FileRender('dawn/native/ChainUtils.cpp',
                            'src/' + native_dir + '/ChainUtils_autogen.cpp',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/api_absl_format.h',
+                FileRender('dawn/native/api_absl_format.h',
                            'src/' + native_dir + '/' + api + '_absl_format_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/api_absl_format.cpp',
+                FileRender('dawn/native/api_absl_format.cpp',
                            'src/' + native_dir + '/' + api + '_absl_format_autogen.cpp',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/ObjectType.h',
+                FileRender('dawn/native/ObjectType.h',
                            'src/' + native_dir + '/ObjectType_autogen.h',
                            frontend_params))
             renders.append(
-                FileRender('dawn_native/ObjectType.cpp',
+                FileRender('dawn/native/ObjectType.cpp',
                            'src/' + native_dir + '/ObjectType_autogen.cpp',
                            frontend_params))
 
diff --git a/generator/opengl_loader_generator.py b/generator/opengl_loader_generator.py
index 4f4f46f..db253e2 100644
--- a/generator/opengl_loader_generator.py
+++ b/generator/opengl_loader_generator.py
@@ -261,13 +261,13 @@
         return [
             FileRender(
                 'opengl/OpenGLFunctionsBase.cpp',
-                'src/dawn_native/opengl/OpenGLFunctionsBase_autogen.cpp',
+                'src/dawn/native/opengl/OpenGLFunctionsBase_autogen.cpp',
                 [params]),
             FileRender('opengl/OpenGLFunctionsBase.h',
-                       'src/dawn_native/opengl/OpenGLFunctionsBase_autogen.h',
+                       'src/dawn/native/opengl/OpenGLFunctionsBase_autogen.h',
                        [params]),
             FileRender('opengl/opengl_platform.h',
-                       'src/dawn_native/opengl/opengl_platform_autogen.h',
+                       'src/dawn/native/opengl/opengl_platform_autogen.h',
                        [params]),
         ]
 
diff --git a/generator/templates/dawn_native/ChainUtils.cpp b/generator/templates/dawn/native/ChainUtils.cpp
similarity index 97%
rename from generator/templates/dawn_native/ChainUtils.cpp
rename to generator/templates/dawn/native/ChainUtils.cpp
index 759a004..2973788 100644
--- a/generator/templates/dawn_native/ChainUtils.cpp
+++ b/generator/templates/dawn/native/ChainUtils.cpp
@@ -15,7 +15,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/ChainUtils_autogen.h"
 
 #include <unordered_set>
diff --git a/generator/templates/dawn_native/ChainUtils.h b/generator/templates/dawn/native/ChainUtils.h
similarity index 98%
rename from generator/templates/dawn_native/ChainUtils.h
rename to generator/templates/dawn/native/ChainUtils.h
index ce7adbc..3377220 100644
--- a/generator/templates/dawn_native/ChainUtils.h
+++ b/generator/templates/dawn/native/ChainUtils.h
@@ -20,7 +20,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 {% set prefix = metadata.proc_table_prefix.lower() %}
 #include "{{native_dir}}/{{prefix}}_platform.h"
 #include "{{native_dir}}/Error.h"
diff --git a/generator/templates/dawn_native/ObjectType.cpp b/generator/templates/dawn/native/ObjectType.cpp
similarity index 95%
rename from generator/templates/dawn_native/ObjectType.cpp
rename to generator/templates/dawn/native/ObjectType.cpp
index 07f4838..8fad3d4 100644
--- a/generator/templates/dawn_native/ObjectType.cpp
+++ b/generator/templates/dawn/native/ObjectType.cpp
@@ -15,7 +15,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/ObjectType_autogen.h"
 
 namespace {{native_namespace}} {
diff --git a/generator/templates/dawn_native/ObjectType.h b/generator/templates/dawn/native/ObjectType.h
similarity index 100%
rename from generator/templates/dawn_native/ObjectType.h
rename to generator/templates/dawn/native/ObjectType.h
diff --git a/generator/templates/dawn_native/ProcTable.cpp b/generator/templates/dawn/native/ProcTable.cpp
similarity index 98%
rename from generator/templates/dawn_native/ProcTable.cpp
rename to generator/templates/dawn/native/ProcTable.cpp
index cfc1e53..47ac2f5 100644
--- a/generator/templates/dawn_native/ProcTable.cpp
+++ b/generator/templates/dawn/native/ProcTable.cpp
@@ -17,7 +17,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/{{prefix}}_platform.h"
 #include "{{native_dir}}/{{Prefix}}Native.h"
 
diff --git a/generator/templates/dawn_native/ValidationUtils.cpp b/generator/templates/dawn/native/ValidationUtils.cpp
similarity index 96%
rename from generator/templates/dawn_native/ValidationUtils.cpp
rename to generator/templates/dawn/native/ValidationUtils.cpp
index 64b991e..1cb78c6 100644
--- a/generator/templates/dawn_native/ValidationUtils.cpp
+++ b/generator/templates/dawn/native/ValidationUtils.cpp
@@ -15,7 +15,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/ValidationUtils_autogen.h"
 
 namespace {{native_namespace}} {
diff --git a/generator/templates/dawn_native/ValidationUtils.h b/generator/templates/dawn/native/ValidationUtils.h
similarity index 95%
rename from generator/templates/dawn_native/ValidationUtils.h
rename to generator/templates/dawn/native/ValidationUtils.h
index 9746397..06d3cc7 100644
--- a/generator/templates/dawn_native/ValidationUtils.h
+++ b/generator/templates/dawn/native/ValidationUtils.h
@@ -21,7 +21,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/Error.h"
 
 namespace {{native_namespace}} {
diff --git a/generator/templates/dawn_native/api_absl_format.cpp b/generator/templates/dawn/native/api_absl_format.cpp
similarity index 98%
rename from generator/templates/dawn_native/api_absl_format.cpp
rename to generator/templates/dawn/native/api_absl_format.cpp
index 90647b2..6a9477c 100644
--- a/generator/templates/dawn_native/api_absl_format.cpp
+++ b/generator/templates/dawn/native/api_absl_format.cpp
@@ -15,7 +15,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 {% set api = metadata.api.lower() %}
 #include "{{native_dir}}/{{api}}_absl_format_autogen.h"
 
diff --git a/generator/templates/dawn_native/api_absl_format.h b/generator/templates/dawn/native/api_absl_format.h
similarity index 97%
rename from generator/templates/dawn_native/api_absl_format.h
rename to generator/templates/dawn/native/api_absl_format.h
index 64c4153..5fa583f 100644
--- a/generator/templates/dawn_native/api_absl_format.h
+++ b/generator/templates/dawn/native/api_absl_format.h
@@ -19,7 +19,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 {% set prefix = metadata.proc_table_prefix.lower() %}
 #include "{{native_dir}}/{{prefix}}_platform.h"
 
diff --git a/generator/templates/dawn_native/api_dawn_native_proc.cpp b/generator/templates/dawn/native/api_dawn_native_proc.cpp
similarity index 98%
rename from generator/templates/dawn_native/api_dawn_native_proc.cpp
rename to generator/templates/dawn/native/api_dawn_native_proc.cpp
index f17d2b4..f9147c6 100644
--- a/generator/templates/dawn_native/api_dawn_native_proc.cpp
+++ b/generator/templates/dawn/native/api_dawn_native_proc.cpp
@@ -16,7 +16,7 @@
 
 namespace dawn::native {
 
-// This file should be kept in sync with generator/templates/dawn_native/ProcTable.cpp
+// This file should be kept in sync with generator/templates/dawn/native/ProcTable.cpp
 
 {% for function in by_category["function"] %}
     extern {{as_cType(function.return_type.name)}} Native{{as_cppType(function.name)}}(
diff --git a/generator/templates/dawn_native/api_structs.cpp b/generator/templates/dawn/native/api_structs.cpp
similarity index 97%
rename from generator/templates/dawn_native/api_structs.cpp
rename to generator/templates/dawn/native/api_structs.cpp
index aa23425..86f54f0 100644
--- a/generator/templates/dawn_native/api_structs.cpp
+++ b/generator/templates/dawn/native/api_structs.cpp
@@ -15,7 +15,7 @@
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set namespace_name = Name(metadata.native_namespace) %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 {% set namespace = metadata.namespace %}
 #include "{{native_dir}}/{{namespace}}_structs_autogen.h"
 
diff --git a/generator/templates/dawn_native/api_structs.h b/generator/templates/dawn/native/api_structs.h
similarity index 98%
rename from generator/templates/dawn_native/api_structs.h
rename to generator/templates/dawn/native/api_structs.h
index 1c1106c..193f937 100644
--- a/generator/templates/dawn_native/api_structs.h
+++ b/generator/templates/dawn/native/api_structs.h
@@ -22,7 +22,7 @@
 #include "dawn/{{api}}_cpp.h"
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/Forward.h"
 
 namespace {{native_namespace}} {
diff --git a/generator/templates/dawn_native/dawn_platform.h b/generator/templates/dawn/native/dawn_platform.h
similarity index 97%
rename from generator/templates/dawn_native/dawn_platform.h
rename to generator/templates/dawn/native/dawn_platform.h
index 94464ca..e3f1c91 100644
--- a/generator/templates/dawn_native/dawn_platform.h
+++ b/generator/templates/dawn/native/dawn_platform.h
@@ -22,7 +22,7 @@
 #include "dawn/{{api}}_cpp.h"
 {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
 {% set native_namespace = namespace_name.namespace_case() %}
-{% set native_dir = impl_dir + namespace_name.snake_case() %}
+{% set native_dir = impl_dir + namespace_name.Dirs() %}
 #include "{{native_dir}}/Forward.h"
 
 {% set namespace = metadata.namespace %}
diff --git a/generator/templates/opengl/OpenGLFunctionsBase.cpp b/generator/templates/opengl/OpenGLFunctionsBase.cpp
index 066b9a7..acddd4f 100644
--- a/generator/templates/opengl/OpenGLFunctionsBase.cpp
+++ b/generator/templates/opengl/OpenGLFunctionsBase.cpp
@@ -12,7 +12,7 @@
 //* See the License for the specific language governing permissions and
 //* limitations under the License.
 
-#include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h"
+#include "dawn/native/opengl/OpenGLFunctionsBase_autogen.h"
 
 namespace dawn::native::opengl {
 
diff --git a/generator/templates/opengl/OpenGLFunctionsBase.h b/generator/templates/opengl/OpenGLFunctionsBase.h
index 0d1e2d7..ac313c4 100644
--- a/generator/templates/opengl/OpenGLFunctionsBase.h
+++ b/generator/templates/opengl/OpenGLFunctionsBase.h
@@ -15,8 +15,8 @@
 #ifndef DAWNNATIVE_OPENGL_OPENGLFUNCTIONSBASE_H_
 #define DAWNNATIVE_OPENGL_OPENGLFUNCTIONSBASE_H_
 
-#include "dawn_native/Error.h"
-#include "dawn_native/opengl/opengl_platform.h"
+#include "dawn/native/Error.h"
+#include "dawn/native/opengl/opengl_platform.h"
 
 namespace dawn::native::opengl {
     using GetProcAddress = void* (*) (const char*);