Rename namespace dawn_native to dawn::native.

But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.

Done with through the following steps:

 - git grep -l dawn_native:: | xargs sed -i "" "s/dawn_native::/dawn::native::/g"
 - git grep -l "namespace dawn_native" | xargs sed -i "" "s/namespace dawn_native/namespace dawn::native/g"
 - git cl format
 - Manual fixups in generator/templates (and the addition of
   namespace_case in dawn_json_generator.py).
 - The addition of the namespace alias in DawnNative.h

Bug: dawn:824
Change-Id: I676cc4e3ced2e0e4bab32a0d66d7eaf9537e3f09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75982
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2022-01-12 09:17:35 +00:00
committed by Dawn LUCI CQ
parent 8b3eaa60d8
commit ec9cf2a85c
504 changed files with 1715 additions and 1692 deletions

View File

@@ -85,7 +85,7 @@ struct WindowData {
static std::unordered_map<GLFWwindow*, std::unique_ptr<WindowData>> windows;
static uint64_t windowSerial = 0;
static std::unique_ptr<dawn_native::Instance> instance;
static std::unique_ptr<dawn::native::Instance> instance;
static wgpu::Device device;
static wgpu::Queue queue;
static wgpu::RenderPipeline trianglePipeline;
@@ -266,15 +266,15 @@ int main(int argc, const char* argv[]) {
// Choose an adapter we like.
// TODO: allow switching the window between devices.
DawnProcTable procs = dawn_native::GetProcs();
DawnProcTable procs = dawn::native::GetProcs();
dawnProcSetProcs(&procs);
instance = std::make_unique<dawn_native::Instance>();
instance = std::make_unique<dawn::native::Instance>();
instance->DiscoverDefaultAdapters();
std::vector<dawn_native::Adapter> adapters = instance->GetAdapters();
dawn_native::Adapter chosenAdapter;
for (dawn_native::Adapter& adapter : adapters) {
std::vector<dawn::native::Adapter> adapters = instance->GetAdapters();
dawn::native::Adapter chosenAdapter;
for (dawn::native::Adapter& adapter : adapters) {
wgpu::AdapterProperties properties;
adapter.GetProperties(&properties);
if (properties.backendType != wgpu::BackendType::Null) {

View File

@@ -81,7 +81,7 @@ static wgpu::BackendType backendType = wgpu::BackendType::OpenGL;
#endif
static CmdBufType cmdBufType = CmdBufType::Terrible;
static std::unique_ptr<dawn_native::Instance> instance;
static std::unique_ptr<dawn::native::Instance> instance;
static utils::BackendBinding* binding = nullptr;
static GLFWwindow* window = nullptr;
@@ -110,15 +110,15 @@ wgpu::Device CreateCppDawnDevice() {
return wgpu::Device();
}
instance = std::make_unique<dawn_native::Instance>();
instance = std::make_unique<dawn::native::Instance>();
utils::DiscoverAdapter(instance.get(), window, backendType);
// Get an adapter for the backend to use, and create the device.
dawn_native::Adapter backendAdapter;
dawn::native::Adapter backendAdapter;
{
std::vector<dawn_native::Adapter> adapters = instance->GetAdapters();
std::vector<dawn::native::Adapter> adapters = instance->GetAdapters();
auto adapterIt = std::find_if(adapters.begin(), adapters.end(),
[](const dawn_native::Adapter adapter) -> bool {
[](const dawn::native::Adapter adapter) -> bool {
wgpu::AdapterProperties properties;
adapter.GetProperties(&properties);
return properties.backendType == backendType;
@@ -128,7 +128,7 @@ wgpu::Device CreateCppDawnDevice() {
}
WGPUDevice backendDevice = backendAdapter.CreateDevice();
DawnProcTable backendProcs = dawn_native::GetProcs();
DawnProcTable backendProcs = dawn::native::GetProcs();
binding = utils::CreateBinding(backendType, window, backendDevice);
if (binding == nullptr) {