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

View File

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

View File

@ -68,6 +68,9 @@ class Name:
def snake_case(self): def snake_case(self):
return '_'.join(self.chunks) return '_'.join(self.chunks)
def namespace_case(self):
return '::'.join(self.chunks)
def js_enum_case(self): def js_enum_case(self):
result = self.chunks[0].lower() result = self.chunks[0].lower()
for chunk in self.chunks[1:]: for chunk in self.chunks[1:]:

View File

@ -13,8 +13,9 @@
// limitations under the License. // limitations under the License.
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = Name(metadata.native_namespace).snake_case() %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_dir = impl_dir + native_namespace %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/ChainUtils_autogen.h" #include "{{native_dir}}/ChainUtils_autogen.h"
#include <unordered_set> #include <unordered_set>

View File

@ -18,8 +18,9 @@
#define {{DIR}}_CHAIN_UTILS_H_ #define {{DIR}}_CHAIN_UTILS_H_
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = namespace_name.snake_case() %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_dir = impl_dir + native_namespace %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
{% set prefix = metadata.proc_table_prefix.lower() %} {% set prefix = metadata.proc_table_prefix.lower() %}
#include "{{native_dir}}/{{prefix}}_platform.h" #include "{{native_dir}}/{{prefix}}_platform.h"
#include "{{native_dir}}/Error.h" #include "{{native_dir}}/Error.h"

View File

@ -12,9 +12,10 @@
//* See the License for the specific language governing permissions and //* See the License for the specific language governing permissions and
//* limitations under the License. //* limitations under the License.
{% set native_namespace = Name(metadata.native_namespace).snake_case() %}
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_dir = impl_dir + native_namespace %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/ObjectType_autogen.h" #include "{{native_dir}}/ObjectType_autogen.h"
namespace {{native_namespace}} { namespace {{native_namespace}} {

View File

@ -21,7 +21,7 @@
#include <cstdint> #include <cstdint>
{% set native_namespace = namespace_name.snake_case() %} {% set native_namespace = namespace_name.namespace_case() %}
namespace {{native_namespace}} { namespace {{native_namespace}} {
enum class ObjectType : uint32_t { enum class ObjectType : uint32_t {

View File

@ -14,9 +14,10 @@
{% set Prefix = metadata.proc_table_prefix %} {% set Prefix = metadata.proc_table_prefix %}
{% set prefix = Prefix.lower() %} {% set prefix = Prefix.lower() %}
{% set native_namespace = Name(metadata.native_namespace).snake_case() %}
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_dir = impl_dir + native_namespace %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/{{prefix}}_platform.h" #include "{{native_dir}}/{{prefix}}_platform.h"
#include "{{native_dir}}/{{Prefix}}Native.h" #include "{{native_dir}}/{{Prefix}}Native.h"

View File

@ -12,9 +12,10 @@
//* See the License for the specific language governing permissions and //* See the License for the specific language governing permissions and
//* limitations under the License. //* limitations under the License.
{% set native_namespace = Name(metadata.native_namespace).snake_case() %}
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_dir = impl_dir + native_namespace %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/ValidationUtils_autogen.h" #include "{{native_dir}}/ValidationUtils_autogen.h"
namespace {{native_namespace}} { namespace {{native_namespace}} {

View File

@ -18,9 +18,10 @@
{% set api = metadata.api.lower() %} {% set api = metadata.api.lower() %}
#include "dawn/{{api}}_cpp.h" #include "dawn/{{api}}_cpp.h"
{% set native_namespace = Name(metadata.native_namespace).snake_case() %}
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_dir = impl_dir + native_namespace %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/Error.h" #include "{{native_dir}}/Error.h"
namespace {{native_namespace}} { namespace {{native_namespace}} {

View File

@ -13,8 +13,9 @@
//* limitations under the License. //* limitations under the License.
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = Name(metadata.native_namespace).snake_case() %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_dir = impl_dir + native_namespace %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
{% set api = metadata.api.lower() %} {% set api = metadata.api.lower() %}
#include "{{native_dir}}/{{api}}_absl_format_autogen.h" #include "{{native_dir}}/{{api}}_absl_format_autogen.h"

View File

@ -17,8 +17,9 @@
#define {{API}}_ABSL_FORMAT_H_ #define {{API}}_ABSL_FORMAT_H_
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = Name(metadata.native_namespace).snake_case() %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_dir = impl_dir + native_namespace %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
{% set prefix = metadata.proc_table_prefix.lower() %} {% set prefix = metadata.proc_table_prefix.lower() %}
#include "{{native_dir}}/{{prefix}}_platform.h" #include "{{native_dir}}/{{prefix}}_platform.h"

View File

@ -14,7 +14,7 @@
#include <dawn/{{metadata.api.lower()}}.h> #include <dawn/{{metadata.api.lower()}}.h>
namespace dawn_native { 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
@ -39,7 +39,7 @@ namespace dawn_native {
} }
extern "C" { extern "C" {
using namespace dawn_native; using namespace dawn::native;
{% for function in by_category["function"] %} {% for function in by_category["function"] %}
{{as_cType(function.return_type.name)}} {{metadata.namespace}}{{as_cppType(function.name)}} ( {{as_cType(function.return_type.name)}} {{metadata.namespace}}{{as_cppType(function.name)}} (

View File

@ -12,9 +12,10 @@
//* See the License for the specific language governing permissions and //* See the License for the specific language governing permissions and
//* limitations under the License. //* limitations under the License.
{% set native_namespace = Name(metadata.native_namespace).snake_case() %}
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_dir = impl_dir + native_namespace %} {% set namespace_name = Name(metadata.native_namespace) %}
{% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + namespace_name.snake_case() %}
{% set namespace = metadata.namespace %} {% set namespace = metadata.namespace %}
#include "{{native_dir}}/{{namespace}}_structs_autogen.h" #include "{{native_dir}}/{{namespace}}_structs_autogen.h"

View File

@ -21,8 +21,8 @@
{% set api = metadata.api.lower() %} {% set api = metadata.api.lower() %}
#include "dawn/{{api}}_cpp.h" #include "dawn/{{api}}_cpp.h"
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = namespace_name.snake_case() %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + native_namespace %} {% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/Forward.h" #include "{{native_dir}}/Forward.h"
namespace {{native_namespace}} { namespace {{native_namespace}} {

View File

@ -21,13 +21,13 @@
{% set api = metadata.api.lower() %} {% set api = metadata.api.lower() %}
#include "dawn/{{api}}_cpp.h" #include "dawn/{{api}}_cpp.h"
{% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %}
{% set native_namespace = namespace_name.snake_case() %} {% set native_namespace = namespace_name.namespace_case() %}
{% set native_dir = impl_dir + native_namespace %} {% set native_dir = impl_dir + namespace_name.snake_case() %}
#include "{{native_dir}}/Forward.h" #include "{{native_dir}}/Forward.h"
{% set namespace = metadata.namespace %} {% set namespace = metadata.namespace %}
// Use our autogenerated version of the {{namespace}} structures that point to {{native_namespace}} object types // Use our autogenerated version of the {{namespace}} structures that point to {{native_namespace}} object types
// (wgpu::Buffer is dawn_native::BufferBase*) // (wgpu::Buffer is dawn::native::BufferBase*)
#include <{{native_dir}}/{{namespace}}_structs_autogen.h> #include <{{native_dir}}/{{namespace}}_structs_autogen.h>
namespace {{native_namespace}} { namespace {{native_namespace}} {

View File

@ -14,7 +14,7 @@
#include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h"
namespace dawn_native::opengl { namespace dawn::native::opengl {
template<typename T> template<typename T>
MaybeError OpenGLFunctionsBase::LoadProc(GetProcAddress getProc, T* memberProc, const char* name) { MaybeError OpenGLFunctionsBase::LoadProc(GetProcAddress getProc, T* memberProc, const char* name) {
@ -67,4 +67,4 @@ MaybeError OpenGLFunctionsBase::LoadDesktopGLProcs(GetProcAddress getProc, int m
return {}; return {};
} }
} // namespace dawn_native::opengl } // namespace dawn::native::opengl

View File

@ -18,7 +18,7 @@
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
#include "dawn_native/opengl/opengl_platform.h" #include "dawn_native/opengl/opengl_platform.h"
namespace dawn_native::opengl { namespace dawn::native::opengl {
using GetProcAddress = void* (*) (const char*); using GetProcAddress = void* (*) (const char*);
struct OpenGLFunctionsBase { struct OpenGLFunctionsBase {
@ -40,6 +40,6 @@ namespace dawn_native::opengl {
MaybeError LoadProc(GetProcAddress getProc, T* memberProc, const char* name); MaybeError LoadProc(GetProcAddress getProc, T* memberProc, const char* name);
}; };
} // namespace dawn_native::opengl } // namespace dawn::native::opengl
#endif // DAWNNATIVE_OPENGL_OPENGLFUNCTIONSBASE_H_ #endif // DAWNNATIVE_OPENGL_OPENGLFUNCTIONSBASE_H_

View File

@ -65,7 +65,7 @@ DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(VkSomeHandle)
// One way to get the alignment inside structures of a type is to look at the alignment of it // One way to get the alignment inside structures of a type is to look at the alignment of it
// wrapped in a structure. Hence VkSameHandleNativeWrappe // wrapped in a structure. Hence VkSameHandleNativeWrappe
namespace dawn_native::vulkan { namespace dawn::native::vulkan {
namespace detail { namespace detail {
template <typename T> template <typename T>
@ -140,17 +140,17 @@ namespace dawn_native::vulkan {
return reinterpret_cast<HandleType*>(handle); return reinterpret_cast<HandleType*>(handle);
} }
} // namespace dawn_native::vulkan } // namespace dawn::native::vulkan
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) \ #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) \
DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) \ DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) \
namespace dawn_native::vulkan { \ namespace dawn::native::vulkan { \
using object = detail::VkHandle<struct VkTag##object, ::object>; \ using object = detail::VkHandle<struct VkTag##object, ::object>; \
static_assert(sizeof(object) == sizeof(uint64_t), ""); \ static_assert(sizeof(object) == sizeof(uint64_t), ""); \
static_assert(alignof(object) == detail::kUint64Alignment, ""); \ static_assert(alignof(object) == detail::kUint64Alignment, ""); \
static_assert(sizeof(object) == sizeof(::object), ""); \ static_assert(sizeof(object) == sizeof(::object), ""); \
static_assert(alignof(object) == detail::kNativeVkHandleAlignment, ""); \ static_assert(alignof(object) == detail::kNativeVkHandleAlignment, ""); \
} // namespace dawn_native::vulkan } // namespace dawn::native::vulkan
// Import additional parts of Vulkan that are supported on our architecture and preemptively include // Import additional parts of Vulkan that are supported on our architecture and preemptively include
// headers that vulkan.h includes that we have "undefs" for. // headers that vulkan.h includes that we have "undefs" for.

View File

@ -19,7 +19,7 @@
#include "dawn_native/Instance.h" #include "dawn_native/Instance.h"
#include "dawn_native/ValidationUtils_autogen.h" #include "dawn_native/ValidationUtils_autogen.h"
namespace dawn_native { namespace dawn::native {
AdapterBase::AdapterBase(InstanceBase* instance, wgpu::BackendType backend) AdapterBase::AdapterBase(InstanceBase* instance, wgpu::BackendType backend)
: mInstance(instance), mBackend(backend) { : mInstance(instance), mBackend(backend) {
@ -218,4 +218,4 @@ namespace dawn_native {
"ResetInternalDeviceForTesting should only be used with the D3D12 backend."); "ResetInternalDeviceForTesting should only be used with the D3D12 backend.");
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -26,7 +26,7 @@
#include <string> #include <string>
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
@ -94,6 +94,6 @@ namespace dawn_native {
bool mUseTieredLimits = false; bool mUseTieredLimits = false;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ADAPTER_H_ #endif // DAWNNATIVE_ADAPTER_H_

View File

@ -2,7 +2,7 @@
#include "dawn_platform/DawnPlatform.h" #include "dawn_platform/DawnPlatform.h"
namespace dawn_native { namespace dawn::native {
AsyncTaskManager::AsyncTaskManager(dawn::platform::WorkerTaskPool* workerTaskPool) AsyncTaskManager::AsyncTaskManager(dawn::platform::WorkerTaskPool* workerTaskPool)
: mWorkerTaskPool(workerTaskPool) { : mWorkerTaskPool(workerTaskPool) {
@ -62,4 +62,4 @@ namespace dawn_native {
waitableTask->taskManager->HandleTaskCompletion(waitableTask.Get()); waitableTask->taskManager->HandleTaskCompletion(waitableTask.Get());
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -27,7 +27,7 @@ namespace dawn::platform {
class WorkerTaskPool; class WorkerTaskPool;
} // namespace dawn::platform } // namespace dawn::platform
namespace dawn_native { namespace dawn::native {
// TODO(crbug.com/dawn/826): we'll add additional things to AsyncTask in the future, like // TODO(crbug.com/dawn/826): we'll add additional things to AsyncTask in the future, like
// Cancel() and RunNow(). Cancelling helps avoid running the task's body when we are just // Cancel() and RunNow(). Cancelling helps avoid running the task's body when we are just
@ -60,6 +60,6 @@ namespace dawn_native {
dawn::platform::WorkerTaskPool* mWorkerTaskPool; dawn::platform::WorkerTaskPool* mWorkerTaskPool;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif #endif

View File

@ -19,7 +19,7 @@
#include "dawn_native/ObjectContentHasher.h" #include "dawn_native/ObjectContentHasher.h"
#include "dawn_native/Texture.h" #include "dawn_native/Texture.h"
namespace dawn_native { namespace dawn::native {
AttachmentStateBlueprint::AttachmentStateBlueprint( AttachmentStateBlueprint::AttachmentStateBlueprint(
const RenderBundleEncoderDescriptor* descriptor) const RenderBundleEncoderDescriptor* descriptor)
@ -162,4 +162,4 @@ namespace dawn_native {
return mSampleCount; return mSampleCount;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -27,7 +27,7 @@
#include <array> #include <array>
#include <bitset> #include <bitset>
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
@ -78,6 +78,6 @@ namespace dawn_native {
~AttachmentState() override; ~AttachmentState() override;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ATTACHMENTSTATE_H_ #endif // DAWNNATIVE_ATTACHMENTSTATE_H_

View File

@ -14,7 +14,7 @@
#include "dawn_native/BackendConnection.h" #include "dawn_native/BackendConnection.h"
namespace dawn_native { namespace dawn::native {
BackendConnection::BackendConnection(InstanceBase* instance, wgpu::BackendType type) BackendConnection::BackendConnection(InstanceBase* instance, wgpu::BackendType type)
: mInstance(instance), mType(type) { : mInstance(instance), mType(type) {
@ -33,4 +33,4 @@ namespace dawn_native {
return DAWN_FORMAT_VALIDATION_ERROR("DiscoverAdapters not implemented for this backend."); return DAWN_FORMAT_VALIDATION_ERROR("DiscoverAdapters not implemented for this backend.");
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -20,7 +20,7 @@
#include <memory> #include <memory>
namespace dawn_native { namespace dawn::native {
// An common interface for all backends. Mostly used to create adapters for a particular // An common interface for all backends. Mostly used to create adapters for a particular
// backend. // backend.
@ -45,6 +45,6 @@ namespace dawn_native {
wgpu::BackendType mType; wgpu::BackendType mType;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BACKENDCONNECTION_H_ #endif // DAWNNATIVE_BACKENDCONNECTION_H_

View File

@ -27,7 +27,7 @@
#include "dawn_native/Sampler.h" #include "dawn_native/Sampler.h"
#include "dawn_native/Texture.h" #include "dawn_native/Texture.h"
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -483,4 +483,4 @@ namespace dawn_native {
return static_cast<ExternalTextureBase*>(mBindingData.bindings[bindingIndex].Get()); return static_cast<ExternalTextureBase*>(mBindingData.bindings[bindingIndex].Get());
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -26,7 +26,7 @@
#include <array> #include <array>
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
@ -87,6 +87,6 @@ namespace dawn_native {
BindGroupLayoutBase::BindingDataPointers mBindingData; BindGroupLayoutBase::BindingDataPointers mBindingData;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BINDGROUP_H_ #endif // DAWNNATIVE_BINDGROUP_H_

View File

@ -28,7 +28,7 @@
#include <functional> #include <functional>
#include <set> #include <set>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
MaybeError ValidateStorageTextureFormat(DeviceBase* device, MaybeError ValidateStorageTextureFormat(DeviceBase* device,
@ -553,4 +553,4 @@ namespace dawn_native {
} }
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -31,7 +31,7 @@
#include <bitset> #include <bitset>
#include <map> #include <map>
namespace dawn_native { namespace dawn::native {
MaybeError ValidateBindGroupLayoutDescriptor(DeviceBase* device, MaybeError ValidateBindGroupLayoutDescriptor(DeviceBase* device,
const BindGroupLayoutDescriptor* descriptor, const BindGroupLayoutDescriptor* descriptor,
@ -142,6 +142,6 @@ namespace dawn_native {
PipelineCompatibilityToken(0); PipelineCompatibilityToken(0);
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BINDGROUPLAYOUT_H_ #endif // DAWNNATIVE_BINDGROUPLAYOUT_H_

View File

@ -23,7 +23,7 @@
#include <array> #include <array>
#include <bitset> #include <bitset>
namespace dawn_native { namespace dawn::native {
// Keeps track of the dirty bind groups so they can be lazily applied when we know the // Keeps track of the dirty bind groups so they can be lazily applied when we know the
// pipeline state or it changes. // pipeline state or it changes.
@ -137,6 +137,6 @@ namespace dawn_native {
} }
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BINDGROUPTRACKER_H_ #endif // DAWNNATIVE_BINDGROUPTRACKER_H_

View File

@ -16,7 +16,7 @@
#include "dawn_native/ChainUtils_autogen.h" #include "dawn_native/ChainUtils_autogen.h"
namespace dawn_native { namespace dawn::native {
absl::FormatConvertResult<absl::FormatConversionCharSet::kString> AbslFormatConvert( absl::FormatConvertResult<absl::FormatConversionCharSet::kString> AbslFormatConvert(
BindingInfoType value, BindingInfoType value,
@ -218,4 +218,4 @@ namespace dawn_native {
return {}; return {};
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -26,7 +26,7 @@
#include <cstdint> #include <cstdint>
namespace dawn_native { namespace dawn::native {
// Not a real WebGPU limit, but the sum of the two limits is useful for internal optimizations. // Not a real WebGPU limit, but the sum of the two limits is useful for internal optimizations.
static constexpr uint32_t kMaxDynamicBuffersPerPipelineLayout = static constexpr uint32_t kMaxDynamicBuffersPerPipelineLayout =
@ -98,6 +98,6 @@ namespace dawn_native {
// For buffer size validation // For buffer size validation
using RequiredBufferSizes = ityp::array<BindGroupIndex, std::vector<uint64_t>, kMaxBindGroups>; using RequiredBufferSizes = ityp::array<BindGroupIndex, std::vector<uint64_t>, kMaxBindGroups>;
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BINDINGINFO_H_ #endif // DAWNNATIVE_BINDINGINFO_H_

View File

@ -17,7 +17,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "common/Math.h" #include "common/Math.h"
namespace dawn_native { namespace dawn::native {
BuddyAllocator::BuddyAllocator(uint64_t maxSize) : mMaxBlockSize(maxSize) { BuddyAllocator::BuddyAllocator(uint64_t maxSize) : mMaxBlockSize(maxSize) {
ASSERT(IsPowerOfTwo(maxSize)); ASSERT(IsPowerOfTwo(maxSize));
@ -261,4 +261,4 @@ namespace dawn_native {
delete block; delete block;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -20,7 +20,7 @@
#include <limits> #include <limits>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
// Buddy allocator uses the buddy memory allocation technique to satisfy an allocation request. // Buddy allocator uses the buddy memory allocation technique to satisfy an allocation request.
// Memory is split into halves until just large enough to fit to the request. This // Memory is split into halves until just large enough to fit to the request. This
@ -112,6 +112,6 @@ namespace dawn_native {
std::vector<BlockList> mFreeLists; std::vector<BlockList> mFreeLists;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BUDDYALLOCATOR_H_ #endif // DAWNNATIVE_BUDDYALLOCATOR_H_

View File

@ -17,7 +17,7 @@
#include "common/Math.h" #include "common/Math.h"
#include "dawn_native/ResourceHeapAllocator.h" #include "dawn_native/ResourceHeapAllocator.h"
namespace dawn_native { namespace dawn::native {
BuddyMemoryAllocator::BuddyMemoryAllocator(uint64_t maxSystemSize, BuddyMemoryAllocator::BuddyMemoryAllocator(uint64_t maxSystemSize,
uint64_t memoryBlockSize, uint64_t memoryBlockSize,
@ -117,4 +117,4 @@ namespace dawn_native {
return count; return count;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -22,7 +22,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
class ResourceHeapAllocator; class ResourceHeapAllocator;
@ -69,6 +69,6 @@ namespace dawn_native {
std::vector<TrackedSubAllocations> mTrackedSubAllocations; std::vector<TrackedSubAllocations> mTrackedSubAllocations;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BUDDYMEMORYALLOCATOR_H_ #endif // DAWNNATIVE_BUDDYMEMORYALLOCATOR_H_

View File

@ -28,7 +28,7 @@
#include <cstring> #include <cstring>
#include <utility> #include <utility>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
struct MapRequestTask : QueueBase::TaskInFlight { struct MapRequestTask : QueueBase::TaskInFlight {
@ -557,4 +557,4 @@ namespace dawn_native {
return offset == 0 && size == GetSize(); return offset == 0 && size == GetSize();
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -24,7 +24,7 @@
#include <memory> #include <memory>
namespace dawn_native { namespace dawn::native {
struct CopyTextureToBufferCmd; struct CopyTextureToBufferCmd;
@ -130,6 +130,6 @@ namespace dawn_native {
size_t mMapSize = 0; size_t mMapSize = 0;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_BUFFER_H_ #endif // DAWNNATIVE_BUFFER_H_

View File

@ -16,7 +16,7 @@
#include "common/Assert.h" #include "common/Assert.h"
namespace dawn_native { namespace dawn::native {
bool CachedObject::IsCachedReference() const { bool CachedObject::IsCachedReference() const {
return mIsCachedReference; return mIsCachedReference;
@ -41,4 +41,4 @@ namespace dawn_native {
mIsContentHashInitialized = true; mIsContentHashInitialized = true;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -17,7 +17,7 @@
#include <cstddef> #include <cstddef>
namespace dawn_native { namespace dawn::native {
// Some objects are cached so that instead of creating new duplicate objects, // Some objects are cached so that instead of creating new duplicate objects,
// we increase the refcount of an existing object. // we increase the refcount of an existing object.
@ -48,6 +48,6 @@ namespace dawn_native {
bool mIsContentHashInitialized = false; bool mIsContentHashInitialized = false;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_CACHED_OBJECT_H_ #endif // DAWNNATIVE_CACHED_OBJECT_H_

View File

@ -14,7 +14,7 @@
#include "dawn_native/CallbackTaskManager.h" #include "dawn_native/CallbackTaskManager.h"
namespace dawn_native { namespace dawn::native {
bool CallbackTaskManager::IsEmpty() { bool CallbackTaskManager::IsEmpty() {
std::lock_guard<std::mutex> lock(mCallbackTaskQueueMutex); std::lock_guard<std::mutex> lock(mCallbackTaskQueueMutex);
@ -34,4 +34,4 @@ namespace dawn_native {
mCallbackTaskQueue.push_back(std::move(callbackTask)); mCallbackTaskQueue.push_back(std::move(callbackTask));
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -19,7 +19,7 @@
#include <mutex> #include <mutex>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
struct CallbackTask { struct CallbackTask {
public: public:
@ -40,6 +40,6 @@ namespace dawn_native {
std::vector<std::unique_ptr<CallbackTask>> mCallbackTaskQueue; std::vector<std::unique_ptr<CallbackTask>> mCallbackTaskQueue;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif #endif

View File

@ -22,7 +22,7 @@
#include <cstdlib> #include <cstdlib>
#include <utility> #include <utility>
namespace dawn_native { namespace dawn::native {
// TODO(cwallez@chromium.org): figure out a way to have more type safety for the iterator // TODO(cwallez@chromium.org): figure out a way to have more type safety for the iterator
@ -225,4 +225,4 @@ namespace dawn_native {
mEndPtr = reinterpret_cast<uint8_t*>(&mDummyEnum[1]); mEndPtr = reinterpret_cast<uint8_t*>(&mDummyEnum[1]);
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -23,7 +23,7 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
// Allocation for command buffers should be fast. To avoid doing an allocation per command // Allocation for command buffers should be fast. To avoid doing an allocation per command
// or to avoid copying commands when reallocing, we use a linear allocator in a growing set // or to avoid copying commands when reallocing, we use a linear allocator in a growing set
@ -268,6 +268,6 @@ namespace dawn_native {
uint8_t* mEndPtr = nullptr; uint8_t* mEndPtr = nullptr;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMAND_ALLOCATOR_H_ #endif // DAWNNATIVE_COMMAND_ALLOCATOR_H_

View File

@ -23,7 +23,7 @@
#include "dawn_native/ObjectType_autogen.h" #include "dawn_native/ObjectType_autogen.h"
#include "dawn_native/Texture.h" #include "dawn_native/Texture.h"
namespace dawn_native { namespace dawn::native {
CommandBufferBase::CommandBufferBase(CommandEncoder* encoder, CommandBufferBase::CommandBufferBase(CommandEncoder* encoder,
const CommandBufferDescriptor* descriptor) const CommandBufferDescriptor* descriptor)
@ -217,24 +217,24 @@ namespace dawn_native {
return true; return true;
} }
std::array<float, 4> ConvertToFloatColor(dawn_native::Color color) { std::array<float, 4> ConvertToFloatColor(dawn::native::Color color) {
const std::array<float, 4> outputValue = { const std::array<float, 4> outputValue = {
static_cast<float>(color.r), static_cast<float>(color.g), static_cast<float>(color.b), static_cast<float>(color.r), static_cast<float>(color.g), static_cast<float>(color.b),
static_cast<float>(color.a)}; static_cast<float>(color.a)};
return outputValue; return outputValue;
} }
std::array<int32_t, 4> ConvertToSignedIntegerColor(dawn_native::Color color) { std::array<int32_t, 4> ConvertToSignedIntegerColor(dawn::native::Color color) {
const std::array<int32_t, 4> outputValue = { const std::array<int32_t, 4> outputValue = {
static_cast<int32_t>(color.r), static_cast<int32_t>(color.g), static_cast<int32_t>(color.r), static_cast<int32_t>(color.g),
static_cast<int32_t>(color.b), static_cast<int32_t>(color.a)}; static_cast<int32_t>(color.b), static_cast<int32_t>(color.a)};
return outputValue; return outputValue;
} }
std::array<uint32_t, 4> ConvertToUnsignedIntegerColor(dawn_native::Color color) { std::array<uint32_t, 4> ConvertToUnsignedIntegerColor(dawn::native::Color color) {
const std::array<uint32_t, 4> outputValue = { const std::array<uint32_t, 4> outputValue = {
static_cast<uint32_t>(color.r), static_cast<uint32_t>(color.g), static_cast<uint32_t>(color.r), static_cast<uint32_t>(color.g),
static_cast<uint32_t>(color.b), static_cast<uint32_t>(color.a)}; static_cast<uint32_t>(color.b), static_cast<uint32_t>(color.a)};
return outputValue; return outputValue;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -24,7 +24,7 @@
#include "dawn_native/PassResourceUsage.h" #include "dawn_native/PassResourceUsage.h"
#include "dawn_native/Texture.h" #include "dawn_native/Texture.h"
namespace dawn_native { namespace dawn::native {
struct BeginRenderPassCmd; struct BeginRenderPassCmd;
struct CopyTextureToBufferCmd; struct CopyTextureToBufferCmd;
@ -67,10 +67,10 @@ namespace dawn_native {
bool IsFullBufferOverwrittenInTextureToBufferCopy(const CopyTextureToBufferCmd* copy); bool IsFullBufferOverwrittenInTextureToBufferCopy(const CopyTextureToBufferCmd* copy);
std::array<float, 4> ConvertToFloatColor(dawn_native::Color color); std::array<float, 4> ConvertToFloatColor(dawn::native::Color color);
std::array<int32_t, 4> ConvertToSignedIntegerColor(dawn_native::Color color); std::array<int32_t, 4> ConvertToSignedIntegerColor(dawn::native::Color color);
std::array<uint32_t, 4> ConvertToUnsignedIntegerColor(dawn_native::Color color); std::array<uint32_t, 4> ConvertToUnsignedIntegerColor(dawn::native::Color color);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMANDBUFFER_H_ #endif // DAWNNATIVE_COMMANDBUFFER_H_

View File

@ -28,7 +28,7 @@
// validating against. It would be nice to improve that, but difficult to do without incurring // validating against. It would be nice to improve that, but difficult to do without incurring
// additional tracking costs. // additional tracking costs.
namespace dawn_native { namespace dawn::native {
namespace { namespace {
bool BufferSizesAtLeastAsBig(const ityp::span<uint32_t, uint64_t> unverifiedBufferSizes, bool BufferSizesAtLeastAsBig(const ityp::span<uint32_t, uint64_t> unverifiedBufferSizes,
@ -404,4 +404,4 @@ namespace dawn_native {
return mIndexBufferSize; return mIndexBufferSize;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -22,7 +22,7 @@
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
#include "dawn_native/Forward.h" #include "dawn_native/Forward.h"
namespace dawn_native { namespace dawn::native {
class CommandBufferStateTracker { class CommandBufferStateTracker {
public: public:
@ -81,6 +81,6 @@ namespace dawn_native {
const RequiredBufferSizes* mMinBufferSizes = nullptr; const RequiredBufferSizes* mMinBufferSizes = nullptr;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMANDBUFFERSTATETRACKER_H #endif // DAWNNATIVE_COMMANDBUFFERSTATETRACKER_H

View File

@ -38,7 +38,7 @@
#include <cmath> #include <cmath>
#include <map> #include <map>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -1134,4 +1134,4 @@ namespace dawn_native {
return {}; return {};
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -24,7 +24,7 @@
#include <string> #include <string>
namespace dawn_native { namespace dawn::native {
class CommandEncoder final : public ApiObjectBase { class CommandEncoder final : public ApiObjectBase {
public: public:
@ -102,6 +102,6 @@ namespace dawn_native {
uint64_t mDebugGroupStackSize = 0; uint64_t mDebugGroupStackSize = 0;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMANDENCODER_H_ #endif // DAWNNATIVE_COMMANDENCODER_H_

View File

@ -26,7 +26,7 @@
#include "dawn_native/RenderPipeline.h" #include "dawn_native/RenderPipeline.h"
#include "dawn_native/ValidationUtils_autogen.h" #include "dawn_native/ValidationUtils_autogen.h"
namespace dawn_native { namespace dawn::native {
// Performs validation of the "synchronization scope" rules of WebGPU. // Performs validation of the "synchronization scope" rules of WebGPU.
MaybeError ValidateSyncScopeResourceUsage(const SyncScopeResourceUsage& scope) { MaybeError ValidateSyncScopeResourceUsage(const SyncScopeResourceUsage& scope) {
@ -465,4 +465,4 @@ namespace dawn_native {
return {}; return {};
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -21,7 +21,7 @@
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
class QuerySetBase; class QuerySetBase;
struct SyncScopeResourceUsage; struct SyncScopeResourceUsage;
@ -79,6 +79,6 @@ namespace dawn_native {
MaybeError ValidateCanUseAs(const BufferBase* buffer, wgpu::BufferUsage usage); MaybeError ValidateCanUseAs(const BufferBase* buffer, wgpu::BufferUsage usage);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMANDVALIDATION_H_ #endif // DAWNNATIVE_COMMANDVALIDATION_H_

View File

@ -23,7 +23,7 @@
#include "dawn_native/RenderPipeline.h" #include "dawn_native/RenderPipeline.h"
#include "dawn_native/Texture.h" #include "dawn_native/Texture.h"
namespace dawn_native { namespace dawn::native {
void FreeCommands(CommandIterator* commands) { void FreeCommands(CommandIterator* commands) {
commands->Reset(); commands->Reset();
@ -362,4 +362,4 @@ namespace dawn_native {
} }
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -26,7 +26,7 @@
#include <array> #include <array>
#include <bitset> #include <bitset>
namespace dawn_native { namespace dawn::native {
// Definition of the commands that are present in the CommandIterator given by the // Definition of the commands that are present in the CommandIterator given by the
// CommandBufferBuilder. There are not defined in CommandBuffer.h to break some header // CommandBufferBuilder. There are not defined in CommandBuffer.h to break some header
@ -80,7 +80,7 @@ namespace dawn_native {
Ref<TextureViewBase> resolveTarget; Ref<TextureViewBase> resolveTarget;
wgpu::LoadOp loadOp; wgpu::LoadOp loadOp;
wgpu::StoreOp storeOp; wgpu::StoreOp storeOp;
dawn_native::Color clearColor; dawn::native::Color clearColor;
}; };
struct RenderPassDepthStencilAttachmentInfo { struct RenderPassDepthStencilAttachmentInfo {
@ -285,6 +285,6 @@ namespace dawn_native {
// consuming the correct amount of data from the command iterator. // consuming the correct amount of data from the command iterator.
void SkipCommand(CommandIterator* commands, Command type); void SkipCommand(CommandIterator* commands, Command type);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMMANDS_H_ #endif // DAWNNATIVE_COMMANDS_H_

View File

@ -19,7 +19,7 @@
#include <tint/tint.h> #include <tint/tint.h>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -198,4 +198,4 @@ namespace dawn_native {
mFormattedTintMessages.push_back(t.str()); mFormattedTintMessages.push_back(t.str());
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -27,7 +27,7 @@ namespace tint::diag {
class List; class List;
} // namespace tint::diag } // namespace tint::diag
namespace dawn_native { namespace dawn::native {
class OwnedCompilationMessages : public NonCopyable { class OwnedCompilationMessages : public NonCopyable {
public: public:
@ -57,6 +57,6 @@ namespace dawn_native {
std::vector<std::string> mFormattedTintMessages; std::vector<std::string> mFormattedTintMessages;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMPILATIONMESSAGES_H_ #endif // DAWNNATIVE_COMPILATIONMESSAGES_H_

View File

@ -28,7 +28,7 @@
#include "dawn_native/QuerySet.h" #include "dawn_native/QuerySet.h"
#include "dawn_native/utils/WGPUHelpers.h" #include "dawn_native/utils/WGPUHelpers.h"
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -456,4 +456,4 @@ namespace dawn_native {
return &mCommandBufferState; return &mCommandBufferState;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -21,7 +21,7 @@
#include "dawn_native/PassResourceUsageTracker.h" #include "dawn_native/PassResourceUsageTracker.h"
#include "dawn_native/ProgrammableEncoder.h" #include "dawn_native/ProgrammableEncoder.h"
namespace dawn_native { namespace dawn::native {
class SyncScopeUsageTracker; class SyncScopeUsageTracker;
@ -83,6 +83,6 @@ namespace dawn_native {
Ref<CommandEncoder> mCommandEncoder; Ref<CommandEncoder> mCommandEncoder;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMPUTEPASSENCODER_H_ #endif // DAWNNATIVE_COMPUTEPASSENCODER_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/ObjectContentHasher.h" #include "dawn_native/ObjectContentHasher.h"
#include "dawn_native/ObjectType_autogen.h" #include "dawn_native/ObjectType_autogen.h"
namespace dawn_native { namespace dawn::native {
MaybeError ValidateComputePipelineDescriptor(DeviceBase* device, MaybeError ValidateComputePipelineDescriptor(DeviceBase* device,
const ComputePipelineDescriptor* descriptor) { const ComputePipelineDescriptor* descriptor) {
@ -93,4 +93,4 @@ namespace dawn_native {
return PipelineBase::EqualForCache(a, b); return PipelineBase::EqualForCache(a, b);
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -19,7 +19,7 @@
#include "dawn_native/Forward.h" #include "dawn_native/Forward.h"
#include "dawn_native/Pipeline.h" #include "dawn_native/Pipeline.h"
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
struct EntryPointMetadata; struct EntryPointMetadata;
@ -50,6 +50,6 @@ namespace dawn_native {
ComputePipelineBase(DeviceBase* device, ObjectBase::ErrorTag tag); ComputePipelineBase(DeviceBase* device, ObjectBase::ErrorTag tag);
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COMPUTEPIPELINE_H_ #endif // DAWNNATIVE_COMPUTEPIPELINE_H_

View File

@ -33,7 +33,7 @@
#include <unordered_set> #include <unordered_set>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
static const char sCopyTextureForBrowserShader[] = R"( static const char sCopyTextureForBrowserShader[] = R"(
@ -594,4 +594,4 @@ namespace dawn_native {
return {}; return {};
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -18,7 +18,7 @@
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
#include "dawn_native/ObjectBase.h" #include "dawn_native/ObjectBase.h"
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
struct Extent3D; struct Extent3D;
struct ImageCopyTexture; struct ImageCopyTexture;
@ -36,6 +36,6 @@ namespace dawn_native {
const Extent3D* copySize, const Extent3D* copySize,
const CopyTextureForBrowserOptions* options); const CopyTextureForBrowserOptions* options);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_COPYTEXTUREFORBROWSERHELPER_H_ #endif // DAWNNATIVE_COPYTEXTUREFORBROWSERHELPER_H_

View File

@ -22,7 +22,7 @@
#include "dawn_platform/tracing/TraceEvent.h" #include "dawn_platform/tracing/TraceEvent.h"
#include "utils/WGPUHelpers.h" #include "utils/WGPUHelpers.h"
namespace dawn_native { namespace dawn::native {
CreatePipelineAsyncCallbackTaskBase::CreatePipelineAsyncCallbackTaskBase( CreatePipelineAsyncCallbackTaskBase::CreatePipelineAsyncCallbackTaskBase(
std::string errorMessage, std::string errorMessage,
@ -199,4 +199,4 @@ namespace dawn_native {
eventLabel); eventLabel);
device->GetAsyncTaskManager()->PostTask(std::move(asyncTask)); device->GetAsyncTaskManager()->PostTask(std::move(asyncTask));
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -20,7 +20,7 @@
#include "dawn_native/CallbackTaskManager.h" #include "dawn_native/CallbackTaskManager.h"
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
namespace dawn_native { namespace dawn::native {
class ComputePipelineBase; class ComputePipelineBase;
class DeviceBase; class DeviceBase;
@ -103,6 +103,6 @@ namespace dawn_native {
void* mUserdata; void* mUserdata;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_CREATEPIPELINEASYNCTASK_H_ #endif // DAWNNATIVE_CREATEPIPELINEASYNCTASK_H_

View File

@ -24,7 +24,7 @@
// Contains the entry-points into dawn_native // Contains the entry-points into dawn_native
namespace dawn_native { namespace dawn::native {
namespace { namespace {
struct ComboDeprecatedDawnDeviceDescriptor : DeviceDescriptor { struct ComboDeprecatedDawnDeviceDescriptor : DeviceDescriptor {
@ -281,4 +281,4 @@ namespace dawn_native {
return FromAPI(a)->IsLayoutEqual(FromAPI(b), excludePipelineCompatibiltyToken); return FromAPI(a)->IsLayoutEqual(FromAPI(b), excludePipelineCompatibiltyToken);
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -52,7 +52,7 @@
#include <mutex> #include <mutex>
#include <unordered_set> #include <unordered_set>
namespace dawn_native { namespace dawn::native {
// DeviceBase sub-structures // DeviceBase sub-structures
@ -1729,4 +1729,4 @@ namespace dawn_native {
return false; return false;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -37,7 +37,7 @@ namespace dawn::platform {
class WorkerTaskPool; class WorkerTaskPool;
} // namespace dawn::platform } // namespace dawn::platform
namespace dawn_native { namespace dawn::native {
class AdapterBase; class AdapterBase;
class AsyncTaskManager; class AsyncTaskManager;
class AttachmentState; class AttachmentState;
@ -540,6 +540,6 @@ namespace dawn_native {
std::string mLabel; std::string mLabel;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_DEVICE_H_ #endif // DAWNNATIVE_DEVICE_H_

View File

@ -16,7 +16,7 @@
#include "common/Math.h" #include "common/Math.h"
#include "dawn_native/Device.h" #include "dawn_native/Device.h"
namespace dawn_native { namespace dawn::native {
DynamicUploader::DynamicUploader(DeviceBase* device) : mDevice(device) { DynamicUploader::DynamicUploader(DeviceBase* device) : mDevice(device) {
mRingBuffers.emplace_back( mRingBuffers.emplace_back(
@ -126,4 +126,4 @@ namespace dawn_native {
uploadHandle.startOffset += additionalOffset; uploadHandle.startOffset += additionalOffset;
return uploadHandle; return uploadHandle;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -22,7 +22,7 @@
// DynamicUploader is the front-end implementation used to manage multiple ring buffers for upload // DynamicUploader is the front-end implementation used to manage multiple ring buffers for upload
// usage. // usage.
namespace dawn_native { namespace dawn::native {
struct UploadHandle { struct UploadHandle {
uint8_t* mappedBuffer = nullptr; uint8_t* mappedBuffer = nullptr;
@ -61,6 +61,6 @@ namespace dawn_native {
SerialQueue<ExecutionSerial, std::unique_ptr<StagingBufferBase>> mReleasedStagingBuffers; SerialQueue<ExecutionSerial, std::unique_ptr<StagingBufferBase>> mReleasedStagingBuffers;
DeviceBase* mDevice; DeviceBase* mDevice;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_DYNAMICUPLOADER_H_ #endif // DAWNNATIVE_DYNAMICUPLOADER_H_

View File

@ -22,7 +22,7 @@
#include "dawn_native/IndirectDrawValidationEncoder.h" #include "dawn_native/IndirectDrawValidationEncoder.h"
#include "dawn_native/RenderBundleEncoder.h" #include "dawn_native/RenderBundleEncoder.h"
namespace dawn_native { namespace dawn::native {
EncodingContext::EncodingContext(DeviceBase* device, const ApiObjectBase* initialEncoder) EncodingContext::EncodingContext(DeviceBase* device, const ApiObjectBase* initialEncoder)
: mDevice(device), mTopLevelEncoder(initialEncoder), mCurrentEncoder(initialEncoder) { : mDevice(device), mTopLevelEncoder(initialEncoder), mCurrentEncoder(initialEncoder) {
@ -214,4 +214,4 @@ namespace dawn_native {
return mTopLevelEncoder == nullptr; return mTopLevelEncoder == nullptr;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -24,7 +24,7 @@
#include <string> #include <string>
namespace dawn_native { namespace dawn::native {
class CommandEncoder; class CommandEncoder;
class DeviceBase; class DeviceBase;
@ -177,6 +177,6 @@ namespace dawn_native {
std::vector<std::string> mDebugGroupLabels; std::vector<std::string> mDebugGroupLabels;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ENCODINGCONTEXT_H_ #endif // DAWNNATIVE_ENCODINGCONTEXT_H_

View File

@ -17,7 +17,7 @@
#include "dawn/EnumClassBitmasks.h" #include "dawn/EnumClassBitmasks.h"
namespace dawn_native { namespace dawn::native {
// EnumClassBitmmasks is a helper in the dawn:: namespace. // EnumClassBitmmasks is a helper in the dawn:: namespace.
// Re-export it in the dawn_native namespace. // Re-export it in the dawn_native namespace.
@ -34,6 +34,6 @@ namespace dawn_native {
return HasZeroOrOneBits(value) && value != T(0); return HasZeroOrOneBits(value) && value != T(0);
} }
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ENUMCLASSBITMASK_H_ #endif // DAWNNATIVE_ENUMCLASSBITMASK_H_

View File

@ -18,7 +18,7 @@
#include "common/BitSetIterator.h" #include "common/BitSetIterator.h"
#include "dawn_native/EnumClassBitmasks.h" #include "dawn_native/EnumClassBitmasks.h"
namespace dawn_native { namespace dawn::native {
template <typename T> template <typename T>
class EnumMaskIterator final { class EnumMaskIterator final {
@ -77,6 +77,6 @@ namespace dawn_native {
return EnumMaskIterator<T>(mask); return EnumMaskIterator<T>(mask);
} }
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ENUMMASKITERATOR_H_ #endif // DAWNNATIVE_ENUMMASKITERATOR_H_

View File

@ -17,7 +17,7 @@
#include "dawn_native/ErrorData.h" #include "dawn_native/ErrorData.h"
#include "dawn_native/dawn_platform.h" #include "dawn_native/dawn_platform.h"
namespace dawn_native { namespace dawn::native {
void IgnoreErrors(MaybeError maybeError) { void IgnoreErrors(MaybeError maybeError) {
if (maybeError.IsError()) { if (maybeError.IsError()) {
@ -61,4 +61,4 @@ namespace dawn_native {
} }
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -22,7 +22,7 @@
#include <string> #include <string>
namespace dawn_native { namespace dawn::native {
enum class InternalErrorType : uint32_t { enum class InternalErrorType : uint32_t {
Validation, Validation,
@ -72,7 +72,7 @@ namespace dawn_native {
// more clarity. // more clarity.
#define DAWN_MAKE_ERROR(TYPE, MESSAGE) \ #define DAWN_MAKE_ERROR(TYPE, MESSAGE) \
::dawn_native::ErrorData::Create(TYPE, MESSAGE, __FILE__, __func__, __LINE__) ::dawn::native::ErrorData::Create(TYPE, MESSAGE, __FILE__, __func__, __LINE__)
#define DAWN_VALIDATION_ERROR(MESSAGE) DAWN_MAKE_ERROR(InternalErrorType::Validation, MESSAGE) #define DAWN_VALIDATION_ERROR(MESSAGE) DAWN_MAKE_ERROR(InternalErrorType::Validation, MESSAGE)
@ -119,17 +119,17 @@ namespace dawn_native {
#define DAWN_TRY_CONTEXT(EXPR, ...) \ #define DAWN_TRY_CONTEXT(EXPR, ...) \
DAWN_TRY_WITH_CLEANUP(EXPR, { error->AppendContext(absl::StrFormat(__VA_ARGS__)); }) DAWN_TRY_WITH_CLEANUP(EXPR, { error->AppendContext(absl::StrFormat(__VA_ARGS__)); })
#define DAWN_TRY_WITH_CLEANUP(EXPR, BODY) \ #define DAWN_TRY_WITH_CLEANUP(EXPR, BODY) \
{ \ { \
auto DAWN_LOCAL_VAR = EXPR; \ auto DAWN_LOCAL_VAR = EXPR; \
if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \ if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \
std::unique_ptr<::dawn_native::ErrorData> error = DAWN_LOCAL_VAR.AcquireError(); \ std::unique_ptr<::dawn::native::ErrorData> error = DAWN_LOCAL_VAR.AcquireError(); \
{BODY} /* comment to force the formatter to insert a newline */ \ {BODY} /* comment to force the formatter to insert a newline */ \
error->AppendBacktrace(__FILE__, __func__, __LINE__); \ error->AppendBacktrace(__FILE__, __func__, __LINE__); \
return {std::move(error)}; \ return {std::move(error)}; \
} \ } \
} \ } \
for (;;) \ for (;;) \
break break
// DAWN_TRY_ASSIGN is the same as DAWN_TRY for ResultOrError and assigns the success value, if // DAWN_TRY_ASSIGN is the same as DAWN_TRY for ResultOrError and assigns the success value, if
@ -192,6 +192,6 @@ namespace dawn_native {
wgpu::ErrorType ToWGPUErrorType(InternalErrorType type); wgpu::ErrorType ToWGPUErrorType(InternalErrorType type);
InternalErrorType FromWGPUErrorType(wgpu::ErrorType type); InternalErrorType FromWGPUErrorType(wgpu::ErrorType type);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ERROR_H_ #endif // DAWNNATIVE_ERROR_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/ObjectBase.h" #include "dawn_native/ObjectBase.h"
#include "dawn_native/dawn_platform.h" #include "dawn_native/dawn_platform.h"
namespace dawn_native { namespace dawn::native {
std::unique_ptr<ErrorData> ErrorData::Create(InternalErrorType type, std::unique_ptr<ErrorData> ErrorData::Create(InternalErrorType type,
std::string message, std::string message,
@ -100,4 +100,4 @@ namespace dawn_native {
return ss.str(); return ss.str();
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -30,7 +30,7 @@ namespace dawn {
using ErrorType = wgpu::ErrorType; using ErrorType = wgpu::ErrorType;
} }
namespace dawn_native { namespace dawn::native {
enum class InternalErrorType : uint32_t; enum class InternalErrorType : uint32_t;
class [[nodiscard]] ErrorData { class [[nodiscard]] ErrorData {
@ -65,6 +65,6 @@ namespace dawn_native {
std::vector<std::string> mDebugGroups; std::vector<std::string> mDebugGroups;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ERRORDATA_H_ #endif // DAWNNATIVE_ERRORDATA_H_

View File

@ -17,7 +17,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_native/DawnNative.h" #include "dawn_native/DawnNative.h"
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -67,4 +67,4 @@ namespace dawn_native {
sHasPendingInjectedError = true; sHasPendingInjectedError = true;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -18,7 +18,7 @@
#include <stdint.h> #include <stdint.h>
#include <type_traits> #include <type_traits>
namespace dawn_native { namespace dawn::native {
template <typename ErrorType> template <typename ErrorType>
struct InjectedErrorResult { struct InjectedErrorResult {
@ -43,15 +43,15 @@ namespace dawn_native {
return MaybeInjectError(errorTypes...); return MaybeInjectError(errorTypes...);
} }
} // namespace dawn_native } // namespace dawn::native
#if defined(DAWN_ENABLE_ERROR_INJECTION) #if defined(DAWN_ENABLE_ERROR_INJECTION)
# define INJECT_ERROR_OR_RUN(stmt, ...) \ # define INJECT_ERROR_OR_RUN(stmt, ...) \
[&]() { \ [&]() { \
if (DAWN_UNLIKELY(::dawn_native::ErrorInjectorEnabled())) { \ if (DAWN_UNLIKELY(::dawn::native::ErrorInjectorEnabled())) { \
/* Only used for testing and fuzzing, so it's okay if this is deoptimized */ \ /* Only used for testing and fuzzing, so it's okay if this is deoptimized */ \
auto injectedError = ::dawn_native::MaybeInjectError(__VA_ARGS__); \ auto injectedError = ::dawn::native::MaybeInjectError(__VA_ARGS__); \
if (injectedError.injected) { \ if (injectedError.injected) { \
return injectedError.error; \ return injectedError.error; \
} \ } \

View File

@ -16,7 +16,7 @@
#include "common/Assert.h" #include "common/Assert.h"
namespace dawn_native { namespace dawn::native {
namespace { namespace {
@ -89,4 +89,4 @@ namespace dawn_native {
return false; return false;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -20,7 +20,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
class ErrorScope { class ErrorScope {
public: public:
@ -52,6 +52,6 @@ namespace dawn_native {
std::vector<ErrorScope> mScopes; std::vector<ErrorScope> mScopes;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_ERRORSCOPE_H_ #endif // DAWNNATIVE_ERRORSCOPE_H_

View File

@ -20,7 +20,7 @@
#include "dawn_native/dawn_platform.h" #include "dawn_native/dawn_platform.h"
namespace dawn_native { namespace dawn::native {
MaybeError ValidateExternalTexturePlane(const TextureViewBase* textureView, MaybeError ValidateExternalTexturePlane(const TextureViewBase* textureView,
wgpu::TextureFormat format) { wgpu::TextureFormat format) {
@ -135,4 +135,4 @@ namespace dawn_native {
return ObjectType::ExternalTexture; return ObjectType::ExternalTexture;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -22,7 +22,7 @@
#include <array> #include <array>
namespace dawn_native { namespace dawn::native {
struct ExternalTextureDescriptor; struct ExternalTextureDescriptor;
class TextureViewBase; class TextureViewBase;
@ -58,6 +58,6 @@ namespace dawn_native {
std::array<Ref<TextureViewBase>, kMaxPlanesPerFormat> textureViews; std::array<Ref<TextureViewBase>, kMaxPlanesPerFormat> textureViews;
ExternalTextureState mState; ExternalTextureState mState;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_EXTERNALTEXTURE_H_ #endif // DAWNNATIVE_EXTERNALTEXTURE_H_

View File

@ -18,7 +18,7 @@
#include "common/BitSetIterator.h" #include "common/BitSetIterator.h"
#include "dawn_native/Features.h" #include "dawn_native/Features.h"
namespace dawn_native { namespace dawn::native {
namespace { namespace {
struct FeatureEnumAndInfo { struct FeatureEnumAndInfo {
@ -274,4 +274,4 @@ namespace dawn_native {
return static_cast<wgpu::FeatureName>(-1); return static_cast<wgpu::FeatureName>(-1);
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -23,7 +23,7 @@
#include "dawn/webgpu_cpp.h" #include "dawn/webgpu_cpp.h"
#include "dawn_native/DawnNative.h" #include "dawn_native/DawnNative.h"
namespace dawn_native { namespace dawn::native {
enum class Feature { enum class Feature {
TextureCompressionBC, TextureCompressionBC,
@ -78,6 +78,6 @@ namespace dawn_native {
std::unordered_map<std::string, Feature> mFeatureNameToEnumMap; std::unordered_map<std::string, Feature> mFeatureNameToEnumMap;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_FEATURES_H_ #endif // DAWNNATIVE_FEATURES_H_

View File

@ -21,7 +21,7 @@
#include <bitset> #include <bitset>
namespace dawn_native { namespace dawn::native {
// Format // Format
@ -469,4 +469,4 @@ namespace dawn_native {
return table; return table;
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -40,7 +40,7 @@
// //
// TODO(dawn:551): Consider moving this comment. // TODO(dawn:551): Consider moving this comment.
namespace dawn_native { namespace dawn::native {
enum class Aspect : uint8_t; enum class Aspect : uint8_t;
class DeviceBase; class DeviceBase;
@ -136,12 +136,12 @@ namespace dawn_native {
// Builds the format table with the extensions enabled on the device. // Builds the format table with the extensions enabled on the device.
FormatTable BuildFormatTable(const DeviceBase* device); FormatTable BuildFormatTable(const DeviceBase* device);
} // namespace dawn_native } // namespace dawn::native
namespace dawn { namespace dawn {
template <> template <>
struct IsDawnBitmask<dawn_native::SampleTypeBit> { struct IsDawnBitmask<dawn::native::SampleTypeBit> {
static constexpr bool enable = true; static constexpr bool enable = true;
}; };

View File

@ -20,7 +20,7 @@
template <typename T> template <typename T>
class Ref; class Ref;
namespace dawn_native { namespace dawn::native {
enum class ObjectType : uint32_t; enum class ObjectType : uint32_t;
@ -66,6 +66,6 @@ namespace dawn_native {
using RenderPassEncoderBase = RenderPassEncoder; using RenderPassEncoderBase = RenderPassEncoder;
using SurfaceBase = Surface; using SurfaceBase = Surface;
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_FORWARD_H_ #endif // DAWNNATIVE_FORWARD_H_

View File

@ -23,7 +23,7 @@
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
namespace dawn_native { namespace dawn::native {
uint32_t ComputeMaxIndirectValidationBatchOffsetRange(const CombinedLimits& limits) { uint32_t ComputeMaxIndirectValidationBatchOffsetRange(const CombinedLimits& limits) {
return limits.v1.maxStorageBufferBindingSize - limits.v1.minStorageBufferOffsetAlignment - return limits.v1.maxStorageBufferBindingSize - limits.v1.minStorageBufferOffsetAlignment -
@ -190,4 +190,4 @@ namespace dawn_native {
std::move(draw)); std::move(draw));
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -27,7 +27,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
namespace dawn_native { namespace dawn::native {
class RenderBundleBase; class RenderBundleBase;
struct CombinedLimits; struct CombinedLimits;
@ -121,6 +121,6 @@ namespace dawn_native {
uint32_t mMaxBatchOffsetRange; uint32_t mMaxBatchOffsetRange;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_INDIRECTDRAWMETADATA_H_ #endif // DAWNNATIVE_INDIRECTDRAWMETADATA_H_

View File

@ -29,7 +29,7 @@
#include <cstdlib> #include <cstdlib>
#include <limits> #include <limits>
namespace dawn_native { namespace dawn::native {
namespace { namespace {
// NOTE: This must match the workgroup_size attribute on the compute entry point below. // NOTE: This must match the workgroup_size attribute on the compute entry point below.
@ -382,4 +382,4 @@ namespace dawn_native {
return {}; return {};
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -18,7 +18,7 @@
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
#include "dawn_native/IndirectDrawMetadata.h" #include "dawn_native/IndirectDrawMetadata.h"
namespace dawn_native { namespace dawn::native {
class CommandEncoder; class CommandEncoder;
struct CombinedLimits; struct CombinedLimits;
@ -35,6 +35,6 @@ namespace dawn_native {
RenderPassResourceUsageTracker* usageTracker, RenderPassResourceUsageTracker* usageTracker,
IndirectDrawMetadata* indirectDrawMetadata); IndirectDrawMetadata* indirectDrawMetadata);
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_INDIRECTDRAWVALIDATIONENCODER_H_ #endif // DAWNNATIVE_INDIRECTDRAWVALIDATIONENCODER_H_

View File

@ -25,7 +25,7 @@
# include "dawn_native/XlibXcbFunctions.h" # include "dawn_native/XlibXcbFunctions.h"
#endif // defined(DAWN_USE_X11) #endif // defined(DAWN_USE_X11)
namespace dawn_native { namespace dawn::native {
// Forward definitions of each backend's "Connect" function that creates new BackendConnection. // Forward definitions of each backend's "Connect" function that creates new BackendConnection.
// Conditionally compiled declarations are used to avoid using static constructors instead. // Conditionally compiled declarations are used to avoid using static constructors instead.
@ -306,4 +306,4 @@ namespace dawn_native {
return new Surface(this, descriptor); return new Surface(this, descriptor);
} }
} // namespace dawn_native } // namespace dawn::native

View File

@ -32,7 +32,7 @@ namespace dawn::platform {
class Platform; class Platform;
} // namespace dawn::platform } // namespace dawn::platform
namespace dawn_native { namespace dawn::native {
class Surface; class Surface;
class XlibXcbFunctions; class XlibXcbFunctions;
@ -117,6 +117,6 @@ namespace dawn_native {
#endif // defined(DAWN_USE_X11) #endif // defined(DAWN_USE_X11)
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_INSTANCE_H_ #endif // DAWNNATIVE_INSTANCE_H_

View File

@ -20,7 +20,7 @@
#include <cstdint> #include <cstdint>
namespace dawn_native { namespace dawn::native {
// Binding numbers in the shader and BindGroup/BindGroupLayoutDescriptors // Binding numbers in the shader and BindGroup/BindGroupLayoutDescriptors
using BindingNumber = TypedInteger<struct BindingNumberT, uint32_t>; using BindingNumber = TypedInteger<struct BindingNumberT, uint32_t>;
@ -70,6 +70,6 @@ namespace dawn_native {
// other pipelines. // other pipelines.
using PipelineCompatibilityToken = TypedInteger<struct PipelineCompatibilityTokenT, uint64_t>; using PipelineCompatibilityToken = TypedInteger<struct PipelineCompatibilityTokenT, uint64_t>;
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_INTEGERTYPES_H_ #endif // DAWNNATIVE_INTEGERTYPES_H_

View File

@ -21,7 +21,7 @@
#include <unordered_map> #include <unordered_map>
namespace dawn_native { namespace dawn::native {
class RenderPipelineBase; class RenderPipelineBase;
class ShaderModuleBase; class ShaderModuleBase;
@ -35,4 +35,4 @@ namespace dawn_native {
InternalPipelineStore::~InternalPipelineStore() = default; InternalPipelineStore::~InternalPipelineStore() = default;
} // namespace dawn_native } // namespace dawn::native

View File

@ -21,7 +21,7 @@
#include <unordered_map> #include <unordered_map>
namespace dawn_native { namespace dawn::native {
class DeviceBase; class DeviceBase;
class RenderPipelineBase; class RenderPipelineBase;
@ -55,6 +55,6 @@ namespace dawn_native {
Ref<ComputePipelineBase> dispatchIndirectValidationPipeline; Ref<ComputePipelineBase> dispatchIndirectValidationPipeline;
}; };
} // namespace dawn_native } // namespace dawn::native
#endif // DAWNNATIVE_INTERNALPIPELINESTORE_H_ #endif // DAWNNATIVE_INTERNALPIPELINESTORE_H_

View File

@ -67,7 +67,7 @@
LIMITS_STORAGE_BUFFER_BINDING_SIZE(X) \ LIMITS_STORAGE_BUFFER_BINDING_SIZE(X) \
LIMITS_OTHER(X) LIMITS_OTHER(X)
namespace dawn_native { namespace dawn::native {
namespace { namespace {
template <uint32_t A, uint32_t B> template <uint32_t A, uint32_t B>
constexpr void StaticAssertSame() { constexpr void StaticAssertSame() {
@ -210,4 +210,4 @@ namespace dawn_native {
return limits; return limits;
} }
} // namespace dawn_native } // namespace dawn::native

Some files were not shown because too many files have changed in this diff Show More