Use C++17 nested namespaces instead of manually nesting them.

This was done with these two commands and a couple manual fixups for
namespaces that had more than one space in the comment in the closing
brace, as well as vulkan_platform.h

git grep -l "namespace .* { namespace " | xargs sed -i "" "s/namespace \(.*\) { namespace /namespace \1::/"
git grep -l "}}  // namespace" | xargs sed -i "" "s%}}  // namespace%}  // namespace%"

Bug: dawn:824
Change-Id: I6f448b820c12fc1004ea5270bf8e1f466b0c0aab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75400
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-01-06 09:22:17 +00:00 committed by Dawn LUCI CQ
parent 5984d8d1a8
commit 7f8fa04edc
349 changed files with 708 additions and 710 deletions

View File

@ -10,7 +10,6 @@ IndentWidth: 4
ObjCBlockIndentWidth: 4 ObjCBlockIndentWidth: 4
AccessModifierOffset: -2 AccessModifierOffset: -2
# Nested namespaces are C++17, fake them by compacting namespaces for now.
CompactNamespaces: true CompactNamespaces: true
# This should result in only one indentation level with compacted namespaces # This should result in only one indentation level with compacted namespaces

View File

@ -18,7 +18,7 @@
#include "dawn_wire/ObjectType_autogen.h" #include "dawn_wire/ObjectType_autogen.h"
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
namespace dawn_wire { namespace client { namespace dawn_wire::client {
template <typename T> template <typename T>
struct ObjectTypeToTypeEnum { struct ObjectTypeToTypeEnum {
@ -48,6 +48,6 @@ namespace dawn_wire { namespace client {
}; };
{% endfor %} {% endfor %}
}} // namespace dawn_wire::client } // namespace dawn_wire::client
#endif // DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_ #endif // DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_

View File

@ -21,7 +21,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace dawn_wire { namespace client { namespace dawn_wire::client {
//* Outputs an rvalue that's the number of elements a pointer member points to. //* Outputs an rvalue that's the number of elements a pointer member points to.
{% macro member_length(member, accessor) -%} {% macro member_length(member, accessor) -%}
@ -175,4 +175,4 @@ namespace dawn_wire { namespace client {
const {{Prefix}}ProcTable& GetProcs() { const {{Prefix}}ProcTable& GetProcs() {
return gProcTable; return gProcTable;
} }
}} // namespace dawn_wire::client } // namespace dawn_wire::client

View File

@ -20,7 +20,7 @@
#include "dawn_wire/client/ApiObjects.h" #include "dawn_wire/client/ApiObjects.h"
#include "dawn_wire/client/ObjectAllocator.h" #include "dawn_wire/client/ObjectAllocator.h"
namespace dawn_wire { namespace client { namespace dawn_wire::client {
class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider { class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider {
public: public:
@ -69,6 +69,6 @@ namespace dawn_wire { namespace client {
{% endfor %} {% endfor %}
}; };
}} // namespace dawn_wire::client } // namespace dawn_wire::client
#endif // DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_ #endif // DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_

View File

@ -17,7 +17,7 @@
#include <string> #include <string>
namespace dawn_wire { namespace client { namespace dawn_wire::client {
{% for command in cmd_records["return command"] %} {% for command in cmd_records["return command"] %}
bool Client::Handle{{command.name.CamelCase()}}(DeserializeBuffer* deserializeBuffer) { bool Client::Handle{{command.name.CamelCase()}}(DeserializeBuffer* deserializeBuffer) {
Return{{command.name.CamelCase()}}Cmd cmd; Return{{command.name.CamelCase()}}Cmd cmd;
@ -94,4 +94,4 @@ namespace dawn_wire { namespace client {
return commands; return commands;
} }
}} // namespace dawn_wire::client } // namespace dawn_wire::client

View File

@ -22,7 +22,7 @@
#include "dawn_wire/WireDeserializeAllocator.h" #include "dawn_wire/WireDeserializeAllocator.h"
#include "dawn_wire/server/ObjectStorage.h" #include "dawn_wire/server/ObjectStorage.h"
namespace dawn_wire { namespace server { namespace dawn_wire::server {
class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver { class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver {
public: public:
@ -100,6 +100,6 @@ namespace dawn_wire { namespace server {
{% endfor %} {% endfor %}
}; };
}} // namespace dawn_wire::server } // namespace dawn_wire::server
#endif // DAWNWIRE_SERVER_SERVERBASE_H_ #endif // DAWNWIRE_SERVER_SERVERBASE_H_

View File

@ -15,7 +15,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire { namespace server { namespace dawn_wire::server {
//* Implementation of the command doers //* Implementation of the command doers
{% for command in cmd_records["command"] %} {% for command in cmd_records["command"] %}
{% set type = command.derived_object %} {% set type = command.derived_object %}
@ -118,4 +118,4 @@ namespace dawn_wire { namespace server {
} }
} }
}} // namespace dawn_wire::server } // namespace dawn_wire::server

View File

@ -15,7 +15,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire { namespace server { namespace dawn_wire::server {
{% for command in cmd_records["command"] %} {% for command in cmd_records["command"] %}
{% set method = command.derived_method %} {% set method = command.derived_method %}
{% set is_method = method != None %} {% set is_method = method != None %}
@ -147,4 +147,4 @@ namespace dawn_wire { namespace server {
return commands; return commands;
} }
}} // namespace dawn_wire::server } // namespace dawn_wire::server

View File

@ -14,7 +14,7 @@
#include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h"
namespace dawn_native { namespace 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 { namespace 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 { namespace 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 { namespace vulkan { namespace dawn_native::vulkan {
namespace detail { namespace detail {
template <typename T> template <typename T>
@ -140,17 +140,16 @@ namespace dawn_native { namespace 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 { namespace 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

View File

@ -22,10 +22,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace tint { namespace diag { namespace tint::diag {
class Diagnostic; class Diagnostic;
class List; class List;
}} // namespace tint::diag } // namespace tint::diag
namespace dawn_native { namespace dawn_native {

View File

@ -24,7 +24,7 @@
#include <sstream> #include <sstream>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
Adapter::Adapter(Backend* backend, ComPtr<IDXGIAdapter3> hardwareAdapter) Adapter::Adapter(Backend* backend, ComPtr<IDXGIAdapter3> hardwareAdapter)
: AdapterBase(backend->GetInstance(), wgpu::BackendType::D3D12), : AdapterBase(backend->GetInstance(), wgpu::BackendType::D3D12),
@ -412,4 +412,4 @@ namespace dawn_native { namespace d3d12 {
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -21,7 +21,7 @@
#include "dawn_native/d3d12/D3D12Info.h" #include "dawn_native/d3d12/D3D12Info.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Backend; class Backend;
@ -61,6 +61,6 @@ namespace dawn_native { namespace d3d12 {
D3D12DeviceInfo mDeviceInfo = {}; D3D12DeviceInfo mDeviceInfo = {};
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_ADAPTERD3D12_H_ #endif // DAWNNATIVE_D3D12_ADAPTERD3D12_H_

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/D3D12Error.h" #include "dawn_native/d3d12/D3D12Error.h"
#include "dawn_native/d3d12/PlatformFunctions.h" #include "dawn_native/d3d12/PlatformFunctions.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
@ -207,4 +207,4 @@ namespace dawn_native { namespace d3d12 {
return backend; return backend;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class PlatformFunctions; class PlatformFunctions;
@ -54,6 +54,6 @@ namespace dawn_native { namespace d3d12 {
ComPtr<IDxcValidator> mDxcValidator; ComPtr<IDxcValidator> mDxcValidator;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BACKENDD3D12_H_ #endif // DAWNNATIVE_D3D12_BACKENDD3D12_H_

View File

@ -23,7 +23,7 @@
#include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h"
#include "dawn_native/d3d12/TextureD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// static // static
ResultOrError<Ref<BindGroup>> BindGroup::Create(Device* device, ResultOrError<Ref<BindGroup>> BindGroup::Create(Device* device,
@ -282,4 +282,4 @@ namespace dawn_native { namespace d3d12 {
return mDynamicStorageBufferLengths; return mDynamicStorageBufferLengths;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@
#include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h"
#include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
class SamplerHeapCacheEntry; class SamplerHeapCacheEntry;
@ -63,6 +63,6 @@ namespace dawn_native { namespace d3d12 {
DynamicStorageBufferLengths mDynamicStorageBufferLengths; DynamicStorageBufferLengths mDynamicStorageBufferLengths;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BINDGROUPD3D12_H_ #endif // DAWNNATIVE_D3D12_BINDGROUPD3D12_H_

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/SamplerHeapCacheD3D12.h" #include "dawn_native/d3d12/SamplerHeapCacheD3D12.h"
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_DESCRIPTOR_RANGE_TYPE WGPUBindingInfoToDescriptorRangeType( D3D12_DESCRIPTOR_RANGE_TYPE WGPUBindingInfoToDescriptorRangeType(
const BindingInfo& bindingInfo) { const BindingInfo& bindingInfo) {
@ -188,4 +188,4 @@ namespace dawn_native { namespace d3d12 {
return mSamplerDescriptorRanges; return mSamplerDescriptorRanges;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -21,7 +21,7 @@
#include "common/ityp_stack_vec.h" #include "common/ityp_stack_vec.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class BindGroup; class BindGroup;
class CPUDescriptorHeapAllocation; class CPUDescriptorHeapAllocation;
@ -89,6 +89,6 @@ namespace dawn_native { namespace d3d12 {
StagingDescriptorAllocator* mViewAllocator = nullptr; StagingDescriptorAllocator* mViewAllocator = nullptr;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BINDGROUPLAYOUTD3D12_H_ #endif // DAWNNATIVE_D3D12_BINDGROUPLAYOUTD3D12_H_

View File

@ -26,7 +26,7 @@
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_RESOURCE_FLAGS D3D12ResourceFlags(wgpu::BufferUsage usage) { D3D12_RESOURCE_FLAGS D3D12ResourceFlags(wgpu::BufferUsage usage) {
@ -490,4 +490,4 @@ namespace dawn_native { namespace d3d12 {
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class CommandRecordingContext; class CommandRecordingContext;
class Device; class Device;
@ -86,6 +86,6 @@ namespace dawn_native { namespace d3d12 {
void* mMappedData = nullptr; void* mMappedData = nullptr;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BUFFERD3D12_H_ #endif // DAWNNATIVE_D3D12_BUFFERD3D12_H_

View File

@ -15,7 +15,7 @@
#include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h"
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
CPUDescriptorHeapAllocation::CPUDescriptorHeapAllocation( CPUDescriptorHeapAllocation::CPUDescriptorHeapAllocation(
D3D12_CPU_DESCRIPTOR_HANDLE baseDescriptor, D3D12_CPU_DESCRIPTOR_HANDLE baseDescriptor,
@ -50,4 +50,4 @@ namespace dawn_native { namespace d3d12 {
mBaseDescriptor = {0}; mBaseDescriptor = {0};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// Wrapper for a handle into a CPU-only descriptor heap. // Wrapper for a handle into a CPU-only descriptor heap.
class CPUDescriptorHeapAllocation { class CPUDescriptorHeapAllocation {
@ -42,6 +42,6 @@ namespace dawn_native { namespace d3d12 {
uint32_t mHeapIndex = -1; uint32_t mHeapIndex = -1;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_

View File

@ -20,7 +20,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "common/BitSetIterator.h" #include "common/BitSetIterator.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
CommandAllocatorManager::CommandAllocatorManager(Device* device) CommandAllocatorManager::CommandAllocatorManager(Device* device)
: device(device), mAllocatorCount(0) { : device(device), mAllocatorCount(0) {
@ -69,4 +69,4 @@ namespace dawn_native { namespace d3d12 {
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -23,7 +23,7 @@
#include <bitset> #include <bitset>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -53,6 +53,6 @@ namespace dawn_native { namespace d3d12 {
SerialQueue<ExecutionSerial, IndexedCommandAllocator> mInFlightCommandAllocators; SerialQueue<ExecutionSerial, IndexedCommandAllocator> mInFlightCommandAllocators;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_COMMANDALLOCATORMANAGER_H_ #endif // DAWNNATIVE_D3D12_COMMANDALLOCATORMANAGER_H_

View File

@ -33,7 +33,7 @@
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
@ -1649,4 +1649,4 @@ namespace dawn_native { namespace d3d12 {
} }
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@ namespace dawn_native {
struct BeginRenderPassCmd; struct BeginRenderPassCmd;
} // namespace dawn_native } // namespace dawn_native
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class BindGroupStateTracker; class BindGroupStateTracker;
class CommandRecordingContext; class CommandRecordingContext;
@ -52,6 +52,6 @@ namespace dawn_native { namespace d3d12 {
const RenderPassBuilder* renderPassBuilder) const; const RenderPassBuilder* renderPassBuilder) const;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_COMMANDBUFFERD3D12_H_ #endif // DAWNNATIVE_D3D12_COMMANDBUFFERD3D12_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/HeapD3D12.h"
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
void CommandRecordingContext::AddToSharedTextureList(Texture* texture) { void CommandRecordingContext::AddToSharedTextureList(Texture* texture) {
ASSERT(IsOpen()); ASSERT(IsOpen());
@ -123,4 +123,4 @@ namespace dawn_native { namespace d3d12 {
mTempBuffers.emplace_back(tempBuffer); mTempBuffers.emplace_back(tempBuffer);
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -21,7 +21,7 @@
#include <set> #include <set>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class CommandAllocatorManager; class CommandAllocatorManager;
class Device; class Device;
class Heap; class Heap;
@ -53,6 +53,6 @@ namespace dawn_native { namespace d3d12 {
std::vector<Ref<Buffer>> mTempBuffers; std::vector<Ref<Buffer>> mTempBuffers;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_ #endif // DAWNNATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_

View File

@ -22,7 +22,7 @@
#include "dawn_native/d3d12/ShaderModuleD3D12.h" #include "dawn_native/d3d12/ShaderModuleD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
Ref<ComputePipeline> ComputePipeline::CreateUninitialized( Ref<ComputePipeline> ComputePipeline::CreateUninitialized(
Device* device, Device* device,
@ -102,4 +102,4 @@ namespace dawn_native { namespace d3d12 {
return ToBackend(GetDevice())->GetDispatchIndirectSignature(); return ToBackend(GetDevice())->GetDispatchIndirectSignature();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -53,6 +53,6 @@ namespace dawn_native { namespace d3d12 {
ComPtr<ID3D12PipelineState> mPipelineState; ComPtr<ID3D12PipelineState> mPipelineState;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_COMPUTEPIPELINED3D12_H_ #endif // DAWNNATIVE_D3D12_COMPUTEPIPELINED3D12_H_

View File

@ -21,7 +21,7 @@
#include "common/Log.h" #include "common/Log.h"
#include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/DeviceD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
void Flush11On12DeviceToAvoidLeaks(ComPtr<ID3D11On12Device> d3d11on12Device) { void Flush11On12DeviceToAvoidLeaks(ComPtr<ID3D11On12Device> d3d11on12Device) {
if (d3d11on12Device == nullptr) { if (d3d11on12Device == nullptr) {
@ -161,4 +161,4 @@ namespace dawn_native { namespace d3d12 {
return entry; return entry;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -25,7 +25,7 @@
struct ID3D11On12Device; struct ID3D11On12Device;
struct IDXGIKeyedMutex; struct IDXGIKeyedMutex;
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// Wraps 11 wrapped resources in a cache. // Wraps 11 wrapped resources in a cache.
class D3D11on12ResourceCacheEntry : public RefCounted { class D3D11on12ResourceCacheEntry : public RefCounted {
@ -84,6 +84,6 @@ namespace dawn_native { namespace d3d12 {
Cache mCache; Cache mCache;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D11ON12UTIL_H_ #endif // DAWNNATIVE_D3D11ON12UTIL_H_

View File

@ -26,7 +26,7 @@
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
#include "dawn_native/d3d12/TextureD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ComPtr<ID3D12Device> GetD3D12Device(WGPUDevice device) { ComPtr<ID3D12Device> GetD3D12Device(WGPUDevice device) {
return ToBackend(FromAPI(device))->GetD3D12Device(); return ToBackend(FromAPI(device))->GetD3D12Device();
@ -178,4 +178,4 @@ namespace dawn_native { namespace d3d12 {
AdapterDiscoveryOptions::AdapterDiscoveryOptions(ComPtr<IDXGIAdapter> adapter) AdapterDiscoveryOptions::AdapterDiscoveryOptions(ComPtr<IDXGIAdapter> adapter)
: AdapterDiscoveryOptionsBase(WGPUBackendType_D3D12), dxgiAdapter(std::move(adapter)) { : AdapterDiscoveryOptionsBase(WGPUBackendType_D3D12), dxgiAdapter(std::move(adapter)) {
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -18,7 +18,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
MaybeError CheckHRESULTImpl(HRESULT result, const char* context) { MaybeError CheckHRESULTImpl(HRESULT result, const char* context) {
if (DAWN_LIKELY(SUCCEEDED(result))) { if (DAWN_LIKELY(SUCCEEDED(result))) {
return {}; return {};
@ -48,4 +48,4 @@ namespace dawn_native { namespace d3d12 {
return CheckHRESULTImpl(result, context); return CheckHRESULTImpl(result, context);
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/Error.h" #include "dawn_native/Error.h"
#include "dawn_native/ErrorInjector.h" #include "dawn_native/ErrorInjector.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
constexpr HRESULT E_FAKE_ERROR_FOR_TESTING = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xFF); constexpr HRESULT E_FAKE_ERROR_FOR_TESTING = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xFF);
constexpr HRESULT E_FAKE_OUTOFMEMORY_ERROR_FOR_TESTING = constexpr HRESULT E_FAKE_OUTOFMEMORY_ERROR_FOR_TESTING =
@ -40,6 +40,6 @@ namespace dawn_native { namespace d3d12 {
E_FAKE_ERROR_FOR_TESTING), \ E_FAKE_ERROR_FOR_TESTING), \
contextIn) contextIn)
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_D3D12ERROR_H_ #endif // DAWNNATIVE_D3D12_D3D12ERROR_H_

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/D3D12Error.h" #include "dawn_native/d3d12/D3D12Error.h"
#include "dawn_native/d3d12/PlatformFunctions.h" #include "dawn_native/d3d12/PlatformFunctions.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter) { ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter) {
D3D12DeviceInfo info = {}; D3D12DeviceInfo info = {};
@ -119,4 +119,4 @@ namespace dawn_native { namespace d3d12 {
return std::move(info); return std::move(info);
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/PerStage.h" #include "dawn_native/PerStage.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Adapter; class Adapter;
@ -36,6 +36,6 @@ namespace dawn_native { namespace d3d12 {
}; };
ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter); ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter);
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_D3D12INFO_H_ #endif // DAWNNATIVE_D3D12_D3D12INFO_H_

View File

@ -44,7 +44,7 @@
#include <sstream> #include <sstream>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// TODO(dawn:155): Figure out these values. // TODO(dawn:155): Figure out these values.
static constexpr uint16_t kShaderVisibleDescriptorHeapSize = 1024; static constexpr uint16_t kShaderVisibleDescriptorHeapSize = 1024;
@ -742,4 +742,4 @@ namespace dawn_native { namespace d3d12 {
return ToBackend(computePipeline)->UsesNumWorkgroups(); return ToBackend(computePipeline)->UsesNumWorkgroups();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@
#include "dawn_native/d3d12/Forward.h" #include "dawn_native/d3d12/Forward.h"
#include "dawn_native/d3d12/TextureD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class CommandAllocatorManager; class CommandAllocatorManager;
class PlatformFunctions; class PlatformFunctions;
@ -261,6 +261,6 @@ namespace dawn_native { namespace d3d12 {
float mTimestampPeriod = 1.0f; float mTimestampPeriod = 1.0f;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_DEVICED3D12_H_ #endif // DAWNNATIVE_D3D12_DEVICED3D12_H_

View File

@ -17,7 +17,7 @@
#include "dawn_native/ToBackend.h" #include "dawn_native/ToBackend.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Adapter; class Adapter;
class BindGroup; class BindGroup;
@ -64,6 +64,6 @@ namespace dawn_native { namespace d3d12 {
return ToBackendBase<D3D12BackendTraits>(common); return ToBackendBase<D3D12BackendTraits>(common);
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_FORWARD_H_ #endif // DAWNNATIVE_D3D12_FORWARD_H_

View File

@ -14,7 +14,7 @@
#include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
GPUDescriptorHeapAllocation::GPUDescriptorHeapAllocation( GPUDescriptorHeapAllocation::GPUDescriptorHeapAllocation(
D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor, D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor,
@ -36,4 +36,4 @@ namespace dawn_native { namespace d3d12 {
HeapVersionID GPUDescriptorHeapAllocation::GetHeapSerial() const { HeapVersionID GPUDescriptorHeapAllocation::GetHeapSerial() const {
return mHeapSerial; return mHeapSerial;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/IntegerTypes.h" #include "dawn_native/d3d12/IntegerTypes.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// Wrapper for a handle into a GPU-only descriptor heap. // Wrapper for a handle into a GPU-only descriptor heap.
class GPUDescriptorHeapAllocation { class GPUDescriptorHeapAllocation {
@ -39,6 +39,6 @@ namespace dawn_native { namespace d3d12 {
HeapVersionID mHeapSerial = HeapVersionID(0); HeapVersionID mHeapSerial = HeapVersionID(0);
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/HeapD3D12.h"
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
HeapAllocator::HeapAllocator(Device* device, HeapAllocator::HeapAllocator(Device* device,
D3D12_HEAP_TYPE heapType, D3D12_HEAP_TYPE heapType,
@ -68,4 +68,4 @@ namespace dawn_native { namespace d3d12 {
mDevice->ReferenceUntilUnused(static_cast<Heap*>(heap.get())->GetD3D12Heap()); mDevice->ReferenceUntilUnused(static_cast<Heap*>(heap.get())->GetD3D12Heap());
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/ResourceHeapAllocator.h" #include "dawn_native/ResourceHeapAllocator.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -43,6 +43,6 @@ namespace dawn_native { namespace d3d12 {
MemorySegment mMemorySegment; MemorySegment mMemorySegment;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_HEAPALLOCATORD3D12_H_ #endif // DAWNNATIVE_D3D12_HEAPALLOCATORD3D12_H_

View File

@ -14,7 +14,7 @@
#include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/HeapD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
Heap::Heap(ComPtr<ID3D12Pageable> d3d12Pageable, MemorySegment memorySegment, uint64_t size) Heap::Heap(ComPtr<ID3D12Pageable> d3d12Pageable, MemorySegment memorySegment, uint64_t size)
: Pageable(std::move(d3d12Pageable), memorySegment, size) { : Pageable(std::move(d3d12Pageable), memorySegment, size) {
mD3d12Pageable.As(&mD3d12Heap); mD3d12Pageable.As(&mD3d12Heap);
@ -28,4 +28,4 @@ namespace dawn_native { namespace d3d12 {
return mD3d12Heap.Get(); return mD3d12Heap.Get();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/PageableD3D12.h" #include "dawn_native/d3d12/PageableD3D12.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -35,6 +35,6 @@ namespace dawn_native { namespace d3d12 {
private: private:
ComPtr<ID3D12Heap> mD3d12Heap; ComPtr<ID3D12Heap> mD3d12Heap;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_HEAPD3D12_H_ #endif // DAWNNATIVE_D3D12_HEAPD3D12_H_

View File

@ -20,7 +20,7 @@
#include <cstdint> #include <cstdint>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// An ID used to desambiguate between multiple uses of the same descriptor heap in the // An ID used to desambiguate between multiple uses of the same descriptor heap in the
// BindGroup allocations. // BindGroup allocations.
@ -29,6 +29,6 @@ namespace dawn_native { namespace d3d12 {
// The monotonically increasing serial for external D3D12 mutexes imported in Dawn. // The monotonically increasing serial for external D3D12 mutexes imported in Dawn.
using ExternalMutexSerial = TypedInteger<struct ExternalMutexSerialT, uint64_t>; using ExternalMutexSerial = TypedInteger<struct ExternalMutexSerialT, uint64_t>;
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_INTEGERTYPES_H_ #endif // DAWNNATIVE_D3D12_INTEGERTYPES_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/DeviceD3D12.h"
#include "dawn_native/d3d12/TextureD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
DXGI_USAGE D3D12SwapChainBufferUsage(WGPUTextureUsage allowedUsages) { DXGI_USAGE D3D12SwapChainBufferUsage(WGPUTextureUsage allowedUsages) {
@ -117,4 +117,4 @@ namespace dawn_native { namespace d3d12 {
return wgpu::TextureFormat::RGBA8Unorm; return wgpu::TextureFormat::RGBA8Unorm;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -23,7 +23,7 @@
#include <vector> #include <vector>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -55,6 +55,6 @@ namespace dawn_native { namespace d3d12 {
uint32_t mCurrentBuffer; uint32_t mCurrentBuffer;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_NATIVESWAPCHAINIMPLD3D12_H_ #endif // DAWNNATIVE_D3D12_NATIVESWAPCHAINIMPLD3D12_H_

View File

@ -14,7 +14,7 @@
#include "dawn_native/d3d12/PageableD3D12.h" #include "dawn_native/d3d12/PageableD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
Pageable::Pageable(ComPtr<ID3D12Pageable> d3d12Pageable, Pageable::Pageable(ComPtr<ID3D12Pageable> d3d12Pageable,
MemorySegment memorySegment, MemorySegment memorySegment,
uint64_t size) uint64_t size)
@ -73,4 +73,4 @@ namespace dawn_native { namespace d3d12 {
bool Pageable::IsResidencyLocked() const { bool Pageable::IsResidencyLocked() const {
return mResidencyLockRefCount != 0; return mResidencyLockRefCount != 0;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -20,7 +20,7 @@
#include "dawn_native/IntegerTypes.h" #include "dawn_native/IntegerTypes.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// This class is used to represent ID3D12Pageable allocations, and also serves as a node within // This class is used to represent ID3D12Pageable allocations, and also serves as a node within
// the ResidencyManager's LRU cache. This node is inserted into the LRU-cache when it is first // the ResidencyManager's LRU cache. This node is inserted into the LRU-cache when it is first
// allocated, and any time it is scheduled to be used by the GPU. This node is removed from the // allocated, and any time it is scheduled to be used by the GPU. This node is removed from the
@ -75,6 +75,6 @@ namespace dawn_native { namespace d3d12 {
uint32_t mResidencyLockRefCount = 0; uint32_t mResidencyLockRefCount = 0;
uint64_t mSize = 0; uint64_t mSize = 0;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif #endif

View File

@ -24,7 +24,7 @@
using Microsoft::WRL::ComPtr; using Microsoft::WRL::ComPtr;
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
// Reserve register names for internal use. This registers map to bindings in the shader, // Reserve register names for internal use. This registers map to bindings in the shader,
@ -364,4 +364,4 @@ namespace dawn_native { namespace d3d12 {
return mDispatchIndirectCommandSignatureWithNumWorkgroups.Get(); return mDispatchIndirectCommandSignatureWithNumWorkgroups.Get();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -21,7 +21,7 @@
#include "dawn_native/PipelineLayout.h" #include "dawn_native/PipelineLayout.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -95,6 +95,6 @@ namespace dawn_native { namespace d3d12 {
ComPtr<ID3D12CommandSignature> mDispatchIndirectCommandSignatureWithNumWorkgroups; ComPtr<ID3D12CommandSignature> mDispatchIndirectCommandSignatureWithNumWorkgroups;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_PIPELINELAYOUTD3D12_H_ #endif // DAWNNATIVE_D3D12_PIPELINELAYOUTD3D12_H_

View File

@ -20,7 +20,7 @@
#include <array> #include <array>
#include <sstream> #include <sstream>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
// Extract Version from "10.0.{Version}.0" if possible, otherwise return 0. // Extract Version from "10.0.{Version}.0" if possible, otherwise return 0.
uint32_t GetWindowsSDKVersionFromDirectoryName(const char* directoryName) { uint32_t GetWindowsSDKVersionFromDirectoryName(const char* directoryName) {
@ -268,4 +268,4 @@ namespace dawn_native { namespace d3d12 {
} }
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@
#include <d3dcompiler.h> #include <d3dcompiler.h>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// Loads the functions required from the platform dynamically so that we don't need to rely on // Loads the functions required from the platform dynamically so that we don't need to rely on
// them being present in the system. For example linking against d3d12.lib would prevent // them being present in the system. For example linking against d3d12.lib would prevent
@ -105,6 +105,6 @@ namespace dawn_native { namespace d3d12 {
DynamicLib mPIXEventRuntimeLib; DynamicLib mPIXEventRuntimeLib;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_PLATFORMFUNCTIONS_H_ #endif // DAWNNATIVE_D3D12_PLATFORMFUNCTIONS_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/DeviceD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_QUERY_HEAP_TYPE D3D12QueryHeapType(wgpu::QueryType type) { D3D12_QUERY_HEAP_TYPE D3D12QueryHeapType(wgpu::QueryType type) {
@ -72,4 +72,4 @@ namespace dawn_native { namespace d3d12 {
SetDebugName(ToBackend(GetDevice()), mQueryHeap.Get(), "Dawn_QuerySet", GetLabel()); SetDebugName(ToBackend(GetDevice()), mQueryHeap.Get(), "Dawn_QuerySet", GetLabel());
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -18,7 +18,7 @@
#include "dawn_native/QuerySet.h" #include "dawn_native/QuerySet.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -41,6 +41,6 @@ namespace dawn_native { namespace d3d12 {
ComPtr<ID3D12QueryHeap> mQueryHeap; ComPtr<ID3D12QueryHeap> mQueryHeap;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_QUERYSETD3D12_H_ #endif // DAWNNATIVE_D3D12_QUERYSETD3D12_H_

View File

@ -24,7 +24,7 @@
#include "dawn_platform/DawnPlatform.h" #include "dawn_platform/DawnPlatform.h"
#include "dawn_platform/tracing/TraceEvent.h" #include "dawn_platform/tracing/TraceEvent.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
Queue::Queue(Device* device) : QueueBase(device) { Queue::Queue(Device* device) : QueueBase(device) {
} }
@ -51,4 +51,4 @@ namespace dawn_native { namespace d3d12 {
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/CommandRecordingContext.h" #include "dawn_native/d3d12/CommandRecordingContext.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -32,6 +32,6 @@ namespace dawn_native { namespace d3d12 {
MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override; MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_QUEUED3D12_H_ #endif // DAWNNATIVE_D3D12_QUEUED3D12_H_

View File

@ -21,7 +21,7 @@
#include "dawn_native/dawn_platform.h" #include "dawn_native/dawn_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE D3D12BeginningAccessType(wgpu::LoadOp loadOp) { D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE D3D12BeginningAccessType(wgpu::LoadOp loadOp) {
@ -235,4 +235,4 @@ namespace dawn_native { namespace d3d12 {
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS; D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -24,7 +24,7 @@
#include <array> #include <array>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class TextureView; class TextureView;
@ -93,6 +93,6 @@ namespace dawn_native { namespace d3d12 {
kMaxColorAttachments> kMaxColorAttachments>
mSubresourceParams; mSubresourceParams;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RENDERPASSBUILDERD3D12_H_ #endif // DAWNNATIVE_D3D12_RENDERPASSBUILDERD3D12_H_

View File

@ -27,7 +27,7 @@
#include <d3dcompiler.h> #include <d3dcompiler.h>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
DXGI_FORMAT VertexFormatType(wgpu::VertexFormat format) { DXGI_FORMAT VertexFormatType(wgpu::VertexFormat format) {
@ -487,4 +487,4 @@ namespace dawn_native { namespace d3d12 {
CreateRenderPipelineAsyncTask::RunAsync(std::move(asyncTask)); CreateRenderPipelineAsyncTask::RunAsync(std::move(asyncTask));
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/ShaderModuleD3D12.h" #include "dawn_native/d3d12/ShaderModuleD3D12.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -57,6 +57,6 @@ namespace dawn_native { namespace d3d12 {
FirstOffsetInfo mFirstOffsetInfo; FirstOffsetInfo mFirstOffsetInfo;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RENDERPIPELINED3D12_H_ #endif // DAWNNATIVE_D3D12_RENDERPIPELINED3D12_H_

View File

@ -20,7 +20,7 @@
#include "dawn_native/d3d12/Forward.h" #include "dawn_native/d3d12/Forward.h"
#include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/HeapD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ResidencyManager::ResidencyManager(Device* device) ResidencyManager::ResidencyManager(Device* device)
: mDevice(device), : mDevice(device),
@ -368,4 +368,4 @@ namespace dawn_native { namespace d3d12 {
} }
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
class Heap; class Heap;
@ -77,6 +77,6 @@ namespace dawn_native { namespace d3d12 {
VideoMemoryInfo mVideoMemoryInfo = {}; VideoMemoryInfo mVideoMemoryInfo = {};
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RESIDENCYMANAGERD3D12_H_ #endif // DAWNNATIVE_D3D12_RESIDENCYMANAGERD3D12_H_

View File

@ -21,7 +21,7 @@
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
MemorySegment GetMemorySegment(Device* device, D3D12_HEAP_TYPE heapType) { MemorySegment GetMemorySegment(Device* device, D3D12_HEAP_TYPE heapType) {
if (device->GetDeviceInfo().isUMA) { if (device->GetDeviceInfo().isUMA) {
@ -407,4 +407,4 @@ namespace dawn_native { namespace d3d12 {
} }
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -24,7 +24,7 @@
#include <array> #include <array>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -102,6 +102,6 @@ namespace dawn_native { namespace d3d12 {
SerialQueue<ExecutionSerial, ResourceHeapAllocation> mAllocationsToDelete; SerialQueue<ExecutionSerial, ResourceHeapAllocation> mAllocationsToDelete;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RESOURCEALLOCATORMANAGERD3D12_H_ #endif // DAWNNATIVE_D3D12_RESOURCEALLOCATORMANAGERD3D12_H_

View File

@ -19,7 +19,7 @@
#include <utility> #include <utility>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ResourceHeapAllocation::ResourceHeapAllocation(const AllocationInfo& info, ResourceHeapAllocation::ResourceHeapAllocation(const AllocationInfo& info,
uint64_t offset, uint64_t offset,
ComPtr<ID3D12Resource> resource, ComPtr<ID3D12Resource> resource,
@ -40,4 +40,4 @@ namespace dawn_native { namespace d3d12 {
D3D12_GPU_VIRTUAL_ADDRESS ResourceHeapAllocation::GetGPUPointer() const { D3D12_GPU_VIRTUAL_ADDRESS ResourceHeapAllocation::GetGPUPointer() const {
return mResource->GetGPUVirtualAddress(); return mResource->GetGPUVirtualAddress();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/ResourceMemoryAllocation.h" #include "dawn_native/ResourceMemoryAllocation.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Heap; class Heap;
@ -43,6 +43,6 @@ namespace dawn_native { namespace d3d12 {
ComPtr<ID3D12Resource> mResource; ComPtr<ID3D12Resource> mResource;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RESOURCEHEAPALLOCATIOND3D12_H_ #endif // DAWNNATIVE_D3D12_RESOURCEHEAPALLOCATIOND3D12_H_

View File

@ -17,7 +17,7 @@
#include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/DeviceD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_TEXTURE_ADDRESS_MODE AddressMode(wgpu::AddressMode mode) { D3D12_TEXTURE_ADDRESS_MODE AddressMode(wgpu::AddressMode mode) {
@ -103,4 +103,4 @@ namespace dawn_native { namespace d3d12 {
return mSamplerDesc; return mSamplerDesc;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -35,6 +35,6 @@ namespace dawn_native { namespace d3d12 {
D3D12_SAMPLER_DESC mSamplerDesc = {}; D3D12_SAMPLER_DESC mSamplerDesc = {};
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SAMPLERD3D12_H_ #endif // DAWNNATIVE_D3D12_SAMPLERD3D12_H_

View File

@ -24,7 +24,7 @@
#include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h"
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
SamplerHeapCacheEntry::SamplerHeapCacheEntry(std::vector<Sampler*> samplers) SamplerHeapCacheEntry::SamplerHeapCacheEntry(std::vector<Sampler*> samplers)
: mSamplers(std::move(samplers)) { : mSamplers(std::move(samplers)) {
@ -163,4 +163,4 @@ namespace dawn_native { namespace d3d12 {
const SamplerHeapCacheEntry* b) const { const SamplerHeapCacheEntry* b) const {
return a->mSamplers == b->mSamplers; return a->mSamplers == b->mSamplers;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -32,7 +32,7 @@
// //
// The cache is primary needed for the GPU sampler heap, which is much smaller than the view heap // The cache is primary needed for the GPU sampler heap, which is much smaller than the view heap
// and switches incur expensive pipeline flushes. // and switches incur expensive pipeline flushes.
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class BindGroup; class BindGroup;
class Device; class Device;
@ -102,6 +102,6 @@ namespace dawn_native { namespace d3d12 {
Cache mCache; Cache mCache;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SAMPLERHEAPCACHE_H_ #endif // DAWNNATIVE_D3D12_SAMPLERHEAPCACHE_H_

View File

@ -34,7 +34,7 @@
#include <sstream> #include <sstream>
#include <unordered_map> #include <unordered_map>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
ResultOrError<uint64_t> GetDXCompilerVersion(ComPtr<IDxcValidator> dxcValidator) { ResultOrError<uint64_t> GetDXCompilerVersion(ComPtr<IDxcValidator> dxcValidator) {
@ -828,4 +828,4 @@ namespace dawn_native { namespace d3d12 {
UNREACHABLE(); UNREACHABLE();
return {}; return {};
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -24,7 +24,7 @@ namespace dawn_native {
struct ProgrammableStage; struct ProgrammableStage;
} // namespace dawn_native } // namespace dawn_native
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
class PipelineLayout; class PipelineLayout;
@ -64,6 +64,6 @@ namespace dawn_native { namespace d3d12 {
MaybeError Initialize(ShaderModuleParseResult* parseResult); MaybeError Initialize(ShaderModuleParseResult* parseResult);
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SHADERMODULED3D12_H_ #endif // DAWNNATIVE_D3D12_SHADERMODULED3D12_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h"
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
// Limits the min/max heap size to always be some known value for testing. // Limits the min/max heap size to always be some known value for testing.
// Thresholds should be adjusted (lower == faster) to avoid tests taking too long to complete. // Thresholds should be adjusted (lower == faster) to avoid tests taking too long to complete.
@ -251,4 +251,4 @@ namespace dawn_native { namespace d3d12 {
ID3D12DescriptorHeap* ShaderVisibleDescriptorHeap::GetD3D12DescriptorHeap() const { ID3D12DescriptorHeap* ShaderVisibleDescriptorHeap::GetD3D12DescriptorHeap() const {
return mD3d12DescriptorHeap.Get(); return mD3d12DescriptorHeap.Get();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -29,7 +29,7 @@
// of two states: switched in or out. Only a switched in heap can be bound to the pipeline. If // of two states: switched in or out. Only a switched in heap can be bound to the pipeline. If
// the heap is full, the caller must switch-in a new heap before re-allocating and the old one // the heap is full, the caller must switch-in a new heap before re-allocating and the old one
// is returned to the pool. // is returned to the pool.
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
class GPUDescriptorHeapAllocation; class GPUDescriptorHeapAllocation;
@ -100,6 +100,6 @@ namespace dawn_native { namespace d3d12 {
// This is stored on the allocator to avoid extra conversions. // This is stored on the allocator to avoid extra conversions.
uint32_t mDescriptorCount = 0; uint32_t mDescriptorCount = 0;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATOR_H_ #endif // DAWNNATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATOR_H_

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
StagingBuffer::StagingBuffer(size_t size, Device* device) StagingBuffer::StagingBuffer(size_t size, Device* device)
: StagingBufferBase(size), mDevice(device) { : StagingBufferBase(size), mDevice(device) {
@ -74,4 +74,4 @@ namespace dawn_native { namespace d3d12 {
ID3D12Resource* StagingBuffer::GetResource() const { ID3D12Resource* StagingBuffer::GetResource() const {
return mUploadHeap.GetD3D12Resource(); return mUploadHeap.GetD3D12Resource();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -19,7 +19,7 @@
#include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -36,6 +36,6 @@ namespace dawn_native { namespace d3d12 {
Device* mDevice; Device* mDevice;
ResourceHeapAllocation mUploadHeap; ResourceHeapAllocation mUploadHeap;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_STAGINGBUFFERD3D12_H_ #endif // DAWNNATIVE_STAGINGBUFFERD3D12_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/DeviceD3D12.h"
#include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
StagingDescriptorAllocator::StagingDescriptorAllocator(Device* device, StagingDescriptorAllocator::StagingDescriptorAllocator(Device* device,
uint32_t descriptorCount, uint32_t descriptorCount,
@ -149,4 +149,4 @@ namespace dawn_native { namespace d3d12 {
mAllocationsToDelete.ClearUpTo(completedSerial); mAllocationsToDelete.ClearUpTo(completedSerial);
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -30,7 +30,7 @@
// at-least one free block. If no AVAILABLE heap exists, a new heap is created and inserted // at-least one free block. If no AVAILABLE heap exists, a new heap is created and inserted
// back into the pool to be immediately used. To deallocate, the block corresponding to the // back into the pool to be immediately used. To deallocate, the block corresponding to the
// offset is inserted back into the free-list. // offset is inserted back into the free-list.
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
@ -80,6 +80,6 @@ namespace dawn_native { namespace d3d12 {
SerialQueue<ExecutionSerial, CPUDescriptorHeapAllocation> mAllocationsToDelete; SerialQueue<ExecutionSerial, CPUDescriptorHeapAllocation> mAllocationsToDelete;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_STAGINGDESCRIPTORALLOCATOR_H_ #endif // DAWNNATIVE_D3D12_STAGINGDESCRIPTORALLOCATOR_H_

View File

@ -23,7 +23,7 @@
#include <windows.ui.xaml.media.dxinterop.h> #include <windows.ui.xaml.media.dxinterop.h>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
uint32_t PresentModeToBufferCount(wgpu::PresentMode mode) { uint32_t PresentModeToBufferCount(wgpu::PresentMode mode) {
@ -374,4 +374,4 @@ namespace dawn_native { namespace d3d12 {
mBuffers.clear(); mBuffers.clear();
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -20,7 +20,7 @@
#include "dawn_native/IntegerTypes.h" #include "dawn_native/IntegerTypes.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class Device; class Device;
class Texture; class Texture;
@ -84,6 +84,6 @@ namespace dawn_native { namespace d3d12 {
Ref<Texture> mApiTexture; Ref<Texture> mApiTexture;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SWAPCHAIN_D3D12_H_ #endif // DAWNNATIVE_D3D12_SWAPCHAIN_D3D12_H_

View File

@ -18,7 +18,7 @@
#include "dawn_native/Format.h" #include "dawn_native/Format.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
Origin3D ComputeTexelOffsets(const TexelBlockInfo& blockInfo, Origin3D ComputeTexelOffsets(const TexelBlockInfo& blockInfo,
@ -536,4 +536,4 @@ namespace dawn_native { namespace d3d12 {
return copySubresource; return copySubresource;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -25,7 +25,7 @@ namespace dawn_native {
} // namespace dawn_native } // namespace dawn_native
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
struct TextureCopySubresource { struct TextureCopySubresource {
static constexpr unsigned int kMaxTextureCopyRegions = 4; static constexpr unsigned int kMaxTextureCopyRegions = 4;
@ -92,6 +92,6 @@ namespace dawn_native { namespace d3d12 {
uint64_t offset, uint64_t offset,
uint32_t bytesPerRow, uint32_t bytesPerRow,
uint32_t rowsPerImage); uint32_t rowsPerImage);
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_TEXTURECOPYSPLITTER_H_ #endif // DAWNNATIVE_D3D12_TEXTURECOPYSPLITTER_H_

View File

@ -31,7 +31,7 @@
#include "dawn_native/d3d12/TextureCopySplitter.h" #include "dawn_native/d3d12/TextureCopySplitter.h"
#include "dawn_native/d3d12/UtilsD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
namespace { namespace {
D3D12_RESOURCE_STATES D3D12TextureUsage(wgpu::TextureUsage usage, const Format& format) { D3D12_RESOURCE_STATES D3D12TextureUsage(wgpu::TextureUsage usage, const Format& format) {
@ -1377,4 +1377,4 @@ namespace dawn_native { namespace d3d12 {
return uavDesc; return uavDesc;
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -24,7 +24,7 @@
#include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h"
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
class CommandRecordingContext; class CommandRecordingContext;
class Device; class Device;
@ -159,6 +159,6 @@ namespace dawn_native { namespace d3d12 {
D3D12_SHADER_RESOURCE_VIEW_DESC mSrvDesc; D3D12_SHADER_RESOURCE_VIEW_DESC mSrvDesc;
}; };
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_TEXTURED3D12_H_ #endif // DAWNNATIVE_D3D12_TEXTURED3D12_H_

View File

@ -23,7 +23,7 @@
#include <stringapiset.h> #include <stringapiset.h>
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ResultOrError<std::wstring> ConvertStringToWstring(const char* str) { ResultOrError<std::wstring> ConvertStringToWstring(const char* str) {
size_t len = strlen(str); size_t len = strlen(str);
@ -388,4 +388,4 @@ namespace dawn_native { namespace d3d12 {
object->SetPrivateData(WKPDID_D3DDebugObjectName, objectName.length(), objectName.c_str()); object->SetPrivateData(WKPDID_D3DDebugObjectName, objectName.length(), objectName.c_str());
} }
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12

View File

@ -22,7 +22,7 @@
#include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/d3d12/d3d12_platform.h"
#include "dawn_native/dawn_platform.h" #include "dawn_native/dawn_platform.h"
namespace dawn_native { namespace d3d12 { namespace dawn_native::d3d12 {
ResultOrError<std::wstring> ConvertStringToWstring(const char* str); ResultOrError<std::wstring> ConvertStringToWstring(const char* str);
@ -86,6 +86,6 @@ namespace dawn_native { namespace d3d12 {
const char* prefix, const char* prefix,
std::string label = ""); std::string label = "");
}} // namespace dawn_native::d3d12 } // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_UTILSD3D12_H_ #endif // DAWNNATIVE_D3D12_UTILSD3D12_H_

View File

@ -17,7 +17,7 @@
#include "dawn_native/BackendConnection.h" #include "dawn_native/BackendConnection.h"
namespace dawn_native { namespace metal { namespace dawn_native::metal {
class Backend : public BackendConnection { class Backend : public BackendConnection {
public: public:
@ -28,6 +28,6 @@ namespace dawn_native { namespace metal {
const AdapterDiscoveryOptionsBase* optionsBase) override; const AdapterDiscoveryOptionsBase* optionsBase) override;
}; };
}} // namespace dawn_native::metal } // namespace dawn_native::metal
#endif // DAWNNATIVE_METAL_BACKENDMTL_H_ #endif // DAWNNATIVE_METAL_BACKENDMTL_H_

View File

@ -31,7 +31,7 @@
#include <vector> #include <vector>
namespace dawn_native { namespace metal { namespace dawn_native::metal {
namespace { namespace {
@ -613,4 +613,4 @@ namespace dawn_native { namespace metal {
return new Backend(instance); return new Backend(instance);
} }
}} // namespace dawn_native::metal } // namespace dawn_native::metal

View File

@ -18,7 +18,7 @@
#include "common/SlabAllocator.h" #include "common/SlabAllocator.h"
#include "dawn_native/BindGroupLayout.h" #include "dawn_native/BindGroupLayout.h"
namespace dawn_native { namespace metal { namespace dawn_native::metal {
class BindGroup; class BindGroup;
class Device; class Device;
@ -41,6 +41,6 @@ namespace dawn_native { namespace metal {
SlabAllocator<BindGroup> mBindGroupAllocator; SlabAllocator<BindGroup> mBindGroupAllocator;
}; };
}} // namespace dawn_native::metal } // namespace dawn_native::metal
#endif // DAWNNATIVE_METAL_BINDGROUPLAYOUTMTL_H_ #endif // DAWNNATIVE_METAL_BINDGROUPLAYOUTMTL_H_

View File

@ -16,7 +16,7 @@
#include "dawn_native/metal/BindGroupMTL.h" #include "dawn_native/metal/BindGroupMTL.h"
namespace dawn_native { namespace metal { namespace dawn_native::metal {
// static // static
Ref<BindGroupLayout> BindGroupLayout::Create( Ref<BindGroupLayout> BindGroupLayout::Create(
@ -42,4 +42,4 @@ namespace dawn_native { namespace metal {
mBindGroupAllocator.Deallocate(bindGroup); mBindGroupAllocator.Deallocate(bindGroup);
} }
}} // namespace dawn_native::metal } // namespace dawn_native::metal

View File

@ -18,7 +18,7 @@
#include "common/PlacementAllocated.h" #include "common/PlacementAllocated.h"
#include "dawn_native/BindGroup.h" #include "dawn_native/BindGroup.h"
namespace dawn_native { namespace metal { namespace dawn_native::metal {
class Device; class Device;
@ -34,6 +34,6 @@ namespace dawn_native { namespace metal {
void DestroyImpl() override; void DestroyImpl() override;
}; };
}} // namespace dawn_native::metal } // namespace dawn_native::metal
#endif // DAWNNATIVE_METAL_BINDGROUPMTL_H_ #endif // DAWNNATIVE_METAL_BINDGROUPMTL_H_

View File

@ -16,7 +16,7 @@
#include "dawn_native/metal/BindGroupLayoutMTL.h" #include "dawn_native/metal/BindGroupLayoutMTL.h"
#include "dawn_native/metal/DeviceMTL.h" #include "dawn_native/metal/DeviceMTL.h"
namespace dawn_native { namespace metal { namespace dawn_native::metal {
BindGroup::BindGroup(Device* device, const BindGroupDescriptor* descriptor) BindGroup::BindGroup(Device* device, const BindGroupDescriptor* descriptor)
: BindGroupBase(this, device, descriptor) { : BindGroupBase(this, device, descriptor) {
@ -34,4 +34,4 @@ namespace dawn_native { namespace metal {
return ToBackend(descriptor->layout)->AllocateBindGroup(device, descriptor); return ToBackend(descriptor->layout)->AllocateBindGroup(device, descriptor);
} }
}} // namespace dawn_native::metal } // namespace dawn_native::metal

View File

@ -21,7 +21,7 @@
#import <Metal/Metal.h> #import <Metal/Metal.h>
namespace dawn_native { namespace metal { namespace dawn_native::metal {
class CommandRecordingContext; class CommandRecordingContext;
class Device; class Device;
@ -62,6 +62,6 @@ namespace dawn_native { namespace metal {
NSPRef<id<MTLBuffer>> mMtlBuffer; NSPRef<id<MTLBuffer>> mMtlBuffer;
}; };
}} // namespace dawn_native::metal } // namespace dawn_native::metal
#endif // DAWNNATIVE_METAL_BUFFERMTL_H_ #endif // DAWNNATIVE_METAL_BUFFERMTL_H_

View File

@ -21,7 +21,7 @@
#include <limits> #include <limits>
namespace dawn_native { namespace metal { namespace dawn_native::metal {
// The size of uniform buffer and storage buffer need to be aligned to 16 bytes which is the // The size of uniform buffer and storage buffer need to be aligned to 16 bytes which is the
// largest alignment of supported data types // largest alignment of supported data types
static constexpr uint32_t kMinUniformOrStorageBufferAlignment = 16u; static constexpr uint32_t kMinUniformOrStorageBufferAlignment = 16u;
@ -237,4 +237,4 @@ namespace dawn_native { namespace metal {
value:clearValue]; value:clearValue];
} }
}} // namespace dawn_native::metal } // namespace dawn_native::metal

View File

@ -24,7 +24,7 @@ namespace dawn_native {
class CommandEncoder; class CommandEncoder;
} }
namespace dawn_native { namespace metal { namespace dawn_native::metal {
class CommandRecordingContext; class CommandRecordingContext;
class Device; class Device;
@ -64,6 +64,6 @@ namespace dawn_native { namespace metal {
uint32_t height); uint32_t height);
}; };
}} // namespace dawn_native::metal } // namespace dawn_native::metal
#endif // DAWNNATIVE_METAL_COMMANDBUFFERMTL_H_ #endif // DAWNNATIVE_METAL_COMMANDBUFFERMTL_H_

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