From ec9cf2a85c2a8266478182bae48f490d4e94c5fb Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Wed, 12 Jan 2022 09:17:35 +0000 Subject: [PATCH] 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 Commit-Queue: Corentin Wallez Auto-Submit: Corentin Wallez --- examples/ManualSwapChainTest.cpp | 12 +- examples/SampleUtils.cpp | 12 +- generator/dawn_json_generator.py | 3 + .../templates/dawn_native/ChainUtils.cpp | 5 +- generator/templates/dawn_native/ChainUtils.h | 5 +- .../templates/dawn_native/ObjectType.cpp | 5 +- generator/templates/dawn_native/ObjectType.h | 2 +- generator/templates/dawn_native/ProcTable.cpp | 5 +- .../templates/dawn_native/ValidationUtils.cpp | 5 +- .../templates/dawn_native/ValidationUtils.h | 5 +- .../templates/dawn_native/api_absl_format.cpp | 5 +- .../templates/dawn_native/api_absl_format.h | 5 +- .../dawn_native/api_dawn_native_proc.cpp | 4 +- .../templates/dawn_native/api_structs.cpp | 5 +- generator/templates/dawn_native/api_structs.h | 4 +- .../templates/dawn_native/dawn_platform.h | 8 +- .../templates/opengl/OpenGLFunctionsBase.cpp | 4 +- .../templates/opengl/OpenGLFunctionsBase.h | 4 +- src/common/vulkan_platform.h | 12 +- src/dawn_native/Adapter.cpp | 4 +- src/dawn_native/Adapter.h | 4 +- src/dawn_native/AsyncTask.cpp | 4 +- src/dawn_native/AsyncTask.h | 4 +- src/dawn_native/AttachmentState.cpp | 4 +- src/dawn_native/AttachmentState.h | 4 +- src/dawn_native/BackendConnection.cpp | 4 +- src/dawn_native/BackendConnection.h | 4 +- src/dawn_native/BindGroup.cpp | 4 +- src/dawn_native/BindGroup.h | 4 +- src/dawn_native/BindGroupLayout.cpp | 4 +- src/dawn_native/BindGroupLayout.h | 4 +- src/dawn_native/BindGroupTracker.h | 4 +- src/dawn_native/BindingInfo.cpp | 4 +- src/dawn_native/BindingInfo.h | 4 +- src/dawn_native/BuddyAllocator.cpp | 4 +- src/dawn_native/BuddyAllocator.h | 4 +- src/dawn_native/BuddyMemoryAllocator.cpp | 4 +- src/dawn_native/BuddyMemoryAllocator.h | 4 +- src/dawn_native/Buffer.cpp | 4 +- src/dawn_native/Buffer.h | 4 +- src/dawn_native/CachedObject.cpp | 4 +- src/dawn_native/CachedObject.h | 4 +- src/dawn_native/CallbackTaskManager.cpp | 4 +- src/dawn_native/CallbackTaskManager.h | 4 +- src/dawn_native/CommandAllocator.cpp | 4 +- src/dawn_native/CommandAllocator.h | 4 +- src/dawn_native/CommandBuffer.cpp | 10 +- src/dawn_native/CommandBuffer.h | 10 +- src/dawn_native/CommandBufferStateTracker.cpp | 4 +- src/dawn_native/CommandBufferStateTracker.h | 4 +- src/dawn_native/CommandEncoder.cpp | 4 +- src/dawn_native/CommandEncoder.h | 4 +- src/dawn_native/CommandValidation.cpp | 4 +- src/dawn_native/CommandValidation.h | 4 +- src/dawn_native/Commands.cpp | 4 +- src/dawn_native/Commands.h | 6 +- src/dawn_native/CompilationMessages.cpp | 4 +- src/dawn_native/CompilationMessages.h | 4 +- src/dawn_native/ComputePassEncoder.cpp | 4 +- src/dawn_native/ComputePassEncoder.h | 4 +- src/dawn_native/ComputePipeline.cpp | 4 +- src/dawn_native/ComputePipeline.h | 4 +- .../CopyTextureForBrowserHelper.cpp | 4 +- src/dawn_native/CopyTextureForBrowserHelper.h | 4 +- src/dawn_native/CreatePipelineAsyncTask.cpp | 4 +- src/dawn_native/CreatePipelineAsyncTask.h | 4 +- src/dawn_native/DawnNative.cpp | 4 +- src/dawn_native/Device.cpp | 4 +- src/dawn_native/Device.h | 4 +- src/dawn_native/DynamicUploader.cpp | 4 +- src/dawn_native/DynamicUploader.h | 4 +- src/dawn_native/EncodingContext.cpp | 4 +- src/dawn_native/EncodingContext.h | 4 +- src/dawn_native/EnumClassBitmasks.h | 4 +- src/dawn_native/EnumMaskIterator.h | 4 +- src/dawn_native/Error.cpp | 4 +- src/dawn_native/Error.h | 28 ++-- src/dawn_native/ErrorData.cpp | 4 +- src/dawn_native/ErrorData.h | 4 +- src/dawn_native/ErrorInjector.cpp | 4 +- src/dawn_native/ErrorInjector.h | 8 +- src/dawn_native/ErrorScope.cpp | 4 +- src/dawn_native/ErrorScope.h | 4 +- src/dawn_native/ExternalTexture.cpp | 4 +- src/dawn_native/ExternalTexture.h | 4 +- src/dawn_native/Features.cpp | 4 +- src/dawn_native/Features.h | 4 +- src/dawn_native/Format.cpp | 4 +- src/dawn_native/Format.h | 6 +- src/dawn_native/Forward.h | 4 +- src/dawn_native/IndirectDrawMetadata.cpp | 4 +- src/dawn_native/IndirectDrawMetadata.h | 4 +- .../IndirectDrawValidationEncoder.cpp | 4 +- .../IndirectDrawValidationEncoder.h | 4 +- src/dawn_native/Instance.cpp | 4 +- src/dawn_native/Instance.h | 4 +- src/dawn_native/IntegerTypes.h | 4 +- src/dawn_native/InternalPipelineStore.cpp | 4 +- src/dawn_native/InternalPipelineStore.h | 4 +- src/dawn_native/Limits.cpp | 4 +- src/dawn_native/Limits.h | 4 +- src/dawn_native/ObjectBase.cpp | 4 +- src/dawn_native/ObjectBase.h | 4 +- src/dawn_native/ObjectContentHasher.cpp | 4 +- src/dawn_native/ObjectContentHasher.h | 4 +- src/dawn_native/PassResourceUsage.h | 4 +- src/dawn_native/PassResourceUsageTracker.cpp | 4 +- src/dawn_native/PassResourceUsageTracker.h | 4 +- src/dawn_native/PerStage.cpp | 4 +- src/dawn_native/PerStage.h | 4 +- src/dawn_native/PersistentCache.cpp | 4 +- src/dawn_native/PersistentCache.h | 4 +- src/dawn_native/Pipeline.cpp | 4 +- src/dawn_native/Pipeline.h | 4 +- src/dawn_native/PipelineLayout.cpp | 4 +- src/dawn_native/PipelineLayout.h | 4 +- .../PooledResourceMemoryAllocator.cpp | 4 +- .../PooledResourceMemoryAllocator.h | 4 +- src/dawn_native/ProgrammableEncoder.cpp | 4 +- src/dawn_native/ProgrammableEncoder.h | 4 +- src/dawn_native/QueryHelper.cpp | 14 +- src/dawn_native/QueryHelper.h | 4 +- src/dawn_native/QuerySet.cpp | 4 +- src/dawn_native/QuerySet.h | 4 +- src/dawn_native/Queue.cpp | 4 +- src/dawn_native/Queue.h | 4 +- src/dawn_native/RenderBundle.cpp | 4 +- src/dawn_native/RenderBundle.h | 4 +- src/dawn_native/RenderBundleEncoder.cpp | 4 +- src/dawn_native/RenderBundleEncoder.h | 4 +- src/dawn_native/RenderEncoderBase.cpp | 4 +- src/dawn_native/RenderEncoderBase.h | 4 +- src/dawn_native/RenderPassEncoder.cpp | 4 +- src/dawn_native/RenderPassEncoder.h | 4 +- src/dawn_native/RenderPipeline.cpp | 4 +- src/dawn_native/RenderPipeline.h | 4 +- src/dawn_native/ResourceHeap.h | 4 +- src/dawn_native/ResourceHeapAllocator.h | 4 +- src/dawn_native/ResourceMemoryAllocation.cpp | 4 +- src/dawn_native/ResourceMemoryAllocation.h | 4 +- src/dawn_native/RingBufferAllocator.cpp | 4 +- src/dawn_native/RingBufferAllocator.h | 4 +- src/dawn_native/Sampler.cpp | 4 +- src/dawn_native/Sampler.h | 4 +- src/dawn_native/ScratchBuffer.cpp | 4 +- src/dawn_native/ScratchBuffer.h | 4 +- src/dawn_native/ShaderModule.cpp | 4 +- src/dawn_native/ShaderModule.h | 4 +- src/dawn_native/SpirvValidation.cpp | 4 +- src/dawn_native/SpirvValidation.h | 4 +- src/dawn_native/StagingBuffer.cpp | 4 +- src/dawn_native/StagingBuffer.h | 4 +- src/dawn_native/Subresource.cpp | 4 +- src/dawn_native/Subresource.h | 6 +- src/dawn_native/SubresourceStorage.h | 4 +- src/dawn_native/Surface.cpp | 4 +- src/dawn_native/Surface.h | 4 +- src/dawn_native/Surface_metal.mm | 4 +- src/dawn_native/SwapChain.cpp | 4 +- src/dawn_native/SwapChain.h | 4 +- src/dawn_native/Texture.cpp | 6 +- src/dawn_native/Texture.h | 4 +- src/dawn_native/TintUtils.cpp | 4 +- src/dawn_native/TintUtils.h | 4 +- src/dawn_native/ToBackend.h | 4 +- src/dawn_native/Toggles.cpp | 4 +- src/dawn_native/Toggles.h | 4 +- src/dawn_native/VertexFormat.cpp | 4 +- src/dawn_native/VertexFormat.h | 4 +- src/dawn_native/XlibXcbFunctions.cpp | 4 +- src/dawn_native/XlibXcbFunctions.h | 4 +- src/dawn_native/d3d12/AdapterD3D12.cpp | 6 +- src/dawn_native/d3d12/AdapterD3D12.h | 4 +- src/dawn_native/d3d12/BackendD3D12.cpp | 4 +- src/dawn_native/d3d12/BackendD3D12.h | 4 +- src/dawn_native/d3d12/BindGroupD3D12.cpp | 4 +- src/dawn_native/d3d12/BindGroupD3D12.h | 4 +- .../d3d12/BindGroupLayoutD3D12.cpp | 4 +- src/dawn_native/d3d12/BindGroupLayoutD3D12.h | 4 +- src/dawn_native/d3d12/BufferD3D12.cpp | 4 +- src/dawn_native/d3d12/BufferD3D12.h | 4 +- .../CPUDescriptorHeapAllocationD3D12.cpp | 4 +- .../d3d12/CPUDescriptorHeapAllocationD3D12.h | 4 +- .../d3d12/CommandAllocatorManager.cpp | 4 +- .../d3d12/CommandAllocatorManager.h | 4 +- src/dawn_native/d3d12/CommandBufferD3D12.cpp | 8 +- src/dawn_native/d3d12/CommandBufferD3D12.h | 8 +- .../d3d12/CommandRecordingContext.cpp | 4 +- .../d3d12/CommandRecordingContext.h | 4 +- .../d3d12/ComputePipelineD3D12.cpp | 4 +- src/dawn_native/d3d12/ComputePipelineD3D12.h | 4 +- src/dawn_native/d3d12/D3D11on12Util.cpp | 4 +- src/dawn_native/d3d12/D3D11on12Util.h | 4 +- src/dawn_native/d3d12/D3D12Backend.cpp | 4 +- src/dawn_native/d3d12/D3D12Error.cpp | 4 +- src/dawn_native/d3d12/D3D12Error.h | 10 +- src/dawn_native/d3d12/D3D12Info.cpp | 4 +- src/dawn_native/d3d12/D3D12Info.h | 4 +- src/dawn_native/d3d12/DeviceD3D12.cpp | 4 +- src/dawn_native/d3d12/DeviceD3D12.h | 4 +- src/dawn_native/d3d12/Forward.h | 4 +- .../GPUDescriptorHeapAllocationD3D12.cpp | 4 +- .../d3d12/GPUDescriptorHeapAllocationD3D12.h | 4 +- src/dawn_native/d3d12/HeapAllocatorD3D12.cpp | 4 +- src/dawn_native/d3d12/HeapAllocatorD3D12.h | 4 +- src/dawn_native/d3d12/HeapD3D12.cpp | 4 +- src/dawn_native/d3d12/HeapD3D12.h | 4 +- src/dawn_native/d3d12/IntegerTypes.h | 4 +- .../d3d12/NativeSwapChainImplD3D12.cpp | 4 +- .../d3d12/NativeSwapChainImplD3D12.h | 4 +- src/dawn_native/d3d12/PageableD3D12.cpp | 4 +- src/dawn_native/d3d12/PageableD3D12.h | 4 +- src/dawn_native/d3d12/PipelineLayoutD3D12.cpp | 4 +- src/dawn_native/d3d12/PipelineLayoutD3D12.h | 4 +- src/dawn_native/d3d12/PlatformFunctions.cpp | 4 +- src/dawn_native/d3d12/PlatformFunctions.h | 4 +- src/dawn_native/d3d12/QuerySetD3D12.cpp | 4 +- src/dawn_native/d3d12/QuerySetD3D12.h | 4 +- src/dawn_native/d3d12/QueueD3D12.cpp | 4 +- src/dawn_native/d3d12/QueueD3D12.h | 4 +- .../d3d12/RenderPassBuilderD3D12.cpp | 6 +- .../d3d12/RenderPassBuilderD3D12.h | 6 +- src/dawn_native/d3d12/RenderPipelineD3D12.cpp | 4 +- src/dawn_native/d3d12/RenderPipelineD3D12.h | 4 +- .../d3d12/ResidencyManagerD3D12.cpp | 4 +- src/dawn_native/d3d12/ResidencyManagerD3D12.h | 4 +- .../d3d12/ResourceAllocatorManagerD3D12.cpp | 4 +- .../d3d12/ResourceAllocatorManagerD3D12.h | 4 +- .../d3d12/ResourceHeapAllocationD3D12.cpp | 4 +- .../d3d12/ResourceHeapAllocationD3D12.h | 4 +- src/dawn_native/d3d12/SamplerD3D12.cpp | 4 +- src/dawn_native/d3d12/SamplerD3D12.h | 4 +- .../d3d12/SamplerHeapCacheD3D12.cpp | 4 +- src/dawn_native/d3d12/SamplerHeapCacheD3D12.h | 4 +- src/dawn_native/d3d12/ShaderModuleD3D12.cpp | 4 +- src/dawn_native/d3d12/ShaderModuleD3D12.h | 8 +- .../ShaderVisibleDescriptorAllocatorD3D12.cpp | 4 +- .../ShaderVisibleDescriptorAllocatorD3D12.h | 4 +- src/dawn_native/d3d12/StagingBufferD3D12.cpp | 4 +- src/dawn_native/d3d12/StagingBufferD3D12.h | 4 +- .../d3d12/StagingDescriptorAllocatorD3D12.cpp | 4 +- .../d3d12/StagingDescriptorAllocatorD3D12.h | 4 +- src/dawn_native/d3d12/SwapChainD3D12.cpp | 4 +- src/dawn_native/d3d12/SwapChainD3D12.h | 4 +- src/dawn_native/d3d12/TextureCopySplitter.cpp | 4 +- src/dawn_native/d3d12/TextureCopySplitter.h | 8 +- src/dawn_native/d3d12/TextureD3D12.cpp | 4 +- src/dawn_native/d3d12/TextureD3D12.h | 4 +- src/dawn_native/d3d12/UtilsD3D12.cpp | 4 +- src/dawn_native/d3d12/UtilsD3D12.h | 4 +- src/dawn_native/dawn_platform.h | 4 +- src/dawn_native/metal/BackendMTL.h | 4 +- src/dawn_native/metal/BackendMTL.mm | 6 +- src/dawn_native/metal/BindGroupLayoutMTL.h | 4 +- src/dawn_native/metal/BindGroupLayoutMTL.mm | 4 +- src/dawn_native/metal/BindGroupMTL.h | 4 +- src/dawn_native/metal/BindGroupMTL.mm | 4 +- src/dawn_native/metal/BufferMTL.h | 4 +- src/dawn_native/metal/BufferMTL.mm | 4 +- src/dawn_native/metal/CommandBufferMTL.h | 6 +- src/dawn_native/metal/CommandBufferMTL.mm | 4 +- .../metal/CommandRecordingContext.h | 4 +- .../metal/CommandRecordingContext.mm | 4 +- src/dawn_native/metal/ComputePipelineMTL.h | 4 +- src/dawn_native/metal/ComputePipelineMTL.mm | 4 +- src/dawn_native/metal/DeviceMTL.h | 4 +- src/dawn_native/metal/DeviceMTL.mm | 4 +- src/dawn_native/metal/Forward.h | 4 +- src/dawn_native/metal/MetalBackend.mm | 4 +- src/dawn_native/metal/PipelineLayoutMTL.h | 4 +- src/dawn_native/metal/PipelineLayoutMTL.mm | 4 +- src/dawn_native/metal/QuerySetMTL.h | 4 +- src/dawn_native/metal/QuerySetMTL.mm | 4 +- src/dawn_native/metal/QueueMTL.h | 4 +- src/dawn_native/metal/QueueMTL.mm | 4 +- src/dawn_native/metal/RenderPipelineMTL.h | 4 +- src/dawn_native/metal/RenderPipelineMTL.mm | 4 +- src/dawn_native/metal/SamplerMTL.h | 4 +- src/dawn_native/metal/SamplerMTL.mm | 4 +- src/dawn_native/metal/ShaderModuleMTL.h | 4 +- src/dawn_native/metal/ShaderModuleMTL.mm | 4 +- src/dawn_native/metal/StagingBufferMTL.h | 4 +- src/dawn_native/metal/StagingBufferMTL.mm | 4 +- src/dawn_native/metal/SwapChainMTL.h | 4 +- src/dawn_native/metal/SwapChainMTL.mm | 4 +- src/dawn_native/metal/TextureMTL.h | 4 +- src/dawn_native/metal/TextureMTL.mm | 4 +- src/dawn_native/metal/UtilsMetal.h | 6 +- src/dawn_native/metal/UtilsMetal.mm | 4 +- src/dawn_native/null/DeviceNull.cpp | 4 +- src/dawn_native/null/DeviceNull.h | 4 +- src/dawn_native/null/NullBackend.cpp | 4 +- src/dawn_native/opengl/BackendGL.cpp | 8 +- src/dawn_native/opengl/BackendGL.h | 4 +- src/dawn_native/opengl/BindGroupGL.cpp | 4 +- src/dawn_native/opengl/BindGroupGL.h | 4 +- src/dawn_native/opengl/BindGroupLayoutGL.cpp | 4 +- src/dawn_native/opengl/BindGroupLayoutGL.h | 4 +- src/dawn_native/opengl/BufferGL.cpp | 4 +- src/dawn_native/opengl/BufferGL.h | 4 +- src/dawn_native/opengl/CommandBufferGL.cpp | 4 +- src/dawn_native/opengl/CommandBufferGL.h | 8 +- src/dawn_native/opengl/ComputePipelineGL.cpp | 4 +- src/dawn_native/opengl/ComputePipelineGL.h | 4 +- src/dawn_native/opengl/DeviceGL.cpp | 4 +- src/dawn_native/opengl/DeviceGL.h | 4 +- src/dawn_native/opengl/Forward.h | 4 +- src/dawn_native/opengl/GLFormat.cpp | 4 +- src/dawn_native/opengl/GLFormat.h | 4 +- .../opengl/NativeSwapChainImplGL.cpp | 4 +- .../opengl/NativeSwapChainImplGL.h | 4 +- src/dawn_native/opengl/OpenGLBackend.cpp | 4 +- src/dawn_native/opengl/OpenGLFunctions.cpp | 4 +- src/dawn_native/opengl/OpenGLFunctions.h | 4 +- src/dawn_native/opengl/OpenGLVersion.cpp | 4 +- src/dawn_native/opengl/OpenGLVersion.h | 4 +- .../opengl/PersistentPipelineStateGL.cpp | 4 +- .../opengl/PersistentPipelineStateGL.h | 4 +- src/dawn_native/opengl/PipelineGL.cpp | 4 +- src/dawn_native/opengl/PipelineGL.h | 8 +- src/dawn_native/opengl/PipelineLayoutGL.cpp | 4 +- src/dawn_native/opengl/PipelineLayoutGL.h | 4 +- src/dawn_native/opengl/QuerySetGL.cpp | 4 +- src/dawn_native/opengl/QuerySetGL.h | 4 +- src/dawn_native/opengl/QueueGL.cpp | 4 +- src/dawn_native/opengl/QueueGL.h | 4 +- src/dawn_native/opengl/RenderPipelineGL.cpp | 4 +- src/dawn_native/opengl/RenderPipelineGL.h | 4 +- src/dawn_native/opengl/SamplerGL.cpp | 4 +- src/dawn_native/opengl/SamplerGL.h | 4 +- src/dawn_native/opengl/ShaderModuleGL.cpp | 4 +- src/dawn_native/opengl/ShaderModuleGL.h | 4 +- src/dawn_native/opengl/SpirvUtils.cpp | 4 +- src/dawn_native/opengl/SpirvUtils.h | 4 +- src/dawn_native/opengl/SwapChainGL.cpp | 4 +- src/dawn_native/opengl/SwapChainGL.h | 4 +- src/dawn_native/opengl/TextureGL.cpp | 6 +- src/dawn_native/opengl/TextureGL.h | 4 +- src/dawn_native/opengl/UtilsGL.cpp | 4 +- src/dawn_native/opengl/UtilsGL.h | 4 +- src/dawn_native/utils/WGPUHelpers.cpp | 4 +- src/dawn_native/utils/WGPUHelpers.h | 4 +- src/dawn_native/vulkan/AdapterVk.cpp | 6 +- src/dawn_native/vulkan/AdapterVk.h | 4 +- src/dawn_native/vulkan/BackendVk.cpp | 4 +- src/dawn_native/vulkan/BackendVk.h | 4 +- src/dawn_native/vulkan/BindGroupLayoutVk.cpp | 4 +- src/dawn_native/vulkan/BindGroupLayoutVk.h | 4 +- src/dawn_native/vulkan/BindGroupVk.cpp | 6 +- src/dawn_native/vulkan/BindGroupVk.h | 4 +- src/dawn_native/vulkan/BufferVk.cpp | 4 +- src/dawn_native/vulkan/BufferVk.h | 4 +- src/dawn_native/vulkan/CommandBufferVk.cpp | 6 +- src/dawn_native/vulkan/CommandBufferVk.h | 8 +- .../vulkan/CommandRecordingContext.h | 4 +- src/dawn_native/vulkan/ComputePipelineVk.cpp | 4 +- src/dawn_native/vulkan/ComputePipelineVk.h | 4 +- .../vulkan/DescriptorSetAllocation.h | 4 +- .../vulkan/DescriptorSetAllocator.cpp | 4 +- .../vulkan/DescriptorSetAllocator.h | 4 +- src/dawn_native/vulkan/DeviceVk.cpp | 4 +- src/dawn_native/vulkan/DeviceVk.h | 4 +- src/dawn_native/vulkan/ExternalHandle.h | 4 +- src/dawn_native/vulkan/FencedDeleter.cpp | 4 +- src/dawn_native/vulkan/FencedDeleter.h | 4 +- src/dawn_native/vulkan/Forward.h | 4 +- .../vulkan/NativeSwapChainImplVk.cpp | 4 +- .../vulkan/NativeSwapChainImplVk.h | 4 +- src/dawn_native/vulkan/PipelineLayoutVk.cpp | 4 +- src/dawn_native/vulkan/PipelineLayoutVk.h | 4 +- src/dawn_native/vulkan/QuerySetVk.cpp | 4 +- src/dawn_native/vulkan/QuerySetVk.h | 4 +- src/dawn_native/vulkan/QueueVk.cpp | 4 +- src/dawn_native/vulkan/QueueVk.h | 4 +- src/dawn_native/vulkan/RenderPassCache.cpp | 4 +- src/dawn_native/vulkan/RenderPassCache.h | 4 +- src/dawn_native/vulkan/RenderPipelineVk.cpp | 8 +- src/dawn_native/vulkan/RenderPipelineVk.h | 4 +- src/dawn_native/vulkan/ResourceHeapVk.cpp | 4 +- src/dawn_native/vulkan/ResourceHeapVk.h | 4 +- .../vulkan/ResourceMemoryAllocatorVk.cpp | 4 +- .../vulkan/ResourceMemoryAllocatorVk.h | 4 +- src/dawn_native/vulkan/SamplerVk.cpp | 4 +- src/dawn_native/vulkan/SamplerVk.h | 4 +- src/dawn_native/vulkan/ShaderModuleVk.cpp | 4 +- src/dawn_native/vulkan/ShaderModuleVk.h | 4 +- src/dawn_native/vulkan/StagingBufferVk.cpp | 4 +- src/dawn_native/vulkan/StagingBufferVk.h | 4 +- src/dawn_native/vulkan/SwapChainVk.cpp | 6 +- src/dawn_native/vulkan/SwapChainVk.h | 4 +- src/dawn_native/vulkan/TextureVk.cpp | 6 +- src/dawn_native/vulkan/TextureVk.h | 6 +- src/dawn_native/vulkan/UtilsVulkan.cpp | 4 +- src/dawn_native/vulkan/UtilsVulkan.h | 8 +- src/dawn_native/vulkan/VulkanBackend.cpp | 4 +- src/dawn_native/vulkan/VulkanError.cpp | 4 +- src/dawn_native/vulkan/VulkanError.h | 12 +- src/dawn_native/vulkan/VulkanExtensions.cpp | 4 +- src/dawn_native/vulkan/VulkanExtensions.h | 4 +- src/dawn_native/vulkan/VulkanFunctions.cpp | 4 +- src/dawn_native/vulkan/VulkanFunctions.h | 6 +- src/dawn_native/vulkan/VulkanInfo.cpp | 6 +- src/dawn_native/vulkan/VulkanInfo.h | 4 +- .../vulkan/external_memory/MemoryService.h | 8 +- .../external_memory/MemoryServiceDmaBuf.cpp | 4 +- .../external_memory/MemoryServiceNull.cpp | 4 +- .../external_memory/MemoryServiceOpaqueFD.cpp | 4 +- .../MemoryServiceZirconHandle.cpp | 4 +- .../external_semaphore/SemaphoreService.h | 8 +- .../external_semaphore/SemaphoreServiceFD.cpp | 4 +- .../SemaphoreServiceNull.cpp | 4 +- .../SemaphoreServiceZirconHandle.cpp | 4 +- src/dawn_native/webgpu_absl_format.cpp | 4 +- src/dawn_native/webgpu_absl_format.h | 4 +- src/dawn_node/Module.cpp | 2 +- src/dawn_node/binding/GPU.cpp | 2 +- src/dawn_node/binding/GPU.h | 4 +- src/dawn_node/binding/GPUAdapter.cpp | 2 +- src/dawn_node/binding/GPUAdapter.h | 6 +- .../DawnWireServerAndD3D12BackendFuzzer.cpp | 6 +- .../DawnWireServerAndFrontendFuzzer.cpp | 6 +- .../DawnWireServerAndVulkanBackendFuzzer.cpp | 6 +- src/fuzzers/DawnWireServerFuzzer.cpp | 12 +- src/fuzzers/DawnWireServerFuzzer.h | 6 +- src/include/dawn_native/D3D12Backend.h | 4 +- src/include/dawn_native/DawnNative.h | 7 +- src/include/dawn_native/MetalBackend.h | 8 +- src/include/dawn_native/NullBackend.h | 4 +- src/include/dawn_native/OpenGLBackend.h | 4 +- src/include/dawn_native/VulkanBackend.h | 4 +- src/tests/DawnNativeTest.cpp | 10 +- src/tests/DawnNativeTest.h | 8 +- src/tests/DawnTest.cpp | 62 ++++---- src/tests/DawnTest.h | 52 +++--- src/tests/end2end/AdapterDiscoveryTests.cpp | 34 ++-- src/tests/end2end/BufferZeroInitTests.cpp | 20 +-- .../end2end/D3D12ResourceWrappingTests.cpp | 38 ++--- .../end2end/DeviceInitializationTests.cpp | 10 +- src/tests/end2end/IOSurfaceWrappingTests.cpp | 6 +- src/tests/end2end/TextureZeroInitTests.cpp | 149 +++++++++--------- src/tests/end2end/VideoViewsTests_gbm.cpp | 10 +- src/tests/end2end/VideoViewsTests_win.cpp | 12 +- src/tests/end2end/WindowSurfaceTests.cpp | 2 +- src/tests/unittests/AsyncTaskTests.cpp | 6 +- src/tests/unittests/BuddyAllocatorTests.cpp | 2 +- .../unittests/BuddyMemoryAllocatorTests.cpp | 2 +- src/tests/unittests/ChainUtilsTests.cpp | 127 ++++++++------- src/tests/unittests/CommandAllocatorTests.cpp | 2 +- src/tests/unittests/ConcurrentCacheTests.cpp | 10 +- src/tests/unittests/EnumMaskIteratorTests.cpp | 10 +- src/tests/unittests/ErrorTests.cpp | 2 +- src/tests/unittests/FeatureTests.cpp | 20 +-- src/tests/unittests/GetProcAddressTests.cpp | 10 +- src/tests/unittests/LimitsTests.cpp | 80 +++++----- src/tests/unittests/PerStageTests.cpp | 2 +- src/tests/unittests/PerThreadProcTests.cpp | 10 +- .../unittests/RingBufferAllocatorTests.cpp | 2 +- .../unittests/SubresourceStorageTests.cpp | 2 +- src/tests/unittests/ToBackendTests.cpp | 6 +- src/tests/unittests/d3d12/CopySplitTests.cpp | 2 +- .../native/CommandBufferEncodingTests.cpp | 12 +- .../unittests/native/DestroyObjectTests.cpp | 4 +- .../unittests/native/DeviceCreationTests.cpp | 10 +- .../native/mocks/BindGroupLayoutMock.h | 4 +- .../unittests/native/mocks/BindGroupMock.h | 4 +- src/tests/unittests/native/mocks/BufferMock.h | 4 +- .../native/mocks/CommandBufferMock.h | 4 +- .../native/mocks/ComputePipelineMock.h | 4 +- src/tests/unittests/native/mocks/DeviceMock.h | 4 +- .../native/mocks/ExternalTextureMock.h | 4 +- .../native/mocks/PipelineLayoutMock.h | 4 +- .../unittests/native/mocks/QuerySetMock.h | 4 +- .../native/mocks/RenderPipelineMock.h | 4 +- .../unittests/native/mocks/SamplerMock.h | 4 +- .../native/mocks/ShaderModuleMock.cpp | 4 +- .../unittests/native/mocks/ShaderModuleMock.h | 4 +- .../unittests/native/mocks/SwapChainMock.h | 4 +- .../unittests/native/mocks/TextureMock.h | 4 +- .../CommandBufferValidationTests.cpp | 18 +-- .../GetBindGroupLayoutValidationTests.cpp | 88 +++++------ src/tests/unittests/validation/LabelTests.cpp | 102 ++++++------ .../ShaderModuleValidationTests.cpp | 6 +- .../validation/ToggleValidationTests.cpp | 13 +- .../unittests/validation/ValidationTest.cpp | 10 +- .../unittests/validation/ValidationTest.h | 24 +-- .../white_box/BufferAllocatedSizeTests.cpp | 6 +- .../white_box/D3D12DescriptorHeapTests.cpp | 22 +-- src/tests/white_box/D3D12ResidencyTests.cpp | 38 ++--- .../white_box/D3D12ResourceHeapTests.cpp | 2 +- src/tests/white_box/EGLImageWrappingTests.cpp | 16 +- .../white_box/InternalResourceUsageTests.cpp | 6 +- .../InternalStorageBufferBindingTests.cpp | 12 +- .../white_box/MetalAutoreleasePoolTests.mm | 2 +- .../white_box/QueryInternalShaderTests.cpp | 12 +- .../white_box/VulkanErrorInjectorTests.cpp | 26 +-- .../VulkanImageWrappingTestsDmaBuf.cpp | 123 ++++++++------- .../VulkanImageWrappingTestsOpaqueFD.cpp | 134 ++++++++-------- src/utils/BackendBinding.cpp | 6 +- src/utils/BackendBinding.h | 2 +- src/utils/D3D12Binding.cpp | 4 +- src/utils/NullBinding.cpp | 2 +- src/utils/OpenGLBinding.cpp | 4 +- src/utils/VulkanBinding.cpp | 6 +- src/utils/WireHelper.cpp | 6 +- 504 files changed, 1715 insertions(+), 1692 deletions(-) diff --git a/examples/ManualSwapChainTest.cpp b/examples/ManualSwapChainTest.cpp index 1c7d9ddade..77b9e84750 100644 --- a/examples/ManualSwapChainTest.cpp +++ b/examples/ManualSwapChainTest.cpp @@ -85,7 +85,7 @@ struct WindowData { static std::unordered_map> windows; static uint64_t windowSerial = 0; -static std::unique_ptr instance; +static std::unique_ptr instance; static wgpu::Device device; static wgpu::Queue queue; static wgpu::RenderPipeline trianglePipeline; @@ -266,15 +266,15 @@ int main(int argc, const char* argv[]) { // Choose an adapter we like. // TODO: allow switching the window between devices. - DawnProcTable procs = dawn_native::GetProcs(); + DawnProcTable procs = dawn::native::GetProcs(); dawnProcSetProcs(&procs); - instance = std::make_unique(); + instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - std::vector adapters = instance->GetAdapters(); - dawn_native::Adapter chosenAdapter; - for (dawn_native::Adapter& adapter : adapters) { + std::vector adapters = instance->GetAdapters(); + dawn::native::Adapter chosenAdapter; + for (dawn::native::Adapter& adapter : adapters) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); if (properties.backendType != wgpu::BackendType::Null) { diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp index 47fd05b86e..336e42f6dc 100644 --- a/examples/SampleUtils.cpp +++ b/examples/SampleUtils.cpp @@ -81,7 +81,7 @@ static wgpu::BackendType backendType = wgpu::BackendType::OpenGL; #endif static CmdBufType cmdBufType = CmdBufType::Terrible; -static std::unique_ptr instance; +static std::unique_ptr instance; static utils::BackendBinding* binding = nullptr; static GLFWwindow* window = nullptr; @@ -110,15 +110,15 @@ wgpu::Device CreateCppDawnDevice() { return wgpu::Device(); } - instance = std::make_unique(); + instance = std::make_unique(); utils::DiscoverAdapter(instance.get(), window, backendType); // Get an adapter for the backend to use, and create the device. - dawn_native::Adapter backendAdapter; + dawn::native::Adapter backendAdapter; { - std::vector adapters = instance->GetAdapters(); + std::vector adapters = instance->GetAdapters(); auto adapterIt = std::find_if(adapters.begin(), adapters.end(), - [](const dawn_native::Adapter adapter) -> bool { + [](const dawn::native::Adapter adapter) -> bool { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); return properties.backendType == backendType; @@ -128,7 +128,7 @@ wgpu::Device CreateCppDawnDevice() { } WGPUDevice backendDevice = backendAdapter.CreateDevice(); - DawnProcTable backendProcs = dawn_native::GetProcs(); + DawnProcTable backendProcs = dawn::native::GetProcs(); binding = utils::CreateBinding(backendType, window, backendDevice); if (binding == nullptr) { diff --git a/generator/dawn_json_generator.py b/generator/dawn_json_generator.py index 7ecf906b62..5439929a0e 100644 --- a/generator/dawn_json_generator.py +++ b/generator/dawn_json_generator.py @@ -68,6 +68,9 @@ class Name: def snake_case(self): return '_'.join(self.chunks) + def namespace_case(self): + return '::'.join(self.chunks) + def js_enum_case(self): result = self.chunks[0].lower() for chunk in self.chunks[1:]: diff --git a/generator/templates/dawn_native/ChainUtils.cpp b/generator/templates/dawn_native/ChainUtils.cpp index 11d150b39b..759a00463b 100644 --- a/generator/templates/dawn_native/ChainUtils.cpp +++ b/generator/templates/dawn_native/ChainUtils.cpp @@ -13,8 +13,9 @@ // limitations under the License. {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = Name(metadata.native_namespace).snake_case() %} -{% 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}}/ChainUtils_autogen.h" #include diff --git a/generator/templates/dawn_native/ChainUtils.h b/generator/templates/dawn_native/ChainUtils.h index 37cf5efd5b..ce7adbc1a0 100644 --- a/generator/templates/dawn_native/ChainUtils.h +++ b/generator/templates/dawn_native/ChainUtils.h @@ -18,8 +18,9 @@ #define {{DIR}}_CHAIN_UTILS_H_ {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = namespace_name.snake_case() %} -{% 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 prefix = metadata.proc_table_prefix.lower() %} #include "{{native_dir}}/{{prefix}}_platform.h" #include "{{native_dir}}/Error.h" diff --git a/generator/templates/dawn_native/ObjectType.cpp b/generator/templates/dawn_native/ObjectType.cpp index 0f79327649..07f48381bc 100644 --- a/generator/templates/dawn_native/ObjectType.cpp +++ b/generator/templates/dawn_native/ObjectType.cpp @@ -12,9 +12,10 @@ //* See the License for the specific language governing permissions and //* 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 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" namespace {{native_namespace}} { diff --git a/generator/templates/dawn_native/ObjectType.h b/generator/templates/dawn_native/ObjectType.h index 6430e6fa86..d99cdd4b95 100644 --- a/generator/templates/dawn_native/ObjectType.h +++ b/generator/templates/dawn_native/ObjectType.h @@ -21,7 +21,7 @@ #include -{% set native_namespace = namespace_name.snake_case() %} +{% set native_namespace = namespace_name.namespace_case() %} namespace {{native_namespace}} { enum class ObjectType : uint32_t { diff --git a/generator/templates/dawn_native/ProcTable.cpp b/generator/templates/dawn_native/ProcTable.cpp index dc39f4ee5d..cfc1e53a6b 100644 --- a/generator/templates/dawn_native/ProcTable.cpp +++ b/generator/templates/dawn_native/ProcTable.cpp @@ -14,9 +14,10 @@ {% set Prefix = metadata.proc_table_prefix %} {% 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 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}}Native.h" diff --git a/generator/templates/dawn_native/ValidationUtils.cpp b/generator/templates/dawn_native/ValidationUtils.cpp index abe07265a2..64b991ec0b 100644 --- a/generator/templates/dawn_native/ValidationUtils.cpp +++ b/generator/templates/dawn_native/ValidationUtils.cpp @@ -12,9 +12,10 @@ //* See the License for the specific language governing permissions and //* 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 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" namespace {{native_namespace}} { diff --git a/generator/templates/dawn_native/ValidationUtils.h b/generator/templates/dawn_native/ValidationUtils.h index 68d7176f9e..9746397d2c 100644 --- a/generator/templates/dawn_native/ValidationUtils.h +++ b/generator/templates/dawn_native/ValidationUtils.h @@ -18,9 +18,10 @@ {% set api = metadata.api.lower() %} #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 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" namespace {{native_namespace}} { diff --git a/generator/templates/dawn_native/api_absl_format.cpp b/generator/templates/dawn_native/api_absl_format.cpp index 8145990b41..90647b2185 100644 --- a/generator/templates/dawn_native/api_absl_format.cpp +++ b/generator/templates/dawn_native/api_absl_format.cpp @@ -13,8 +13,9 @@ //* limitations under the License. {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = Name(metadata.native_namespace).snake_case() %} -{% 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 api = metadata.api.lower() %} #include "{{native_dir}}/{{api}}_absl_format_autogen.h" diff --git a/generator/templates/dawn_native/api_absl_format.h b/generator/templates/dawn_native/api_absl_format.h index efca15ba31..64c4153a47 100644 --- a/generator/templates/dawn_native/api_absl_format.h +++ b/generator/templates/dawn_native/api_absl_format.h @@ -17,8 +17,9 @@ #define {{API}}_ABSL_FORMAT_H_ {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = Name(metadata.native_namespace).snake_case() %} -{% 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 prefix = metadata.proc_table_prefix.lower() %} #include "{{native_dir}}/{{prefix}}_platform.h" diff --git a/generator/templates/dawn_native/api_dawn_native_proc.cpp b/generator/templates/dawn_native/api_dawn_native_proc.cpp index 846a4097f7..f17d2b4d70 100644 --- a/generator/templates/dawn_native/api_dawn_native_proc.cpp +++ b/generator/templates/dawn_native/api_dawn_native_proc.cpp @@ -14,7 +14,7 @@ #include -namespace dawn_native { +namespace dawn::native { // This file should be kept in sync with generator/templates/dawn_native/ProcTable.cpp @@ -39,7 +39,7 @@ namespace dawn_native { } extern "C" { - using namespace dawn_native; + using namespace dawn::native; {% for function in by_category["function"] %} {{as_cType(function.return_type.name)}} {{metadata.namespace}}{{as_cppType(function.name)}} ( diff --git a/generator/templates/dawn_native/api_structs.cpp b/generator/templates/dawn_native/api_structs.cpp index 40aca8fcf4..aa23425ade 100644 --- a/generator/templates/dawn_native/api_structs.cpp +++ b/generator/templates/dawn_native/api_structs.cpp @@ -12,9 +12,10 @@ //* See the License for the specific language governing permissions and //* 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 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 %} #include "{{native_dir}}/{{namespace}}_structs_autogen.h" diff --git a/generator/templates/dawn_native/api_structs.h b/generator/templates/dawn_native/api_structs.h index 2bf429662c..1c1106cfac 100644 --- a/generator/templates/dawn_native/api_structs.h +++ b/generator/templates/dawn_native/api_structs.h @@ -21,8 +21,8 @@ {% set api = metadata.api.lower() %} #include "dawn/{{api}}_cpp.h" {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = namespace_name.snake_case() %} -{% 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}}/Forward.h" namespace {{native_namespace}} { diff --git a/generator/templates/dawn_native/dawn_platform.h b/generator/templates/dawn_native/dawn_platform.h index cffa2ae25b..94464ca5fd 100644 --- a/generator/templates/dawn_native/dawn_platform.h +++ b/generator/templates/dawn_native/dawn_platform.h @@ -21,13 +21,13 @@ {% set api = metadata.api.lower() %} #include "dawn/{{api}}_cpp.h" {% set impl_dir = metadata.impl_dir + "/" if metadata.impl_dir else "" %} -{% set native_namespace = namespace_name.snake_case() %} -{% 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}}/Forward.h" {% set namespace = metadata.namespace %} // 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> namespace {{native_namespace}} { @@ -79,4 +79,4 @@ namespace {{native_namespace}} { {% endfor %} } -#endif // {{NATIVE_DIR}}_{{PREFIX}}_PLATFORM_AUTOGEN_H_ \ No newline at end of file +#endif // {{NATIVE_DIR}}_{{PREFIX}}_PLATFORM_AUTOGEN_H_ diff --git a/generator/templates/opengl/OpenGLFunctionsBase.cpp b/generator/templates/opengl/OpenGLFunctionsBase.cpp index af76102632..066b9a739c 100644 --- a/generator/templates/opengl/OpenGLFunctionsBase.cpp +++ b/generator/templates/opengl/OpenGLFunctionsBase.cpp @@ -14,7 +14,7 @@ #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { template MaybeError OpenGLFunctionsBase::LoadProc(GetProcAddress getProc, T* memberProc, const char* name) { @@ -67,4 +67,4 @@ MaybeError OpenGLFunctionsBase::LoadDesktopGLProcs(GetProcAddress getProc, int m return {}; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/generator/templates/opengl/OpenGLFunctionsBase.h b/generator/templates/opengl/OpenGLFunctionsBase.h index 31272be74c..0d1e2d7a9a 100644 --- a/generator/templates/opengl/OpenGLFunctionsBase.h +++ b/generator/templates/opengl/OpenGLFunctionsBase.h @@ -18,7 +18,7 @@ #include "dawn_native/Error.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { using GetProcAddress = void* (*) (const char*); struct OpenGLFunctionsBase { @@ -40,6 +40,6 @@ namespace dawn_native::opengl { MaybeError LoadProc(GetProcAddress getProc, T* memberProc, const char* name); }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_OPENGLFUNCTIONSBASE_H_ diff --git a/src/common/vulkan_platform.h b/src/common/vulkan_platform.h index 7011e7bbbf..46818a782c 100644 --- a/src/common/vulkan_platform.h +++ b/src/common/vulkan_platform.h @@ -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 // wrapped in a structure. Hence VkSameHandleNativeWrappe -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace detail { template @@ -140,17 +140,17 @@ namespace dawn_native::vulkan { return reinterpret_cast(handle); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) \ - DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) \ - namespace dawn_native::vulkan { \ +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) \ + DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) \ + namespace dawn::native::vulkan { \ using object = detail::VkHandle; \ static_assert(sizeof(object) == sizeof(uint64_t), ""); \ static_assert(alignof(object) == detail::kUint64Alignment, ""); \ static_assert(sizeof(object) == sizeof(::object), ""); \ 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 // headers that vulkan.h includes that we have "undefs" for. diff --git a/src/dawn_native/Adapter.cpp b/src/dawn_native/Adapter.cpp index f8a5d91c59..7c09235059 100644 --- a/src/dawn_native/Adapter.cpp +++ b/src/dawn_native/Adapter.cpp @@ -19,7 +19,7 @@ #include "dawn_native/Instance.h" #include "dawn_native/ValidationUtils_autogen.h" -namespace dawn_native { +namespace dawn::native { AdapterBase::AdapterBase(InstanceBase* instance, wgpu::BackendType backend) : mInstance(instance), mBackend(backend) { @@ -218,4 +218,4 @@ namespace dawn_native { "ResetInternalDeviceForTesting should only be used with the D3D12 backend."); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Adapter.h b/src/dawn_native/Adapter.h index 3636bfcff5..c9398d274b 100644 --- a/src/dawn_native/Adapter.h +++ b/src/dawn_native/Adapter.h @@ -26,7 +26,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -94,6 +94,6 @@ namespace dawn_native { bool mUseTieredLimits = false; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ADAPTER_H_ diff --git a/src/dawn_native/AsyncTask.cpp b/src/dawn_native/AsyncTask.cpp index 41463bb759..1310d4df91 100644 --- a/src/dawn_native/AsyncTask.cpp +++ b/src/dawn_native/AsyncTask.cpp @@ -2,7 +2,7 @@ #include "dawn_platform/DawnPlatform.h" -namespace dawn_native { +namespace dawn::native { AsyncTaskManager::AsyncTaskManager(dawn::platform::WorkerTaskPool* workerTaskPool) : mWorkerTaskPool(workerTaskPool) { @@ -62,4 +62,4 @@ namespace dawn_native { waitableTask->taskManager->HandleTaskCompletion(waitableTask.Get()); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/AsyncTask.h b/src/dawn_native/AsyncTask.h index 070942fdf4..e6c5781f93 100644 --- a/src/dawn_native/AsyncTask.h +++ b/src/dawn_native/AsyncTask.h @@ -27,7 +27,7 @@ namespace dawn::platform { class WorkerTaskPool; } // 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 // 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; }; -} // namespace dawn_native +} // namespace dawn::native #endif diff --git a/src/dawn_native/AttachmentState.cpp b/src/dawn_native/AttachmentState.cpp index 427db42bb9..ceff76d657 100644 --- a/src/dawn_native/AttachmentState.cpp +++ b/src/dawn_native/AttachmentState.cpp @@ -19,7 +19,7 @@ #include "dawn_native/ObjectContentHasher.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { AttachmentStateBlueprint::AttachmentStateBlueprint( const RenderBundleEncoderDescriptor* descriptor) @@ -162,4 +162,4 @@ namespace dawn_native { return mSampleCount; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/AttachmentState.h b/src/dawn_native/AttachmentState.h index 6c1e434971..b30998ea60 100644 --- a/src/dawn_native/AttachmentState.h +++ b/src/dawn_native/AttachmentState.h @@ -27,7 +27,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -78,6 +78,6 @@ namespace dawn_native { ~AttachmentState() override; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ATTACHMENTSTATE_H_ diff --git a/src/dawn_native/BackendConnection.cpp b/src/dawn_native/BackendConnection.cpp index 89379cb43d..a25010f1a3 100644 --- a/src/dawn_native/BackendConnection.cpp +++ b/src/dawn_native/BackendConnection.cpp @@ -14,7 +14,7 @@ #include "dawn_native/BackendConnection.h" -namespace dawn_native { +namespace dawn::native { BackendConnection::BackendConnection(InstanceBase* instance, wgpu::BackendType type) : mInstance(instance), mType(type) { @@ -33,4 +33,4 @@ namespace dawn_native { return DAWN_FORMAT_VALIDATION_ERROR("DiscoverAdapters not implemented for this backend."); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BackendConnection.h b/src/dawn_native/BackendConnection.h index f17108ec58..e9007e3baf 100644 --- a/src/dawn_native/BackendConnection.h +++ b/src/dawn_native/BackendConnection.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { // An common interface for all backends. Mostly used to create adapters for a particular // backend. @@ -45,6 +45,6 @@ namespace dawn_native { wgpu::BackendType mType; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BACKENDCONNECTION_H_ diff --git a/src/dawn_native/BindGroup.cpp b/src/dawn_native/BindGroup.cpp index d125a59d7c..61858e70b4 100644 --- a/src/dawn_native/BindGroup.cpp +++ b/src/dawn_native/BindGroup.cpp @@ -27,7 +27,7 @@ #include "dawn_native/Sampler.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { namespace { @@ -483,4 +483,4 @@ namespace dawn_native { return static_cast(mBindingData.bindings[bindingIndex].Get()); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BindGroup.h b/src/dawn_native/BindGroup.h index 6b687ce14d..2510db74c2 100644 --- a/src/dawn_native/BindGroup.h +++ b/src/dawn_native/BindGroup.h @@ -26,7 +26,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -87,6 +87,6 @@ namespace dawn_native { BindGroupLayoutBase::BindingDataPointers mBindingData; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BINDGROUP_H_ diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp index c56f0ac033..cea3a067f2 100644 --- a/src/dawn_native/BindGroupLayout.cpp +++ b/src/dawn_native/BindGroupLayout.cpp @@ -28,7 +28,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { namespace { MaybeError ValidateStorageTextureFormat(DeviceBase* device, @@ -553,4 +553,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BindGroupLayout.h b/src/dawn_native/BindGroupLayout.h index 6749adbb18..91c889007b 100644 --- a/src/dawn_native/BindGroupLayout.h +++ b/src/dawn_native/BindGroupLayout.h @@ -31,7 +31,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidateBindGroupLayoutDescriptor(DeviceBase* device, const BindGroupLayoutDescriptor* descriptor, @@ -142,6 +142,6 @@ namespace dawn_native { PipelineCompatibilityToken(0); }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BINDGROUPLAYOUT_H_ diff --git a/src/dawn_native/BindGroupTracker.h b/src/dawn_native/BindGroupTracker.h index f7a9142083..53b886be4a 100644 --- a/src/dawn_native/BindGroupTracker.h +++ b/src/dawn_native/BindGroupTracker.h @@ -23,7 +23,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // Keeps track of the dirty bind groups so they can be lazily applied when we know the // pipeline state or it changes. @@ -137,6 +137,6 @@ namespace dawn_native { } }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BINDGROUPTRACKER_H_ diff --git a/src/dawn_native/BindingInfo.cpp b/src/dawn_native/BindingInfo.cpp index aba5d0dde1..d24c150878 100644 --- a/src/dawn_native/BindingInfo.cpp +++ b/src/dawn_native/BindingInfo.cpp @@ -16,7 +16,7 @@ #include "dawn_native/ChainUtils_autogen.h" -namespace dawn_native { +namespace dawn::native { absl::FormatConvertResult AbslFormatConvert( BindingInfoType value, @@ -218,4 +218,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BindingInfo.h b/src/dawn_native/BindingInfo.h index 6662554090..aea4fc9daf 100644 --- a/src/dawn_native/BindingInfo.h +++ b/src/dawn_native/BindingInfo.h @@ -26,7 +26,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Not a real WebGPU limit, but the sum of the two limits is useful for internal optimizations. static constexpr uint32_t kMaxDynamicBuffersPerPipelineLayout = @@ -98,6 +98,6 @@ namespace dawn_native { // For buffer size validation using RequiredBufferSizes = ityp::array, kMaxBindGroups>; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BINDINGINFO_H_ diff --git a/src/dawn_native/BuddyAllocator.cpp b/src/dawn_native/BuddyAllocator.cpp index b19cc19e55..647bb6cd58 100644 --- a/src/dawn_native/BuddyAllocator.cpp +++ b/src/dawn_native/BuddyAllocator.cpp @@ -17,7 +17,7 @@ #include "common/Assert.h" #include "common/Math.h" -namespace dawn_native { +namespace dawn::native { BuddyAllocator::BuddyAllocator(uint64_t maxSize) : mMaxBlockSize(maxSize) { ASSERT(IsPowerOfTwo(maxSize)); @@ -261,4 +261,4 @@ namespace dawn_native { delete block; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BuddyAllocator.h b/src/dawn_native/BuddyAllocator.h index af959fc4a7..31c8b0b9fd 100644 --- a/src/dawn_native/BuddyAllocator.h +++ b/src/dawn_native/BuddyAllocator.h @@ -20,7 +20,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // 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 @@ -112,6 +112,6 @@ namespace dawn_native { std::vector mFreeLists; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BUDDYALLOCATOR_H_ diff --git a/src/dawn_native/BuddyMemoryAllocator.cpp b/src/dawn_native/BuddyMemoryAllocator.cpp index eb7320c56a..fd2387c0e8 100644 --- a/src/dawn_native/BuddyMemoryAllocator.cpp +++ b/src/dawn_native/BuddyMemoryAllocator.cpp @@ -17,7 +17,7 @@ #include "common/Math.h" #include "dawn_native/ResourceHeapAllocator.h" -namespace dawn_native { +namespace dawn::native { BuddyMemoryAllocator::BuddyMemoryAllocator(uint64_t maxSystemSize, uint64_t memoryBlockSize, @@ -117,4 +117,4 @@ namespace dawn_native { return count; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/BuddyMemoryAllocator.h b/src/dawn_native/BuddyMemoryAllocator.h index c057f74822..18b4635997 100644 --- a/src/dawn_native/BuddyMemoryAllocator.h +++ b/src/dawn_native/BuddyMemoryAllocator.h @@ -22,7 +22,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { class ResourceHeapAllocator; @@ -69,6 +69,6 @@ namespace dawn_native { std::vector mTrackedSubAllocations; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BUDDYMEMORYALLOCATOR_H_ diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp index 6b04cbb493..0aa54dbee9 100644 --- a/src/dawn_native/Buffer.cpp +++ b/src/dawn_native/Buffer.cpp @@ -28,7 +28,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { namespace { struct MapRequestTask : QueueBase::TaskInFlight { @@ -557,4 +557,4 @@ namespace dawn_native { return offset == 0 && size == GetSize(); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Buffer.h b/src/dawn_native/Buffer.h index acdbc717d5..534100ad8e 100644 --- a/src/dawn_native/Buffer.h +++ b/src/dawn_native/Buffer.h @@ -24,7 +24,7 @@ #include -namespace dawn_native { +namespace dawn::native { struct CopyTextureToBufferCmd; @@ -130,6 +130,6 @@ namespace dawn_native { size_t mMapSize = 0; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_BUFFER_H_ diff --git a/src/dawn_native/CachedObject.cpp b/src/dawn_native/CachedObject.cpp index 523924d99f..8f305bcf32 100644 --- a/src/dawn_native/CachedObject.cpp +++ b/src/dawn_native/CachedObject.cpp @@ -16,7 +16,7 @@ #include "common/Assert.h" -namespace dawn_native { +namespace dawn::native { bool CachedObject::IsCachedReference() const { return mIsCachedReference; @@ -41,4 +41,4 @@ namespace dawn_native { mIsContentHashInitialized = true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CachedObject.h b/src/dawn_native/CachedObject.h index ff84e1e0d0..b6c011511f 100644 --- a/src/dawn_native/CachedObject.h +++ b/src/dawn_native/CachedObject.h @@ -17,7 +17,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Some objects are cached so that instead of creating new duplicate objects, // we increase the refcount of an existing object. @@ -48,6 +48,6 @@ namespace dawn_native { bool mIsContentHashInitialized = false; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_CACHED_OBJECT_H_ diff --git a/src/dawn_native/CallbackTaskManager.cpp b/src/dawn_native/CallbackTaskManager.cpp index 1c9106c261..999438ed35 100644 --- a/src/dawn_native/CallbackTaskManager.cpp +++ b/src/dawn_native/CallbackTaskManager.cpp @@ -14,7 +14,7 @@ #include "dawn_native/CallbackTaskManager.h" -namespace dawn_native { +namespace dawn::native { bool CallbackTaskManager::IsEmpty() { std::lock_guard lock(mCallbackTaskQueueMutex); @@ -34,4 +34,4 @@ namespace dawn_native { mCallbackTaskQueue.push_back(std::move(callbackTask)); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CallbackTaskManager.h b/src/dawn_native/CallbackTaskManager.h index 49108ec0d0..37fddd431d 100644 --- a/src/dawn_native/CallbackTaskManager.h +++ b/src/dawn_native/CallbackTaskManager.h @@ -19,7 +19,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { struct CallbackTask { public: @@ -40,6 +40,6 @@ namespace dawn_native { std::vector> mCallbackTaskQueue; }; -} // namespace dawn_native +} // namespace dawn::native #endif diff --git a/src/dawn_native/CommandAllocator.cpp b/src/dawn_native/CommandAllocator.cpp index 9516b59c55..a9cea4632e 100644 --- a/src/dawn_native/CommandAllocator.cpp +++ b/src/dawn_native/CommandAllocator.cpp @@ -22,7 +22,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // 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(&mDummyEnum[1]); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CommandAllocator.h b/src/dawn_native/CommandAllocator.h index 7a706aad9e..e6ad3c5bbb 100644 --- a/src/dawn_native/CommandAllocator.h +++ b/src/dawn_native/CommandAllocator.h @@ -23,7 +23,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // 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 @@ -268,6 +268,6 @@ namespace dawn_native { uint8_t* mEndPtr = nullptr; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMAND_ALLOCATOR_H_ diff --git a/src/dawn_native/CommandBuffer.cpp b/src/dawn_native/CommandBuffer.cpp index c214fbf04a..94222be9b2 100644 --- a/src/dawn_native/CommandBuffer.cpp +++ b/src/dawn_native/CommandBuffer.cpp @@ -23,7 +23,7 @@ #include "dawn_native/ObjectType_autogen.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { CommandBufferBase::CommandBufferBase(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor) @@ -217,24 +217,24 @@ namespace dawn_native { return true; } - std::array ConvertToFloatColor(dawn_native::Color color) { + std::array ConvertToFloatColor(dawn::native::Color color) { const std::array outputValue = { static_cast(color.r), static_cast(color.g), static_cast(color.b), static_cast(color.a)}; return outputValue; } - std::array ConvertToSignedIntegerColor(dawn_native::Color color) { + std::array ConvertToSignedIntegerColor(dawn::native::Color color) { const std::array outputValue = { static_cast(color.r), static_cast(color.g), static_cast(color.b), static_cast(color.a)}; return outputValue; } - std::array ConvertToUnsignedIntegerColor(dawn_native::Color color) { + std::array ConvertToUnsignedIntegerColor(dawn::native::Color color) { const std::array outputValue = { static_cast(color.r), static_cast(color.g), static_cast(color.b), static_cast(color.a)}; return outputValue; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CommandBuffer.h b/src/dawn_native/CommandBuffer.h index a8c23a6a9c..e3c9bc6013 100644 --- a/src/dawn_native/CommandBuffer.h +++ b/src/dawn_native/CommandBuffer.h @@ -24,7 +24,7 @@ #include "dawn_native/PassResourceUsage.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { struct BeginRenderPassCmd; struct CopyTextureToBufferCmd; @@ -67,10 +67,10 @@ namespace dawn_native { bool IsFullBufferOverwrittenInTextureToBufferCopy(const CopyTextureToBufferCmd* copy); - std::array ConvertToFloatColor(dawn_native::Color color); - std::array ConvertToSignedIntegerColor(dawn_native::Color color); - std::array ConvertToUnsignedIntegerColor(dawn_native::Color color); + std::array ConvertToFloatColor(dawn::native::Color color); + std::array ConvertToSignedIntegerColor(dawn::native::Color color); + std::array ConvertToUnsignedIntegerColor(dawn::native::Color color); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMANDBUFFER_H_ diff --git a/src/dawn_native/CommandBufferStateTracker.cpp b/src/dawn_native/CommandBufferStateTracker.cpp index 17a9b61672..c20ee993ef 100644 --- a/src/dawn_native/CommandBufferStateTracker.cpp +++ b/src/dawn_native/CommandBufferStateTracker.cpp @@ -28,7 +28,7 @@ // validating against. It would be nice to improve that, but difficult to do without incurring // additional tracking costs. -namespace dawn_native { +namespace dawn::native { namespace { bool BufferSizesAtLeastAsBig(const ityp::span unverifiedBufferSizes, @@ -404,4 +404,4 @@ namespace dawn_native { return mIndexBufferSize; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CommandBufferStateTracker.h b/src/dawn_native/CommandBufferStateTracker.h index 5686956faf..19bfb194e3 100644 --- a/src/dawn_native/CommandBufferStateTracker.h +++ b/src/dawn_native/CommandBufferStateTracker.h @@ -22,7 +22,7 @@ #include "dawn_native/Error.h" #include "dawn_native/Forward.h" -namespace dawn_native { +namespace dawn::native { class CommandBufferStateTracker { public: @@ -81,6 +81,6 @@ namespace dawn_native { const RequiredBufferSizes* mMinBufferSizes = nullptr; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMANDBUFFERSTATETRACKER_H diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp index cec2df7624..d78196230d 100644 --- a/src/dawn_native/CommandEncoder.cpp +++ b/src/dawn_native/CommandEncoder.cpp @@ -38,7 +38,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -1134,4 +1134,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CommandEncoder.h b/src/dawn_native/CommandEncoder.h index ec0a12145d..e773ed2c6e 100644 --- a/src/dawn_native/CommandEncoder.h +++ b/src/dawn_native/CommandEncoder.h @@ -24,7 +24,7 @@ #include -namespace dawn_native { +namespace dawn::native { class CommandEncoder final : public ApiObjectBase { public: @@ -102,6 +102,6 @@ namespace dawn_native { uint64_t mDebugGroupStackSize = 0; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMANDENCODER_H_ diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp index 25f49f290a..e7a0feb905 100644 --- a/src/dawn_native/CommandValidation.cpp +++ b/src/dawn_native/CommandValidation.cpp @@ -26,7 +26,7 @@ #include "dawn_native/RenderPipeline.h" #include "dawn_native/ValidationUtils_autogen.h" -namespace dawn_native { +namespace dawn::native { // Performs validation of the "synchronization scope" rules of WebGPU. MaybeError ValidateSyncScopeResourceUsage(const SyncScopeResourceUsage& scope) { @@ -465,4 +465,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h index 3f57eae972..92b61e66f5 100644 --- a/src/dawn_native/CommandValidation.h +++ b/src/dawn_native/CommandValidation.h @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { class QuerySetBase; struct SyncScopeResourceUsage; @@ -79,6 +79,6 @@ namespace dawn_native { MaybeError ValidateCanUseAs(const BufferBase* buffer, wgpu::BufferUsage usage); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMANDVALIDATION_H_ diff --git a/src/dawn_native/Commands.cpp b/src/dawn_native/Commands.cpp index fbc6d93b28..544ee9e197 100644 --- a/src/dawn_native/Commands.cpp +++ b/src/dawn_native/Commands.cpp @@ -23,7 +23,7 @@ #include "dawn_native/RenderPipeline.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { void FreeCommands(CommandIterator* commands) { commands->Reset(); @@ -362,4 +362,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Commands.h b/src/dawn_native/Commands.h index 03eed407e9..de37a3869a 100644 --- a/src/dawn_native/Commands.h +++ b/src/dawn_native/Commands.h @@ -26,7 +26,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // 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 @@ -80,7 +80,7 @@ namespace dawn_native { Ref resolveTarget; wgpu::LoadOp loadOp; wgpu::StoreOp storeOp; - dawn_native::Color clearColor; + dawn::native::Color clearColor; }; struct RenderPassDepthStencilAttachmentInfo { @@ -285,6 +285,6 @@ namespace dawn_native { // consuming the correct amount of data from the command iterator. void SkipCommand(CommandIterator* commands, Command type); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMMANDS_H_ diff --git a/src/dawn_native/CompilationMessages.cpp b/src/dawn_native/CompilationMessages.cpp index cc0790e2c0..50e19bd33c 100644 --- a/src/dawn_native/CompilationMessages.cpp +++ b/src/dawn_native/CompilationMessages.cpp @@ -19,7 +19,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -198,4 +198,4 @@ namespace dawn_native { mFormattedTintMessages.push_back(t.str()); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CompilationMessages.h b/src/dawn_native/CompilationMessages.h index 36db1033a2..ebddc1f592 100644 --- a/src/dawn_native/CompilationMessages.h +++ b/src/dawn_native/CompilationMessages.h @@ -27,7 +27,7 @@ namespace tint::diag { class List; } // namespace tint::diag -namespace dawn_native { +namespace dawn::native { class OwnedCompilationMessages : public NonCopyable { public: @@ -57,6 +57,6 @@ namespace dawn_native { std::vector mFormattedTintMessages; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMPILATIONMESSAGES_H_ \ No newline at end of file diff --git a/src/dawn_native/ComputePassEncoder.cpp b/src/dawn_native/ComputePassEncoder.cpp index f7b9aa7150..22a2a4ddba 100644 --- a/src/dawn_native/ComputePassEncoder.cpp +++ b/src/dawn_native/ComputePassEncoder.cpp @@ -28,7 +28,7 @@ #include "dawn_native/QuerySet.h" #include "dawn_native/utils/WGPUHelpers.h" -namespace dawn_native { +namespace dawn::native { namespace { @@ -456,4 +456,4 @@ namespace dawn_native { return &mCommandBufferState; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ComputePassEncoder.h b/src/dawn_native/ComputePassEncoder.h index 41d4d472c7..1b526fec14 100644 --- a/src/dawn_native/ComputePassEncoder.h +++ b/src/dawn_native/ComputePassEncoder.h @@ -21,7 +21,7 @@ #include "dawn_native/PassResourceUsageTracker.h" #include "dawn_native/ProgrammableEncoder.h" -namespace dawn_native { +namespace dawn::native { class SyncScopeUsageTracker; @@ -83,6 +83,6 @@ namespace dawn_native { Ref mCommandEncoder; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMPUTEPASSENCODER_H_ diff --git a/src/dawn_native/ComputePipeline.cpp b/src/dawn_native/ComputePipeline.cpp index b6c1766aed..c67bb40853 100644 --- a/src/dawn_native/ComputePipeline.cpp +++ b/src/dawn_native/ComputePipeline.cpp @@ -18,7 +18,7 @@ #include "dawn_native/ObjectContentHasher.h" #include "dawn_native/ObjectType_autogen.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateComputePipelineDescriptor(DeviceBase* device, const ComputePipelineDescriptor* descriptor) { @@ -93,4 +93,4 @@ namespace dawn_native { return PipelineBase::EqualForCache(a, b); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ComputePipeline.h b/src/dawn_native/ComputePipeline.h index 28d5ed9d6c..1a80ed291a 100644 --- a/src/dawn_native/ComputePipeline.h +++ b/src/dawn_native/ComputePipeline.h @@ -19,7 +19,7 @@ #include "dawn_native/Forward.h" #include "dawn_native/Pipeline.h" -namespace dawn_native { +namespace dawn::native { class DeviceBase; struct EntryPointMetadata; @@ -50,6 +50,6 @@ namespace dawn_native { ComputePipelineBase(DeviceBase* device, ObjectBase::ErrorTag tag); }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COMPUTEPIPELINE_H_ diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp index 8fd87bd230..6cfd74c702 100644 --- a/src/dawn_native/CopyTextureForBrowserHelper.cpp +++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp @@ -33,7 +33,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { static const char sCopyTextureForBrowserShader[] = R"( @@ -594,4 +594,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CopyTextureForBrowserHelper.h b/src/dawn_native/CopyTextureForBrowserHelper.h index e0965abcf1..209aae26eb 100644 --- a/src/dawn_native/CopyTextureForBrowserHelper.h +++ b/src/dawn_native/CopyTextureForBrowserHelper.h @@ -18,7 +18,7 @@ #include "dawn_native/Error.h" #include "dawn_native/ObjectBase.h" -namespace dawn_native { +namespace dawn::native { class DeviceBase; struct Extent3D; struct ImageCopyTexture; @@ -36,6 +36,6 @@ namespace dawn_native { const Extent3D* copySize, const CopyTextureForBrowserOptions* options); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_COPYTEXTUREFORBROWSERHELPER_H_ diff --git a/src/dawn_native/CreatePipelineAsyncTask.cpp b/src/dawn_native/CreatePipelineAsyncTask.cpp index a2669888bd..5683c704a0 100644 --- a/src/dawn_native/CreatePipelineAsyncTask.cpp +++ b/src/dawn_native/CreatePipelineAsyncTask.cpp @@ -22,7 +22,7 @@ #include "dawn_platform/tracing/TraceEvent.h" #include "utils/WGPUHelpers.h" -namespace dawn_native { +namespace dawn::native { CreatePipelineAsyncCallbackTaskBase::CreatePipelineAsyncCallbackTaskBase( std::string errorMessage, @@ -199,4 +199,4 @@ namespace dawn_native { eventLabel); device->GetAsyncTaskManager()->PostTask(std::move(asyncTask)); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/CreatePipelineAsyncTask.h b/src/dawn_native/CreatePipelineAsyncTask.h index 3bac477e6a..ad68164856 100644 --- a/src/dawn_native/CreatePipelineAsyncTask.h +++ b/src/dawn_native/CreatePipelineAsyncTask.h @@ -20,7 +20,7 @@ #include "dawn_native/CallbackTaskManager.h" #include "dawn_native/Error.h" -namespace dawn_native { +namespace dawn::native { class ComputePipelineBase; class DeviceBase; @@ -103,6 +103,6 @@ namespace dawn_native { void* mUserdata; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_CREATEPIPELINEASYNCTASK_H_ diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp index 3736dc10a5..4079cd69fd 100644 --- a/src/dawn_native/DawnNative.cpp +++ b/src/dawn_native/DawnNative.cpp @@ -24,7 +24,7 @@ // Contains the entry-points into dawn_native -namespace dawn_native { +namespace dawn::native { namespace { struct ComboDeprecatedDawnDeviceDescriptor : DeviceDescriptor { @@ -281,4 +281,4 @@ namespace dawn_native { return FromAPI(a)->IsLayoutEqual(FromAPI(b), excludePipelineCompatibiltyToken); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp index ec086fb07a..a08bc06e05 100644 --- a/src/dawn_native/Device.cpp +++ b/src/dawn_native/Device.cpp @@ -52,7 +52,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // DeviceBase sub-structures @@ -1729,4 +1729,4 @@ namespace dawn_native { return false; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Device.h b/src/dawn_native/Device.h index 9e2a2c4dc8..89ddcf5b73 100644 --- a/src/dawn_native/Device.h +++ b/src/dawn_native/Device.h @@ -37,7 +37,7 @@ namespace dawn::platform { class WorkerTaskPool; } // namespace dawn::platform -namespace dawn_native { +namespace dawn::native { class AdapterBase; class AsyncTaskManager; class AttachmentState; @@ -540,6 +540,6 @@ namespace dawn_native { std::string mLabel; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_DEVICE_H_ diff --git a/src/dawn_native/DynamicUploader.cpp b/src/dawn_native/DynamicUploader.cpp index a53972361c..a8df60912c 100644 --- a/src/dawn_native/DynamicUploader.cpp +++ b/src/dawn_native/DynamicUploader.cpp @@ -16,7 +16,7 @@ #include "common/Math.h" #include "dawn_native/Device.h" -namespace dawn_native { +namespace dawn::native { DynamicUploader::DynamicUploader(DeviceBase* device) : mDevice(device) { mRingBuffers.emplace_back( @@ -126,4 +126,4 @@ namespace dawn_native { uploadHandle.startOffset += additionalOffset; return uploadHandle; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/DynamicUploader.h b/src/dawn_native/DynamicUploader.h index 9ab0ea2b02..310e55b966 100644 --- a/src/dawn_native/DynamicUploader.h +++ b/src/dawn_native/DynamicUploader.h @@ -22,7 +22,7 @@ // DynamicUploader is the front-end implementation used to manage multiple ring buffers for upload // usage. -namespace dawn_native { +namespace dawn::native { struct UploadHandle { uint8_t* mappedBuffer = nullptr; @@ -61,6 +61,6 @@ namespace dawn_native { SerialQueue> mReleasedStagingBuffers; DeviceBase* mDevice; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_DYNAMICUPLOADER_H_ diff --git a/src/dawn_native/EncodingContext.cpp b/src/dawn_native/EncodingContext.cpp index b218c51c20..bdc9640408 100644 --- a/src/dawn_native/EncodingContext.cpp +++ b/src/dawn_native/EncodingContext.cpp @@ -22,7 +22,7 @@ #include "dawn_native/IndirectDrawValidationEncoder.h" #include "dawn_native/RenderBundleEncoder.h" -namespace dawn_native { +namespace dawn::native { EncodingContext::EncodingContext(DeviceBase* device, const ApiObjectBase* initialEncoder) : mDevice(device), mTopLevelEncoder(initialEncoder), mCurrentEncoder(initialEncoder) { @@ -214,4 +214,4 @@ namespace dawn_native { return mTopLevelEncoder == nullptr; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/EncodingContext.h b/src/dawn_native/EncodingContext.h index a87d5c9712..d64865dcb6 100644 --- a/src/dawn_native/EncodingContext.h +++ b/src/dawn_native/EncodingContext.h @@ -24,7 +24,7 @@ #include -namespace dawn_native { +namespace dawn::native { class CommandEncoder; class DeviceBase; @@ -177,6 +177,6 @@ namespace dawn_native { std::vector mDebugGroupLabels; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ENCODINGCONTEXT_H_ diff --git a/src/dawn_native/EnumClassBitmasks.h b/src/dawn_native/EnumClassBitmasks.h index addaab9ab1..671db23325 100644 --- a/src/dawn_native/EnumClassBitmasks.h +++ b/src/dawn_native/EnumClassBitmasks.h @@ -17,7 +17,7 @@ #include "dawn/EnumClassBitmasks.h" -namespace dawn_native { +namespace dawn::native { // EnumClassBitmmasks is a helper in the dawn:: namespace. // Re-export it in the dawn_native namespace. @@ -34,6 +34,6 @@ namespace dawn_native { return HasZeroOrOneBits(value) && value != T(0); } -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ENUMCLASSBITMASK_H_ diff --git a/src/dawn_native/EnumMaskIterator.h b/src/dawn_native/EnumMaskIterator.h index 75d639da0d..e4fcc178e8 100644 --- a/src/dawn_native/EnumMaskIterator.h +++ b/src/dawn_native/EnumMaskIterator.h @@ -18,7 +18,7 @@ #include "common/BitSetIterator.h" #include "dawn_native/EnumClassBitmasks.h" -namespace dawn_native { +namespace dawn::native { template class EnumMaskIterator final { @@ -77,6 +77,6 @@ namespace dawn_native { return EnumMaskIterator(mask); } -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ENUMMASKITERATOR_H_ diff --git a/src/dawn_native/Error.cpp b/src/dawn_native/Error.cpp index 6dcc3f86c1..c014e7f9b6 100644 --- a/src/dawn_native/Error.cpp +++ b/src/dawn_native/Error.cpp @@ -17,7 +17,7 @@ #include "dawn_native/ErrorData.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { void IgnoreErrors(MaybeError maybeError) { if (maybeError.IsError()) { @@ -61,4 +61,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Error.h b/src/dawn_native/Error.h index c67fcdd159..51cbcf5c8d 100644 --- a/src/dawn_native/Error.h +++ b/src/dawn_native/Error.h @@ -22,7 +22,7 @@ #include -namespace dawn_native { +namespace dawn::native { enum class InternalErrorType : uint32_t { Validation, @@ -72,7 +72,7 @@ namespace dawn_native { // more clarity. #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) @@ -119,17 +119,17 @@ namespace dawn_native { #define DAWN_TRY_CONTEXT(EXPR, ...) \ DAWN_TRY_WITH_CLEANUP(EXPR, { error->AppendContext(absl::StrFormat(__VA_ARGS__)); }) -#define DAWN_TRY_WITH_CLEANUP(EXPR, BODY) \ - { \ - auto DAWN_LOCAL_VAR = EXPR; \ - if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \ - std::unique_ptr<::dawn_native::ErrorData> error = DAWN_LOCAL_VAR.AcquireError(); \ - {BODY} /* comment to force the formatter to insert a newline */ \ - error->AppendBacktrace(__FILE__, __func__, __LINE__); \ - return {std::move(error)}; \ - } \ - } \ - for (;;) \ +#define DAWN_TRY_WITH_CLEANUP(EXPR, BODY) \ + { \ + auto DAWN_LOCAL_VAR = EXPR; \ + if (DAWN_UNLIKELY(DAWN_LOCAL_VAR.IsError())) { \ + std::unique_ptr<::dawn::native::ErrorData> error = DAWN_LOCAL_VAR.AcquireError(); \ + {BODY} /* comment to force the formatter to insert a newline */ \ + error->AppendBacktrace(__FILE__, __func__, __LINE__); \ + return {std::move(error)}; \ + } \ + } \ + for (;;) \ break // 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); InternalErrorType FromWGPUErrorType(wgpu::ErrorType type); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ERROR_H_ diff --git a/src/dawn_native/ErrorData.cpp b/src/dawn_native/ErrorData.cpp index 6e28161985..5f01530429 100644 --- a/src/dawn_native/ErrorData.cpp +++ b/src/dawn_native/ErrorData.cpp @@ -18,7 +18,7 @@ #include "dawn_native/ObjectBase.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { std::unique_ptr ErrorData::Create(InternalErrorType type, std::string message, @@ -100,4 +100,4 @@ namespace dawn_native { return ss.str(); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ErrorData.h b/src/dawn_native/ErrorData.h index 8dce44c152..9600c34bef 100644 --- a/src/dawn_native/ErrorData.h +++ b/src/dawn_native/ErrorData.h @@ -30,7 +30,7 @@ namespace dawn { using ErrorType = wgpu::ErrorType; } -namespace dawn_native { +namespace dawn::native { enum class InternalErrorType : uint32_t; class [[nodiscard]] ErrorData { @@ -65,6 +65,6 @@ namespace dawn_native { std::vector mDebugGroups; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ERRORDATA_H_ diff --git a/src/dawn_native/ErrorInjector.cpp b/src/dawn_native/ErrorInjector.cpp index 836ef1ecab..2dd67b95e9 100644 --- a/src/dawn_native/ErrorInjector.cpp +++ b/src/dawn_native/ErrorInjector.cpp @@ -17,7 +17,7 @@ #include "common/Assert.h" #include "dawn_native/DawnNative.h" -namespace dawn_native { +namespace dawn::native { namespace { @@ -67,4 +67,4 @@ namespace dawn_native { sHasPendingInjectedError = true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ErrorInjector.h b/src/dawn_native/ErrorInjector.h index 4d7d2b8a2b..ab41886529 100644 --- a/src/dawn_native/ErrorInjector.h +++ b/src/dawn_native/ErrorInjector.h @@ -18,7 +18,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { template struct InjectedErrorResult { @@ -43,15 +43,15 @@ namespace dawn_native { return MaybeInjectError(errorTypes...); } -} // namespace dawn_native +} // namespace dawn::native #if defined(DAWN_ENABLE_ERROR_INJECTION) # 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 */ \ - auto injectedError = ::dawn_native::MaybeInjectError(__VA_ARGS__); \ + auto injectedError = ::dawn::native::MaybeInjectError(__VA_ARGS__); \ if (injectedError.injected) { \ return injectedError.error; \ } \ diff --git a/src/dawn_native/ErrorScope.cpp b/src/dawn_native/ErrorScope.cpp index 4aebf1a8d7..b9a8079457 100644 --- a/src/dawn_native/ErrorScope.cpp +++ b/src/dawn_native/ErrorScope.cpp @@ -16,7 +16,7 @@ #include "common/Assert.h" -namespace dawn_native { +namespace dawn::native { namespace { @@ -89,4 +89,4 @@ namespace dawn_native { return false; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ErrorScope.h b/src/dawn_native/ErrorScope.h index 2d74456f71..77c88e3045 100644 --- a/src/dawn_native/ErrorScope.h +++ b/src/dawn_native/ErrorScope.h @@ -20,7 +20,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { class ErrorScope { public: @@ -52,6 +52,6 @@ namespace dawn_native { std::vector mScopes; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_ERRORSCOPE_H_ diff --git a/src/dawn_native/ExternalTexture.cpp b/src/dawn_native/ExternalTexture.cpp index 14a9e1dbbb..63fa38560e 100644 --- a/src/dawn_native/ExternalTexture.cpp +++ b/src/dawn_native/ExternalTexture.cpp @@ -20,7 +20,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateExternalTexturePlane(const TextureViewBase* textureView, wgpu::TextureFormat format) { @@ -135,4 +135,4 @@ namespace dawn_native { return ObjectType::ExternalTexture; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ExternalTexture.h b/src/dawn_native/ExternalTexture.h index e8596fb8e6..2179f3702d 100644 --- a/src/dawn_native/ExternalTexture.h +++ b/src/dawn_native/ExternalTexture.h @@ -22,7 +22,7 @@ #include -namespace dawn_native { +namespace dawn::native { struct ExternalTextureDescriptor; class TextureViewBase; @@ -58,6 +58,6 @@ namespace dawn_native { std::array, kMaxPlanesPerFormat> textureViews; ExternalTextureState mState; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_EXTERNALTEXTURE_H_ diff --git a/src/dawn_native/Features.cpp b/src/dawn_native/Features.cpp index d6eb622d91..0d98b4e4ad 100644 --- a/src/dawn_native/Features.cpp +++ b/src/dawn_native/Features.cpp @@ -18,7 +18,7 @@ #include "common/BitSetIterator.h" #include "dawn_native/Features.h" -namespace dawn_native { +namespace dawn::native { namespace { struct FeatureEnumAndInfo { @@ -274,4 +274,4 @@ namespace dawn_native { return static_cast(-1); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Features.h b/src/dawn_native/Features.h index 6616e7ca94..169861a99a 100644 --- a/src/dawn_native/Features.h +++ b/src/dawn_native/Features.h @@ -23,7 +23,7 @@ #include "dawn/webgpu_cpp.h" #include "dawn_native/DawnNative.h" -namespace dawn_native { +namespace dawn::native { enum class Feature { TextureCompressionBC, @@ -78,6 +78,6 @@ namespace dawn_native { std::unordered_map mFeatureNameToEnumMap; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_FEATURES_H_ diff --git a/src/dawn_native/Format.cpp b/src/dawn_native/Format.cpp index 45f89f1cfd..30f4555d80 100644 --- a/src/dawn_native/Format.cpp +++ b/src/dawn_native/Format.cpp @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Format @@ -469,4 +469,4 @@ namespace dawn_native { return table; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Format.h b/src/dawn_native/Format.h index a0730c68a9..3a9f1a8ad2 100644 --- a/src/dawn_native/Format.h +++ b/src/dawn_native/Format.h @@ -40,7 +40,7 @@ // // TODO(dawn:551): Consider moving this comment. -namespace dawn_native { +namespace dawn::native { enum class Aspect : uint8_t; class DeviceBase; @@ -136,12 +136,12 @@ namespace dawn_native { // Builds the format table with the extensions enabled on the device. FormatTable BuildFormatTable(const DeviceBase* device); -} // namespace dawn_native +} // namespace dawn::native namespace dawn { template <> - struct IsDawnBitmask { + struct IsDawnBitmask { static constexpr bool enable = true; }; diff --git a/src/dawn_native/Forward.h b/src/dawn_native/Forward.h index 2716f63c14..36b092c371 100644 --- a/src/dawn_native/Forward.h +++ b/src/dawn_native/Forward.h @@ -20,7 +20,7 @@ template class Ref; -namespace dawn_native { +namespace dawn::native { enum class ObjectType : uint32_t; @@ -66,6 +66,6 @@ namespace dawn_native { using RenderPassEncoderBase = RenderPassEncoder; using SurfaceBase = Surface; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_FORWARD_H_ diff --git a/src/dawn_native/IndirectDrawMetadata.cpp b/src/dawn_native/IndirectDrawMetadata.cpp index 40f144b3a6..a1bb0843a1 100644 --- a/src/dawn_native/IndirectDrawMetadata.cpp +++ b/src/dawn_native/IndirectDrawMetadata.cpp @@ -23,7 +23,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { uint32_t ComputeMaxIndirectValidationBatchOffsetRange(const CombinedLimits& limits) { return limits.v1.maxStorageBufferBindingSize - limits.v1.minStorageBufferOffsetAlignment - @@ -190,4 +190,4 @@ namespace dawn_native { std::move(draw)); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/IndirectDrawMetadata.h b/src/dawn_native/IndirectDrawMetadata.h index e6527502b3..c4f62fabb4 100644 --- a/src/dawn_native/IndirectDrawMetadata.h +++ b/src/dawn_native/IndirectDrawMetadata.h @@ -27,7 +27,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { class RenderBundleBase; struct CombinedLimits; @@ -121,6 +121,6 @@ namespace dawn_native { uint32_t mMaxBatchOffsetRange; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_INDIRECTDRAWMETADATA_H_ diff --git a/src/dawn_native/IndirectDrawValidationEncoder.cpp b/src/dawn_native/IndirectDrawValidationEncoder.cpp index 5e6309405e..a22e6d4d98 100644 --- a/src/dawn_native/IndirectDrawValidationEncoder.cpp +++ b/src/dawn_native/IndirectDrawValidationEncoder.cpp @@ -29,7 +29,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { namespace { // NOTE: This must match the workgroup_size attribute on the compute entry point below. @@ -382,4 +382,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/IndirectDrawValidationEncoder.h b/src/dawn_native/IndirectDrawValidationEncoder.h index aa56b09975..84593a98d5 100644 --- a/src/dawn_native/IndirectDrawValidationEncoder.h +++ b/src/dawn_native/IndirectDrawValidationEncoder.h @@ -18,7 +18,7 @@ #include "dawn_native/Error.h" #include "dawn_native/IndirectDrawMetadata.h" -namespace dawn_native { +namespace dawn::native { class CommandEncoder; struct CombinedLimits; @@ -35,6 +35,6 @@ namespace dawn_native { RenderPassResourceUsageTracker* usageTracker, IndirectDrawMetadata* indirectDrawMetadata); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_INDIRECTDRAWVALIDATIONENCODER_H_ diff --git a/src/dawn_native/Instance.cpp b/src/dawn_native/Instance.cpp index 1a801f5cbc..12abde6ec0 100644 --- a/src/dawn_native/Instance.cpp +++ b/src/dawn_native/Instance.cpp @@ -25,7 +25,7 @@ # include "dawn_native/XlibXcbFunctions.h" #endif // defined(DAWN_USE_X11) -namespace dawn_native { +namespace dawn::native { // Forward definitions of each backend's "Connect" function that creates new BackendConnection. // Conditionally compiled declarations are used to avoid using static constructors instead. @@ -306,4 +306,4 @@ namespace dawn_native { return new Surface(this, descriptor); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Instance.h b/src/dawn_native/Instance.h index 9ff1799869..e7a72ca909 100644 --- a/src/dawn_native/Instance.h +++ b/src/dawn_native/Instance.h @@ -32,7 +32,7 @@ namespace dawn::platform { class Platform; } // namespace dawn::platform -namespace dawn_native { +namespace dawn::native { class Surface; class XlibXcbFunctions; @@ -117,6 +117,6 @@ namespace dawn_native { #endif // defined(DAWN_USE_X11) }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_INSTANCE_H_ diff --git a/src/dawn_native/IntegerTypes.h b/src/dawn_native/IntegerTypes.h index fbbaf4ed1a..15bdb41ffc 100644 --- a/src/dawn_native/IntegerTypes.h +++ b/src/dawn_native/IntegerTypes.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Binding numbers in the shader and BindGroup/BindGroupLayoutDescriptors using BindingNumber = TypedInteger; @@ -70,6 +70,6 @@ namespace dawn_native { // other pipelines. using PipelineCompatibilityToken = TypedInteger; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_INTEGERTYPES_H_ diff --git a/src/dawn_native/InternalPipelineStore.cpp b/src/dawn_native/InternalPipelineStore.cpp index edfd115f5e..285deabef7 100644 --- a/src/dawn_native/InternalPipelineStore.cpp +++ b/src/dawn_native/InternalPipelineStore.cpp @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { class RenderPipelineBase; class ShaderModuleBase; @@ -35,4 +35,4 @@ namespace dawn_native { InternalPipelineStore::~InternalPipelineStore() = default; -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/InternalPipelineStore.h b/src/dawn_native/InternalPipelineStore.h index 803e0dfd38..38e18934c4 100644 --- a/src/dawn_native/InternalPipelineStore.h +++ b/src/dawn_native/InternalPipelineStore.h @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; class RenderPipelineBase; @@ -55,6 +55,6 @@ namespace dawn_native { Ref dispatchIndirectValidationPipeline; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_INTERNALPIPELINESTORE_H_ diff --git a/src/dawn_native/Limits.cpp b/src/dawn_native/Limits.cpp index b893e94cb7..4bd1a60a5d 100644 --- a/src/dawn_native/Limits.cpp +++ b/src/dawn_native/Limits.cpp @@ -67,7 +67,7 @@ LIMITS_STORAGE_BUFFER_BINDING_SIZE(X) \ LIMITS_OTHER(X) -namespace dawn_native { +namespace dawn::native { namespace { template constexpr void StaticAssertSame() { @@ -210,4 +210,4 @@ namespace dawn_native { return limits; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Limits.h b/src/dawn_native/Limits.h index 4beed2e780..b3e09d00a5 100644 --- a/src/dawn_native/Limits.h +++ b/src/dawn_native/Limits.h @@ -18,7 +18,7 @@ #include "dawn_native/Error.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { struct CombinedLimits { Limits v1; @@ -38,6 +38,6 @@ namespace dawn_native { // Returns a copy of |limits| where limit tiers are applied. Limits ApplyLimitTiers(Limits limits); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_LIMITS_H_ diff --git a/src/dawn_native/ObjectBase.cpp b/src/dawn_native/ObjectBase.cpp index c6f091a974..ece3f48a3f 100644 --- a/src/dawn_native/ObjectBase.cpp +++ b/src/dawn_native/ObjectBase.cpp @@ -17,7 +17,7 @@ #include -namespace dawn_native { +namespace dawn::native { static constexpr uint64_t kErrorPayload = 0; static constexpr uint64_t kNotErrorPayload = 1; @@ -87,4 +87,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ObjectBase.h b/src/dawn_native/ObjectBase.h index 5c91628748..04777c7a89 100644 --- a/src/dawn_native/ObjectBase.h +++ b/src/dawn_native/ObjectBase.h @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -92,6 +92,6 @@ namespace dawn_native { std::string mLabel; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_OBJECTBASE_H_ diff --git a/src/dawn_native/ObjectContentHasher.cpp b/src/dawn_native/ObjectContentHasher.cpp index 901e4cc702..9603fe98ae 100644 --- a/src/dawn_native/ObjectContentHasher.cpp +++ b/src/dawn_native/ObjectContentHasher.cpp @@ -14,9 +14,9 @@ #include "dawn_native/ObjectContentHasher.h" -namespace dawn_native { +namespace dawn::native { size_t ObjectContentHasher::GetContentHash() const { return mContentHash; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ObjectContentHasher.h b/src/dawn_native/ObjectContentHasher.h index 16509bcb9c..710eadc21d 100644 --- a/src/dawn_native/ObjectContentHasher.h +++ b/src/dawn_native/ObjectContentHasher.h @@ -20,7 +20,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // ObjectContentHasher records a hash that can be used as a key to lookup a cached object in a // cache. @@ -77,6 +77,6 @@ namespace dawn_native { } }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_OBJECT_CONTENT_HASHER_H_ diff --git a/src/dawn_native/PassResourceUsage.h b/src/dawn_native/PassResourceUsage.h index 555eb0fc87..f757ad5e15 100644 --- a/src/dawn_native/PassResourceUsage.h +++ b/src/dawn_native/PassResourceUsage.h @@ -21,7 +21,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // This file declares various "ResourceUsage" structures. They are produced by the frontend // while recording commands to be used for later validation and also some operations in the @@ -95,6 +95,6 @@ namespace dawn_native { std::set usedQuerySets; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PASSRESOURCEUSAGE_H diff --git a/src/dawn_native/PassResourceUsageTracker.cpp b/src/dawn_native/PassResourceUsageTracker.cpp index 46ceda731f..2acb20794c 100644 --- a/src/dawn_native/PassResourceUsageTracker.cpp +++ b/src/dawn_native/PassResourceUsageTracker.cpp @@ -24,7 +24,7 @@ #include -namespace dawn_native { +namespace dawn::native { void SyncScopeUsageTracker::BufferUsedAs(BufferBase* buffer, wgpu::BufferUsage usage) { // std::map's operator[] will create the key and return 0 if the key didn't exist @@ -259,4 +259,4 @@ namespace dawn_native { return mQueryAvailabilities; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/PassResourceUsageTracker.h b/src/dawn_native/PassResourceUsageTracker.h index 33f33ff032..c7f989da39 100644 --- a/src/dawn_native/PassResourceUsageTracker.h +++ b/src/dawn_native/PassResourceUsageTracker.h @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { class BindGroupBase; class BufferBase; @@ -81,6 +81,6 @@ namespace dawn_native { QueryAvailabilityMap mQueryAvailabilities; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PASSRESOURCEUSAGETRACKER_H_ diff --git a/src/dawn_native/PerStage.cpp b/src/dawn_native/PerStage.cpp index 469fd9fd6c..47bbcfdc57 100644 --- a/src/dawn_native/PerStage.cpp +++ b/src/dawn_native/PerStage.cpp @@ -14,7 +14,7 @@ #include "dawn_native/PerStage.h" -namespace dawn_native { +namespace dawn::native { absl::FormatConvertResult AbslFormatConvert( SingleShaderStage value, @@ -46,4 +46,4 @@ namespace dawn_native { return static_cast(1 << static_cast(stage)); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/PerStage.h b/src/dawn_native/PerStage.h index a67a08a36f..3fa65c6c1d 100644 --- a/src/dawn_native/PerStage.h +++ b/src/dawn_native/PerStage.h @@ -24,7 +24,7 @@ #include -namespace dawn_native { +namespace dawn::native { enum class SingleShaderStage { Vertex, Fragment, Compute }; @@ -85,6 +85,6 @@ namespace dawn_native { std::array mData; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PERSTAGE_H_ diff --git a/src/dawn_native/PersistentCache.cpp b/src/dawn_native/PersistentCache.cpp index 7ee7bea37a..7679275156 100644 --- a/src/dawn_native/PersistentCache.cpp +++ b/src/dawn_native/PersistentCache.cpp @@ -18,7 +18,7 @@ #include "dawn_native/Device.h" #include "dawn_platform/DawnPlatform.h" -namespace dawn_native { +namespace dawn::native { PersistentCache::PersistentCache(DeviceBase* device) : mDevice(device), mCache(GetPlatformCache()) { @@ -61,4 +61,4 @@ namespace dawn_native { } return nullptr; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/PersistentCache.h b/src/dawn_native/PersistentCache.h index c55098234e..28de28d2b0 100644 --- a/src/dawn_native/PersistentCache.h +++ b/src/dawn_native/PersistentCache.h @@ -24,7 +24,7 @@ namespace dawn::platform { class CachingInterface; } -namespace dawn_native { +namespace dawn::native { using PersistentCacheKey = std::vector; @@ -87,6 +87,6 @@ namespace dawn_native { std::mutex mMutex; dawn::platform::CachingInterface* mCache = nullptr; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PERSISTENTCACHE_H_ diff --git a/src/dawn_native/Pipeline.cpp b/src/dawn_native/Pipeline.cpp index 7b24460451..02a9d8d0d3 100644 --- a/src/dawn_native/Pipeline.cpp +++ b/src/dawn_native/Pipeline.cpp @@ -21,7 +21,7 @@ #include "dawn_native/PipelineLayout.h" #include "dawn_native/ShaderModule.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateProgrammableStage(DeviceBase* device, const ShaderModuleBase* module, const std::string& entryPoint, @@ -247,4 +247,4 @@ namespace dawn_native { return true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Pipeline.h b/src/dawn_native/Pipeline.h index 10aec50ca7..d640ace68e 100644 --- a/src/dawn_native/Pipeline.h +++ b/src/dawn_native/Pipeline.h @@ -27,7 +27,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidateProgrammableStage(DeviceBase* device, const ShaderModuleBase* module, @@ -93,6 +93,6 @@ namespace dawn_native { RequiredBufferSizes mMinBufferSizes; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PIPELINE_H_ diff --git a/src/dawn_native/PipelineLayout.cpp b/src/dawn_native/PipelineLayout.cpp index 27e38011a8..3883bb7452 100644 --- a/src/dawn_native/PipelineLayout.cpp +++ b/src/dawn_native/PipelineLayout.cpp @@ -23,7 +23,7 @@ #include "dawn_native/ObjectType_autogen.h" #include "dawn_native/ShaderModule.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidatePipelineLayoutDescriptor( DeviceBase* device, @@ -406,4 +406,4 @@ namespace dawn_native { return true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/PipelineLayout.h b/src/dawn_native/PipelineLayout.h index 948b3446a7..faf259d588 100644 --- a/src/dawn_native/PipelineLayout.h +++ b/src/dawn_native/PipelineLayout.h @@ -29,7 +29,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidatePipelineLayoutDescriptor( DeviceBase*, @@ -92,6 +92,6 @@ namespace dawn_native { BindGroupLayoutMask mMask; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PIPELINELAYOUT_H_ diff --git a/src/dawn_native/PooledResourceMemoryAllocator.cpp b/src/dawn_native/PooledResourceMemoryAllocator.cpp index 2b6d44ae1e..161493fb49 100644 --- a/src/dawn_native/PooledResourceMemoryAllocator.cpp +++ b/src/dawn_native/PooledResourceMemoryAllocator.cpp @@ -15,7 +15,7 @@ #include "dawn_native/PooledResourceMemoryAllocator.h" #include "dawn_native/Device.h" -namespace dawn_native { +namespace dawn::native { PooledResourceMemoryAllocator::PooledResourceMemoryAllocator( ResourceHeapAllocator* heapAllocator) @@ -57,4 +57,4 @@ namespace dawn_native { uint64_t PooledResourceMemoryAllocator::GetPoolSizeForTesting() const { return mPool.size(); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/PooledResourceMemoryAllocator.h b/src/dawn_native/PooledResourceMemoryAllocator.h index 5b6b816ee6..c21c75228a 100644 --- a/src/dawn_native/PooledResourceMemoryAllocator.h +++ b/src/dawn_native/PooledResourceMemoryAllocator.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -48,6 +48,6 @@ namespace dawn_native { std::deque> mPool; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_POOLEDRESOURCEMEMORYALLOCATOR_H_ diff --git a/src/dawn_native/ProgrammableEncoder.cpp b/src/dawn_native/ProgrammableEncoder.cpp index 99e2c7772b..0bd588aa3d 100644 --- a/src/dawn_native/ProgrammableEncoder.cpp +++ b/src/dawn_native/ProgrammableEncoder.cpp @@ -26,7 +26,7 @@ #include -namespace dawn_native { +namespace dawn::native { ProgrammableEncoder::ProgrammableEncoder(DeviceBase* device, const char* label, @@ -200,4 +200,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ProgrammableEncoder.h b/src/dawn_native/ProgrammableEncoder.h index 9f88f28a3c..47f6b80218 100644 --- a/src/dawn_native/ProgrammableEncoder.h +++ b/src/dawn_native/ProgrammableEncoder.h @@ -23,7 +23,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -67,6 +67,6 @@ namespace dawn_native { const bool mValidationEnabled; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_PROGRAMMABLEENCODER_H_ diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp index ef8e206ee1..46ce1a5582 100644 --- a/src/dawn_native/QueryHelper.cpp +++ b/src/dawn_native/QueryHelper.cpp @@ -24,15 +24,15 @@ #include "dawn_native/InternalPipelineStore.h" #include "dawn_native/utils/WGPUHelpers.h" -namespace dawn_native { +namespace dawn::native { namespace { - // Assert the offsets in dawn_native::TimestampParams are same with the ones in the shader - static_assert(offsetof(dawn_native::TimestampParams, first) == 0, ""); - static_assert(offsetof(dawn_native::TimestampParams, count) == 4, ""); - static_assert(offsetof(dawn_native::TimestampParams, offset) == 8, ""); - static_assert(offsetof(dawn_native::TimestampParams, period) == 12, ""); + // Assert the offsets in dawn::native::TimestampParams are same with the ones in the shader + static_assert(offsetof(dawn::native::TimestampParams, first) == 0, ""); + static_assert(offsetof(dawn::native::TimestampParams, count) == 4, ""); + static_assert(offsetof(dawn::native::TimestampParams, offset) == 8, ""); + static_assert(offsetof(dawn::native::TimestampParams, period) == 12, ""); static const char sConvertTimestampsToNanoseconds[] = R"( struct Timestamp { @@ -184,4 +184,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/QueryHelper.h b/src/dawn_native/QueryHelper.h index 90f3398294..6f8362ceee 100644 --- a/src/dawn_native/QueryHelper.h +++ b/src/dawn_native/QueryHelper.h @@ -18,7 +18,7 @@ #include "dawn_native/Error.h" #include "dawn_native/ObjectBase.h" -namespace dawn_native { +namespace dawn::native { class BufferBase; class CommandEncoder; @@ -35,6 +35,6 @@ namespace dawn_native { BufferBase* availability, BufferBase* params); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_QUERYHELPER_H_ diff --git a/src/dawn_native/QuerySet.cpp b/src/dawn_native/QuerySet.cpp index 37d8a9967a..5c02574015 100644 --- a/src/dawn_native/QuerySet.cpp +++ b/src/dawn_native/QuerySet.cpp @@ -21,7 +21,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -177,4 +177,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/QuerySet.h b/src/dawn_native/QuerySet.h index 58ebc1a926..42c2b87ac3 100644 --- a/src/dawn_native/QuerySet.h +++ b/src/dawn_native/QuerySet.h @@ -21,7 +21,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateQuerySetDescriptor(DeviceBase* device, const QuerySetDescriptor* descriptor); @@ -67,6 +67,6 @@ namespace dawn_native { std::vector mQueryAvailability; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_QUERYSET_H_ diff --git a/src/dawn_native/Queue.cpp b/src/dawn_native/Queue.cpp index 0fb7ab23de..a6d10b78cb 100644 --- a/src/dawn_native/Queue.cpp +++ b/src/dawn_native/Queue.cpp @@ -34,7 +34,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -509,4 +509,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Queue.h b/src/dawn_native/Queue.h index 204a4ae0a9..ee8ba17c2b 100644 --- a/src/dawn_native/Queue.h +++ b/src/dawn_native/Queue.h @@ -23,7 +23,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { class QueueBase : public ApiObjectBase { public: @@ -106,6 +106,6 @@ namespace dawn_native { SerialQueue> mTasksInFlight; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_QUEUE_H_ diff --git a/src/dawn_native/RenderBundle.cpp b/src/dawn_native/RenderBundle.cpp index 9ee937070f..7937106049 100644 --- a/src/dawn_native/RenderBundle.cpp +++ b/src/dawn_native/RenderBundle.cpp @@ -20,7 +20,7 @@ #include "dawn_native/ObjectType_autogen.h" #include "dawn_native/RenderBundleEncoder.h" -namespace dawn_native { +namespace dawn::native { RenderBundleBase::RenderBundleBase(RenderBundleEncoder* encoder, const RenderBundleDescriptor* descriptor, @@ -88,4 +88,4 @@ namespace dawn_native { return mIndirectDrawMetadata; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RenderBundle.h b/src/dawn_native/RenderBundle.h index 4ad8dafbc0..a2db78ae7a 100644 --- a/src/dawn_native/RenderBundle.h +++ b/src/dawn_native/RenderBundle.h @@ -28,7 +28,7 @@ #include -namespace dawn_native { +namespace dawn::native { struct RenderBundleDescriptor; class RenderBundleEncoder; @@ -68,6 +68,6 @@ namespace dawn_native { RenderPassResourceUsage mResourceUsage; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RENDERBUNDLE_H_ diff --git a/src/dawn_native/RenderBundleEncoder.cpp b/src/dawn_native/RenderBundleEncoder.cpp index f7aab72210..07e2ea78de 100644 --- a/src/dawn_native/RenderBundleEncoder.cpp +++ b/src/dawn_native/RenderBundleEncoder.cpp @@ -24,7 +24,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateColorAttachmentFormat(const DeviceBase* device, wgpu::TextureFormat textureFormat) { @@ -164,4 +164,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RenderBundleEncoder.h b/src/dawn_native/RenderBundleEncoder.h index 11411b05b9..ebd2a90b8d 100644 --- a/src/dawn_native/RenderBundleEncoder.h +++ b/src/dawn_native/RenderBundleEncoder.h @@ -21,7 +21,7 @@ #include "dawn_native/RenderBundle.h" #include "dawn_native/RenderEncoderBase.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateRenderBundleEncoderDescriptor( const DeviceBase* device, @@ -51,6 +51,6 @@ namespace dawn_native { EncodingContext mBundleEncodingContext; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RENDERBUNDLEENCODER_H_ diff --git a/src/dawn_native/RenderEncoderBase.cpp b/src/dawn_native/RenderEncoderBase.cpp index 4a5b89cf13..e548200bac 100644 --- a/src/dawn_native/RenderEncoderBase.cpp +++ b/src/dawn_native/RenderEncoderBase.cpp @@ -27,7 +27,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { RenderEncoderBase::RenderEncoderBase(DeviceBase* device, const char* label, @@ -411,4 +411,4 @@ namespace dawn_native { dynamicOffsetCount); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RenderEncoderBase.h b/src/dawn_native/RenderEncoderBase.h index 2153178259..7bd1d5f8c5 100644 --- a/src/dawn_native/RenderEncoderBase.h +++ b/src/dawn_native/RenderEncoderBase.h @@ -22,7 +22,7 @@ #include "dawn_native/PassResourceUsageTracker.h" #include "dawn_native/ProgrammableEncoder.h" -namespace dawn_native { +namespace dawn::native { class RenderEncoderBase : public ProgrammableEncoder { public: @@ -82,6 +82,6 @@ namespace dawn_native { bool mStencilReadOnly = false; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RENDERENCODERBASE_H_ diff --git a/src/dawn_native/RenderPassEncoder.cpp b/src/dawn_native/RenderPassEncoder.cpp index 279fe45a52..a5b38a0dcd 100644 --- a/src/dawn_native/RenderPassEncoder.cpp +++ b/src/dawn_native/RenderPassEncoder.cpp @@ -28,7 +28,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { namespace { // Check the query at queryIndex is unavailable, otherwise it cannot be written. @@ -390,4 +390,4 @@ namespace dawn_native { "encoding %s.WriteTimestamp(%s, %u).", this, querySet, queryIndex); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RenderPassEncoder.h b/src/dawn_native/RenderPassEncoder.h index adaa8da1f2..34adb817a0 100644 --- a/src/dawn_native/RenderPassEncoder.h +++ b/src/dawn_native/RenderPassEncoder.h @@ -19,7 +19,7 @@ #include "dawn_native/Forward.h" #include "dawn_native/RenderEncoderBase.h" -namespace dawn_native { +namespace dawn::native { class RenderBundleBase; @@ -85,6 +85,6 @@ namespace dawn_native { bool mOcclusionQueryActive = false; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RENDERPASSENCODER_H_ diff --git a/src/dawn_native/RenderPipeline.cpp b/src/dawn_native/RenderPipeline.cpp index d16826de23..715f8efe30 100644 --- a/src/dawn_native/RenderPipeline.cpp +++ b/src/dawn_native/RenderPipeline.cpp @@ -27,7 +27,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { absl::FormatConvertResult AbslFormatConvert( VertexFormatBaseType value, const absl::FormatConversionSpec& spec, @@ -1062,4 +1062,4 @@ namespace dawn_native { return true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RenderPipeline.h b/src/dawn_native/RenderPipeline.h index f09ca84760..78a49966f1 100644 --- a/src/dawn_native/RenderPipeline.h +++ b/src/dawn_native/RenderPipeline.h @@ -26,7 +26,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -139,6 +139,6 @@ namespace dawn_native { bool mWritesStencil = false; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RENDERPIPELINE_H_ diff --git a/src/dawn_native/ResourceHeap.h b/src/dawn_native/ResourceHeap.h index e9a4a67226..465faaea83 100644 --- a/src/dawn_native/ResourceHeap.h +++ b/src/dawn_native/ResourceHeap.h @@ -17,7 +17,7 @@ #include "dawn_native/Error.h" -namespace dawn_native { +namespace dawn::native { // Wrapper for a resource backed by a heap. class ResourceHeapBase { @@ -26,6 +26,6 @@ namespace dawn_native { virtual ~ResourceHeapBase() = default; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RESOURCEHEAP_H_ diff --git a/src/dawn_native/ResourceHeapAllocator.h b/src/dawn_native/ResourceHeapAllocator.h index 1b0fd621de..1fcf854346 100644 --- a/src/dawn_native/ResourceHeapAllocator.h +++ b/src/dawn_native/ResourceHeapAllocator.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Interface for backend allocators that create memory heaps resoruces can be suballocated in. class ResourceHeapAllocator { @@ -32,6 +32,6 @@ namespace dawn_native { virtual void DeallocateResourceHeap(std::unique_ptr allocation) = 0; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RESOURCEHEAPALLOCATOR_H_ diff --git a/src/dawn_native/ResourceMemoryAllocation.cpp b/src/dawn_native/ResourceMemoryAllocation.cpp index b1c35d4172..4107b73bdb 100644 --- a/src/dawn_native/ResourceMemoryAllocation.cpp +++ b/src/dawn_native/ResourceMemoryAllocation.cpp @@ -15,7 +15,7 @@ #include "dawn_native/ResourceMemoryAllocation.h" #include "common/Assert.h" -namespace dawn_native { +namespace dawn::native { ResourceMemoryAllocation::ResourceMemoryAllocation() : mOffset(0), mResourceHeap(nullptr), mMappedPointer(nullptr) { @@ -50,4 +50,4 @@ namespace dawn_native { mResourceHeap = nullptr; mInfo = {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ResourceMemoryAllocation.h b/src/dawn_native/ResourceMemoryAllocation.h index f8b05f509e..307d90a1db 100644 --- a/src/dawn_native/ResourceMemoryAllocation.h +++ b/src/dawn_native/ResourceMemoryAllocation.h @@ -17,7 +17,7 @@ #include -namespace dawn_native { +namespace dawn::native { class ResourceHeapBase; @@ -75,6 +75,6 @@ namespace dawn_native { ResourceHeapBase* mResourceHeap; uint8_t* mMappedPointer; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RESOURCEMEMORYALLOCATION_H_ diff --git a/src/dawn_native/RingBufferAllocator.cpp b/src/dawn_native/RingBufferAllocator.cpp index c77f0a58ee..69d6769731 100644 --- a/src/dawn_native/RingBufferAllocator.cpp +++ b/src/dawn_native/RingBufferAllocator.cpp @@ -26,7 +26,7 @@ // only two indices that keep increasing (unbounded) but can be still indexed using bit masks. // However, this 1) requires the size to always be a power-of-two and 2) remove tests that check // used bytes. -namespace dawn_native { +namespace dawn::native { RingBufferAllocator::RingBufferAllocator(uint64_t maxSize) : mMaxBlockSize(maxSize) { } @@ -118,4 +118,4 @@ namespace dawn_native { return startOffset; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/RingBufferAllocator.h b/src/dawn_native/RingBufferAllocator.h index 3e9fb4355f..90411ae980 100644 --- a/src/dawn_native/RingBufferAllocator.h +++ b/src/dawn_native/RingBufferAllocator.h @@ -22,7 +22,7 @@ #include // RingBufferAllocator is the front-end implementation used to manage a ring buffer in GPU memory. -namespace dawn_native { +namespace dawn::native { class RingBufferAllocator { public: @@ -58,6 +58,6 @@ namespace dawn_native { uint64_t mCurrentRequestSize = 0; // Size of the sub-alloc requests (in bytes) of the current serial. }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_RINGBUFFERALLOCATOR_H_ diff --git a/src/dawn_native/Sampler.cpp b/src/dawn_native/Sampler.cpp index 12ab8cb2b2..9703e1bcc7 100644 --- a/src/dawn_native/Sampler.cpp +++ b/src/dawn_native/Sampler.cpp @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidateSamplerDescriptor(DeviceBase*, const SamplerDescriptor* descriptor) { DAWN_INVALID_IF(descriptor->nextInChain != nullptr, "nextInChain must be nullptr"); @@ -150,4 +150,4 @@ namespace dawn_native { a->mCompareFunction == b->mCompareFunction && a->mMaxAnisotropy == b->mMaxAnisotropy; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Sampler.h b/src/dawn_native/Sampler.h index 0116d47c9e..7c8e762d71 100644 --- a/src/dawn_native/Sampler.h +++ b/src/dawn_native/Sampler.h @@ -22,7 +22,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -75,6 +75,6 @@ namespace dawn_native { uint16_t mMaxAnisotropy; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SAMPLER_H_ diff --git a/src/dawn_native/ScratchBuffer.cpp b/src/dawn_native/ScratchBuffer.cpp index 976214cb91..41f241f8ed 100644 --- a/src/dawn_native/ScratchBuffer.cpp +++ b/src/dawn_native/ScratchBuffer.cpp @@ -16,7 +16,7 @@ #include "dawn_native/Device.h" -namespace dawn_native { +namespace dawn::native { ScratchBuffer::ScratchBuffer(DeviceBase* device, wgpu::BufferUsage usage) : mDevice(device), mUsage(usage) { @@ -44,4 +44,4 @@ namespace dawn_native { return mBuffer.Get(); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ScratchBuffer.h b/src/dawn_native/ScratchBuffer.h index 7bb446dfa2..16d3e90236 100644 --- a/src/dawn_native/ScratchBuffer.h +++ b/src/dawn_native/ScratchBuffer.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -50,6 +50,6 @@ namespace dawn_native { Ref mBuffer; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SCRATCHBUFFER_H_ diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index b589fa6c6b..9d57787e6e 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -31,7 +31,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -1275,4 +1275,4 @@ namespace dawn_native { return hash; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/ShaderModule.h b/src/dawn_native/ShaderModule.h index 4625ae888b..b978c1d0b2 100644 --- a/src/dawn_native/ShaderModule.h +++ b/src/dawn_native/ShaderModule.h @@ -47,7 +47,7 @@ namespace tint { } // namespace tint -namespace dawn_native { +namespace dawn::native { struct EntryPointMetadata; @@ -298,6 +298,6 @@ namespace dawn_native { std::unique_ptr mCompilationMessages; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SHADERMODULE_H_ diff --git a/src/dawn_native/SpirvValidation.cpp b/src/dawn_native/SpirvValidation.cpp index b7844c19ff..87d50ca15b 100644 --- a/src/dawn_native/SpirvValidation.cpp +++ b/src/dawn_native/SpirvValidation.cpp @@ -19,7 +19,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidateSpirv(DeviceBase* device, const std::vector& spirv, @@ -71,4 +71,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/SpirvValidation.h b/src/dawn_native/SpirvValidation.h index b22fd06e0b..598d0112ab 100644 --- a/src/dawn_native/SpirvValidation.h +++ b/src/dawn_native/SpirvValidation.h @@ -16,7 +16,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -24,4 +24,4 @@ namespace dawn_native { const std::vector& spirv, bool dumpSpirv); -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/StagingBuffer.cpp b/src/dawn_native/StagingBuffer.cpp index 63dd65e9bf..6378e81596 100644 --- a/src/dawn_native/StagingBuffer.cpp +++ b/src/dawn_native/StagingBuffer.cpp @@ -14,7 +14,7 @@ #include "dawn_native/StagingBuffer.h" -namespace dawn_native { +namespace dawn::native { StagingBufferBase::StagingBufferBase(size_t size) : mBufferSize(size) { } @@ -26,4 +26,4 @@ namespace dawn_native { void* StagingBufferBase::GetMappedPointer() const { return mMappedPointer; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/StagingBuffer.h b/src/dawn_native/StagingBuffer.h index 4d195488bc..3e85765bf9 100644 --- a/src/dawn_native/StagingBuffer.h +++ b/src/dawn_native/StagingBuffer.h @@ -17,7 +17,7 @@ #include "dawn_native/Error.h" -namespace dawn_native { +namespace dawn::native { class StagingBufferBase { public: @@ -36,6 +36,6 @@ namespace dawn_native { const size_t mBufferSize; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_STAGINGBUFFER_H_ diff --git a/src/dawn_native/Subresource.cpp b/src/dawn_native/Subresource.cpp index ff0bd53fd1..9e4887f0c6 100644 --- a/src/dawn_native/Subresource.cpp +++ b/src/dawn_native/Subresource.cpp @@ -17,7 +17,7 @@ #include "common/Assert.h" #include "dawn_native/Format.h" -namespace dawn_native { +namespace dawn::native { Aspect ConvertSingleAspect(const Format& format, wgpu::TextureAspect aspect) { Aspect aspectMask = ConvertAspect(format, aspect); @@ -129,4 +129,4 @@ namespace dawn_native { return {aspects, {0, layerCount}, {0, levelCount}}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Subresource.h b/src/dawn_native/Subresource.h index 454e17c031..35da7b5c6e 100644 --- a/src/dawn_native/Subresource.h +++ b/src/dawn_native/Subresource.h @@ -18,7 +18,7 @@ #include "dawn_native/EnumClassBitmasks.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { // Note: Subresource indices are computed by iterating the aspects in increasing order. // D3D12 uses these directly, so the order much match D3D12's indices. @@ -98,12 +98,12 @@ namespace dawn_native { // the per plane index does not exceed the known maximum plane count. static constexpr uint32_t kMaxPlanesPerFormat = 3; -} // namespace dawn_native +} // namespace dawn::native namespace dawn { template <> - struct IsDawnBitmask { + struct IsDawnBitmask { static constexpr bool enable = true; }; diff --git a/src/dawn_native/SubresourceStorage.h b/src/dawn_native/SubresourceStorage.h index 16feffcea2..2b960cc784 100644 --- a/src/dawn_native/SubresourceStorage.h +++ b/src/dawn_native/SubresourceStorage.h @@ -25,7 +25,7 @@ #include #include -namespace dawn_native { +namespace dawn::native { // SubresourceStorage acts like a simple map from subresource (aspect, layer, level) to a // value of type T except that it tries to compress similar subresources so that algorithms @@ -550,6 +550,6 @@ namespace dawn_native { return mData[(aspectIndex * mArrayLayerCount + layer) * mMipLevelCount + level]; } -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SUBRESOURCESTORAGE_H_ diff --git a/src/dawn_native/Surface.cpp b/src/dawn_native/Surface.cpp index 5ec5ffd5bc..57734cbd72 100644 --- a/src/dawn_native/Surface.cpp +++ b/src/dawn_native/Surface.cpp @@ -28,7 +28,7 @@ # include "common/xlib_with_undefs.h" #endif // defined(DAWN_USE_X11) -namespace dawn_native { +namespace dawn::native { absl::FormatConvertResult AbslFormatConvert( Surface::Type value, @@ -243,4 +243,4 @@ namespace dawn_native { return mXWindow; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Surface.h b/src/dawn_native/Surface.h index f9b47d3442..1a274b6efa 100644 --- a/src/dawn_native/Surface.h +++ b/src/dawn_native/Surface.h @@ -32,7 +32,7 @@ // non-windows platforms don't have this type struct IUnknown; -namespace dawn_native { +namespace dawn::native { MaybeError ValidateSurfaceDescriptor(const InstanceBase* instance, const SurfaceDescriptor* descriptor); @@ -105,6 +105,6 @@ namespace dawn_native { const absl::FormatConversionSpec& spec, absl::FormatSink* s); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SURFACE_H_ diff --git a/src/dawn_native/Surface_metal.mm b/src/dawn_native/Surface_metal.mm index 9989674fe6..ecb5d884aa 100644 --- a/src/dawn_native/Surface_metal.mm +++ b/src/dawn_native/Surface_metal.mm @@ -20,11 +20,11 @@ #import -namespace dawn_native { +namespace dawn::native { bool InheritsFromCAMetalLayer(void* obj) { id object = static_cast(obj); return [object isKindOfClass:[CAMetalLayer class]]; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/SwapChain.cpp b/src/dawn_native/SwapChain.cpp index 20ee991b84..502e66bc93 100644 --- a/src/dawn_native/SwapChain.cpp +++ b/src/dawn_native/SwapChain.cpp @@ -22,7 +22,7 @@ #include "dawn_native/Texture.h" #include "dawn_native/ValidationUtils_autogen.h" -namespace dawn_native { +namespace dawn::native { namespace { @@ -409,4 +409,4 @@ namespace dawn_native { return {}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/SwapChain.h b/src/dawn_native/SwapChain.h index bb88045062..09323d42f5 100644 --- a/src/dawn_native/SwapChain.h +++ b/src/dawn_native/SwapChain.h @@ -22,7 +22,7 @@ #include "dawn/dawn_wsi.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { MaybeError ValidateSwapChainDescriptor(const DeviceBase* device, const Surface* surface, @@ -164,6 +164,6 @@ namespace dawn_native { virtual void DetachFromSurfaceImpl() = 0; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_SWAPCHAIN_H_ diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp index cbc81c1632..092f7a1357 100644 --- a/src/dawn_native/Texture.cpp +++ b/src/dawn_native/Texture.cpp @@ -27,7 +27,7 @@ #include "dawn_native/PassResourceUsage.h" #include "dawn_native/ValidationUtils_autogen.h" -namespace dawn_native { +namespace dawn::native { namespace { // WebGPU currently does not have texture format reinterpretation. If it does, the // code to check for it might go here. @@ -229,7 +229,7 @@ namespace dawn_native { MaybeError ValidateTextureUsage(const TextureDescriptor* descriptor, wgpu::TextureUsage usage, const Format* format) { - DAWN_TRY(dawn_native::ValidateTextureUsage(usage)); + DAWN_TRY(dawn::native::ValidateTextureUsage(usage)); constexpr wgpu::TextureUsage kValidCompressedUsages = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc | @@ -775,4 +775,4 @@ namespace dawn_native { return mRange; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Texture.h b/src/dawn_native/Texture.h index 145d7f3acf..053e6f54a3 100644 --- a/src/dawn_native/Texture.h +++ b/src/dawn_native/Texture.h @@ -26,7 +26,7 @@ #include -namespace dawn_native { +namespace dawn::native { MaybeError ValidateTextureDescriptor(const DeviceBase* device, const TextureDescriptor* descriptor); @@ -152,6 +152,6 @@ namespace dawn_native { SubresourceRange mRange; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_TEXTURE_H_ diff --git a/src/dawn_native/TintUtils.cpp b/src/dawn_native/TintUtils.cpp index 7315904fef..aae7de6276 100644 --- a/src/dawn_native/TintUtils.cpp +++ b/src/dawn_native/TintUtils.cpp @@ -17,7 +17,7 @@ #include -namespace dawn_native { +namespace dawn::native { namespace { @@ -52,4 +52,4 @@ namespace dawn_native { tlDevice = nullptr; } -} // namespace dawn_native \ No newline at end of file +} // namespace dawn::native \ No newline at end of file diff --git a/src/dawn_native/TintUtils.h b/src/dawn_native/TintUtils.h index c3761f69ff..ee094e3af4 100644 --- a/src/dawn_native/TintUtils.h +++ b/src/dawn_native/TintUtils.h @@ -17,7 +17,7 @@ #include "common/NonCopyable.h" -namespace dawn_native { +namespace dawn::native { class DeviceBase; @@ -32,6 +32,6 @@ namespace dawn_native { ScopedTintICEHandler(ScopedTintICEHandler&&) = delete; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_TEXTURE_H_ \ No newline at end of file diff --git a/src/dawn_native/ToBackend.h b/src/dawn_native/ToBackend.h index 5b0f049894..9e3db19c6d 100644 --- a/src/dawn_native/ToBackend.h +++ b/src/dawn_native/ToBackend.h @@ -17,7 +17,7 @@ #include "dawn_native/Forward.h" -namespace dawn_native { +namespace dawn::native { // ToBackendTraits implements the mapping from base type to member type of BackendTraits template @@ -150,6 +150,6 @@ namespace dawn_native { common); } -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_TOBACKEND_H_ diff --git a/src/dawn_native/Toggles.cpp b/src/dawn_native/Toggles.cpp index 25792b81ad..63dcdda036 100644 --- a/src/dawn_native/Toggles.cpp +++ b/src/dawn_native/Toggles.cpp @@ -18,7 +18,7 @@ #include "common/BitSetIterator.h" #include "dawn_native/Toggles.h" -namespace dawn_native { +namespace dawn::native { namespace { struct ToggleEnumAndInfo { @@ -314,4 +314,4 @@ namespace dawn_native { mToggleNameToEnumMapInitialized = true; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/Toggles.h b/src/dawn_native/Toggles.h index 4682cbd57b..0fc748ffd5 100644 --- a/src/dawn_native/Toggles.h +++ b/src/dawn_native/Toggles.h @@ -21,7 +21,7 @@ #include "dawn_native/DawnNative.h" -namespace dawn_native { +namespace dawn::native { enum class Toggle { EmulateStoreAndMSAAResolve, @@ -92,6 +92,6 @@ namespace dawn_native { std::unordered_map mToggleNameToEnumMap; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_TOGGLES_H_ diff --git a/src/dawn_native/VertexFormat.cpp b/src/dawn_native/VertexFormat.cpp index b4bdfb7aab..4cc2c9dcb9 100644 --- a/src/dawn_native/VertexFormat.cpp +++ b/src/dawn_native/VertexFormat.cpp @@ -18,7 +18,7 @@ #include -namespace dawn_native { +namespace dawn::native { static constexpr std::array sVertexFormatTable = {{ // @@ -66,4 +66,4 @@ namespace dawn_native { return sVertexFormatTable[static_cast(format)]; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/VertexFormat.h b/src/dawn_native/VertexFormat.h index 582c95d1e7..e5c9c62f9b 100644 --- a/src/dawn_native/VertexFormat.h +++ b/src/dawn_native/VertexFormat.h @@ -17,7 +17,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { enum class VertexFormatBaseType { Float, @@ -35,6 +35,6 @@ namespace dawn_native { const VertexFormatInfo& GetVertexFormatInfo(wgpu::VertexFormat format); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_VERTEXFORMAT_H_ diff --git a/src/dawn_native/XlibXcbFunctions.cpp b/src/dawn_native/XlibXcbFunctions.cpp index 605d250824..aa5ccbf583 100644 --- a/src/dawn_native/XlibXcbFunctions.cpp +++ b/src/dawn_native/XlibXcbFunctions.cpp @@ -14,7 +14,7 @@ #include "dawn_native/XlibXcbFunctions.h" -namespace dawn_native { +namespace dawn::native { XlibXcbFunctions::XlibXcbFunctions() { if (!mLib.Open("libX11-xcb.so.1") || @@ -28,4 +28,4 @@ namespace dawn_native { return xGetXCBConnection != nullptr; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/XlibXcbFunctions.h b/src/dawn_native/XlibXcbFunctions.h index f295c2aebe..05fd58324d 100644 --- a/src/dawn_native/XlibXcbFunctions.h +++ b/src/dawn_native/XlibXcbFunctions.h @@ -22,7 +22,7 @@ class DynamicLib; -namespace dawn_native { +namespace dawn::native { // A helper class that dynamically loads the x11-xcb library that contains XGetXCBConnection // (and nothing else). This has to be dynamic because this libraries isn't present on all Linux @@ -41,6 +41,6 @@ namespace dawn_native { DynamicLib mLib; }; -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_XLIBXCBFUNCTIONS_H_ diff --git a/src/dawn_native/d3d12/AdapterD3D12.cpp b/src/dawn_native/d3d12/AdapterD3D12.cpp index 1f17979f7d..fd4746d30c 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.cpp +++ b/src/dawn_native/d3d12/AdapterD3D12.cpp @@ -24,7 +24,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { Adapter::Adapter(Backend* backend, ComPtr hardwareAdapter) : AdapterBase(backend->GetInstance(), wgpu::BackendType::D3D12), @@ -37,7 +37,7 @@ namespace dawn_native::d3d12 { } bool Adapter::SupportsExternalImages() const { - // Via dawn_native::d3d12::ExternalImageDXGI::Create + // Via dawn::native::d3d12::ExternalImageDXGI::Create return true; } @@ -412,4 +412,4 @@ namespace dawn_native::d3d12 { return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/AdapterD3D12.h b/src/dawn_native/d3d12/AdapterD3D12.h index 56b602f950..c4d3df19d9 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.h +++ b/src/dawn_native/d3d12/AdapterD3D12.h @@ -21,7 +21,7 @@ #include "dawn_native/d3d12/D3D12Info.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Backend; @@ -61,6 +61,6 @@ namespace dawn_native::d3d12 { D3D12DeviceInfo mDeviceInfo = {}; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_ADAPTERD3D12_H_ diff --git a/src/dawn_native/d3d12/BackendD3D12.cpp b/src/dawn_native/d3d12/BackendD3D12.cpp index 71a9ccf6b6..8476553117 100644 --- a/src/dawn_native/d3d12/BackendD3D12.cpp +++ b/src/dawn_native/d3d12/BackendD3D12.cpp @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/D3D12Error.h" #include "dawn_native/d3d12/PlatformFunctions.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { @@ -207,4 +207,4 @@ namespace dawn_native::d3d12 { return backend; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/BackendD3D12.h b/src/dawn_native/d3d12/BackendD3D12.h index e41fd7a0bf..8fb237d876 100644 --- a/src/dawn_native/d3d12/BackendD3D12.h +++ b/src/dawn_native/d3d12/BackendD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class PlatformFunctions; @@ -54,6 +54,6 @@ namespace dawn_native::d3d12 { ComPtr mDxcValidator; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_BACKENDD3D12_H_ diff --git a/src/dawn_native/d3d12/BindGroupD3D12.cpp b/src/dawn_native/d3d12/BindGroupD3D12.cpp index 6c19488162..7957bd5763 100644 --- a/src/dawn_native/d3d12/BindGroupD3D12.cpp +++ b/src/dawn_native/d3d12/BindGroupD3D12.cpp @@ -23,7 +23,7 @@ #include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // static ResultOrError> BindGroup::Create(Device* device, @@ -282,4 +282,4 @@ namespace dawn_native::d3d12 { return mDynamicStorageBufferLengths; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/BindGroupD3D12.h b/src/dawn_native/d3d12/BindGroupD3D12.h index a0b8c7a34e..0d327552d0 100644 --- a/src/dawn_native/d3d12/BindGroupD3D12.h +++ b/src/dawn_native/d3d12/BindGroupD3D12.h @@ -22,7 +22,7 @@ #include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; class SamplerHeapCacheEntry; @@ -63,6 +63,6 @@ namespace dawn_native::d3d12 { DynamicStorageBufferLengths mDynamicStorageBufferLengths; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_BINDGROUPD3D12_H_ diff --git a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp index 527d41cbb1..834bc04da9 100644 --- a/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp +++ b/src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/SamplerHeapCacheD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { D3D12_DESCRIPTOR_RANGE_TYPE WGPUBindingInfoToDescriptorRangeType( const BindingInfo& bindingInfo) { @@ -188,4 +188,4 @@ namespace dawn_native::d3d12 { return mSamplerDescriptorRanges; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/BindGroupLayoutD3D12.h b/src/dawn_native/d3d12/BindGroupLayoutD3D12.h index 377d620daa..7d00763899 100644 --- a/src/dawn_native/d3d12/BindGroupLayoutD3D12.h +++ b/src/dawn_native/d3d12/BindGroupLayoutD3D12.h @@ -21,7 +21,7 @@ #include "common/ityp_stack_vec.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class BindGroup; class CPUDescriptorHeapAllocation; @@ -89,6 +89,6 @@ namespace dawn_native::d3d12 { StagingDescriptorAllocator* mViewAllocator = nullptr; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_BINDGROUPLAYOUTD3D12_H_ diff --git a/src/dawn_native/d3d12/BufferD3D12.cpp b/src/dawn_native/d3d12/BufferD3D12.cpp index 4741f79cae..c3a691e56a 100644 --- a/src/dawn_native/d3d12/BufferD3D12.cpp +++ b/src/dawn_native/d3d12/BufferD3D12.cpp @@ -26,7 +26,7 @@ #include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { D3D12_RESOURCE_FLAGS D3D12ResourceFlags(wgpu::BufferUsage usage) { @@ -490,4 +490,4 @@ namespace dawn_native::d3d12 { return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/BufferD3D12.h b/src/dawn_native/d3d12/BufferD3D12.h index c5a7148efb..be99642fb2 100644 --- a/src/dawn_native/d3d12/BufferD3D12.h +++ b/src/dawn_native/d3d12/BufferD3D12.h @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class CommandRecordingContext; class Device; @@ -86,6 +86,6 @@ namespace dawn_native::d3d12 { void* mMappedData = nullptr; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_BUFFERD3D12_H_ diff --git a/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.cpp b/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.cpp index bd71def421..5df287ed5f 100644 --- a/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.cpp +++ b/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.cpp @@ -15,7 +15,7 @@ #include "dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/Error.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { CPUDescriptorHeapAllocation::CPUDescriptorHeapAllocation( D3D12_CPU_DESCRIPTOR_HANDLE baseDescriptor, @@ -50,4 +50,4 @@ namespace dawn_native::d3d12 { mBaseDescriptor = {0}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h b/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h index 9cff652b5d..57be2a1f66 100644 --- a/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h +++ b/src/dawn_native/d3d12/CPUDescriptorHeapAllocationD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // Wrapper for a handle into a CPU-only descriptor heap. class CPUDescriptorHeapAllocation { @@ -42,6 +42,6 @@ namespace dawn_native::d3d12 { uint32_t mHeapIndex = -1; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ diff --git a/src/dawn_native/d3d12/CommandAllocatorManager.cpp b/src/dawn_native/d3d12/CommandAllocatorManager.cpp index 01891b8e16..6dc73dfeac 100644 --- a/src/dawn_native/d3d12/CommandAllocatorManager.cpp +++ b/src/dawn_native/d3d12/CommandAllocatorManager.cpp @@ -20,7 +20,7 @@ #include "common/Assert.h" #include "common/BitSetIterator.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { CommandAllocatorManager::CommandAllocatorManager(Device* device) : device(device), mAllocatorCount(0) { @@ -69,4 +69,4 @@ namespace dawn_native::d3d12 { return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/CommandAllocatorManager.h b/src/dawn_native/d3d12/CommandAllocatorManager.h index 0ecdadac2b..8a79bcc8fe 100644 --- a/src/dawn_native/d3d12/CommandAllocatorManager.h +++ b/src/dawn_native/d3d12/CommandAllocatorManager.h @@ -23,7 +23,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -53,6 +53,6 @@ namespace dawn_native::d3d12 { SerialQueue mInFlightCommandAllocators; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_COMMANDALLOCATORMANAGER_H_ diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp index 5365351d13..f18a149cd4 100644 --- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp +++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp @@ -33,7 +33,7 @@ #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { @@ -190,7 +190,7 @@ namespace dawn_native::d3d12 { const Extent3D& copySize) { ASSERT(srcCopy.texture->GetFormat().format == dstCopy.texture->GetFormat().format); ASSERT(srcCopy.aspect == dstCopy.aspect); - dawn_native::Format format = srcCopy.texture->GetFormat(); + dawn::native::Format format = srcCopy.texture->GetFormat(); const TexelBlockInfo& blockInfo = format.GetAspectInfo(srcCopy.aspect).block; ASSERT(copySize.width % blockInfo.width == 0); uint32_t widthInBlocks = copySize.width / blockInfo.width; @@ -867,7 +867,7 @@ namespace dawn_native::d3d12 { // TODO(crbug.com/dawn/814): support copying with 1D. ASSERT(source->GetDimension() != wgpu::TextureDimension::e1D && destination->GetDimension() != wgpu::TextureDimension::e1D); - const dawn_native::Extent3D copyExtentOneSlice = { + const dawn::native::Extent3D copyExtentOneSlice = { copy->copySize.width, copy->copySize.height, 1u}; for (Aspect aspect : IterateEnumMask(srcRange.aspects)) { @@ -1649,4 +1649,4 @@ namespace dawn_native::d3d12 { } return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.h b/src/dawn_native/d3d12/CommandBufferD3D12.h index 50f28c68a6..df654335d0 100644 --- a/src/dawn_native/d3d12/CommandBufferD3D12.h +++ b/src/dawn_native/d3d12/CommandBufferD3D12.h @@ -18,11 +18,11 @@ #include "dawn_native/CommandBuffer.h" #include "dawn_native/Error.h" -namespace dawn_native { +namespace dawn::native { struct BeginRenderPassCmd; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class BindGroupStateTracker; class CommandRecordingContext; @@ -52,6 +52,6 @@ namespace dawn_native::d3d12 { const RenderPassBuilder* renderPassBuilder) const; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_COMMANDBUFFERD3D12_H_ diff --git a/src/dawn_native/d3d12/CommandRecordingContext.cpp b/src/dawn_native/d3d12/CommandRecordingContext.cpp index ad207640fa..6749c2c30f 100644 --- a/src/dawn_native/d3d12/CommandRecordingContext.cpp +++ b/src/dawn_native/d3d12/CommandRecordingContext.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { void CommandRecordingContext::AddToSharedTextureList(Texture* texture) { ASSERT(IsOpen()); @@ -128,4 +128,4 @@ namespace dawn_native::d3d12 { mTempBuffers.emplace_back(tempBuffer); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/CommandRecordingContext.h b/src/dawn_native/d3d12/CommandRecordingContext.h index 75a83502f0..db4d6e79c7 100644 --- a/src/dawn_native/d3d12/CommandRecordingContext.h +++ b/src/dawn_native/d3d12/CommandRecordingContext.h @@ -21,7 +21,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class CommandAllocatorManager; class Device; class Heap; @@ -53,6 +53,6 @@ namespace dawn_native::d3d12 { std::vector> mTempBuffers; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_ diff --git a/src/dawn_native/d3d12/ComputePipelineD3D12.cpp b/src/dawn_native/d3d12/ComputePipelineD3D12.cpp index d50f21092c..933f62da76 100644 --- a/src/dawn_native/d3d12/ComputePipelineD3D12.cpp +++ b/src/dawn_native/d3d12/ComputePipelineD3D12.cpp @@ -22,7 +22,7 @@ #include "dawn_native/d3d12/ShaderModuleD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { Ref ComputePipeline::CreateUninitialized( Device* device, @@ -102,4 +102,4 @@ namespace dawn_native::d3d12 { return ToBackend(GetDevice())->GetDispatchIndirectSignature(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ComputePipelineD3D12.h b/src/dawn_native/d3d12/ComputePipelineD3D12.h index 3e14217676..9fb2d606cb 100644 --- a/src/dawn_native/d3d12/ComputePipelineD3D12.h +++ b/src/dawn_native/d3d12/ComputePipelineD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -53,6 +53,6 @@ namespace dawn_native::d3d12 { ComPtr mPipelineState; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_COMPUTEPIPELINED3D12_H_ diff --git a/src/dawn_native/d3d12/D3D11on12Util.cpp b/src/dawn_native/d3d12/D3D11on12Util.cpp index 55b23932da..245de6ce00 100644 --- a/src/dawn_native/d3d12/D3D11on12Util.cpp +++ b/src/dawn_native/d3d12/D3D11on12Util.cpp @@ -24,7 +24,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { void Flush11On12DeviceToAvoidLeaks(ComPtr d3d11on12Device) { if (d3d11on12Device == nullptr) { @@ -184,4 +184,4 @@ namespace dawn_native::d3d12 { return entry; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/D3D11on12Util.h b/src/dawn_native/d3d12/D3D11on12Util.h index 9abf7c61dc..6970cdd6c5 100644 --- a/src/dawn_native/d3d12/D3D11on12Util.h +++ b/src/dawn_native/d3d12/D3D11on12Util.h @@ -26,7 +26,7 @@ struct ID3D11On12Device; struct IDXGIKeyedMutex; -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // Wraps 11 wrapped resources in a cache. class D3D11on12ResourceCacheEntry : public RefCounted { @@ -87,6 +87,6 @@ namespace dawn_native::d3d12 { Cache mCache; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D11ON12UTIL_H_ diff --git a/src/dawn_native/d3d12/D3D12Backend.cpp b/src/dawn_native/d3d12/D3D12Backend.cpp index c0cbe48813..a79be15b78 100644 --- a/src/dawn_native/d3d12/D3D12Backend.cpp +++ b/src/dawn_native/d3d12/D3D12Backend.cpp @@ -26,7 +26,7 @@ #include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ComPtr GetD3D12Device(WGPUDevice device) { return ToBackend(FromAPI(device))->GetD3D12Device(); @@ -176,4 +176,4 @@ namespace dawn_native::d3d12 { AdapterDiscoveryOptions::AdapterDiscoveryOptions(ComPtr adapter) : AdapterDiscoveryOptionsBase(WGPUBackendType_D3D12), dxgiAdapter(std::move(adapter)) { } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/D3D12Error.cpp b/src/dawn_native/d3d12/D3D12Error.cpp index 914ff23041..9b2522bc27 100644 --- a/src/dawn_native/d3d12/D3D12Error.cpp +++ b/src/dawn_native/d3d12/D3D12Error.cpp @@ -18,7 +18,7 @@ #include #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { MaybeError CheckHRESULTImpl(HRESULT result, const char* context) { if (DAWN_LIKELY(SUCCEEDED(result))) { return {}; @@ -48,4 +48,4 @@ namespace dawn_native::d3d12 { return CheckHRESULTImpl(result, context); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/D3D12Error.h b/src/dawn_native/d3d12/D3D12Error.h index 6d01c9e1a8..931c59b205 100644 --- a/src/dawn_native/d3d12/D3D12Error.h +++ b/src/dawn_native/d3d12/D3D12Error.h @@ -19,7 +19,7 @@ #include "dawn_native/Error.h" #include "dawn_native/ErrorInjector.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { constexpr HRESULT E_FAKE_ERROR_FOR_TESTING = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xFF); constexpr HRESULT E_FAKE_OUTOFMEMORY_ERROR_FOR_TESTING = @@ -31,15 +31,15 @@ namespace dawn_native::d3d12 { // Uses CheckRESULT but returns OOM specific error when recoverable. MaybeError CheckOutOfMemoryHRESULTImpl(HRESULT result, const char* context); -#define CheckHRESULT(resultIn, contextIn) \ - ::dawn_native::d3d12::CheckHRESULTImpl( \ +#define CheckHRESULT(resultIn, contextIn) \ + ::dawn::native::d3d12::CheckHRESULTImpl( \ INJECT_ERROR_OR_RUN(resultIn, E_FAKE_ERROR_FOR_TESTING), contextIn) #define CheckOutOfMemoryHRESULT(resultIn, contextIn) \ - ::dawn_native::d3d12::CheckOutOfMemoryHRESULTImpl( \ + ::dawn::native::d3d12::CheckOutOfMemoryHRESULTImpl( \ INJECT_ERROR_OR_RUN(resultIn, E_FAKE_OUTOFMEMORY_ERROR_FOR_TESTING, \ E_FAKE_ERROR_FOR_TESTING), \ contextIn) -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_D3D12ERROR_H_ diff --git a/src/dawn_native/d3d12/D3D12Info.cpp b/src/dawn_native/d3d12/D3D12Info.cpp index ab68487cc4..154803fbf9 100644 --- a/src/dawn_native/d3d12/D3D12Info.cpp +++ b/src/dawn_native/d3d12/D3D12Info.cpp @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/D3D12Error.h" #include "dawn_native/d3d12/PlatformFunctions.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ResultOrError GatherDeviceInfo(const Adapter& adapter) { D3D12DeviceInfo info = {}; @@ -119,4 +119,4 @@ namespace dawn_native::d3d12 { return std::move(info); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/D3D12Info.h b/src/dawn_native/d3d12/D3D12Info.h index b8c7c0b9ec..b5ef7fc2de 100644 --- a/src/dawn_native/d3d12/D3D12Info.h +++ b/src/dawn_native/d3d12/D3D12Info.h @@ -19,7 +19,7 @@ #include "dawn_native/PerStage.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Adapter; @@ -36,6 +36,6 @@ namespace dawn_native::d3d12 { }; ResultOrError GatherDeviceInfo(const Adapter& adapter); -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_D3D12INFO_H_ diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp index d0d06c1a4a..fd68df36f7 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.cpp +++ b/src/dawn_native/d3d12/DeviceD3D12.cpp @@ -44,7 +44,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // TODO(dawn:155): Figure out these values. static constexpr uint16_t kShaderVisibleDescriptorHeapSize = 1024; @@ -740,4 +740,4 @@ namespace dawn_native::d3d12 { return ToBackend(computePipeline)->UsesNumWorkgroups(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/DeviceD3D12.h b/src/dawn_native/d3d12/DeviceD3D12.h index 64c0e3513d..09b2246578 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.h +++ b/src/dawn_native/d3d12/DeviceD3D12.h @@ -22,7 +22,7 @@ #include "dawn_native/d3d12/Forward.h" #include "dawn_native/d3d12/TextureD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class CommandAllocatorManager; class PlatformFunctions; @@ -259,6 +259,6 @@ namespace dawn_native::d3d12 { float mTimestampPeriod = 1.0f; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_DEVICED3D12_H_ diff --git a/src/dawn_native/d3d12/Forward.h b/src/dawn_native/d3d12/Forward.h index de2b0b4a02..15d1739d2c 100644 --- a/src/dawn_native/d3d12/Forward.h +++ b/src/dawn_native/d3d12/Forward.h @@ -17,7 +17,7 @@ #include "dawn_native/ToBackend.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Adapter; class BindGroup; @@ -64,6 +64,6 @@ namespace dawn_native::d3d12 { return ToBackendBase(common); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_FORWARD_H_ diff --git a/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.cpp b/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.cpp index 59288b1ddc..3ee011d5fa 100644 --- a/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.cpp +++ b/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.cpp @@ -14,7 +14,7 @@ #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { GPUDescriptorHeapAllocation::GPUDescriptorHeapAllocation( D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor, @@ -36,4 +36,4 @@ namespace dawn_native::d3d12 { HeapVersionID GPUDescriptorHeapAllocation::GetHeapSerial() const { return mHeapSerial; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h b/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h index 58b39fe66f..34cc8052e8 100644 --- a/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h +++ b/src/dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/IntegerTypes.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // Wrapper for a handle into a GPU-only descriptor heap. class GPUDescriptorHeapAllocation { @@ -39,6 +39,6 @@ namespace dawn_native::d3d12 { HeapVersionID mHeapSerial = HeapVersionID(0); }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ diff --git a/src/dawn_native/d3d12/HeapAllocatorD3D12.cpp b/src/dawn_native/d3d12/HeapAllocatorD3D12.cpp index bb333e7ffa..27ba04424b 100644 --- a/src/dawn_native/d3d12/HeapAllocatorD3D12.cpp +++ b/src/dawn_native/d3d12/HeapAllocatorD3D12.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/HeapD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { HeapAllocator::HeapAllocator(Device* device, D3D12_HEAP_TYPE heapType, @@ -68,4 +68,4 @@ namespace dawn_native::d3d12 { mDevice->ReferenceUntilUnused(static_cast(heap.get())->GetD3D12Heap()); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/HeapAllocatorD3D12.h b/src/dawn_native/d3d12/HeapAllocatorD3D12.h index f8e58be025..fbb083ba59 100644 --- a/src/dawn_native/d3d12/HeapAllocatorD3D12.h +++ b/src/dawn_native/d3d12/HeapAllocatorD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/ResourceHeapAllocator.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -43,6 +43,6 @@ namespace dawn_native::d3d12 { MemorySegment mMemorySegment; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_HEAPALLOCATORD3D12_H_ diff --git a/src/dawn_native/d3d12/HeapD3D12.cpp b/src/dawn_native/d3d12/HeapD3D12.cpp index d5605054c9..6e08cd30d3 100644 --- a/src/dawn_native/d3d12/HeapD3D12.cpp +++ b/src/dawn_native/d3d12/HeapD3D12.cpp @@ -14,7 +14,7 @@ #include "dawn_native/d3d12/HeapD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { Heap::Heap(ComPtr d3d12Pageable, MemorySegment memorySegment, uint64_t size) : Pageable(std::move(d3d12Pageable), memorySegment, size) { mD3d12Pageable.As(&mD3d12Heap); @@ -28,4 +28,4 @@ namespace dawn_native::d3d12 { return mD3d12Heap.Get(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/HeapD3D12.h b/src/dawn_native/d3d12/HeapD3D12.h index 6b04177bd4..0ff6fd20cd 100644 --- a/src/dawn_native/d3d12/HeapD3D12.h +++ b/src/dawn_native/d3d12/HeapD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/PageableD3D12.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -35,6 +35,6 @@ namespace dawn_native::d3d12 { private: ComPtr mD3d12Heap; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_HEAPD3D12_H_ diff --git a/src/dawn_native/d3d12/IntegerTypes.h b/src/dawn_native/d3d12/IntegerTypes.h index b2f330932f..54dcda8f8d 100644 --- a/src/dawn_native/d3d12/IntegerTypes.h +++ b/src/dawn_native/d3d12/IntegerTypes.h @@ -20,12 +20,12 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // An ID used to desambiguate between multiple uses of the same descriptor heap in the // BindGroup allocations. using HeapVersionID = TypedInteger; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_INTEGERTYPES_H_ diff --git a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp index 933e44d724..7884e13934 100644 --- a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp +++ b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { DXGI_USAGE D3D12SwapChainBufferUsage(WGPUTextureUsage allowedUsages) { @@ -117,4 +117,4 @@ namespace dawn_native::d3d12 { return wgpu::TextureFormat::RGBA8Unorm; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.h b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.h index f3f721597a..35927e5c01 100644 --- a/src/dawn_native/d3d12/NativeSwapChainImplD3D12.h +++ b/src/dawn_native/d3d12/NativeSwapChainImplD3D12.h @@ -23,7 +23,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -55,6 +55,6 @@ namespace dawn_native::d3d12 { uint32_t mCurrentBuffer; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_NATIVESWAPCHAINIMPLD3D12_H_ diff --git a/src/dawn_native/d3d12/PageableD3D12.cpp b/src/dawn_native/d3d12/PageableD3D12.cpp index 06b8d8b3ef..fe84d48798 100644 --- a/src/dawn_native/d3d12/PageableD3D12.cpp +++ b/src/dawn_native/d3d12/PageableD3D12.cpp @@ -14,7 +14,7 @@ #include "dawn_native/d3d12/PageableD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { Pageable::Pageable(ComPtr d3d12Pageable, MemorySegment memorySegment, uint64_t size) @@ -73,4 +73,4 @@ namespace dawn_native::d3d12 { bool Pageable::IsResidencyLocked() const { return mResidencyLockRefCount != 0; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/PageableD3D12.h b/src/dawn_native/d3d12/PageableD3D12.h index 0a7a46a5d3..c706c5cef6 100644 --- a/src/dawn_native/d3d12/PageableD3D12.h +++ b/src/dawn_native/d3d12/PageableD3D12.h @@ -20,7 +20,7 @@ #include "dawn_native/IntegerTypes.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // 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 // 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::d3d12 { uint32_t mResidencyLockRefCount = 0; uint64_t mSize = 0; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif diff --git a/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp b/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp index bd38998013..b934ca9f43 100644 --- a/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp +++ b/src/dawn_native/d3d12/PipelineLayoutD3D12.cpp @@ -24,7 +24,7 @@ using Microsoft::WRL::ComPtr; -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { // Reserve register names for internal use. This registers map to bindings in the shader, @@ -364,4 +364,4 @@ namespace dawn_native::d3d12 { return mDispatchIndirectCommandSignatureWithNumWorkgroups.Get(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/PipelineLayoutD3D12.h b/src/dawn_native/d3d12/PipelineLayoutD3D12.h index 2a477b1388..444266edf7 100644 --- a/src/dawn_native/d3d12/PipelineLayoutD3D12.h +++ b/src/dawn_native/d3d12/PipelineLayoutD3D12.h @@ -21,7 +21,7 @@ #include "dawn_native/PipelineLayout.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -95,6 +95,6 @@ namespace dawn_native::d3d12 { ComPtr mDispatchIndirectCommandSignatureWithNumWorkgroups; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_PIPELINELAYOUTD3D12_H_ diff --git a/src/dawn_native/d3d12/PlatformFunctions.cpp b/src/dawn_native/d3d12/PlatformFunctions.cpp index c89b3923af..c3b3d175b2 100644 --- a/src/dawn_native/d3d12/PlatformFunctions.cpp +++ b/src/dawn_native/d3d12/PlatformFunctions.cpp @@ -20,7 +20,7 @@ #include #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { // Extract Version from "10.0.{Version}.0" if possible, otherwise return 0. uint32_t GetWindowsSDKVersionFromDirectoryName(const char* directoryName) { @@ -268,4 +268,4 @@ namespace dawn_native::d3d12 { } } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/PlatformFunctions.h b/src/dawn_native/d3d12/PlatformFunctions.h index be8c48f6ba..56473c7f12 100644 --- a/src/dawn_native/d3d12/PlatformFunctions.h +++ b/src/dawn_native/d3d12/PlatformFunctions.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // 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 @@ -105,6 +105,6 @@ namespace dawn_native::d3d12 { DynamicLib mPIXEventRuntimeLib; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_PLATFORMFUNCTIONS_H_ diff --git a/src/dawn_native/d3d12/QuerySetD3D12.cpp b/src/dawn_native/d3d12/QuerySetD3D12.cpp index 933b0850dc..0f8cb3fadc 100644 --- a/src/dawn_native/d3d12/QuerySetD3D12.cpp +++ b/src/dawn_native/d3d12/QuerySetD3D12.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { D3D12_QUERY_HEAP_TYPE D3D12QueryHeapType(wgpu::QueryType type) { @@ -72,4 +72,4 @@ namespace dawn_native::d3d12 { SetDebugName(ToBackend(GetDevice()), mQueryHeap.Get(), "Dawn_QuerySet", GetLabel()); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/QuerySetD3D12.h b/src/dawn_native/d3d12/QuerySetD3D12.h index c7a2193105..e41f3051ac 100644 --- a/src/dawn_native/d3d12/QuerySetD3D12.h +++ b/src/dawn_native/d3d12/QuerySetD3D12.h @@ -18,7 +18,7 @@ #include "dawn_native/QuerySet.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -41,6 +41,6 @@ namespace dawn_native::d3d12 { ComPtr mQueryHeap; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_QUERYSETD3D12_H_ diff --git a/src/dawn_native/d3d12/QueueD3D12.cpp b/src/dawn_native/d3d12/QueueD3D12.cpp index 0bf4edc580..9693febabf 100644 --- a/src/dawn_native/d3d12/QueueD3D12.cpp +++ b/src/dawn_native/d3d12/QueueD3D12.cpp @@ -24,7 +24,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { Queue::Queue(Device* device) : QueueBase(device) { } @@ -51,4 +51,4 @@ namespace dawn_native::d3d12 { return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/QueueD3D12.h b/src/dawn_native/d3d12/QueueD3D12.h index 446dc1aee8..b085e9bb8d 100644 --- a/src/dawn_native/d3d12/QueueD3D12.h +++ b/src/dawn_native/d3d12/QueueD3D12.h @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/CommandRecordingContext.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -32,6 +32,6 @@ namespace dawn_native::d3d12 { MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_QUEUED3D12_H_ diff --git a/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp b/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp index d63d77e1b5..f86f5251a2 100644 --- a/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp +++ b/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp @@ -21,7 +21,7 @@ #include "dawn_native/dawn_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE D3D12BeginningAccessType(wgpu::LoadOp loadOp) { @@ -149,7 +149,7 @@ namespace dawn_native::d3d12 { void RenderPassBuilder::SetRenderTargetBeginningAccess(ColorAttachmentIndex attachment, wgpu::LoadOp loadOp, - dawn_native::Color clearColor, + dawn::native::Color clearColor, DXGI_FORMAT format) { mRenderPassRenderTargetDescriptors[attachment].BeginningAccess.Type = D3D12BeginningAccessType(loadOp); @@ -235,4 +235,4 @@ namespace dawn_native::d3d12 { D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/RenderPassBuilderD3D12.h b/src/dawn_native/d3d12/RenderPassBuilderD3D12.h index 7fa7c6c4e8..47c1746557 100644 --- a/src/dawn_native/d3d12/RenderPassBuilderD3D12.h +++ b/src/dawn_native/d3d12/RenderPassBuilderD3D12.h @@ -24,7 +24,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class TextureView; @@ -61,7 +61,7 @@ namespace dawn_native::d3d12 { void SetDepthStencilNoAccess(); void SetRenderTargetBeginningAccess(ColorAttachmentIndex attachment, wgpu::LoadOp loadOp, - dawn_native::Color clearColor, + dawn::native::Color clearColor, DXGI_FORMAT format); void SetRenderTargetEndingAccess(ColorAttachmentIndex attachment, wgpu::StoreOp storeOp); void SetRenderTargetEndingAccessResolve(ColorAttachmentIndex attachment, @@ -93,6 +93,6 @@ namespace dawn_native::d3d12 { kMaxColorAttachments> mSubresourceParams; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_RENDERPASSBUILDERD3D12_H_ diff --git a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp index c8efa7f479..c2fc7ef746 100644 --- a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp +++ b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp @@ -27,7 +27,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { DXGI_FORMAT VertexFormatType(wgpu::VertexFormat format) { @@ -487,4 +487,4 @@ namespace dawn_native::d3d12 { CreateRenderPipelineAsyncTask::RunAsync(std::move(asyncTask)); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/RenderPipelineD3D12.h b/src/dawn_native/d3d12/RenderPipelineD3D12.h index 6ac5a19ade..0c0c7e6149 100644 --- a/src/dawn_native/d3d12/RenderPipelineD3D12.h +++ b/src/dawn_native/d3d12/RenderPipelineD3D12.h @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/ShaderModuleD3D12.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -57,6 +57,6 @@ namespace dawn_native::d3d12 { FirstOffsetInfo mFirstOffsetInfo; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_RENDERPIPELINED3D12_H_ diff --git a/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp b/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp index 8eea16a151..e35941cca1 100644 --- a/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp +++ b/src/dawn_native/d3d12/ResidencyManagerD3D12.cpp @@ -20,7 +20,7 @@ #include "dawn_native/d3d12/Forward.h" #include "dawn_native/d3d12/HeapD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ResidencyManager::ResidencyManager(Device* device) : mDevice(device), @@ -368,4 +368,4 @@ namespace dawn_native::d3d12 { } } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ResidencyManagerD3D12.h b/src/dawn_native/d3d12/ResidencyManagerD3D12.h index 7c10aa5426..c9530b31aa 100644 --- a/src/dawn_native/d3d12/ResidencyManagerD3D12.h +++ b/src/dawn_native/d3d12/ResidencyManagerD3D12.h @@ -22,7 +22,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; class Heap; @@ -77,6 +77,6 @@ namespace dawn_native::d3d12 { VideoMemoryInfo mVideoMemoryInfo = {}; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_RESIDENCYMANAGERD3D12_H_ diff --git a/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.cpp b/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.cpp index 832b193fe7..6f1b4770e5 100644 --- a/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.cpp +++ b/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.cpp @@ -21,7 +21,7 @@ #include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { MemorySegment GetMemorySegment(Device* device, D3D12_HEAP_TYPE heapType) { if (device->GetDeviceInfo().isUMA) { @@ -407,4 +407,4 @@ namespace dawn_native::d3d12 { } } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.h b/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.h index f8ddaacc42..8129e3d76d 100644 --- a/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.h +++ b/src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.h @@ -24,7 +24,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -102,6 +102,6 @@ namespace dawn_native::d3d12 { SerialQueue mAllocationsToDelete; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_RESOURCEALLOCATORMANAGERD3D12_H_ diff --git a/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.cpp b/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.cpp index 514a9b49e8..9e4dac40c6 100644 --- a/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.cpp +++ b/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.cpp @@ -19,7 +19,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ResourceHeapAllocation::ResourceHeapAllocation(const AllocationInfo& info, uint64_t offset, ComPtr resource, @@ -40,4 +40,4 @@ namespace dawn_native::d3d12 { D3D12_GPU_VIRTUAL_ADDRESS ResourceHeapAllocation::GetGPUPointer() const { return mResource->GetGPUVirtualAddress(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.h b/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.h index 8c2951d72a..3ca80a2bcd 100644 --- a/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.h +++ b/src/dawn_native/d3d12/ResourceHeapAllocationD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/ResourceMemoryAllocation.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Heap; @@ -43,6 +43,6 @@ namespace dawn_native::d3d12 { ComPtr mResource; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_RESOURCEHEAPALLOCATIOND3D12_H_ diff --git a/src/dawn_native/d3d12/SamplerD3D12.cpp b/src/dawn_native/d3d12/SamplerD3D12.cpp index a72dd1d064..0ece76db8e 100644 --- a/src/dawn_native/d3d12/SamplerD3D12.cpp +++ b/src/dawn_native/d3d12/SamplerD3D12.cpp @@ -17,7 +17,7 @@ #include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { D3D12_TEXTURE_ADDRESS_MODE AddressMode(wgpu::AddressMode mode) { @@ -103,4 +103,4 @@ namespace dawn_native::d3d12 { return mSamplerDesc; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/SamplerD3D12.h b/src/dawn_native/d3d12/SamplerD3D12.h index f1ad94ead1..b28ab93a2e 100644 --- a/src/dawn_native/d3d12/SamplerD3D12.h +++ b/src/dawn_native/d3d12/SamplerD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -35,6 +35,6 @@ namespace dawn_native::d3d12 { D3D12_SAMPLER_DESC mSamplerDesc = {}; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_SAMPLERD3D12_H_ diff --git a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.cpp b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.cpp index de8f1365fb..4131e972d2 100644 --- a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.cpp +++ b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.cpp @@ -24,7 +24,7 @@ #include "dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { SamplerHeapCacheEntry::SamplerHeapCacheEntry(std::vector samplers) : mSamplers(std::move(samplers)) { @@ -163,4 +163,4 @@ namespace dawn_native::d3d12 { const SamplerHeapCacheEntry* b) const { return a->mSamplers == b->mSamplers; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h index 09064f7745..e8c86efc6c 100644 --- a/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h +++ b/src/dawn_native/d3d12/SamplerHeapCacheD3D12.h @@ -32,7 +32,7 @@ // // The cache is primary needed for the GPU sampler heap, which is much smaller than the view heap // and switches incur expensive pipeline flushes. -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class BindGroup; class Device; @@ -102,6 +102,6 @@ namespace dawn_native::d3d12 { Cache mCache; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_SAMPLERHEAPCACHE_H_ diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index b580a08157..4cf58e2a68 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -34,7 +34,7 @@ #include #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { ResultOrError GetDXCompilerVersion(ComPtr dxcValidator) { @@ -828,4 +828,4 @@ namespace dawn_native::d3d12 { UNREACHABLE(); return {}; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.h b/src/dawn_native/d3d12/ShaderModuleD3D12.h index 9ab5e499e6..3eb91e1294 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.h +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.h @@ -20,11 +20,11 @@ #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native { +namespace dawn::native { struct ProgrammableStage; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; class PipelineLayout; @@ -64,6 +64,6 @@ namespace dawn_native::d3d12 { MaybeError Initialize(ShaderModuleParseResult* parseResult); }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_SHADERMODULED3D12_H_ diff --git a/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.cpp b/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.cpp index 631a02e582..9ac146d932 100644 --- a/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/GPUDescriptorHeapAllocationD3D12.h" #include "dawn_native/d3d12/ResidencyManagerD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { // 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. @@ -251,4 +251,4 @@ namespace dawn_native::d3d12 { ID3D12DescriptorHeap* ShaderVisibleDescriptorHeap::GetD3D12DescriptorHeap() const { return mD3d12DescriptorHeap.Get(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h b/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h index 72a207e436..ee6009c78b 100644 --- a/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h +++ b/src/dawn_native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h @@ -29,7 +29,7 @@ // 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 // is returned to the pool. -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; class GPUDescriptorHeapAllocation; @@ -100,6 +100,6 @@ namespace dawn_native::d3d12 { // This is stored on the allocator to avoid extra conversions. uint32_t mDescriptorCount = 0; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATOR_H_ diff --git a/src/dawn_native/d3d12/StagingBufferD3D12.cpp b/src/dawn_native/d3d12/StagingBufferD3D12.cpp index 46ce9ec637..c1a307334e 100644 --- a/src/dawn_native/d3d12/StagingBufferD3D12.cpp +++ b/src/dawn_native/d3d12/StagingBufferD3D12.cpp @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/ResidencyManagerD3D12.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { StagingBuffer::StagingBuffer(size_t size, Device* device) : StagingBufferBase(size), mDevice(device) { @@ -74,4 +74,4 @@ namespace dawn_native::d3d12 { ID3D12Resource* StagingBuffer::GetResource() const { return mUploadHeap.GetD3D12Resource(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/StagingBufferD3D12.h b/src/dawn_native/d3d12/StagingBufferD3D12.h index 64c32abaa1..455adda01c 100644 --- a/src/dawn_native/d3d12/StagingBufferD3D12.h +++ b/src/dawn_native/d3d12/StagingBufferD3D12.h @@ -19,7 +19,7 @@ #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -36,6 +36,6 @@ namespace dawn_native::d3d12 { Device* mDevice; ResourceHeapAllocation mUploadHeap; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_STAGINGBUFFERD3D12_H_ diff --git a/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.cpp b/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.cpp index 151d155a73..83b9eeee36 100644 --- a/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.cpp +++ b/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.cpp @@ -18,7 +18,7 @@ #include "dawn_native/d3d12/DeviceD3D12.h" #include "dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { StagingDescriptorAllocator::StagingDescriptorAllocator(Device* device, uint32_t descriptorCount, @@ -149,4 +149,4 @@ namespace dawn_native::d3d12 { mAllocationsToDelete.ClearUpTo(completedSerial); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h b/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h index 3bcaff253e..64e9c3f44e 100644 --- a/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h +++ b/src/dawn_native/d3d12/StagingDescriptorAllocatorD3D12.h @@ -30,7 +30,7 @@ // 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 // offset is inserted back into the free-list. -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; @@ -80,6 +80,6 @@ namespace dawn_native::d3d12 { SerialQueue mAllocationsToDelete; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_STAGINGDESCRIPTORALLOCATOR_H_ diff --git a/src/dawn_native/d3d12/SwapChainD3D12.cpp b/src/dawn_native/d3d12/SwapChainD3D12.cpp index bf8a955eec..1b6175ca86 100644 --- a/src/dawn_native/d3d12/SwapChainD3D12.cpp +++ b/src/dawn_native/d3d12/SwapChainD3D12.cpp @@ -23,7 +23,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { uint32_t PresentModeToBufferCount(wgpu::PresentMode mode) { @@ -374,4 +374,4 @@ namespace dawn_native::d3d12 { mBuffers.clear(); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/SwapChainD3D12.h b/src/dawn_native/d3d12/SwapChainD3D12.h index 0a77777d80..8a27cef235 100644 --- a/src/dawn_native/d3d12/SwapChainD3D12.h +++ b/src/dawn_native/d3d12/SwapChainD3D12.h @@ -20,7 +20,7 @@ #include "dawn_native/IntegerTypes.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class Device; class Texture; @@ -84,6 +84,6 @@ namespace dawn_native::d3d12 { Ref mApiTexture; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_SWAPCHAIN_D3D12_H_ diff --git a/src/dawn_native/d3d12/TextureCopySplitter.cpp b/src/dawn_native/d3d12/TextureCopySplitter.cpp index b1d4b73bf1..cc1688ebf8 100644 --- a/src/dawn_native/d3d12/TextureCopySplitter.cpp +++ b/src/dawn_native/d3d12/TextureCopySplitter.cpp @@ -18,7 +18,7 @@ #include "dawn_native/Format.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { Origin3D ComputeTexelOffsets(const TexelBlockInfo& blockInfo, @@ -536,4 +536,4 @@ namespace dawn_native::d3d12 { return copySubresource; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/TextureCopySplitter.h b/src/dawn_native/d3d12/TextureCopySplitter.h index 3cb93e26ba..e75e192ef6 100644 --- a/src/dawn_native/d3d12/TextureCopySplitter.h +++ b/src/dawn_native/d3d12/TextureCopySplitter.h @@ -19,13 +19,13 @@ #include -namespace dawn_native { +namespace dawn::native { struct TexelBlockInfo; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { struct TextureCopySubresource { static constexpr unsigned int kMaxTextureCopyRegions = 4; @@ -92,6 +92,6 @@ namespace dawn_native::d3d12 { uint64_t offset, uint32_t bytesPerRow, uint32_t rowsPerImage); -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_TEXTURECOPYSPLITTER_H_ diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp index 623ac02688..85ceabc13b 100644 --- a/src/dawn_native/d3d12/TextureD3D12.cpp +++ b/src/dawn_native/d3d12/TextureD3D12.cpp @@ -31,7 +31,7 @@ #include "dawn_native/d3d12/TextureCopySplitter.h" #include "dawn_native/d3d12/UtilsD3D12.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { namespace { @@ -1373,4 +1373,4 @@ namespace dawn_native::d3d12 { return uavDesc; } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/TextureD3D12.h b/src/dawn_native/d3d12/TextureD3D12.h index 9bc6cedda2..b7371dd303 100644 --- a/src/dawn_native/d3d12/TextureD3D12.h +++ b/src/dawn_native/d3d12/TextureD3D12.h @@ -24,7 +24,7 @@ #include "dawn_native/d3d12/ResourceHeapAllocationD3D12.h" #include "dawn_native/d3d12/d3d12_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class CommandRecordingContext; class Device; @@ -157,6 +157,6 @@ namespace dawn_native::d3d12 { D3D12_SHADER_RESOURCE_VIEW_DESC mSrvDesc; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_TEXTURED3D12_H_ diff --git a/src/dawn_native/d3d12/UtilsD3D12.cpp b/src/dawn_native/d3d12/UtilsD3D12.cpp index e19bebff4c..04be72b1fd 100644 --- a/src/dawn_native/d3d12/UtilsD3D12.cpp +++ b/src/dawn_native/d3d12/UtilsD3D12.cpp @@ -23,7 +23,7 @@ #include -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ResultOrError ConvertStringToWstring(const char* str) { size_t len = strlen(str); @@ -388,4 +388,4 @@ namespace dawn_native::d3d12 { object->SetPrivateData(WKPDID_D3DDebugObjectName, objectName.length(), objectName.c_str()); } -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 diff --git a/src/dawn_native/d3d12/UtilsD3D12.h b/src/dawn_native/d3d12/UtilsD3D12.h index 8e4520a379..dcfb5ae83a 100644 --- a/src/dawn_native/d3d12/UtilsD3D12.h +++ b/src/dawn_native/d3d12/UtilsD3D12.h @@ -22,7 +22,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { ResultOrError ConvertStringToWstring(const char* str); @@ -86,6 +86,6 @@ namespace dawn_native::d3d12 { const char* prefix, std::string label = ""); -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12_UTILSD3D12_H_ diff --git a/src/dawn_native/dawn_platform.h b/src/dawn_native/dawn_platform.h index de9ef50920..90e729ce29 100644 --- a/src/dawn_native/dawn_platform.h +++ b/src/dawn_native/dawn_platform.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { // kEnumCount is a constant specifying the number of enums in a WebGPU enum type, // if the enums are contiguous, making it suitable for iteration. @@ -57,6 +57,6 @@ namespace dawn_native { static constexpr wgpu::BufferBindingType kInternalStorageBufferBinding = static_cast(0xFFFFFFFF); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_DAWNPLATFORM_H_ diff --git a/src/dawn_native/metal/BackendMTL.h b/src/dawn_native/metal/BackendMTL.h index daa8ac2d43..da673357ee 100644 --- a/src/dawn_native/metal/BackendMTL.h +++ b/src/dawn_native/metal/BackendMTL.h @@ -17,7 +17,7 @@ #include "dawn_native/BackendConnection.h" -namespace dawn_native::metal { +namespace dawn::native::metal { class Backend : public BackendConnection { public: @@ -28,6 +28,6 @@ namespace dawn_native::metal { const AdapterDiscoveryOptionsBase* optionsBase) override; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_BACKENDMTL_H_ diff --git a/src/dawn_native/metal/BackendMTL.mm b/src/dawn_native/metal/BackendMTL.mm index fd5e5070d7..bc9c6fc759 100644 --- a/src/dawn_native/metal/BackendMTL.mm +++ b/src/dawn_native/metal/BackendMTL.mm @@ -31,7 +31,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { @@ -272,7 +272,7 @@ namespace dawn_native::metal { // AdapterBase Implementation bool SupportsExternalImages() const override { - // Via dawn_native::metal::WrapIOSurface + // Via dawn::native::metal::WrapIOSurface return true; } @@ -613,4 +613,4 @@ namespace dawn_native::metal { return new Backend(instance); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/BindGroupLayoutMTL.h b/src/dawn_native/metal/BindGroupLayoutMTL.h index 9b1771cba4..dc2566e107 100644 --- a/src/dawn_native/metal/BindGroupLayoutMTL.h +++ b/src/dawn_native/metal/BindGroupLayoutMTL.h @@ -18,7 +18,7 @@ #include "common/SlabAllocator.h" #include "dawn_native/BindGroupLayout.h" -namespace dawn_native::metal { +namespace dawn::native::metal { class BindGroup; class Device; @@ -41,6 +41,6 @@ namespace dawn_native::metal { SlabAllocator mBindGroupAllocator; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_BINDGROUPLAYOUTMTL_H_ diff --git a/src/dawn_native/metal/BindGroupLayoutMTL.mm b/src/dawn_native/metal/BindGroupLayoutMTL.mm index b3e7c35182..bfe6870b27 100644 --- a/src/dawn_native/metal/BindGroupLayoutMTL.mm +++ b/src/dawn_native/metal/BindGroupLayoutMTL.mm @@ -16,7 +16,7 @@ #include "dawn_native/metal/BindGroupMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { // static Ref BindGroupLayout::Create( @@ -42,4 +42,4 @@ namespace dawn_native::metal { mBindGroupAllocator.Deallocate(bindGroup); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/BindGroupMTL.h b/src/dawn_native/metal/BindGroupMTL.h index 09056641e2..c94a409683 100644 --- a/src/dawn_native/metal/BindGroupMTL.h +++ b/src/dawn_native/metal/BindGroupMTL.h @@ -18,7 +18,7 @@ #include "common/PlacementAllocated.h" #include "dawn_native/BindGroup.h" -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -34,6 +34,6 @@ namespace dawn_native::metal { void DestroyImpl() override; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_BINDGROUPMTL_H_ diff --git a/src/dawn_native/metal/BindGroupMTL.mm b/src/dawn_native/metal/BindGroupMTL.mm index c8673423ff..272703e897 100644 --- a/src/dawn_native/metal/BindGroupMTL.mm +++ b/src/dawn_native/metal/BindGroupMTL.mm @@ -16,7 +16,7 @@ #include "dawn_native/metal/BindGroupLayoutMTL.h" #include "dawn_native/metal/DeviceMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { BindGroup::BindGroup(Device* device, const BindGroupDescriptor* descriptor) : BindGroupBase(this, device, descriptor) { @@ -34,4 +34,4 @@ namespace dawn_native::metal { return ToBackend(descriptor->layout)->AllocateBindGroup(device, descriptor); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/BufferMTL.h b/src/dawn_native/metal/BufferMTL.h index 7b6c586f84..9397d69166 100644 --- a/src/dawn_native/metal/BufferMTL.h +++ b/src/dawn_native/metal/BufferMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class CommandRecordingContext; class Device; @@ -62,6 +62,6 @@ namespace dawn_native::metal { NSPRef> mMtlBuffer; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_BUFFERMTL_H_ diff --git a/src/dawn_native/metal/BufferMTL.mm b/src/dawn_native/metal/BufferMTL.mm index c3a4a98954..d40f883303 100644 --- a/src/dawn_native/metal/BufferMTL.mm +++ b/src/dawn_native/metal/BufferMTL.mm @@ -21,7 +21,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { // The size of uniform buffer and storage buffer need to be aligned to 16 bytes which is the // largest alignment of supported data types static constexpr uint32_t kMinUniformOrStorageBufferAlignment = 16u; @@ -237,4 +237,4 @@ namespace dawn_native::metal { value:clearValue]; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/CommandBufferMTL.h b/src/dawn_native/metal/CommandBufferMTL.h index eb236a9eb0..69427f4845 100644 --- a/src/dawn_native/metal/CommandBufferMTL.h +++ b/src/dawn_native/metal/CommandBufferMTL.h @@ -20,11 +20,11 @@ #import -namespace dawn_native { +namespace dawn::native { class CommandEncoder; } -namespace dawn_native::metal { +namespace dawn::native::metal { class CommandRecordingContext; class Device; @@ -64,6 +64,6 @@ namespace dawn_native::metal { uint32_t height); }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_COMMANDBUFFERMTL_H_ diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm index 11e655b7db..d353e99a69 100644 --- a/src/dawn_native/metal/CommandBufferMTL.mm +++ b/src/dawn_native/metal/CommandBufferMTL.mm @@ -34,7 +34,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { @@ -1564,4 +1564,4 @@ namespace dawn_native::metal { UNREACHABLE(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/CommandRecordingContext.h b/src/dawn_native/metal/CommandRecordingContext.h index 4caeb0f44e..662cdcd54c 100644 --- a/src/dawn_native/metal/CommandRecordingContext.h +++ b/src/dawn_native/metal/CommandRecordingContext.h @@ -20,7 +20,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { // This class wraps a MTLCommandBuffer and tracks which Metal encoder is open. // Only one encoder may be open at a time. @@ -54,6 +54,6 @@ namespace dawn_native::metal { bool mUsed = false; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_COMMANDRECORDINGCONTEXT_H_ diff --git a/src/dawn_native/metal/CommandRecordingContext.mm b/src/dawn_native/metal/CommandRecordingContext.mm index 95d7b2e481..4b3e158bc0 100644 --- a/src/dawn_native/metal/CommandRecordingContext.mm +++ b/src/dawn_native/metal/CommandRecordingContext.mm @@ -16,7 +16,7 @@ #include "common/Assert.h" -namespace dawn_native::metal { +namespace dawn::native::metal { CommandRecordingContext::CommandRecordingContext() = default; @@ -129,4 +129,4 @@ namespace dawn_native::metal { mInEncoder = false; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/ComputePipelineMTL.h b/src/dawn_native/metal/ComputePipelineMTL.h index 64e93560b8..b3f70d9912 100644 --- a/src/dawn_native/metal/ComputePipelineMTL.h +++ b/src/dawn_native/metal/ComputePipelineMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -48,6 +48,6 @@ namespace dawn_native::metal { std::vector mWorkgroupAllocations; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_COMPUTEPIPELINEMTL_H_ diff --git a/src/dawn_native/metal/ComputePipelineMTL.mm b/src/dawn_native/metal/ComputePipelineMTL.mm index 5041961e85..9f5255fded 100644 --- a/src/dawn_native/metal/ComputePipelineMTL.mm +++ b/src/dawn_native/metal/ComputePipelineMTL.mm @@ -19,7 +19,7 @@ #include "dawn_native/metal/ShaderModuleMTL.h" #include "dawn_native/metal/UtilsMetal.h" -namespace dawn_native::metal { +namespace dawn::native::metal { // static Ref ComputePipeline::CreateUninitialized( @@ -83,4 +83,4 @@ namespace dawn_native::metal { CreateComputePipelineAsyncTask::RunAsync(std::move(asyncTask)); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/DeviceMTL.h b/src/dawn_native/metal/DeviceMTL.h index 779b726051..f7817c4a76 100644 --- a/src/dawn_native/metal/DeviceMTL.h +++ b/src/dawn_native/metal/DeviceMTL.h @@ -30,7 +30,7 @@ #include #include -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { struct KalmanInfo; @@ -149,6 +149,6 @@ namespace dawn_native::metal { std::unique_ptr mKalmanInfo; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_DEVICEMTL_H_ diff --git a/src/dawn_native/metal/DeviceMTL.mm b/src/dawn_native/metal/DeviceMTL.mm index 978b2f64f1..c62417fef2 100644 --- a/src/dawn_native/metal/DeviceMTL.mm +++ b/src/dawn_native/metal/DeviceMTL.mm @@ -40,7 +40,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { @@ -503,4 +503,4 @@ namespace dawn_native::metal { return mTimestampPeriod; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/Forward.h b/src/dawn_native/metal/Forward.h index 5d590b1686..cfa2cac08a 100644 --- a/src/dawn_native/metal/Forward.h +++ b/src/dawn_native/metal/Forward.h @@ -17,7 +17,7 @@ #include "dawn_native/ToBackend.h" -namespace dawn_native::metal { +namespace dawn::native::metal { class Adapter; class BindGroup; @@ -63,6 +63,6 @@ namespace dawn_native::metal { return ToBackendBase(common); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_FORWARD_H_ diff --git a/src/dawn_native/metal/MetalBackend.mm b/src/dawn_native/metal/MetalBackend.mm index 928977464e..95174ebfb1 100644 --- a/src/dawn_native/metal/MetalBackend.mm +++ b/src/dawn_native/metal/MetalBackend.mm @@ -20,7 +20,7 @@ #include "dawn_native/metal/DeviceMTL.h" #include "dawn_native/metal/TextureMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { id GetMetalDevice(WGPUDevice device) { return ToBackend(FromAPI(device))->GetMTLDevice(); @@ -46,4 +46,4 @@ namespace dawn_native::metal { ToBackend(FromAPI(device))->WaitForCommandsToBeScheduled(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/PipelineLayoutMTL.h b/src/dawn_native/metal/PipelineLayoutMTL.h index 9aa4f7bc47..715da14adc 100644 --- a/src/dawn_native/metal/PipelineLayoutMTL.h +++ b/src/dawn_native/metal/PipelineLayoutMTL.h @@ -23,7 +23,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -57,6 +57,6 @@ namespace dawn_native::metal { PerStage mBufferBindingCount; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_PIPELINELAYOUTMTL_H_ diff --git a/src/dawn_native/metal/PipelineLayoutMTL.mm b/src/dawn_native/metal/PipelineLayoutMTL.mm index ac908ab49a..956ba58789 100644 --- a/src/dawn_native/metal/PipelineLayoutMTL.mm +++ b/src/dawn_native/metal/PipelineLayoutMTL.mm @@ -18,7 +18,7 @@ #include "dawn_native/BindGroupLayout.h" #include "dawn_native/metal/DeviceMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { // static Ref PipelineLayout::Create(Device* device, @@ -79,4 +79,4 @@ namespace dawn_native::metal { return mBufferBindingCount[stage]; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/QuerySetMTL.h b/src/dawn_native/metal/QuerySetMTL.h index 6bde84ff62..27ac10c01e 100644 --- a/src/dawn_native/metal/QuerySetMTL.h +++ b/src/dawn_native/metal/QuerySetMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -49,6 +49,6 @@ namespace dawn_native::metal { ios(14.0)) = nullptr; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_QUERYSETMTL_H_ diff --git a/src/dawn_native/metal/QuerySetMTL.mm b/src/dawn_native/metal/QuerySetMTL.mm index e92991ad19..ac732c8b7a 100644 --- a/src/dawn_native/metal/QuerySetMTL.mm +++ b/src/dawn_native/metal/QuerySetMTL.mm @@ -18,7 +18,7 @@ #include "common/Platform.h" #include "dawn_native/metal/DeviceMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { @@ -136,4 +136,4 @@ namespace dawn_native::metal { } } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/QueueMTL.h b/src/dawn_native/metal/QueueMTL.h index b608166b58..6df9801ded 100644 --- a/src/dawn_native/metal/QueueMTL.h +++ b/src/dawn_native/metal/QueueMTL.h @@ -17,7 +17,7 @@ #include "dawn_native/Queue.h" -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -29,6 +29,6 @@ namespace dawn_native::metal { MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_QUEUEMTL_H_ diff --git a/src/dawn_native/metal/QueueMTL.mm b/src/dawn_native/metal/QueueMTL.mm index 09cc2ffe99..09aadd63bd 100644 --- a/src/dawn_native/metal/QueueMTL.mm +++ b/src/dawn_native/metal/QueueMTL.mm @@ -24,7 +24,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" -namespace dawn_native::metal { +namespace dawn::native::metal { Queue::Queue(Device* device) : QueueBase(device) { } @@ -45,4 +45,4 @@ namespace dawn_native::metal { return device->SubmitPendingCommandBuffer(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/RenderPipelineMTL.h b/src/dawn_native/metal/RenderPipelineMTL.h index d4bc69c160..ca150f1c01 100644 --- a/src/dawn_native/metal/RenderPipelineMTL.h +++ b/src/dawn_native/metal/RenderPipelineMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -65,6 +65,6 @@ namespace dawn_native::metal { wgpu::ShaderStage mStagesRequiringStorageBufferLength = wgpu::ShaderStage::None; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_RENDERPIPELINEMTL_H_ diff --git a/src/dawn_native/metal/RenderPipelineMTL.mm b/src/dawn_native/metal/RenderPipelineMTL.mm index 74cf3bd7e8..695684c5e0 100644 --- a/src/dawn_native/metal/RenderPipelineMTL.mm +++ b/src/dawn_native/metal/RenderPipelineMTL.mm @@ -22,7 +22,7 @@ #include "dawn_native/metal/TextureMTL.h" #include "dawn_native/metal/UtilsMetal.h" -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { MTLVertexFormat VertexFormatType(wgpu::VertexFormat format) { @@ -503,4 +503,4 @@ namespace dawn_native::metal { CreateRenderPipelineAsyncTask::RunAsync(std::move(asyncTask)); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/SamplerMTL.h b/src/dawn_native/metal/SamplerMTL.h index 52c4ef09ae..a90f518b64 100644 --- a/src/dawn_native/metal/SamplerMTL.h +++ b/src/dawn_native/metal/SamplerMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -39,6 +39,6 @@ namespace dawn_native::metal { NSPRef> mMtlSamplerState; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_SAMPLERMTL_H_ diff --git a/src/dawn_native/metal/SamplerMTL.mm b/src/dawn_native/metal/SamplerMTL.mm index 809c79317d..ef9960c9bb 100644 --- a/src/dawn_native/metal/SamplerMTL.mm +++ b/src/dawn_native/metal/SamplerMTL.mm @@ -17,7 +17,7 @@ #include "dawn_native/metal/DeviceMTL.h" #include "dawn_native/metal/UtilsMetal.h" -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { MTLSamplerMinMagFilter FilterModeToMinMagFilter(wgpu::FilterMode mode) { @@ -103,4 +103,4 @@ namespace dawn_native::metal { return mMtlSamplerState.Get(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/ShaderModuleMTL.h b/src/dawn_native/metal/ShaderModuleMTL.h index 93800863e7..4bf201495a 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.h +++ b/src/dawn_native/metal/ShaderModuleMTL.h @@ -22,7 +22,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; class PipelineLayout; @@ -65,6 +65,6 @@ namespace dawn_native::metal { MaybeError Initialize(ShaderModuleParseResult* parseResult); }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_SHADERMODULEMTL_H_ diff --git a/src/dawn_native/metal/ShaderModuleMTL.mm b/src/dawn_native/metal/ShaderModuleMTL.mm index 79de704be1..c09720d206 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.mm +++ b/src/dawn_native/metal/ShaderModuleMTL.mm @@ -24,7 +24,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { // static ResultOrError> ShaderModule::Create(Device* device, @@ -257,4 +257,4 @@ namespace dawn_native::metal { return {}; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/StagingBufferMTL.h b/src/dawn_native/metal/StagingBufferMTL.h index c545b07e96..3b177f2523 100644 --- a/src/dawn_native/metal/StagingBufferMTL.h +++ b/src/dawn_native/metal/StagingBufferMTL.h @@ -21,7 +21,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; @@ -37,6 +37,6 @@ namespace dawn_native::metal { Device* mDevice; NSPRef> mBuffer; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_STAGINGBUFFERMETAL_H_ diff --git a/src/dawn_native/metal/StagingBufferMTL.mm b/src/dawn_native/metal/StagingBufferMTL.mm index 5ca18e5d81..6820e58571 100644 --- a/src/dawn_native/metal/StagingBufferMTL.mm +++ b/src/dawn_native/metal/StagingBufferMTL.mm @@ -15,7 +15,7 @@ #include "dawn_native/metal/StagingBufferMTL.h" #include "dawn_native/metal/DeviceMTL.h" -namespace dawn_native::metal { +namespace dawn::native::metal { StagingBuffer::StagingBuffer(size_t size, Device* device) : StagingBufferBase(size), mDevice(device) { @@ -43,4 +43,4 @@ namespace dawn_native::metal { return mBuffer.Get(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/SwapChainMTL.h b/src/dawn_native/metal/SwapChainMTL.h index 5513e4fb5f..ef173cbbb9 100644 --- a/src/dawn_native/metal/SwapChainMTL.h +++ b/src/dawn_native/metal/SwapChainMTL.h @@ -22,7 +22,7 @@ @class CAMetalLayer; @protocol CAMetalDrawable; -namespace dawn_native::metal { +namespace dawn::native::metal { class Device; class Texture; @@ -62,6 +62,6 @@ namespace dawn_native::metal { void DetachFromSurfaceImpl() override; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_SWAPCHAINMTL_H_ diff --git a/src/dawn_native/metal/SwapChainMTL.mm b/src/dawn_native/metal/SwapChainMTL.mm index 8ec989c04c..cc978d77d2 100644 --- a/src/dawn_native/metal/SwapChainMTL.mm +++ b/src/dawn_native/metal/SwapChainMTL.mm @@ -22,7 +22,7 @@ #import -namespace dawn_native::metal { +namespace dawn::native::metal { // OldSwapChain @@ -152,4 +152,4 @@ namespace dawn_native::metal { } } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/TextureMTL.h b/src/dawn_native/metal/TextureMTL.h index 185816783e..711f68349c 100644 --- a/src/dawn_native/metal/TextureMTL.h +++ b/src/dawn_native/metal/TextureMTL.h @@ -23,7 +23,7 @@ #include #import -namespace dawn_native::metal { +namespace dawn::native::metal { class CommandRecordingContext; class Device; @@ -91,6 +91,6 @@ namespace dawn_native::metal { NSPRef> mMtlTextureView; }; -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_TEXTUREMTL_H_ diff --git a/src/dawn_native/metal/TextureMTL.mm b/src/dawn_native/metal/TextureMTL.mm index c166f4f837..a3e9745e6e 100644 --- a/src/dawn_native/metal/TextureMTL.mm +++ b/src/dawn_native/metal/TextureMTL.mm @@ -25,7 +25,7 @@ #include -namespace dawn_native::metal { +namespace dawn::native::metal { namespace { bool UsageNeedsTextureView(wgpu::TextureUsage usage) { @@ -849,4 +849,4 @@ namespace dawn_native::metal { ASSERT(mMtlTextureView != nullptr); return mMtlTextureView.Get(); } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/metal/UtilsMetal.h b/src/dawn_native/metal/UtilsMetal.h index 8dfb7442cb..ef993a44b0 100644 --- a/src/dawn_native/metal/UtilsMetal.h +++ b/src/dawn_native/metal/UtilsMetal.h @@ -22,13 +22,13 @@ #import -namespace dawn_native { +namespace dawn::native { struct ProgrammableStage; struct EntryPointMetadata; enum class SingleShaderStage; } -namespace dawn_native::metal { +namespace dawn::native::metal { MTLCompareFunction ToMetalCompareFunction(wgpu::CompareFunction compareFunction); @@ -81,6 +81,6 @@ namespace dawn_native::metal { uint32_t sampleMask = 0xFFFFFFFF, const RenderPipeline* renderPipeline = nullptr); -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // DAWNNATIVE_METAL_UTILSMETAL_H_ diff --git a/src/dawn_native/metal/UtilsMetal.mm b/src/dawn_native/metal/UtilsMetal.mm index 8d163acc2d..084c6a60b8 100644 --- a/src/dawn_native/metal/UtilsMetal.mm +++ b/src/dawn_native/metal/UtilsMetal.mm @@ -19,7 +19,7 @@ #include "common/Assert.h" -namespace dawn_native::metal { +namespace dawn::native::metal { MTLCompareFunction ToMetalCompareFunction(wgpu::CompareFunction compareFunction) { switch (compareFunction) { @@ -287,4 +287,4 @@ namespace dawn_native::metal { return {}; } -} // namespace dawn_native::metal +} // namespace dawn::native::metal diff --git a/src/dawn_native/null/DeviceNull.cpp b/src/dawn_native/null/DeviceNull.cpp index 548426cd86..3259f44e35 100644 --- a/src/dawn_native/null/DeviceNull.cpp +++ b/src/dawn_native/null/DeviceNull.cpp @@ -20,7 +20,7 @@ #include "dawn_native/Instance.h" #include "dawn_native/Surface.h" -namespace dawn_native::null { +namespace dawn::native::null { // Implementation of pre-Device objects: the null adapter, null backend connection and Connect() @@ -517,4 +517,4 @@ namespace dawn_native::null { return 1.0f; } -} // namespace dawn_native::null +} // namespace dawn::native::null diff --git a/src/dawn_native/null/DeviceNull.h b/src/dawn_native/null/DeviceNull.h index b25de2694b..9052cfd456 100644 --- a/src/dawn_native/null/DeviceNull.h +++ b/src/dawn_native/null/DeviceNull.h @@ -36,7 +36,7 @@ #include "dawn_native/ToBackend.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native::null { +namespace dawn::native::null { class Adapter; class BindGroup; @@ -335,6 +335,6 @@ namespace dawn_native::null { std::unique_ptr mBuffer; }; -} // namespace dawn_native::null +} // namespace dawn::native::null #endif // DAWNNATIVE_NULL_DEVICENULL_H_ diff --git a/src/dawn_native/null/NullBackend.cpp b/src/dawn_native/null/NullBackend.cpp index 431e149d78..9e28695322 100644 --- a/src/dawn_native/null/NullBackend.cpp +++ b/src/dawn_native/null/NullBackend.cpp @@ -20,7 +20,7 @@ #include "common/SwapChainUtils.h" #include "dawn_native/null/DeviceNull.h" -namespace dawn_native::null { +namespace dawn::native::null { DawnSwapChainImplementation CreateNativeSwapChainImpl() { DawnSwapChainImplementation impl; @@ -29,4 +29,4 @@ namespace dawn_native::null { return impl; } -} // namespace dawn_native::null +} // namespace dawn::native::null diff --git a/src/dawn_native/opengl/BackendGL.cpp b/src/dawn_native/opengl/BackendGL.cpp index 7726ed2102..2d5901ee19 100644 --- a/src/dawn_native/opengl/BackendGL.cpp +++ b/src/dawn_native/opengl/BackendGL.cpp @@ -22,7 +22,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { @@ -132,7 +132,7 @@ namespace dawn_native::opengl { // AdapterBase Implementation bool SupportsExternalImages() const override { - // Via dawn_native::opengl::WrapExternalEGLImage + // Via dawn::native::opengl::WrapExternalEGLImage return GetBackendType() == wgpu::BackendType::OpenGLES; } @@ -242,7 +242,7 @@ namespace dawn_native::opengl { if (supportsS3TC && (supportsTextureSRGB || supportsS3TCSRGB) && supportsRGTC && supportsBPTC) { - mSupportedFeatures.EnableFeature(dawn_native::Feature::TextureCompressionBC); + mSupportedFeatures.EnableFeature(dawn::native::Feature::TextureCompressionBC); } } @@ -303,4 +303,4 @@ namespace dawn_native::opengl { return new Backend(instance, backendType); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/BackendGL.h b/src/dawn_native/opengl/BackendGL.h index 02db43f56d..9b925e44c2 100644 --- a/src/dawn_native/opengl/BackendGL.h +++ b/src/dawn_native/opengl/BackendGL.h @@ -17,7 +17,7 @@ #include "dawn_native/BackendConnection.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Backend : public BackendConnection { public: @@ -31,6 +31,6 @@ namespace dawn_native::opengl { bool mCreatedAdapter = false; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_BACKENDGL_H_ diff --git a/src/dawn_native/opengl/BindGroupGL.cpp b/src/dawn_native/opengl/BindGroupGL.cpp index 3c381f32f0..f4e4d1aece 100644 --- a/src/dawn_native/opengl/BindGroupGL.cpp +++ b/src/dawn_native/opengl/BindGroupGL.cpp @@ -18,7 +18,7 @@ #include "dawn_native/opengl/BindGroupLayoutGL.h" #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { MaybeError ValidateGLBindGroupDescriptor(const BindGroupDescriptor* descriptor) { const BindGroupLayoutBase::BindingMap& bindingMap = descriptor->layout->GetBindingMap(); @@ -62,4 +62,4 @@ namespace dawn_native::opengl { return ToBackend(descriptor->layout)->AllocateBindGroup(device, descriptor); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/BindGroupGL.h b/src/dawn_native/opengl/BindGroupGL.h index 6982c4916e..a4720489aa 100644 --- a/src/dawn_native/opengl/BindGroupGL.h +++ b/src/dawn_native/opengl/BindGroupGL.h @@ -18,7 +18,7 @@ #include "common/PlacementAllocated.h" #include "dawn_native/BindGroup.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -36,6 +36,6 @@ namespace dawn_native::opengl { void DestroyImpl() override; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_BINDGROUPGL_H_ diff --git a/src/dawn_native/opengl/BindGroupLayoutGL.cpp b/src/dawn_native/opengl/BindGroupLayoutGL.cpp index df28bc452b..bb14bec931 100644 --- a/src/dawn_native/opengl/BindGroupLayoutGL.cpp +++ b/src/dawn_native/opengl/BindGroupLayoutGL.cpp @@ -16,7 +16,7 @@ #include "dawn_native/opengl/BindGroupGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { BindGroupLayout::BindGroupLayout(DeviceBase* device, const BindGroupLayoutDescriptor* descriptor, @@ -34,4 +34,4 @@ namespace dawn_native::opengl { mBindGroupAllocator.Deallocate(bindGroup); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/BindGroupLayoutGL.h b/src/dawn_native/opengl/BindGroupLayoutGL.h index 7e1eb77a51..7e70eb0d00 100644 --- a/src/dawn_native/opengl/BindGroupLayoutGL.h +++ b/src/dawn_native/opengl/BindGroupLayoutGL.h @@ -18,7 +18,7 @@ #include "common/SlabAllocator.h" #include "dawn_native/BindGroupLayout.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class BindGroup; class Device; @@ -37,6 +37,6 @@ namespace dawn_native::opengl { SlabAllocator mBindGroupAllocator; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_BINDGROUPLAYOUTGL_H_ diff --git a/src/dawn_native/opengl/BufferGL.cpp b/src/dawn_native/opengl/BufferGL.cpp index 5e7458eaf2..294ea5ec7a 100644 --- a/src/dawn_native/opengl/BufferGL.cpp +++ b/src/dawn_native/opengl/BufferGL.cpp @@ -17,7 +17,7 @@ #include "dawn_native/CommandBuffer.h" #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { // Buffer @@ -181,4 +181,4 @@ namespace dawn_native::opengl { mBuffer = 0; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/BufferGL.h b/src/dawn_native/opengl/BufferGL.h index 32cf277139..ef81ba789d 100644 --- a/src/dawn_native/opengl/BufferGL.h +++ b/src/dawn_native/opengl/BufferGL.h @@ -19,7 +19,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -53,6 +53,6 @@ namespace dawn_native::opengl { void* mMappedData = nullptr; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_BUFFERGL_H_ diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp index ac1fa15e0b..2601d613dd 100644 --- a/src/dawn_native/opengl/CommandBufferGL.cpp +++ b/src/dawn_native/opengl/CommandBufferGL.cpp @@ -34,7 +34,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { @@ -1488,4 +1488,4 @@ namespace dawn_native::opengl { } } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/CommandBufferGL.h b/src/dawn_native/opengl/CommandBufferGL.h index 0fd222bbfb..2caf707da1 100644 --- a/src/dawn_native/opengl/CommandBufferGL.h +++ b/src/dawn_native/opengl/CommandBufferGL.h @@ -17,11 +17,11 @@ #include "dawn_native/CommandBuffer.h" -namespace dawn_native { +namespace dawn::native { struct BeginRenderPassCmd; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; struct OpenGLFunctions; @@ -44,6 +44,6 @@ namespace dawn_native::opengl { const void* data, const TextureDataLayout& dataLayout, const Extent3D& copySize); -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_COMMANDBUFFERGL_H_ diff --git a/src/dawn_native/opengl/ComputePipelineGL.cpp b/src/dawn_native/opengl/ComputePipelineGL.cpp index 0c93f2919f..513972efbc 100644 --- a/src/dawn_native/opengl/ComputePipelineGL.cpp +++ b/src/dawn_native/opengl/ComputePipelineGL.cpp @@ -16,7 +16,7 @@ #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { // static Ref ComputePipeline::CreateUninitialized( @@ -42,4 +42,4 @@ namespace dawn_native::opengl { PipelineGL::ApplyNow(ToBackend(GetDevice())->gl); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/ComputePipelineGL.h b/src/dawn_native/opengl/ComputePipelineGL.h index 060bd65825..61b9ac3253 100644 --- a/src/dawn_native/opengl/ComputePipelineGL.h +++ b/src/dawn_native/opengl/ComputePipelineGL.h @@ -21,7 +21,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -41,6 +41,6 @@ namespace dawn_native::opengl { void DestroyImpl() override; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_COMPUTEPIPELINEGL_H_ diff --git a/src/dawn_native/opengl/DeviceGL.cpp b/src/dawn_native/opengl/DeviceGL.cpp index a562cc6419..438cb45bc5 100644 --- a/src/dawn_native/opengl/DeviceGL.cpp +++ b/src/dawn_native/opengl/DeviceGL.cpp @@ -32,7 +32,7 @@ #include "dawn_native/opengl/SwapChainGL.h" #include "dawn_native/opengl/TextureGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { // static ResultOrError> Device::Create(AdapterBase* adapter, @@ -312,4 +312,4 @@ namespace dawn_native::opengl { return 1.0f; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/DeviceGL.h b/src/dawn_native/opengl/DeviceGL.h index 66cd7855fc..a0aa597784 100644 --- a/src/dawn_native/opengl/DeviceGL.h +++ b/src/dawn_native/opengl/DeviceGL.h @@ -33,7 +33,7 @@ typedef void* EGLImage; -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device final : public DeviceBase { public: @@ -126,6 +126,6 @@ namespace dawn_native::opengl { GLFormatTable mFormatTable; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_DEVICEGL_H_ diff --git a/src/dawn_native/opengl/Forward.h b/src/dawn_native/opengl/Forward.h index fcf6d2c18c..066bd2e429 100644 --- a/src/dawn_native/opengl/Forward.h +++ b/src/dawn_native/opengl/Forward.h @@ -17,7 +17,7 @@ #include "dawn_native/ToBackend.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Adapter; class BindGroup; @@ -61,6 +61,6 @@ namespace dawn_native::opengl { return ToBackendBase(common); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_FORWARD_H_ diff --git a/src/dawn_native/opengl/GLFormat.cpp b/src/dawn_native/opengl/GLFormat.cpp index 4bab9e2f13..cc2cf49e40 100644 --- a/src/dawn_native/opengl/GLFormat.cpp +++ b/src/dawn_native/opengl/GLFormat.cpp @@ -14,7 +14,7 @@ #include "dawn_native/opengl/GLFormat.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { GLFormatTable BuildGLFormatTable() { GLFormatTable table; @@ -117,4 +117,4 @@ namespace dawn_native::opengl { return table; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/GLFormat.h b/src/dawn_native/opengl/GLFormat.h index b04fa5eb1e..a6c33328b0 100644 --- a/src/dawn_native/opengl/GLFormat.h +++ b/src/dawn_native/opengl/GLFormat.h @@ -18,7 +18,7 @@ #include "dawn_native/Format.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -37,6 +37,6 @@ namespace dawn_native::opengl { using GLFormatTable = std::array; GLFormatTable BuildGLFormatTable(); -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_GLFORMAT_H_ diff --git a/src/dawn_native/opengl/NativeSwapChainImplGL.cpp b/src/dawn_native/opengl/NativeSwapChainImplGL.cpp index 03c9eb09e5..178e5d6dd5 100644 --- a/src/dawn_native/opengl/NativeSwapChainImplGL.cpp +++ b/src/dawn_native/opengl/NativeSwapChainImplGL.cpp @@ -16,7 +16,7 @@ #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { NativeSwapChainImpl::NativeSwapChainImpl(Device* device, PresentCallback present, @@ -85,4 +85,4 @@ namespace dawn_native::opengl { return wgpu::TextureFormat::RGBA8Unorm; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/NativeSwapChainImplGL.h b/src/dawn_native/opengl/NativeSwapChainImplGL.h index ddf2b26bbd..56a25ecdbe 100644 --- a/src/dawn_native/opengl/NativeSwapChainImplGL.h +++ b/src/dawn_native/opengl/NativeSwapChainImplGL.h @@ -20,7 +20,7 @@ #include "dawn_native/dawn_platform.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -53,6 +53,6 @@ namespace dawn_native::opengl { Device* mDevice = nullptr; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_NATIVESWAPCHAINIMPLGL_H_ diff --git a/src/dawn_native/opengl/OpenGLBackend.cpp b/src/dawn_native/opengl/OpenGLBackend.cpp index ca46537ff3..727e36a48f 100644 --- a/src/dawn_native/opengl/OpenGLBackend.cpp +++ b/src/dawn_native/opengl/OpenGLBackend.cpp @@ -21,7 +21,7 @@ #include "dawn_native/opengl/DeviceGL.h" #include "dawn_native/opengl/NativeSwapChainImplGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { AdapterDiscoveryOptions::AdapterDiscoveryOptions() : AdapterDiscoveryOptionsBase(WGPUBackendType_OpenGL) { @@ -62,4 +62,4 @@ namespace dawn_native::opengl { return ToAPI(texture); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/OpenGLFunctions.cpp b/src/dawn_native/opengl/OpenGLFunctions.cpp index 05e5014f3c..d0d2e50cff 100644 --- a/src/dawn_native/opengl/OpenGLFunctions.cpp +++ b/src/dawn_native/opengl/OpenGLFunctions.cpp @@ -16,7 +16,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { MaybeError OpenGLFunctions::Initialize(GetProcAddress getProc) { DAWN_TRY(mVersion.Initialize(getProc)); @@ -58,4 +58,4 @@ namespace dawn_native::opengl { return mVersion.IsES() && mVersion.IsAtLeast(majorVersion, minorVersion); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/OpenGLFunctions.h b/src/dawn_native/opengl/OpenGLFunctions.h index ff728a6243..6b867357d9 100644 --- a/src/dawn_native/opengl/OpenGLFunctions.h +++ b/src/dawn_native/opengl/OpenGLFunctions.h @@ -20,7 +20,7 @@ #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" #include "dawn_native/opengl/OpenGLVersion.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { struct OpenGLFunctions : OpenGLFunctionsBase { public: @@ -40,6 +40,6 @@ namespace dawn_native::opengl { std::unordered_set mSupportedGLExtensionsSet; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_OPENGLFUNCTIONS_H_ diff --git a/src/dawn_native/opengl/OpenGLVersion.cpp b/src/dawn_native/opengl/OpenGLVersion.cpp index a97ba5d1f7..2c3eb8c989 100644 --- a/src/dawn_native/opengl/OpenGLVersion.cpp +++ b/src/dawn_native/opengl/OpenGLVersion.cpp @@ -17,7 +17,7 @@ #include #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { MaybeError OpenGLVersion::Initialize(GetProcAddress getProc) { PFNGLGETSTRINGPROC getString = reinterpret_cast(getProc("glGetString")); @@ -73,4 +73,4 @@ namespace dawn_native::opengl { return std::tie(mMajorVersion, mMinorVersion) >= std::tie(majorVersion, minorVersion); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/OpenGLVersion.h b/src/dawn_native/opengl/OpenGLVersion.h index 295e771cd7..d489daed0c 100644 --- a/src/dawn_native/opengl/OpenGLVersion.h +++ b/src/dawn_native/opengl/OpenGLVersion.h @@ -17,7 +17,7 @@ #include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { struct OpenGLVersion { public: @@ -39,6 +39,6 @@ namespace dawn_native::opengl { Standard mStandard; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_OPENGLVERSION_H_ diff --git a/src/dawn_native/opengl/PersistentPipelineStateGL.cpp b/src/dawn_native/opengl/PersistentPipelineStateGL.cpp index edbffd002f..41daac55cb 100644 --- a/src/dawn_native/opengl/PersistentPipelineStateGL.cpp +++ b/src/dawn_native/opengl/PersistentPipelineStateGL.cpp @@ -16,7 +16,7 @@ #include "dawn_native/opengl/OpenGLFunctions.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { void PersistentPipelineState::SetDefaultState(const OpenGLFunctions& gl) { CallGLStencilFunc(gl); @@ -55,4 +55,4 @@ namespace dawn_native::opengl { mStencilReadMask); } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/PersistentPipelineStateGL.h b/src/dawn_native/opengl/PersistentPipelineStateGL.h index 553d07a60d..e17e060ddc 100644 --- a/src/dawn_native/opengl/PersistentPipelineStateGL.h +++ b/src/dawn_native/opengl/PersistentPipelineStateGL.h @@ -18,7 +18,7 @@ #include "dawn_native/dawn_platform.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { struct OpenGLFunctions; @@ -40,6 +40,6 @@ namespace dawn_native::opengl { GLuint mStencilReference = 0; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_PERSISTENTPIPELINESTATEGL_H_ diff --git a/src/dawn_native/opengl/PipelineGL.cpp b/src/dawn_native/opengl/PipelineGL.cpp index 21f522c4b4..80d1bf8fee 100644 --- a/src/dawn_native/opengl/PipelineGL.cpp +++ b/src/dawn_native/opengl/PipelineGL.cpp @@ -27,7 +27,7 @@ #include #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { @@ -215,4 +215,4 @@ namespace dawn_native::opengl { } } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/PipelineGL.h b/src/dawn_native/opengl/PipelineGL.h index 6199e6ecff..7aef649cb8 100644 --- a/src/dawn_native/opengl/PipelineGL.h +++ b/src/dawn_native/opengl/PipelineGL.h @@ -22,11 +22,11 @@ #include -namespace dawn_native { +namespace dawn::native { struct ProgrammableStage; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::opengl { +namespace dawn::native::opengl { struct OpenGLFunctions; class PipelineLayout; @@ -64,6 +64,6 @@ namespace dawn_native::opengl { Ref mDummySampler; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_PIPELINEGL_H_ diff --git a/src/dawn_native/opengl/PipelineLayoutGL.cpp b/src/dawn_native/opengl/PipelineLayoutGL.cpp index 9c8fffaff4..eb61df869b 100644 --- a/src/dawn_native/opengl/PipelineLayoutGL.cpp +++ b/src/dawn_native/opengl/PipelineLayoutGL.cpp @@ -18,7 +18,7 @@ #include "dawn_native/BindGroupLayout.h" #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { PipelineLayout::PipelineLayout(Device* device, const PipelineLayoutDescriptor* descriptor) : PipelineLayoutBase(device, descriptor) { @@ -92,4 +92,4 @@ namespace dawn_native::opengl { return mNumSampledTextures; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/PipelineLayoutGL.h b/src/dawn_native/opengl/PipelineLayoutGL.h index 2386fe23b9..3348770a73 100644 --- a/src/dawn_native/opengl/PipelineLayoutGL.h +++ b/src/dawn_native/opengl/PipelineLayoutGL.h @@ -22,7 +22,7 @@ #include "dawn_native/BindingInfo.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -45,6 +45,6 @@ namespace dawn_native::opengl { size_t mNumSampledTextures; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_PIPELINELAYOUTGL_H_ diff --git a/src/dawn_native/opengl/QuerySetGL.cpp b/src/dawn_native/opengl/QuerySetGL.cpp index 3d701d4cf6..8b41cc8b33 100644 --- a/src/dawn_native/opengl/QuerySetGL.cpp +++ b/src/dawn_native/opengl/QuerySetGL.cpp @@ -16,7 +16,7 @@ #include "dawn_native/opengl/DeviceGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { QuerySet::QuerySet(Device* device, const QuerySetDescriptor* descriptor) : QuerySetBase(device, descriptor) { @@ -24,4 +24,4 @@ namespace dawn_native::opengl { QuerySet::~QuerySet() = default; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/QuerySetGL.h b/src/dawn_native/opengl/QuerySetGL.h index 0a39e8b206..adfa039979 100644 --- a/src/dawn_native/opengl/QuerySetGL.h +++ b/src/dawn_native/opengl/QuerySetGL.h @@ -17,7 +17,7 @@ #include "dawn_native/QuerySet.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -29,6 +29,6 @@ namespace dawn_native::opengl { ~QuerySet() override; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_QUERYSETGL_H_ diff --git a/src/dawn_native/opengl/QueueGL.cpp b/src/dawn_native/opengl/QueueGL.cpp index c9ecbb02b6..6bba686716 100644 --- a/src/dawn_native/opengl/QueueGL.cpp +++ b/src/dawn_native/opengl/QueueGL.cpp @@ -21,7 +21,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { Queue::Queue(Device* device) : QueueBase(device) { } @@ -77,4 +77,4 @@ namespace dawn_native::opengl { return {}; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/QueueGL.h b/src/dawn_native/opengl/QueueGL.h index 2534297761..f0d997da46 100644 --- a/src/dawn_native/opengl/QueueGL.h +++ b/src/dawn_native/opengl/QueueGL.h @@ -17,7 +17,7 @@ #include "dawn_native/Queue.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -37,6 +37,6 @@ namespace dawn_native::opengl { const Extent3D& writeSizePixel) override; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_QUEUEGL_H_ diff --git a/src/dawn_native/opengl/RenderPipelineGL.cpp b/src/dawn_native/opengl/RenderPipelineGL.cpp index fe04fcd8f1..26b8521389 100644 --- a/src/dawn_native/opengl/RenderPipelineGL.cpp +++ b/src/dawn_native/opengl/RenderPipelineGL.cpp @@ -19,7 +19,7 @@ #include "dawn_native/opengl/PersistentPipelineStateGL.h" #include "dawn_native/opengl/UtilsGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { @@ -342,4 +342,4 @@ namespace dawn_native::opengl { } } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/RenderPipelineGL.h b/src/dawn_native/opengl/RenderPipelineGL.h index 44d01a5404..6c49143bea 100644 --- a/src/dawn_native/opengl/RenderPipelineGL.h +++ b/src/dawn_native/opengl/RenderPipelineGL.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; class PersistentPipelineState; @@ -57,6 +57,6 @@ namespace dawn_native::opengl { mAttributesUsingVertexBuffer; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_RENDERPIPELINEGL_H_ diff --git a/src/dawn_native/opengl/SamplerGL.cpp b/src/dawn_native/opengl/SamplerGL.cpp index 9e5435c01c..942fd8020c 100644 --- a/src/dawn_native/opengl/SamplerGL.cpp +++ b/src/dawn_native/opengl/SamplerGL.cpp @@ -18,7 +18,7 @@ #include "dawn_native/opengl/DeviceGL.h" #include "dawn_native/opengl/UtilsGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { GLenum MagFilterMode(wgpu::FilterMode filter) { @@ -127,4 +127,4 @@ namespace dawn_native::opengl { return mNonFilteringHandle; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/SamplerGL.h b/src/dawn_native/opengl/SamplerGL.h index f8b21b9521..1e5c597351 100644 --- a/src/dawn_native/opengl/SamplerGL.h +++ b/src/dawn_native/opengl/SamplerGL.h @@ -19,7 +19,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -43,6 +43,6 @@ namespace dawn_native::opengl { GLuint mNonFilteringHandle; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_SAMPLERGL_H_ diff --git a/src/dawn_native/opengl/ShaderModuleGL.cpp b/src/dawn_native/opengl/ShaderModuleGL.cpp index 6517502dcf..fef2671c58 100644 --- a/src/dawn_native/opengl/ShaderModuleGL.cpp +++ b/src/dawn_native/opengl/ShaderModuleGL.cpp @@ -34,7 +34,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { std::string GetBindingName(BindGroupIndex group, BindingNumber bindingNumber) { std::ostringstream o; @@ -397,4 +397,4 @@ namespace dawn_native::opengl { return glsl; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/ShaderModuleGL.h b/src/dawn_native/opengl/ShaderModuleGL.h index f3d5462ba8..6cadf82e6e 100644 --- a/src/dawn_native/opengl/ShaderModuleGL.h +++ b/src/dawn_native/opengl/ShaderModuleGL.h @@ -19,7 +19,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; class PipelineLayout; @@ -70,6 +70,6 @@ namespace dawn_native::opengl { BindingInfoArrayTable mGLBindings; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_SHADERMODULEGL_H_ diff --git a/src/dawn_native/opengl/SpirvUtils.cpp b/src/dawn_native/opengl/SpirvUtils.cpp index 6ce41ca7be..2864791f3d 100644 --- a/src/dawn_native/opengl/SpirvUtils.cpp +++ b/src/dawn_native/opengl/SpirvUtils.cpp @@ -14,7 +14,7 @@ #include "dawn_native/opengl/SpirvUtils.h" -namespace dawn_native { +namespace dawn::native { spv::ExecutionModel ShaderStageToExecutionModel(SingleShaderStage stage) { switch (stage) { @@ -176,4 +176,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/opengl/SpirvUtils.h b/src/dawn_native/opengl/SpirvUtils.h index 844b0b7009..15ea9c5255 100644 --- a/src/dawn_native/opengl/SpirvUtils.h +++ b/src/dawn_native/opengl/SpirvUtils.h @@ -25,7 +25,7 @@ #include -namespace dawn_native { +namespace dawn::native { // Returns the spirv_cross equivalent for this shader stage and vice-versa. spv::ExecutionModel ShaderStageToExecutionModel(SingleShaderStage stage); @@ -46,6 +46,6 @@ namespace dawn_native { VertexFormatBaseType SpirvBaseTypeToVertexFormatBaseType( spirv_cross::SPIRType::BaseType spirvBaseType); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_OPENGL_SPIRV_UTILS_H_ diff --git a/src/dawn_native/opengl/SwapChainGL.cpp b/src/dawn_native/opengl/SwapChainGL.cpp index f8043a435c..551569cad9 100644 --- a/src/dawn_native/opengl/SwapChainGL.cpp +++ b/src/dawn_native/opengl/SwapChainGL.cpp @@ -20,7 +20,7 @@ #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { SwapChain::SwapChain(Device* device, const SwapChainDescriptor* descriptor) : OldSwapChainBase(device, descriptor) { @@ -48,4 +48,4 @@ namespace dawn_native::opengl { return {}; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/SwapChainGL.h b/src/dawn_native/opengl/SwapChainGL.h index 18689729c0..d0dda2d65c 100644 --- a/src/dawn_native/opengl/SwapChainGL.h +++ b/src/dawn_native/opengl/SwapChainGL.h @@ -19,7 +19,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; @@ -33,6 +33,6 @@ namespace dawn_native::opengl { MaybeError OnBeforePresent(TextureViewBase* view) override; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_SWAPCHAINGL_H_ diff --git a/src/dawn_native/opengl/TextureGL.cpp b/src/dawn_native/opengl/TextureGL.cpp index 7c7cb9fcaf..225fd9c4e3 100644 --- a/src/dawn_native/opengl/TextureGL.cpp +++ b/src/dawn_native/opengl/TextureGL.cpp @@ -23,7 +23,7 @@ #include "dawn_native/opengl/DeviceGL.h" #include "dawn_native/opengl/UtilsGL.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { namespace { @@ -467,7 +467,7 @@ namespace dawn_native::opengl { } size_t bufferSize = static_cast(bufferSize64); - dawn_native::BufferDescriptor descriptor = {}; + dawn::native::BufferDescriptor descriptor = {}; descriptor.mappedAtCreation = true; descriptor.usage = wgpu::BufferUsage::CopySrc; descriptor.size = bufferSize; @@ -577,4 +577,4 @@ namespace dawn_native::opengl { return mTarget; } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/TextureGL.h b/src/dawn_native/opengl/TextureGL.h index f6deaf5ab9..729df6023b 100644 --- a/src/dawn_native/opengl/TextureGL.h +++ b/src/dawn_native/opengl/TextureGL.h @@ -19,7 +19,7 @@ #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { class Device; struct GLFormat; @@ -64,6 +64,6 @@ namespace dawn_native::opengl { bool mOwnsHandle; }; -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_TEXTUREGL_H_ diff --git a/src/dawn_native/opengl/UtilsGL.cpp b/src/dawn_native/opengl/UtilsGL.cpp index 1dd7a69d53..a16cc4c87f 100644 --- a/src/dawn_native/opengl/UtilsGL.cpp +++ b/src/dawn_native/opengl/UtilsGL.cpp @@ -16,7 +16,7 @@ #include "common/Assert.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { GLuint ToOpenGLCompareFunction(wgpu::CompareFunction compareFunction) { switch (compareFunction) { @@ -52,4 +52,4 @@ namespace dawn_native::opengl { UNREACHABLE(); } } -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl diff --git a/src/dawn_native/opengl/UtilsGL.h b/src/dawn_native/opengl/UtilsGL.h index fe8a940fca..cd57a9e60a 100644 --- a/src/dawn_native/opengl/UtilsGL.h +++ b/src/dawn_native/opengl/UtilsGL.h @@ -18,10 +18,10 @@ #include "dawn_native/dawn_platform.h" #include "dawn_native/opengl/opengl_platform.h" -namespace dawn_native::opengl { +namespace dawn::native::opengl { GLuint ToOpenGLCompareFunction(wgpu::CompareFunction compareFunction); GLint GetStencilMaskFromStencilFormat(wgpu::TextureFormat depthStencilFormat); -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGL_UTILSGL_H_ diff --git a/src/dawn_native/utils/WGPUHelpers.cpp b/src/dawn_native/utils/WGPUHelpers.cpp index 3fb0549fc4..707166130c 100644 --- a/src/dawn_native/utils/WGPUHelpers.cpp +++ b/src/dawn_native/utils/WGPUHelpers.cpp @@ -31,7 +31,7 @@ #include #include -namespace dawn_native::utils { +namespace dawn::native::utils { ResultOrError> CreateShaderModule(DeviceBase* device, const char* source) { @@ -189,4 +189,4 @@ namespace dawn_native::utils { return (label == nullptr || strlen(label) == 0) ? "None" : label; } -} // namespace dawn_native::utils +} // namespace dawn::native::utils diff --git a/src/dawn_native/utils/WGPUHelpers.h b/src/dawn_native/utils/WGPUHelpers.h index 0077059df5..8335d72e14 100644 --- a/src/dawn_native/utils/WGPUHelpers.h +++ b/src/dawn_native/utils/WGPUHelpers.h @@ -24,7 +24,7 @@ #include "common/RefCounted.h" #include "dawn_native/Error.h" -namespace dawn_native::utils { +namespace dawn::native::utils { ResultOrError> CreateShaderModule(DeviceBase* device, const char* source); @@ -118,6 +118,6 @@ namespace dawn_native::utils { const char* GetLabelForTrace(const char* label); -} // namespace dawn_native::utils +} // namespace dawn::native::utils #endif // DAWNNATIVE_UTILS_WGPUHELPERS_H_ \ No newline at end of file diff --git a/src/dawn_native/vulkan/AdapterVk.cpp b/src/dawn_native/vulkan/AdapterVk.cpp index 9ac789edf0..76c2033f64 100644 --- a/src/dawn_native/vulkan/AdapterVk.cpp +++ b/src/dawn_native/vulkan/AdapterVk.cpp @@ -20,7 +20,7 @@ #include "common/GPUInfo.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { Adapter::Adapter(InstanceBase* instance, VulkanInstance* vulkanInstance, @@ -340,7 +340,7 @@ namespace dawn_native::vulkan { } bool Adapter::SupportsExternalImages() const { - // Via dawn_native::vulkan::WrapVulkanImage + // Via dawn::native::vulkan::WrapVulkanImage return external_memory::Service::CheckSupport(mDeviceInfo) && external_semaphore::Service::CheckSupport(mDeviceInfo, mPhysicalDevice, mVulkanInstance->GetFunctions()); @@ -350,4 +350,4 @@ namespace dawn_native::vulkan { return Device::Create(this, descriptor); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/AdapterVk.h b/src/dawn_native/vulkan/AdapterVk.h index c61b70e3bd..700c09eed2 100644 --- a/src/dawn_native/vulkan/AdapterVk.h +++ b/src/dawn_native/vulkan/AdapterVk.h @@ -21,7 +21,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/vulkan/VulkanInfo.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class VulkanInstance; @@ -54,6 +54,6 @@ namespace dawn_native::vulkan { VulkanDeviceInfo mDeviceInfo = {}; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_ADAPTERVK_H_ diff --git a/src/dawn_native/vulkan/BackendVk.cpp b/src/dawn_native/vulkan/BackendVk.cpp index 24340b4b82..4378413e25 100644 --- a/src/dawn_native/vulkan/BackendVk.cpp +++ b/src/dawn_native/vulkan/BackendVk.cpp @@ -77,7 +77,7 @@ constexpr SkippedMessage kSkippedMessages[] = { "SYNC_FRAGMENT_SHADER_SHADER_STORAGE_READ, read_barriers: VK_PIPELINE_STAGE_2_NONE_KHR, "}, }; -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -444,4 +444,4 @@ namespace dawn_native::vulkan { return new Backend(instance); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/BackendVk.h b/src/dawn_native/vulkan/BackendVk.h index 2532e91110..dd4a5da66d 100644 --- a/src/dawn_native/vulkan/BackendVk.h +++ b/src/dawn_native/vulkan/BackendVk.h @@ -23,7 +23,7 @@ #include "dawn_native/vulkan/VulkanFunctions.h" #include "dawn_native/vulkan/VulkanInfo.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { enum class ICD { None, @@ -81,6 +81,6 @@ namespace dawn_native::vulkan { ityp::array, 2> mVulkanInstances = {}; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_BACKENDVK_H_ diff --git a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp index 264188755a..695301ec0a 100644 --- a/src/dawn_native/vulkan/BindGroupLayoutVk.cpp +++ b/src/dawn_native/vulkan/BindGroupLayoutVk.cpp @@ -25,7 +25,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -196,4 +196,4 @@ namespace dawn_native::vulkan { reinterpret_cast(mHandle), "Dawn_BindGroupLayout", GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/BindGroupLayoutVk.h b/src/dawn_native/vulkan/BindGroupLayoutVk.h index c144562876..7ec7f0880c 100644 --- a/src/dawn_native/vulkan/BindGroupLayoutVk.h +++ b/src/dawn_native/vulkan/BindGroupLayoutVk.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class BindGroup; struct DescriptorSetAllocation; @@ -75,6 +75,6 @@ namespace dawn_native::vulkan { Ref mDescriptorSetAllocator; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_BINDGROUPLAYOUTVK_H_ diff --git a/src/dawn_native/vulkan/BindGroupVk.cpp b/src/dawn_native/vulkan/BindGroupVk.cpp index b415685b1f..fca8d88869 100644 --- a/src/dawn_native/vulkan/BindGroupVk.cpp +++ b/src/dawn_native/vulkan/BindGroupVk.cpp @@ -26,7 +26,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // static ResultOrError> BindGroup::Create(Device* device, @@ -131,7 +131,7 @@ namespace dawn_native::vulkan { } case BindingInfoType::ExternalTexture: { - const std::array, kMaxPlanesPerFormat>& + const std::array, kMaxPlanesPerFormat>& textureViews = GetBindingAsExternalTexture(bindingIndex)->GetTextureViews(); // Only single-plane formats are supported right now, so ensure only one view @@ -177,4 +177,4 @@ namespace dawn_native::vulkan { GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/BindGroupVk.h b/src/dawn_native/vulkan/BindGroupVk.h index 95d2be0f8f..6c85a85d71 100644 --- a/src/dawn_native/vulkan/BindGroupVk.h +++ b/src/dawn_native/vulkan/BindGroupVk.h @@ -22,7 +22,7 @@ #include "dawn_native/vulkan/BindGroupLayoutVk.h" #include "dawn_native/vulkan/DescriptorSetAllocation.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -50,6 +50,6 @@ namespace dawn_native::vulkan { DescriptorSetAllocation mDescriptorSetAllocation; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_BINDGROUPVK_H_ diff --git a/src/dawn_native/vulkan/BufferVk.cpp b/src/dawn_native/vulkan/BufferVk.cpp index 8331dd2b00..794f226912 100644 --- a/src/dawn_native/vulkan/BufferVk.cpp +++ b/src/dawn_native/vulkan/BufferVk.cpp @@ -24,7 +24,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -410,4 +410,4 @@ namespace dawn_native::vulkan { device->fn.CmdFillBuffer(recordingContext->commandBuffer, mHandle, offset, size, clearValue); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/BufferVk.h b/src/dawn_native/vulkan/BufferVk.h index 6dfe3c0aa8..7c316923d2 100644 --- a/src/dawn_native/vulkan/BufferVk.h +++ b/src/dawn_native/vulkan/BufferVk.h @@ -21,7 +21,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/ResourceMemoryAllocation.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { struct CommandRecordingContext; class Device; @@ -77,6 +77,6 @@ namespace dawn_native::vulkan { wgpu::BufferUsage mLastUsage = wgpu::BufferUsage::None; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_BUFFERVK_H_ diff --git a/src/dawn_native/vulkan/CommandBufferVk.cpp b/src/dawn_native/vulkan/CommandBufferVk.cpp index 8d73790032..1783ffdd77 100644 --- a/src/dawn_native/vulkan/CommandBufferVk.cpp +++ b/src/dawn_native/vulkan/CommandBufferVk.cpp @@ -38,7 +38,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -444,7 +444,7 @@ namespace dawn_native::vulkan { const Extent3D& copySize) { ASSERT(srcCopy.texture->GetFormat().format == dstCopy.texture->GetFormat().format); ASSERT(srcCopy.aspect == dstCopy.aspect); - dawn_native::Format format = srcCopy.texture->GetFormat(); + dawn::native::Format format = srcCopy.texture->GetFormat(); const TexelBlockInfo& blockInfo = format.GetAspectInfo(srcCopy.aspect).block; ASSERT(copySize.width % blockInfo.width == 0); uint32_t widthInBlocks = copySize.width / blockInfo.width; @@ -1321,4 +1321,4 @@ namespace dawn_native::vulkan { UNREACHABLE(); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/CommandBufferVk.h b/src/dawn_native/vulkan/CommandBufferVk.h index 53d604e1ff..a9a6b4680e 100644 --- a/src/dawn_native/vulkan/CommandBufferVk.h +++ b/src/dawn_native/vulkan/CommandBufferVk.h @@ -20,12 +20,12 @@ #include "common/vulkan_platform.h" -namespace dawn_native { +namespace dawn::native { struct BeginRenderPassCmd; struct TextureCopy; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { struct CommandRecordingContext; class Device; @@ -50,6 +50,6 @@ namespace dawn_native::vulkan { const Extent3D& copySize); }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_COMMANDBUFFERVK_H_ diff --git a/src/dawn_native/vulkan/CommandRecordingContext.h b/src/dawn_native/vulkan/CommandRecordingContext.h index ccd5a019ea..931540ea31 100644 --- a/src/dawn_native/vulkan/CommandRecordingContext.h +++ b/src/dawn_native/vulkan/CommandRecordingContext.h @@ -18,7 +18,7 @@ #include "dawn_native/vulkan/BufferVk.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // Used to track operations that are handled after recording. // Currently only tracks semaphores, but may be used to do barrier coalescing in the future. struct CommandRecordingContext { @@ -35,6 +35,6 @@ namespace dawn_native::vulkan { bool used = false; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_COMMANDRECORDINGCONTEXT_H_ diff --git a/src/dawn_native/vulkan/ComputePipelineVk.cpp b/src/dawn_native/vulkan/ComputePipelineVk.cpp index 7def0e14d3..6b2ae245d7 100644 --- a/src/dawn_native/vulkan/ComputePipelineVk.cpp +++ b/src/dawn_native/vulkan/ComputePipelineVk.cpp @@ -22,7 +22,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // static Ref ComputePipeline::CreateUninitialized( @@ -113,4 +113,4 @@ namespace dawn_native::vulkan { CreateComputePipelineAsyncTask::RunAsync(std::move(asyncTask)); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/ComputePipelineVk.h b/src/dawn_native/vulkan/ComputePipelineVk.h index 3164bdfd37..c1b28847a2 100644 --- a/src/dawn_native/vulkan/ComputePipelineVk.h +++ b/src/dawn_native/vulkan/ComputePipelineVk.h @@ -20,7 +20,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/Error.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -48,6 +48,6 @@ namespace dawn_native::vulkan { VkPipeline mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_COMPUTEPIPELINEVK_H_ diff --git a/src/dawn_native/vulkan/DescriptorSetAllocation.h b/src/dawn_native/vulkan/DescriptorSetAllocation.h index 0e49d34760..a3221be933 100644 --- a/src/dawn_native/vulkan/DescriptorSetAllocation.h +++ b/src/dawn_native/vulkan/DescriptorSetAllocation.h @@ -17,7 +17,7 @@ #include "common/vulkan_platform.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // Contains a descriptor set along with data necessary to track its allocation. struct DescriptorSetAllocation { @@ -26,6 +26,6 @@ namespace dawn_native::vulkan { uint16_t setIndex; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_DESCRIPTORSETALLOCATION_H_ diff --git a/src/dawn_native/vulkan/DescriptorSetAllocator.cpp b/src/dawn_native/vulkan/DescriptorSetAllocator.cpp index 47f68adffd..c18d44a3fd 100644 --- a/src/dawn_native/vulkan/DescriptorSetAllocator.cpp +++ b/src/dawn_native/vulkan/DescriptorSetAllocator.cpp @@ -19,7 +19,7 @@ #include "dawn_native/vulkan/FencedDeleter.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // TODO(enga): Figure out this value. static constexpr uint32_t kMaxDescriptorsPerPool = 512; @@ -185,4 +185,4 @@ namespace dawn_native::vulkan { return {}; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/DescriptorSetAllocator.h b/src/dawn_native/vulkan/DescriptorSetAllocator.h index dfeba15759..6fedcaa71e 100644 --- a/src/dawn_native/vulkan/DescriptorSetAllocator.h +++ b/src/dawn_native/vulkan/DescriptorSetAllocator.h @@ -25,7 +25,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class BindGroupLayout; @@ -71,6 +71,6 @@ namespace dawn_native::vulkan { ExecutionSerial mLastDeallocationSerial = ExecutionSerial(0); }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_DESCRIPTORSETALLOCATOR_H_ diff --git a/src/dawn_native/vulkan/DeviceVk.cpp b/src/dawn_native/vulkan/DeviceVk.cpp index 2bce87852f..84dc1ee64b 100644 --- a/src/dawn_native/vulkan/DeviceVk.cpp +++ b/src/dawn_native/vulkan/DeviceVk.cpp @@ -42,7 +42,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // static ResultOrError> Device::Create(Adapter* adapter, @@ -1015,4 +1015,4 @@ namespace dawn_native::vulkan { return mDeviceInfo.properties.limits.timestampPeriod; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/DeviceVk.h b/src/dawn_native/vulkan/DeviceVk.h index 5bdb6d928a..9d90311279 100644 --- a/src/dawn_native/vulkan/DeviceVk.h +++ b/src/dawn_native/vulkan/DeviceVk.h @@ -32,7 +32,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Adapter; class BindGroupLayout; @@ -208,6 +208,6 @@ namespace dawn_native::vulkan { std::vector* outWaitSemaphores); }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_DEVICEVK_H_ diff --git a/src/dawn_native/vulkan/ExternalHandle.h b/src/dawn_native/vulkan/ExternalHandle.h index 84e672c5ad..e87da41791 100644 --- a/src/dawn_native/vulkan/ExternalHandle.h +++ b/src/dawn_native/vulkan/ExternalHandle.h @@ -3,7 +3,7 @@ #include "common/vulkan_platform.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { #if DAWN_PLATFORM_LINUX // File descriptor @@ -21,6 +21,6 @@ namespace dawn_native::vulkan { using ExternalSemaphoreHandle = void*; #endif -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_EXTERNALHANDLE_H_ diff --git a/src/dawn_native/vulkan/FencedDeleter.cpp b/src/dawn_native/vulkan/FencedDeleter.cpp index 9607a471e1..03a158ce14 100644 --- a/src/dawn_native/vulkan/FencedDeleter.cpp +++ b/src/dawn_native/vulkan/FencedDeleter.cpp @@ -16,7 +16,7 @@ #include "dawn_native/vulkan/DeviceVk.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { FencedDeleter::FencedDeleter(Device* device) : mDevice(device) { } @@ -180,4 +180,4 @@ namespace dawn_native::vulkan { mSamplersToDelete.ClearUpTo(completedSerial); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/FencedDeleter.h b/src/dawn_native/vulkan/FencedDeleter.h index a137d4903c..cc9e5721d7 100644 --- a/src/dawn_native/vulkan/FencedDeleter.h +++ b/src/dawn_native/vulkan/FencedDeleter.h @@ -19,7 +19,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/IntegerTypes.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -65,6 +65,6 @@ namespace dawn_native::vulkan { SerialQueue mSwapChainsToDelete; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_FENCEDDELETER_H_ diff --git a/src/dawn_native/vulkan/Forward.h b/src/dawn_native/vulkan/Forward.h index bc34458e88..d01e40d545 100644 --- a/src/dawn_native/vulkan/Forward.h +++ b/src/dawn_native/vulkan/Forward.h @@ -17,7 +17,7 @@ #include "dawn_native/ToBackend.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Adapter; class BindGroup; @@ -64,6 +64,6 @@ namespace dawn_native::vulkan { return ToBackendBase(common); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_FORWARD_H_ diff --git a/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp b/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp index 8b7cc55bfd..4182333074 100644 --- a/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp +++ b/src/dawn_native/vulkan/NativeSwapChainImplVk.cpp @@ -20,7 +20,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -222,4 +222,4 @@ namespace dawn_native::vulkan { return mConfig.format; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/NativeSwapChainImplVk.h b/src/dawn_native/vulkan/NativeSwapChainImplVk.h index b908fd93a6..7af843f33d 100644 --- a/src/dawn_native/vulkan/NativeSwapChainImplVk.h +++ b/src/dawn_native/vulkan/NativeSwapChainImplVk.h @@ -20,7 +20,7 @@ #include "dawn/dawn_wsi.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -66,6 +66,6 @@ namespace dawn_native::vulkan { Device* mDevice = nullptr; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_NATIVESWAPCHAINIMPLVK_H_ diff --git a/src/dawn_native/vulkan/PipelineLayoutVk.cpp b/src/dawn_native/vulkan/PipelineLayoutVk.cpp index 6a34c237b6..64f9ef83ca 100644 --- a/src/dawn_native/vulkan/PipelineLayoutVk.cpp +++ b/src/dawn_native/vulkan/PipelineLayoutVk.cpp @@ -21,7 +21,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // static ResultOrError> PipelineLayout::Create( @@ -81,4 +81,4 @@ namespace dawn_native::vulkan { reinterpret_cast(mHandle), "Dawn_PipelineLayout", GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/PipelineLayoutVk.h b/src/dawn_native/vulkan/PipelineLayoutVk.h index 86a1cafe7c..894084e1e5 100644 --- a/src/dawn_native/vulkan/PipelineLayoutVk.h +++ b/src/dawn_native/vulkan/PipelineLayoutVk.h @@ -20,7 +20,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/Error.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -45,6 +45,6 @@ namespace dawn_native::vulkan { VkPipelineLayout mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_PIPELINELAYOUTVK_H_ diff --git a/src/dawn_native/vulkan/QuerySetVk.cpp b/src/dawn_native/vulkan/QuerySetVk.cpp index f8373ba352..975f323ca9 100644 --- a/src/dawn_native/vulkan/QuerySetVk.cpp +++ b/src/dawn_native/vulkan/QuerySetVk.cpp @@ -20,7 +20,7 @@ #include "dawn_native/vulkan/VulkanError.h" #include "dawn_platform/DawnPlatform.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { VkQueryType VulkanQueryType(wgpu::QueryType type) { @@ -114,4 +114,4 @@ namespace dawn_native::vulkan { reinterpret_cast(mHandle), "Dawn_QuerySet", GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/QuerySetVk.h b/src/dawn_native/vulkan/QuerySetVk.h index 9632d6e714..a4cd8988d8 100644 --- a/src/dawn_native/vulkan/QuerySetVk.h +++ b/src/dawn_native/vulkan/QuerySetVk.h @@ -19,7 +19,7 @@ #include "common/vulkan_platform.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -42,6 +42,6 @@ namespace dawn_native::vulkan { VkQueryPool mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_QUERYSETVK_H_ diff --git a/src/dawn_native/vulkan/QueueVk.cpp b/src/dawn_native/vulkan/QueueVk.cpp index 79f2973350..c59f22cef8 100644 --- a/src/dawn_native/vulkan/QueueVk.cpp +++ b/src/dawn_native/vulkan/QueueVk.cpp @@ -25,7 +25,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // static Queue* Queue::Create(Device* device) { @@ -56,4 +56,4 @@ namespace dawn_native::vulkan { return {}; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/QueueVk.h b/src/dawn_native/vulkan/QueueVk.h index effc6ad196..5cf000c73c 100644 --- a/src/dawn_native/vulkan/QueueVk.h +++ b/src/dawn_native/vulkan/QueueVk.h @@ -17,7 +17,7 @@ #include "dawn_native/Queue.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -33,6 +33,6 @@ namespace dawn_native::vulkan { MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_QUEUEVK_H_ diff --git a/src/dawn_native/vulkan/RenderPassCache.cpp b/src/dawn_native/vulkan/RenderPassCache.cpp index 091a574308..20fefe8550 100644 --- a/src/dawn_native/vulkan/RenderPassCache.cpp +++ b/src/dawn_native/vulkan/RenderPassCache.cpp @@ -20,7 +20,7 @@ #include "dawn_native/vulkan/TextureVk.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { VkAttachmentLoadOp VulkanAttachmentLoadOp(wgpu::LoadOp op) { @@ -291,4 +291,4 @@ namespace dawn_native::vulkan { return true; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/RenderPassCache.h b/src/dawn_native/vulkan/RenderPassCache.h index 400c575d19..08c55c3b2d 100644 --- a/src/dawn_native/vulkan/RenderPassCache.h +++ b/src/dawn_native/vulkan/RenderPassCache.h @@ -28,7 +28,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -101,6 +101,6 @@ namespace dawn_native::vulkan { Cache mCache; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_RENDERPASSCACHE_H_ diff --git a/src/dawn_native/vulkan/RenderPipelineVk.cpp b/src/dawn_native/vulkan/RenderPipelineVk.cpp index 2f19386c69..f38766adb5 100644 --- a/src/dawn_native/vulkan/RenderPipelineVk.cpp +++ b/src/dawn_native/vulkan/RenderPipelineVk.cpp @@ -24,7 +24,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -360,11 +360,11 @@ namespace dawn_native::vulkan { shaderStage.pName = programmableStage.entryPoint.c_str(); switch (stage) { - case dawn_native::SingleShaderStage::Vertex: { + case dawn::native::SingleShaderStage::Vertex: { shaderStage.stage = VK_SHADER_STAGE_VERTEX_BIT; break; } - case dawn_native::SingleShaderStage::Fragment: { + case dawn::native::SingleShaderStage::Fragment: { shaderStage.stage = VK_SHADER_STAGE_FRAGMENT_BIT; break; } @@ -624,4 +624,4 @@ namespace dawn_native::vulkan { CreateRenderPipelineAsyncTask::RunAsync(std::move(asyncTask)); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/RenderPipelineVk.h b/src/dawn_native/vulkan/RenderPipelineVk.h index 810041abef..f47e239738 100644 --- a/src/dawn_native/vulkan/RenderPipelineVk.h +++ b/src/dawn_native/vulkan/RenderPipelineVk.h @@ -20,7 +20,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/Error.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -54,6 +54,6 @@ namespace dawn_native::vulkan { VkPipeline mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_RENDERPIPELINEVK_H_ diff --git a/src/dawn_native/vulkan/ResourceHeapVk.cpp b/src/dawn_native/vulkan/ResourceHeapVk.cpp index c0af2d3f19..8e070305b4 100644 --- a/src/dawn_native/vulkan/ResourceHeapVk.cpp +++ b/src/dawn_native/vulkan/ResourceHeapVk.cpp @@ -14,7 +14,7 @@ #include "dawn_native/vulkan/ResourceHeapVk.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { ResourceHeap::ResourceHeap(VkDeviceMemory memory, size_t memoryType) : mMemory(memory), mMemoryType(memoryType) { @@ -28,4 +28,4 @@ namespace dawn_native::vulkan { return mMemoryType; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/ResourceHeapVk.h b/src/dawn_native/vulkan/ResourceHeapVk.h index b87600b056..318f5f7615 100644 --- a/src/dawn_native/vulkan/ResourceHeapVk.h +++ b/src/dawn_native/vulkan/ResourceHeapVk.h @@ -18,7 +18,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/ResourceHeap.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // Wrapper for physical memory used with or without a resource object. class ResourceHeap : public ResourceHeapBase { @@ -34,6 +34,6 @@ namespace dawn_native::vulkan { size_t mMemoryType = 0; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_RESOURCEHEAPVK_H_ diff --git a/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp b/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp index abfd3aad2a..3e8d55ee60 100644 --- a/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp +++ b/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp @@ -22,7 +22,7 @@ #include "dawn_native/vulkan/ResourceHeapVk.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -289,4 +289,4 @@ namespace dawn_native::vulkan { } } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.h b/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.h index 788ea1c27f..f77cc48ab8 100644 --- a/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.h +++ b/src/dawn_native/vulkan/ResourceMemoryAllocatorVk.h @@ -25,7 +25,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -61,6 +61,6 @@ namespace dawn_native::vulkan { SerialQueue mSubAllocationsToDelete; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_RESOURCEMEMORYALLOCATORVK_H_ diff --git a/src/dawn_native/vulkan/SamplerVk.cpp b/src/dawn_native/vulkan/SamplerVk.cpp index 0885d55de1..9b022046d1 100644 --- a/src/dawn_native/vulkan/SamplerVk.cpp +++ b/src/dawn_native/vulkan/SamplerVk.cpp @@ -19,7 +19,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { VkSamplerAddressMode VulkanSamplerAddressMode(wgpu::AddressMode mode) { @@ -128,4 +128,4 @@ namespace dawn_native::vulkan { reinterpret_cast(mHandle), "Dawn_Sampler", GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/SamplerVk.h b/src/dawn_native/vulkan/SamplerVk.h index e3aea2c6cc..1367967841 100644 --- a/src/dawn_native/vulkan/SamplerVk.h +++ b/src/dawn_native/vulkan/SamplerVk.h @@ -20,7 +20,7 @@ #include "common/vulkan_platform.h" #include "dawn_native/Error.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -43,6 +43,6 @@ namespace dawn_native::vulkan { VkSampler mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_SAMPLERVK_H_ diff --git a/src/dawn_native/vulkan/ShaderModuleVk.cpp b/src/dawn_native/vulkan/ShaderModuleVk.cpp index 53d8f3ec7c..79dba896a5 100644 --- a/src/dawn_native/vulkan/ShaderModuleVk.cpp +++ b/src/dawn_native/vulkan/ShaderModuleVk.cpp @@ -26,7 +26,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { ShaderModule::ConcurrentTransformedShaderModuleCache::ConcurrentTransformedShaderModuleCache( Device* device) @@ -200,4 +200,4 @@ namespace dawn_native::vulkan { return newHandle; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/ShaderModuleVk.h b/src/dawn_native/vulkan/ShaderModuleVk.h index d91b8f0b6d..862f30a62e 100644 --- a/src/dawn_native/vulkan/ShaderModuleVk.h +++ b/src/dawn_native/vulkan/ShaderModuleVk.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; class PipelineLayout; @@ -62,6 +62,6 @@ namespace dawn_native::vulkan { std::unique_ptr mTransformedShaderModuleCache; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_SHADERMODULEVK_H_ diff --git a/src/dawn_native/vulkan/StagingBufferVk.cpp b/src/dawn_native/vulkan/StagingBufferVk.cpp index d8cbb88eaa..58920c9c64 100644 --- a/src/dawn_native/vulkan/StagingBufferVk.cpp +++ b/src/dawn_native/vulkan/StagingBufferVk.cpp @@ -20,7 +20,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { StagingBuffer::StagingBuffer(size_t size, Device* device) : StagingBufferBase(size), mDevice(device) { @@ -74,4 +74,4 @@ namespace dawn_native::vulkan { return mBuffer; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/StagingBufferVk.h b/src/dawn_native/vulkan/StagingBufferVk.h index 477bed5602..ed6f6c6b3e 100644 --- a/src/dawn_native/vulkan/StagingBufferVk.h +++ b/src/dawn_native/vulkan/StagingBufferVk.h @@ -19,7 +19,7 @@ #include "dawn_native/ResourceMemoryAllocation.h" #include "dawn_native/StagingBuffer.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -37,6 +37,6 @@ namespace dawn_native::vulkan { VkBuffer mBuffer; ResourceMemoryAllocation mAllocation; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_STAGINGBUFFERVK_H_ diff --git a/src/dawn_native/vulkan/SwapChainVk.cpp b/src/dawn_native/vulkan/SwapChainVk.cpp index 8cf6cff721..020719f941 100644 --- a/src/dawn_native/vulkan/SwapChainVk.cpp +++ b/src/dawn_native/vulkan/SwapChainVk.cpp @@ -30,7 +30,7 @@ # include "dawn_native/XlibXcbFunctions.h" #endif // defined(DAWN_USE_X11) -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // OldSwapChain @@ -259,7 +259,7 @@ namespace dawn_native::vulkan { DAWN_INVALID_IF(previousInstance != ToBackend(GetDevice())->GetVkInstance(), "Vulkan SwapChain cannot switch between Vulkan instances."); - // The previous swapchain is a dawn_native::vulkan::SwapChain so we can reuse its + // The previous swapchain is a dawn::native::vulkan::SwapChain so we can reuse its // VkSurfaceKHR provided since they are on the same instance. std::swap(previousVulkanSwapChain->mVkSurface, mVkSurface); @@ -661,4 +661,4 @@ namespace dawn_native::vulkan { } } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/SwapChainVk.h b/src/dawn_native/vulkan/SwapChainVk.h index c85aa329a7..2becbe9e99 100644 --- a/src/dawn_native/vulkan/SwapChainVk.h +++ b/src/dawn_native/vulkan/SwapChainVk.h @@ -21,7 +21,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; class Texture; @@ -93,6 +93,6 @@ namespace dawn_native::vulkan { Ref mTexture; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_SWAPCHAINVK_H_ diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp index 3fc2b85af0..83982e8e11 100644 --- a/src/dawn_native/vulkan/TextureVk.cpp +++ b/src/dawn_native/vulkan/TextureVk.cpp @@ -31,7 +31,7 @@ #include "dawn_native/vulkan/UtilsVulkan.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { // Converts an Dawn texture dimension to a Vulkan image view type. @@ -577,7 +577,7 @@ namespace dawn_native::vulkan { return {}; } - bool IsSampleCountSupported(const dawn_native::vulkan::Device* device, + bool IsSampleCountSupported(const dawn::native::vulkan::Device* device, const VkImageCreateInfo& imageCreateInfo) { ASSERT(device); @@ -1364,4 +1364,4 @@ namespace dawn_native::vulkan { reinterpret_cast(mHandle), "Dawn_InternalTextureView", GetLabel()); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/TextureVk.h b/src/dawn_native/vulkan/TextureVk.h index d339e99c10..a2a8f700e9 100644 --- a/src/dawn_native/vulkan/TextureVk.h +++ b/src/dawn_native/vulkan/TextureVk.h @@ -23,7 +23,7 @@ #include "dawn_native/vulkan/ExternalHandle.h" #include "dawn_native/vulkan/external_memory/MemoryService.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { struct CommandRecordingContext; class Device; @@ -37,7 +37,7 @@ namespace dawn_native::vulkan { MaybeError ValidateVulkanImageCanBeWrapped(const DeviceBase* device, const TextureDescriptor* descriptor); - bool IsSampleCountSupported(const dawn_native::vulkan::Device* device, + bool IsSampleCountSupported(const dawn::native::vulkan::Device* device, const VkImageCreateInfo& imageCreateInfo); class Texture final : public TextureBase { @@ -197,6 +197,6 @@ namespace dawn_native::vulkan { VkImageView mHandle = VK_NULL_HANDLE; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_TEXTUREVK_H_ diff --git a/src/dawn_native/vulkan/UtilsVulkan.cpp b/src/dawn_native/vulkan/UtilsVulkan.cpp index 51095341db..bc2adeeb7f 100644 --- a/src/dawn_native/vulkan/UtilsVulkan.cpp +++ b/src/dawn_native/vulkan/UtilsVulkan.cpp @@ -24,7 +24,7 @@ #include "dawn_native/vulkan/TextureVk.h" #include "dawn_native/vulkan/VulkanError.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { VkCompareOp ToVulkanCompareOp(wgpu::CompareFunction op) { switch (op) { @@ -261,4 +261,4 @@ namespace dawn_native::vulkan { return specializationInfo; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/UtilsVulkan.h b/src/dawn_native/vulkan/UtilsVulkan.h index f91c782210..1b5013cd14 100644 --- a/src/dawn_native/vulkan/UtilsVulkan.h +++ b/src/dawn_native/vulkan/UtilsVulkan.h @@ -19,12 +19,12 @@ #include "dawn_native/Commands.h" #include "dawn_native/dawn_platform.h" -namespace dawn_native { +namespace dawn::native { struct ProgrammableStage; union OverridableConstantScalar; -} // namespace dawn_native +} // namespace dawn::native -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; @@ -116,6 +116,6 @@ namespace dawn_native::vulkan { std::vector* specializationDataEntries, std::vector* specializationMapEntries); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_UTILSVULKAN_H_ diff --git a/src/dawn_native/vulkan/VulkanBackend.cpp b/src/dawn_native/vulkan/VulkanBackend.cpp index 658e8fd8d6..f15cb8a594 100644 --- a/src/dawn_native/vulkan/VulkanBackend.cpp +++ b/src/dawn_native/vulkan/VulkanBackend.cpp @@ -26,7 +26,7 @@ #include "dawn_native/vulkan/NativeSwapChainImplVk.h" #include "dawn_native/vulkan/TextureVk.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { VkInstance GetInstance(WGPUDevice device) { Device* backendDevice = ToBackend(FromAPI(device)); @@ -126,4 +126,4 @@ namespace dawn_native::vulkan { #endif // DAWN_PLATFORM_LINUX } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/VulkanError.cpp b/src/dawn_native/vulkan/VulkanError.cpp index 9b58d1619a..8a84bc8fc6 100644 --- a/src/dawn_native/vulkan/VulkanError.cpp +++ b/src/dawn_native/vulkan/VulkanError.cpp @@ -16,7 +16,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { const char* VkResultAsString(::VkResult result) { // Convert to a int32_t to silence and MSVC warning that the fake errors don't appear in @@ -106,4 +106,4 @@ namespace dawn_native::vulkan { } } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/VulkanError.h b/src/dawn_native/vulkan/VulkanError.h index 0d7ee5fb9c..885aae2901 100644 --- a/src/dawn_native/vulkan/VulkanError.h +++ b/src/dawn_native/vulkan/VulkanError.h @@ -21,7 +21,7 @@ constexpr VkResult VK_FAKE_ERROR_FOR_TESTING = VK_RESULT_MAX_ENUM; constexpr VkResult VK_FAKE_DEVICE_OOM_FOR_TESTING = static_cast(VK_RESULT_MAX_ENUM - 1); -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // Returns a string version of the result. const char* VkResultAsString(::VkResult result); @@ -34,17 +34,17 @@ namespace dawn_native::vulkan { // // DAWN_TRY(CheckVkSuccess(vkDoSomething, "doing something")); #define CheckVkSuccess(resultIn, contextIn) \ - ::dawn_native::vulkan::CheckVkSuccessImpl( \ - ::dawn_native::vulkan::VkResult::WrapUnsafe( \ + ::dawn::native::vulkan::CheckVkSuccessImpl( \ + ::dawn::native::vulkan::VkResult::WrapUnsafe( \ INJECT_ERROR_OR_RUN(resultIn, VK_FAKE_ERROR_FOR_TESTING)), \ contextIn) #define CheckVkOOMThenSuccess(resultIn, contextIn) \ - ::dawn_native::vulkan::CheckVkOOMThenSuccessImpl( \ - ::dawn_native::vulkan::VkResult::WrapUnsafe(INJECT_ERROR_OR_RUN( \ + ::dawn::native::vulkan::CheckVkOOMThenSuccessImpl( \ + ::dawn::native::vulkan::VkResult::WrapUnsafe(INJECT_ERROR_OR_RUN( \ resultIn, VK_FAKE_DEVICE_OOM_FOR_TESTING, VK_FAKE_ERROR_FOR_TESTING)), \ contextIn) -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_VULKANERROR_H_ diff --git a/src/dawn_native/vulkan/VulkanExtensions.cpp b/src/dawn_native/vulkan/VulkanExtensions.cpp index 96b1e50fa4..660b5646cb 100644 --- a/src/dawn_native/vulkan/VulkanExtensions.cpp +++ b/src/dawn_native/vulkan/VulkanExtensions.cpp @@ -20,7 +20,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { static constexpr uint32_t VulkanVersion_1_1 = VK_MAKE_VERSION(1, 1, 0); static constexpr uint32_t VulkanVersion_1_2 = VK_MAKE_VERSION(1, 2, 0); @@ -323,4 +323,4 @@ namespace dawn_native::vulkan { return result; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/VulkanExtensions.h b/src/dawn_native/vulkan/VulkanExtensions.h index dd5974703e..caf2280ebd 100644 --- a/src/dawn_native/vulkan/VulkanExtensions.h +++ b/src/dawn_native/vulkan/VulkanExtensions.h @@ -19,7 +19,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { // The list of known instance extensions. They must be in dependency order (this is checked // inside EnsureDependencies) @@ -157,6 +157,6 @@ namespace dawn_native::vulkan { // Returns a map that maps a Vulkan layer name to its VulkanLayer. std::unordered_map CreateVulkanLayerNameMap(); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_VULKANEXTENSIONS_H_ diff --git a/src/dawn_native/vulkan/VulkanFunctions.cpp b/src/dawn_native/vulkan/VulkanFunctions.cpp index 99c9acd97d..7146e0a6d7 100644 --- a/src/dawn_native/vulkan/VulkanFunctions.cpp +++ b/src/dawn_native/vulkan/VulkanFunctions.cpp @@ -17,7 +17,7 @@ #include "common/DynamicLib.h" #include "dawn_native/vulkan/VulkanInfo.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { #define GET_GLOBAL_PROC(name) \ do { \ @@ -329,4 +329,4 @@ namespace dawn_native::vulkan { return {}; } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/VulkanFunctions.h b/src/dawn_native/vulkan/VulkanFunctions.h index a677cd26e3..41938c66d1 100644 --- a/src/dawn_native/vulkan/VulkanFunctions.h +++ b/src/dawn_native/vulkan/VulkanFunctions.h @@ -21,7 +21,7 @@ class DynamicLib; -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { struct VulkanGlobalInfo; struct VulkanDeviceInfo; @@ -299,7 +299,7 @@ namespace dawn_native::vulkan { #endif }; - // Create a wrapper around VkResult in the dawn_native::vulkan namespace. This shadows the + // Create a wrapper around VkResult in the dawn::native::vulkan namespace. This shadows the // default VkResult (::VkResult). This ensures that assigning or creating a VkResult from a raw // ::VkResult uses WrapUnsafe. This makes it clear that users of VkResult must be intentional // about handling error cases. @@ -321,6 +321,6 @@ namespace dawn_native::vulkan { ::VkResult mValue; }; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_VULKANFUNCTIONS_H_ diff --git a/src/dawn_native/vulkan/VulkanInfo.cpp b/src/dawn_native/vulkan/VulkanInfo.cpp index c3883cd96a..202d6d1012 100644 --- a/src/dawn_native/vulkan/VulkanInfo.cpp +++ b/src/dawn_native/vulkan/VulkanInfo.cpp @@ -21,12 +21,12 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { ResultOrError GatherInstanceExtensions( const char* layerName, - const dawn_native::vulkan::VulkanFunctions& vkFunctions, + const dawn::native::vulkan::VulkanFunctions& vkFunctions, const std::unordered_map& knownExts) { uint32_t count = 0; VkResult vkResult = VkResult::WrapUnsafe( @@ -331,4 +331,4 @@ namespace dawn_native::vulkan { return std::move(info); } -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/dawn_native/vulkan/VulkanInfo.h b/src/dawn_native/vulkan/VulkanInfo.h index 83fd1374e7..1d466f7702 100644 --- a/src/dawn_native/vulkan/VulkanInfo.h +++ b/src/dawn_native/vulkan/VulkanInfo.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Adapter; class Backend; @@ -84,6 +84,6 @@ namespace dawn_native::vulkan { ResultOrError GatherDeviceInfo(const Adapter& adapter); ResultOrError GatherSurfaceInfo(const Adapter& adapter, VkSurfaceKHR surface); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKAN_VULKANINFO_H_ diff --git a/src/dawn_native/vulkan/external_memory/MemoryService.h b/src/dawn_native/vulkan/external_memory/MemoryService.h index 3e8ae3ef45..89254f075a 100644 --- a/src/dawn_native/vulkan/external_memory/MemoryService.h +++ b/src/dawn_native/vulkan/external_memory/MemoryService.h @@ -20,12 +20,12 @@ #include "dawn_native/VulkanBackend.h" #include "dawn_native/vulkan/ExternalHandle.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; struct VulkanDeviceInfo; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan -namespace dawn_native { namespace vulkan::external_memory { +namespace dawn::native { namespace vulkan::external_memory { struct MemoryImportParams { VkDeviceSize allocationSize; @@ -73,6 +73,6 @@ namespace dawn_native { namespace vulkan::external_memory { bool mSupported = false; }; -}} // namespace dawn_native::vulkan::external_memory +}} // namespace dawn::native::vulkan::external_memory #endif // DAWNNATIVE_VULKAN_EXTERNALMEMORY_SERVICE_H_ diff --git a/src/dawn_native/vulkan/external_memory/MemoryServiceDmaBuf.cpp b/src/dawn_native/vulkan/external_memory/MemoryServiceDmaBuf.cpp index 3317b43bf5..2bf8874fd5 100644 --- a/src/dawn_native/vulkan/external_memory/MemoryServiceDmaBuf.cpp +++ b/src/dawn_native/vulkan/external_memory/MemoryServiceDmaBuf.cpp @@ -21,7 +21,7 @@ #include "dawn_native/vulkan/VulkanError.h" #include "dawn_native/vulkan/external_memory/MemoryService.h" -namespace dawn_native { namespace vulkan::external_memory { +namespace dawn::native { namespace vulkan::external_memory { namespace { @@ -354,4 +354,4 @@ namespace dawn_native { namespace vulkan::external_memory { return image; } -}} // namespace dawn_native::vulkan::external_memory +}} // namespace dawn::native::vulkan::external_memory diff --git a/src/dawn_native/vulkan/external_memory/MemoryServiceNull.cpp b/src/dawn_native/vulkan/external_memory/MemoryServiceNull.cpp index aefe550015..081cd21085 100644 --- a/src/dawn_native/vulkan/external_memory/MemoryServiceNull.cpp +++ b/src/dawn_native/vulkan/external_memory/MemoryServiceNull.cpp @@ -15,7 +15,7 @@ #include "dawn_native/vulkan/DeviceVk.h" #include "dawn_native/vulkan/external_memory/MemoryService.h" -namespace dawn_native { namespace vulkan::external_memory { +namespace dawn::native { namespace vulkan::external_memory { Service::Service(Device* device) : mDevice(device) { DAWN_UNUSED(mDevice); @@ -62,4 +62,4 @@ namespace dawn_native { namespace vulkan::external_memory { return DAWN_UNIMPLEMENTED_ERROR("Using null memory service to interop inside Vulkan"); } -}} // namespace dawn_native::vulkan::external_memory +}} // namespace dawn::native::vulkan::external_memory diff --git a/src/dawn_native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp b/src/dawn_native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp index 0222833f81..e8762d2dba 100644 --- a/src/dawn_native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp +++ b/src/dawn_native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp @@ -20,7 +20,7 @@ #include "dawn_native/vulkan/VulkanError.h" #include "dawn_native/vulkan/external_memory/MemoryService.h" -namespace dawn_native { namespace vulkan::external_memory { +namespace dawn::native { namespace vulkan::external_memory { Service::Service(Device* device) : mDevice(device), mSupported(CheckSupport(device->GetDeviceInfo())) { @@ -153,4 +153,4 @@ namespace dawn_native { namespace vulkan::external_memory { return image; } -}} // namespace dawn_native::vulkan::external_memory +}} // namespace dawn::native::vulkan::external_memory diff --git a/src/dawn_native/vulkan/external_memory/MemoryServiceZirconHandle.cpp b/src/dawn_native/vulkan/external_memory/MemoryServiceZirconHandle.cpp index 7c37135a30..29661449e0 100644 --- a/src/dawn_native/vulkan/external_memory/MemoryServiceZirconHandle.cpp +++ b/src/dawn_native/vulkan/external_memory/MemoryServiceZirconHandle.cpp @@ -20,7 +20,7 @@ #include "dawn_native/vulkan/VulkanError.h" #include "dawn_native/vulkan/external_memory/MemoryService.h" -namespace dawn_native { namespace vulkan::external_memory { +namespace dawn::native { namespace vulkan::external_memory { Service::Service(Device* device) : mDevice(device), mSupported(CheckSupport(device->GetDeviceInfo())) { @@ -155,4 +155,4 @@ namespace dawn_native { namespace vulkan::external_memory { return image; } -}} // namespace dawn_native::vulkan::external_memory +}} // namespace dawn::native::vulkan::external_memory diff --git a/src/dawn_native/vulkan/external_semaphore/SemaphoreService.h b/src/dawn_native/vulkan/external_semaphore/SemaphoreService.h index 5824c520c3..58cc8e92e3 100644 --- a/src/dawn_native/vulkan/external_semaphore/SemaphoreService.h +++ b/src/dawn_native/vulkan/external_semaphore/SemaphoreService.h @@ -21,11 +21,11 @@ #include "dawn_native/vulkan/VulkanFunctions.h" #include "dawn_native/vulkan/VulkanInfo.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { class Device; -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan -namespace dawn_native { namespace vulkan::external_semaphore { +namespace dawn::native { namespace vulkan::external_semaphore { class Service { public: @@ -55,6 +55,6 @@ namespace dawn_native { namespace vulkan::external_semaphore { bool mSupported = false; }; -}} // namespace dawn_native::vulkan::external_semaphore +}} // namespace dawn::native::vulkan::external_semaphore #endif // DAWNNATIVE_VULKAN_EXTERNALSEMAPHORE_SERVICE_H_ diff --git a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceFD.cpp b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceFD.cpp index 58c6f961f7..d7038bcb0c 100644 --- a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceFD.cpp +++ b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceFD.cpp @@ -25,7 +25,7 @@ static constexpr VkExternalSemaphoreHandleTypeFlagBits kHandleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; #endif // defined(DAWN_USE_SYNC_FDS) -namespace dawn_native { namespace vulkan::external_semaphore { +namespace dawn::native { namespace vulkan::external_semaphore { Service::Service(Device* device) : mDevice(device), @@ -134,4 +134,4 @@ namespace dawn_native { namespace vulkan::external_semaphore { return fd; } -}} // namespace dawn_native::vulkan::external_semaphore +}} // namespace dawn::native::vulkan::external_semaphore diff --git a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceNull.cpp b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceNull.cpp index 8c99da1832..b3c7a60e8a 100644 --- a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceNull.cpp +++ b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceNull.cpp @@ -15,7 +15,7 @@ #include "dawn_native/vulkan/DeviceVk.h" #include "dawn_native/vulkan/external_semaphore/SemaphoreService.h" -namespace dawn_native { namespace vulkan::external_semaphore { +namespace dawn::native { namespace vulkan::external_semaphore { Service::Service(Device* device) : mDevice(device) { DAWN_UNUSED(mDevice); @@ -47,4 +47,4 @@ namespace dawn_native { namespace vulkan::external_semaphore { return DAWN_UNIMPLEMENTED_ERROR("Using null semaphore service to interop inside Vulkan"); } -}} // namespace dawn_native::vulkan::external_semaphore +}} // namespace dawn::native::vulkan::external_semaphore diff --git a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp index 35c2b2b90b..bc069dc6d1 100644 --- a/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp +++ b/src/dawn_native/vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp @@ -18,7 +18,7 @@ #include "dawn_native/vulkan/VulkanError.h" #include "dawn_native/vulkan/external_semaphore/SemaphoreService.h" -namespace dawn_native { namespace vulkan::external_semaphore { +namespace dawn::native { namespace vulkan::external_semaphore { Service::Service(Device* device) : mDevice(device), @@ -132,4 +132,4 @@ namespace dawn_native { namespace vulkan::external_semaphore { return handle; } -}} // namespace dawn_native::vulkan::external_semaphore +}} // namespace dawn::native::vulkan::external_semaphore diff --git a/src/dawn_native/webgpu_absl_format.cpp b/src/dawn_native/webgpu_absl_format.cpp index 465fd2ccc0..f112b9f89d 100644 --- a/src/dawn_native/webgpu_absl_format.cpp +++ b/src/dawn_native/webgpu_absl_format.cpp @@ -18,7 +18,7 @@ #include "dawn_native/ObjectBase.h" #include "dawn_native/Texture.h" -namespace dawn_native { +namespace dawn::native { // // Structs @@ -130,4 +130,4 @@ namespace dawn_native { return {true}; } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/dawn_native/webgpu_absl_format.h b/src/dawn_native/webgpu_absl_format.h index 340e1062f2..21e431259a 100644 --- a/src/dawn_native/webgpu_absl_format.h +++ b/src/dawn_native/webgpu_absl_format.h @@ -19,7 +19,7 @@ #include "dawn_native/dawn_platform.h" #include "dawn_native/webgpu_absl_format_autogen.h" -namespace dawn_native { +namespace dawn::native { // // Structs @@ -67,6 +67,6 @@ namespace dawn_native { const absl::FormatConversionSpec& spec, absl::FormatSink* s); -} // namespace dawn_native +} // namespace dawn::native #endif // DAWNNATIVE_WEBGPUABSLFORMAT_H_ diff --git a/src/dawn_node/Module.cpp b/src/dawn_node/Module.cpp index 96fce3f073..4f07c4dd8c 100644 --- a/src/dawn_node/Module.cpp +++ b/src/dawn_node/Module.cpp @@ -51,7 +51,7 @@ namespace { // object. Napi::Object Initialize(Napi::Env env, Napi::Object exports) { // Begin by setting the Dawn procedure function pointers. - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); // Register all the interop types wgpu::interop::Initialize(env); diff --git a/src/dawn_node/binding/GPU.cpp b/src/dawn_node/binding/GPU.cpp index c123c1ebc5..4e18a9170e 100644 --- a/src/dawn_node/binding/GPU.cpp +++ b/src/dawn_node/binding/GPU.cpp @@ -59,7 +59,7 @@ namespace wgpu::binding { GPU::GPU(Flags flags) : flags_(std::move(flags)) { // TODO: Disable in 'release' instance_.EnableBackendValidation(true); - instance_.SetBackendValidationLevel(dawn_native::BackendValidationLevel::Full); + instance_.SetBackendValidationLevel(dawn::native::BackendValidationLevel::Full); // Setting the DllDir changes where we load adapter DLLs from (e.g. d3dcompiler_47.dll) if (auto dir = flags_.Get("dlldir")) { diff --git a/src/dawn_node/binding/GPU.h b/src/dawn_node/binding/GPU.h index e526403a03..c840b9508b 100644 --- a/src/dawn_node/binding/GPU.h +++ b/src/dawn_node/binding/GPU.h @@ -22,7 +22,7 @@ #include "src/dawn_node/interop/WebGPU.h" namespace wgpu::binding { - // GPU is an implementation of interop::GPU that wraps a dawn_native::Instance. + // GPU is an implementation of interop::GPU that wraps a dawn::native::Instance. class GPU final : public interop::GPU { public: GPU(Flags flags); @@ -34,7 +34,7 @@ namespace wgpu::binding { private: const Flags flags_; - dawn_native::Instance instance_; + dawn::native::Instance instance_; }; } // namespace wgpu::binding diff --git a/src/dawn_node/binding/GPUAdapter.cpp b/src/dawn_node/binding/GPUAdapter.cpp index 44c70d4fce..e91fb895ce 100644 --- a/src/dawn_node/binding/GPUAdapter.cpp +++ b/src/dawn_node/binding/GPUAdapter.cpp @@ -117,7 +117,7 @@ namespace wgpu::binding { // wgpu::bindings::GPUAdapter // TODO(crbug.com/dawn/1133): This is a stub implementation. Properly implement. //////////////////////////////////////////////////////////////////////////////// - GPUAdapter::GPUAdapter(dawn_native::Adapter a, const Flags& flags) + GPUAdapter::GPUAdapter(dawn::native::Adapter a, const Flags& flags) : adapter_(a), flags_(flags) { } diff --git a/src/dawn_node/binding/GPUAdapter.h b/src/dawn_node/binding/GPUAdapter.h index a54cd0bf52..3bcd7d3420 100644 --- a/src/dawn_node/binding/GPUAdapter.h +++ b/src/dawn_node/binding/GPUAdapter.h @@ -23,10 +23,10 @@ namespace wgpu::binding { class Flags; - // GPUAdapter is an implementation of interop::GPUAdapter that wraps a dawn_native::Adapter. + // GPUAdapter is an implementation of interop::GPUAdapter that wraps a dawn::native::Adapter. class GPUAdapter final : public interop::GPUAdapter { public: - GPUAdapter(dawn_native::Adapter a, const Flags& flags); + GPUAdapter(dawn::native::Adapter a, const Flags& flags); // interop::GPUAdapter interface compliance std::string getName(Napi::Env) override; @@ -38,7 +38,7 @@ namespace wgpu::binding { interop::GPUDeviceDescriptor descriptor) override; private: - dawn_native::Adapter adapter_; + dawn::native::Adapter adapter_; const Flags& flags_; }; diff --git a/src/fuzzers/DawnWireServerAndD3D12BackendFuzzer.cpp b/src/fuzzers/DawnWireServerAndD3D12BackendFuzzer.cpp index 79211361a8..f170e04812 100644 --- a/src/fuzzers/DawnWireServerAndD3D12BackendFuzzer.cpp +++ b/src/fuzzers/DawnWireServerAndD3D12BackendFuzzer.cpp @@ -24,11 +24,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return DawnWireServerFuzzer::Run( data, size, - [](dawn_native::Instance* instance) { - std::vector adapters = instance->GetAdapters(); + [](dawn::native::Instance* instance) { + std::vector adapters = instance->GetAdapters(); wgpu::Device device; - for (dawn_native::Adapter adapter : adapters) { + for (dawn::native::Adapter adapter : adapters) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); diff --git a/src/fuzzers/DawnWireServerAndFrontendFuzzer.cpp b/src/fuzzers/DawnWireServerAndFrontendFuzzer.cpp index f41b8cb195..0a6f3f0597 100644 --- a/src/fuzzers/DawnWireServerAndFrontendFuzzer.cpp +++ b/src/fuzzers/DawnWireServerAndFrontendFuzzer.cpp @@ -25,11 +25,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return DawnWireServerFuzzer::Run( data, size, - [](dawn_native::Instance* instance) { - std::vector adapters = instance->GetAdapters(); + [](dawn::native::Instance* instance) { + std::vector adapters = instance->GetAdapters(); wgpu::Device nullDevice; - for (dawn_native::Adapter adapter : adapters) { + for (dawn::native::Adapter adapter : adapters) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); diff --git a/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp b/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp index b23b132e8c..6a0e95110b 100644 --- a/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp +++ b/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp @@ -24,11 +24,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return DawnWireServerFuzzer::Run( data, size, - [](dawn_native::Instance* instance) { - std::vector adapters = instance->GetAdapters(); + [](dawn::native::Instance* instance) { + std::vector adapters = instance->GetAdapters(); wgpu::Device device; - for (dawn_native::Adapter adapter : adapters) { + for (dawn::native::Adapter adapter : adapters) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); diff --git a/src/fuzzers/DawnWireServerFuzzer.cpp b/src/fuzzers/DawnWireServerFuzzer.cpp index e514304775..367d79a526 100644 --- a/src/fuzzers/DawnWireServerFuzzer.cpp +++ b/src/fuzzers/DawnWireServerFuzzer.cpp @@ -48,7 +48,7 @@ namespace { std::vector buf; }; - std::unique_ptr sInstance; + std::unique_ptr sInstance; WGPUProcDeviceCreateSwapChain sOriginalDeviceCreateSwapChain = nullptr; bool sCommandsComplete = false; @@ -68,7 +68,7 @@ int DawnWireServerFuzzer::Initialize(int* argc, char*** argv) { // TODO(crbug.com/1038952): The Instance must be static because destructing the vkInstance with // Swiftshader crashes libFuzzer. When this is fixed, move this into Run so that error injection // for adapter discovery can be fuzzed. - sInstance = std::make_unique(); + sInstance = std::make_unique(); sInstance->DiscoverDefaultAdapters(); return 0; @@ -89,15 +89,15 @@ int DawnWireServerFuzzer::Run(const uint8_t* data, size -= sizeof(uint64_t); if (supportsErrorInjection) { - dawn_native::EnableErrorInjector(); + dawn::native::EnableErrorInjector(); // Clear the error injector since it has the previous run's call counts. - dawn_native::ClearErrorInjector(); + dawn::native::ClearErrorInjector(); - dawn_native::InjectErrorAt(injectedErrorIndex); + dawn::native::InjectErrorAt(injectedErrorIndex); } - DawnProcTable procs = dawn_native::GetProcs(); + DawnProcTable procs = dawn::native::GetProcs(); // Swapchains receive a pointer to an implementation. The fuzzer will pass garbage in so we // intercept calls to create swapchains and make sure they always return error swapchains. diff --git a/src/fuzzers/DawnWireServerFuzzer.h b/src/fuzzers/DawnWireServerFuzzer.h index c2e176765f..83b6d3a9d4 100644 --- a/src/fuzzers/DawnWireServerFuzzer.h +++ b/src/fuzzers/DawnWireServerFuzzer.h @@ -17,15 +17,15 @@ #include #include -namespace dawn_native { +namespace dawn::native { class Instance; -} // namespace dawn_native +} // namespace dawn::native namespace DawnWireServerFuzzer { - using MakeDeviceFn = std::function; + using MakeDeviceFn = std::function; int Initialize(int* argc, char*** argv); diff --git a/src/include/dawn_native/D3D12Backend.h b/src/include/dawn_native/D3D12Backend.h index d614b16e8a..afb389b674 100644 --- a/src/include/dawn_native/D3D12Backend.h +++ b/src/include/dawn_native/D3D12Backend.h @@ -28,7 +28,7 @@ struct ID3D12Device; struct ID3D12Resource; -namespace dawn_native::d3d12 { +namespace dawn::native::d3d12 { class D3D11on12ResourceCache; @@ -106,6 +106,6 @@ namespace dawn_native::d3d12 { Microsoft::WRL::ComPtr dxgiAdapter; }; -} // namespace dawn_native::d3d12 +} // namespace dawn::native::d3d12 #endif // DAWNNATIVE_D3D12BACKEND_H_ diff --git a/src/include/dawn_native/DawnNative.h b/src/include/dawn_native/DawnNative.h index 82df6883d8..e8a6e13fdd 100644 --- a/src/include/dawn_native/DawnNative.h +++ b/src/include/dawn_native/DawnNative.h @@ -31,7 +31,7 @@ namespace wgpu { struct DeviceDescriptor; } -namespace dawn_native { +namespace dawn::native { class InstanceBase; class AdapterBase; @@ -247,6 +247,9 @@ namespace dawn_native { DAWN_NATIVE_EXPORT bool BindGroupLayoutBindingsEqualForTesting(WGPUBindGroupLayout a, WGPUBindGroupLayout b); -} // namespace dawn_native +} // namespace dawn::native + +// TODO(dawn:824): Remove once the deprecation period is passed. +namespace dawn_native = dawn::native; #endif // DAWNNATIVE_DAWNNATIVE_H_ diff --git a/src/include/dawn_native/MetalBackend.h b/src/include/dawn_native/MetalBackend.h index a8c11068cb..17e304e55e 100644 --- a/src/include/dawn_native/MetalBackend.h +++ b/src/include/dawn_native/MetalBackend.h @@ -32,7 +32,7 @@ typedef __IOSurface* IOSurfaceRef; # import #endif //__OBJC__ -namespace dawn_native::metal { +namespace dawn::native::metal { struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { AdapterDiscoveryOptions(); @@ -56,14 +56,14 @@ namespace dawn_native::metal { // scheduled could lead to races in who gets scheduled first and incorrect rendering. DAWN_NATIVE_EXPORT void WaitForCommandsToBeScheduled(WGPUDevice device); -} // namespace dawn_native::metal +} // namespace dawn::native::metal #ifdef __OBJC__ -namespace dawn_native::metal { +namespace dawn::native::metal { DAWN_NATIVE_EXPORT id GetMetalDevice(WGPUDevice device); -} // namespace dawn_native::metal +} // namespace dawn::native::metal #endif // __OBJC__ #pragma clang diagnostic pop diff --git a/src/include/dawn_native/NullBackend.h b/src/include/dawn_native/NullBackend.h index 02f8b952fc..a3928b888c 100644 --- a/src/include/dawn_native/NullBackend.h +++ b/src/include/dawn_native/NullBackend.h @@ -18,8 +18,8 @@ #include #include -namespace dawn_native::null { +namespace dawn::native::null { DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(); -} // namespace dawn_native::null +} // namespace dawn::native::null #endif // DAWNNATIVE_NULLBACKEND_H_ diff --git a/src/include/dawn_native/OpenGLBackend.h b/src/include/dawn_native/OpenGLBackend.h index d8d4afdccf..5aaa723622 100644 --- a/src/include/dawn_native/OpenGLBackend.h +++ b/src/include/dawn_native/OpenGLBackend.h @@ -20,7 +20,7 @@ typedef void* EGLImage; #include #include -namespace dawn_native::opengl { +namespace dawn::native::opengl { struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { AdapterDiscoveryOptions(); @@ -50,6 +50,6 @@ namespace dawn_native::opengl { DAWN_NATIVE_EXPORT WGPUTexture WrapExternalEGLImage(WGPUDevice device, const ExternalImageDescriptorEGLImage* descriptor); -} // namespace dawn_native::opengl +} // namespace dawn::native::opengl #endif // DAWNNATIVE_OPENGLBACKEND_H_ diff --git a/src/include/dawn_native/VulkanBackend.h b/src/include/dawn_native/VulkanBackend.h index 4c8cfb5dc2..756ae4af68 100644 --- a/src/include/dawn_native/VulkanBackend.h +++ b/src/include/dawn_native/VulkanBackend.h @@ -22,7 +22,7 @@ #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { DAWN_NATIVE_EXPORT VkInstance GetInstance(WGPUDevice device); @@ -135,6 +135,6 @@ namespace dawn_native::vulkan { VkImageLayout desiredLayout, ExternalImageExportInfoVk* info); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan #endif // DAWNNATIVE_VULKANBACKEND_H_ diff --git a/src/tests/DawnNativeTest.cpp b/src/tests/DawnNativeTest.cpp index 20d7146ea7..7532dfd48b 100644 --- a/src/tests/DawnNativeTest.cpp +++ b/src/tests/DawnNativeTest.cpp @@ -19,7 +19,7 @@ #include "dawn/dawn_proc.h" #include "dawn_native/ErrorData.h" -namespace dawn_native { +namespace dawn::native { void AddFatalDawnFailure(const char* expression, const ErrorData* error) { const auto& backtrace = error->GetBacktrace(); @@ -29,10 +29,10 @@ namespace dawn_native { ::testing::TestPartResult::kFatalFailure); } -} // namespace dawn_native +} // namespace dawn::native DawnNativeTest::DawnNativeTest() { - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); } DawnNativeTest::~DawnNativeTest() { @@ -41,10 +41,10 @@ DawnNativeTest::~DawnNativeTest() { } void DawnNativeTest::SetUp() { - instance = std::make_unique(); + instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - std::vector adapters = instance->GetAdapters(); + std::vector adapters = instance->GetAdapters(); // DawnNative unittests run against the null backend, find the corresponding adapter bool foundNullAdapter = false; diff --git a/src/tests/DawnNativeTest.h b/src/tests/DawnNativeTest.h index 91904a39e5..ab44e39d7a 100644 --- a/src/tests/DawnNativeTest.h +++ b/src/tests/DawnNativeTest.h @@ -21,7 +21,7 @@ #include "dawn_native/DawnNative.h" #include "dawn_native/ErrorData.h" -namespace dawn_native { +namespace dawn::native { // This is similar to DAWN_TRY_ASSIGN but produces a fatal GTest error if EXPR is an error. #define DAWN_ASSERT_AND_ASSIGN(VAR, EXPR) \ @@ -29,7 +29,7 @@ namespace dawn_native { void AddFatalDawnFailure(const char* expression, const ErrorData* error); -} // namespace dawn_native +} // namespace dawn::native class DawnNativeTest : public ::testing::Test { public: @@ -42,8 +42,8 @@ class DawnNativeTest : public ::testing::Test { virtual WGPUDevice CreateTestDevice(); protected: - std::unique_ptr instance; - dawn_native::Adapter adapter; + std::unique_ptr instance; + dawn::native::Adapter adapter; wgpu::Device device; private: diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 4102c0f09e..51895921fe 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -234,7 +234,7 @@ void DawnTestEnvironment::SetEnvironment(DawnTestEnvironment* env) { DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) { ParseArgs(argc, argv); - if (mBackendValidationLevel != dawn_native::BackendValidationLevel::Disabled) { + if (mBackendValidationLevel != dawn::native::BackendValidationLevel::Disabled) { mPlatformDebugLogger = std::unique_ptr(utils::CreatePlatformDebugLogger()); } @@ -245,7 +245,7 @@ DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) { // because the Vulkan validation layers use static global mutexes which behave badly when // Chromium's test launcher forks the test process. The instance will be recreated on test // environment setup. - std::unique_ptr instance = CreateInstanceAndDiscoverAdapters(); + std::unique_ptr instance = CreateInstanceAndDiscoverAdapters(); ASSERT(instance); SelectPreferredAdapterProperties(instance.get()); @@ -273,17 +273,17 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) { const char* level = argv[i] + argLen; if (level[0] != '\0') { if (strcmp(level, "=full") == 0) { - mBackendValidationLevel = dawn_native::BackendValidationLevel::Full; + mBackendValidationLevel = dawn::native::BackendValidationLevel::Full; } else if (strcmp(level, "=partial") == 0) { - mBackendValidationLevel = dawn_native::BackendValidationLevel::Partial; + mBackendValidationLevel = dawn::native::BackendValidationLevel::Partial; } else if (strcmp(level, "=disabled") == 0) { - mBackendValidationLevel = dawn_native::BackendValidationLevel::Disabled; + mBackendValidationLevel = dawn::native::BackendValidationLevel::Disabled; } else { dawn::ErrorLog() << "Invalid backend validation level" << level; UNREACHABLE(); } } else { - mBackendValidationLevel = dawn_native::BackendValidationLevel::Partial; + mBackendValidationLevel = dawn::native::BackendValidationLevel::Partial; } continue; } @@ -410,8 +410,8 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) { } } -std::unique_ptr DawnTestEnvironment::CreateInstanceAndDiscoverAdapters() { - auto instance = std::make_unique(); +std::unique_ptr DawnTestEnvironment::CreateInstanceAndDiscoverAdapters() { + auto instance = std::make_unique(); instance->EnableBeginCaptureOnStartup(mBeginCaptureOnStartup); instance->SetBackendValidationLevel(mBackendValidationLevel); instance->DiscoverDefaultAdapters(); @@ -430,7 +430,7 @@ std::unique_ptr DawnTestEnvironment::CreateInstanceAndDis mOpenGLWindow = glfwCreateWindow(400, 400, "Dawn OpenGL test window", nullptr, nullptr); glfwMakeContextCurrent(mOpenGLWindow); - dawn_native::opengl::AdapterDiscoveryOptions adapterOptions; + dawn::native::opengl::AdapterDiscoveryOptions adapterOptions; adapterOptions.getProc = reinterpret_cast(glfwGetProcAddress); instance->DiscoverAdapters(&adapterOptions); #endif // DAWN_ENABLE_BACKEND_DESKTOP_GL @@ -455,7 +455,7 @@ std::unique_ptr DawnTestEnvironment::CreateInstanceAndDis mOpenGLESWindow = glfwCreateWindow(400, 400, "Dawn OpenGLES test window", nullptr, nullptr); glfwMakeContextCurrent(mOpenGLESWindow); - dawn_native::opengl::AdapterDiscoveryOptionsES adapterOptionsES; + dawn::native::opengl::AdapterDiscoveryOptionsES adapterOptionsES; adapterOptionsES.getProc = reinterpret_cast(glfwGetProcAddress); instance->DiscoverAdapters(&adapterOptionsES); glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE); @@ -472,12 +472,12 @@ GLFWwindow* DawnTestEnvironment::GetOpenGLESWindow() const { return mOpenGLESWindow; } -void DawnTestEnvironment::SelectPreferredAdapterProperties(const dawn_native::Instance* instance) { +void DawnTestEnvironment::SelectPreferredAdapterProperties(const dawn::native::Instance* instance) { // Get the first available preferred device type. wgpu::AdapterType preferredDeviceType = static_cast(-1); bool hasDevicePreference = false; for (wgpu::AdapterType devicePreference : mDevicePreferences) { - for (const dawn_native::Adapter& adapter : instance->GetAdapters()) { + for (const dawn::native::Adapter& adapter : instance->GetAdapters()) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); @@ -493,7 +493,7 @@ void DawnTestEnvironment::SelectPreferredAdapterProperties(const dawn_native::In } std::set> adapterNameSet; - for (const dawn_native::Adapter& adapter : instance->GetAdapters()) { + for (const dawn::native::Adapter& adapter : instance->GetAdapters()) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); @@ -559,7 +559,7 @@ std::vector DawnTestEnvironment::GetAvailableAdapterTestParams } void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo( - dawn_native::Instance* instance) const { + dawn::native::Instance* instance) const { dawn::LogMessage log = dawn::InfoLog(); log << "Testing configuration\n" "---------------------\n" @@ -572,13 +572,13 @@ void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo( "BackendValidation: "; switch (mBackendValidationLevel) { - case dawn_native::BackendValidationLevel::Full: + case dawn::native::BackendValidationLevel::Full: log << "full"; break; - case dawn_native::BackendValidationLevel::Partial: + case dawn::native::BackendValidationLevel::Partial: log << "partial"; break; - case dawn_native::BackendValidationLevel::Disabled: + case dawn::native::BackendValidationLevel::Disabled: log << "disabled"; break; default: @@ -589,7 +589,7 @@ void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo( log << "\n" "Enabled Toggles\n"; for (const std::string& toggle : GetEnabledToggles()) { - const dawn_native::ToggleInfo* info = instance->GetToggleInfo(toggle.c_str()); + const dawn::native::ToggleInfo* info = instance->GetToggleInfo(toggle.c_str()); ASSERT(info != nullptr); log << " - " << info->name << ": " << info->description << "\n"; } @@ -599,7 +599,7 @@ void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo( log << "\n" "Disabled Toggles\n"; for (const std::string& toggle : GetDisabledToggles()) { - const dawn_native::ToggleInfo* info = instance->GetToggleInfo(toggle.c_str()); + const dawn::native::ToggleInfo* info = instance->GetToggleInfo(toggle.c_str()); ASSERT(info != nullptr); log << " - " << info->name << ": " << info->description << "\n"; } @@ -651,11 +651,11 @@ bool DawnTestEnvironment::RunSuppressedTests() const { return mRunSuppressedTests; } -dawn_native::BackendValidationLevel DawnTestEnvironment::GetBackendValidationLevel() const { +dawn::native::BackendValidationLevel DawnTestEnvironment::GetBackendValidationLevel() const { return mBackendValidationLevel; } -dawn_native::Instance* DawnTestEnvironment::GetInstance() const { +dawn::native::Instance* DawnTestEnvironment::GetInstance() const { return mInstance.get(); } @@ -807,7 +807,7 @@ bool DawnTestBase::UsesWire() const { } bool DawnTestBase::IsBackendValidationEnabled() const { - return gTestEnv->GetBackendValidationLevel() != dawn_native::BackendValidationLevel::Disabled; + return gTestEnv->GetBackendValidationLevel() != dawn::native::BackendValidationLevel::Disabled; } bool DawnTestBase::RunSuppressedTests() const { @@ -827,7 +827,7 @@ bool DawnTestBase::IsAsan() const { } bool DawnTestBase::HasToggleEnabled(const char* toggle) const { - auto toggles = dawn_native::GetTogglesUsed(backendDevice); + auto toggles = dawn::native::GetTogglesUsed(backendDevice); return std::find_if(toggles.begin(), toggles.end(), [toggle](const char* name) { return strcmp(toggle, name) == 0; }) != toggles.end(); @@ -853,7 +853,7 @@ wgpu::Instance DawnTestBase::GetInstance() const { return gTestEnv->GetInstance()->Get(); } -dawn_native::Adapter DawnTestBase::GetAdapter() const { +dawn::native::Adapter DawnTestBase::GetAdapter() const { return mBackendAdapter; } @@ -872,7 +872,7 @@ const wgpu::AdapterProperties& DawnTestBase::GetAdapterProperties() const { wgpu::SupportedLimits DawnTestBase::GetSupportedLimits() { WGPUSupportedLimits supportedLimits; supportedLimits.nextInChain = nullptr; - dawn_native::GetProcs().deviceGetLimits(backendDevice, &supportedLimits); + dawn::native::GetProcs().deviceGetLimits(backendDevice, &supportedLimits); return *reinterpret_cast(&supportedLimits); } @@ -880,9 +880,9 @@ bool DawnTestBase::SupportsFeatures(const std::vector& featur ASSERT(mBackendAdapter); std::vector supportedFeatures; uint32_t count = - dawn_native::GetProcs().adapterEnumerateFeatures(mBackendAdapter.Get(), nullptr); + dawn::native::GetProcs().adapterEnumerateFeatures(mBackendAdapter.Get(), nullptr); supportedFeatures.resize(count); - dawn_native::GetProcs().adapterEnumerateFeatures( + dawn::native::GetProcs().adapterEnumerateFeatures( mBackendAdapter.Get(), reinterpret_cast(&supportedFeatures[0])); std::unordered_set supportedSet; @@ -903,7 +903,7 @@ void DawnTestBase::SetUp() { // Find the adapter that exactly matches our adapter properties. const auto& adapters = gTestEnv->GetInstance()->GetAdapters(); const auto& it = std::find_if( - adapters.begin(), adapters.end(), [&](const dawn_native::Adapter& adapter) { + adapters.begin(), adapters.end(), [&](const dawn::native::Adapter& adapter) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); @@ -943,14 +943,14 @@ void DawnTestBase::SetUp() { forceDisabledToggles.push_back("disallow_unsafe_apis"); for (const std::string& toggle : gTestEnv->GetEnabledToggles()) { - const dawn_native::ToggleInfo* info = + const dawn::native::ToggleInfo* info = gTestEnv->GetInstance()->GetToggleInfo(toggle.c_str()); ASSERT(info != nullptr); forceEnabledToggles.push_back(info->name); } for (const std::string& toggle : gTestEnv->GetDisabledToggles()) { - const dawn_native::ToggleInfo* info = + const dawn::native::ToggleInfo* info = gTestEnv->GetInstance()->GetToggleInfo(toggle.c_str()); ASSERT(info != nullptr); forceDisabledToggles.push_back(info->name); @@ -1024,7 +1024,7 @@ void DawnTestBase::TearDown() { if (!UsesWire()) { EXPECT_EQ(mLastWarningCount, - dawn_native::GetDeprecationWarningCountForTesting(device.Get())); + dawn::native::GetDeprecationWarningCountForTesting(device.Get())); } // The device will be destroyed soon after, so we want to set the expectation. diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h index e79a3e467d..9c9f228ca8 100644 --- a/src/tests/DawnTest.h +++ b/src/tests/DawnTest.h @@ -224,8 +224,8 @@ class DawnTestEnvironment : public testing::Environment { void TearDown() override; bool UsesWire() const; - dawn_native::BackendValidationLevel GetBackendValidationLevel() const; - dawn_native::Instance* GetInstance() const; + dawn::native::BackendValidationLevel GetBackendValidationLevel() const; + dawn::native::Instance* GetInstance() const; bool HasVendorIdFilter() const; uint32_t GetVendorIdFilter() const; bool HasBackendTypeFilter() const; @@ -240,17 +240,17 @@ class DawnTestEnvironment : public testing::Environment { bool RunSuppressedTests() const; protected: - std::unique_ptr mInstance; + std::unique_ptr mInstance; private: void ParseArgs(int argc, char** argv); - std::unique_ptr CreateInstanceAndDiscoverAdapters(); - void SelectPreferredAdapterProperties(const dawn_native::Instance* instance); - void PrintTestConfigurationAndAdapterInfo(dawn_native::Instance* instance) const; + std::unique_ptr CreateInstanceAndDiscoverAdapters(); + void SelectPreferredAdapterProperties(const dawn::native::Instance* instance); + void PrintTestConfigurationAndAdapterInfo(dawn::native::Instance* instance) const; bool mUseWire = false; - dawn_native::BackendValidationLevel mBackendValidationLevel = - dawn_native::BackendValidationLevel::Disabled; + dawn::native::BackendValidationLevel mBackendValidationLevel = + dawn::native::BackendValidationLevel::Disabled; bool mBeginCaptureOnStartup = false; bool mHasVendorIdFilter = false; uint32_t mVendorIdFilter = 0; @@ -322,7 +322,7 @@ class DawnTestBase { wgpu::BackendType GetBackendTypeFilter() const; wgpu::Instance GetInstance() const; - dawn_native::Adapter GetAdapter() const; + dawn::native::Adapter GetAdapter() const; virtual std::unique_ptr CreateTestPlatform(); @@ -597,7 +597,7 @@ class DawnTestBase { // Assuming the data is mapped, checks all expectations void ResolveExpectations(); - dawn_native::Adapter mBackendAdapter; + dawn::native::Adapter mBackendAdapter; std::unique_ptr mTestPlatform; }; @@ -621,22 +621,22 @@ class DawnTestBase { #define DAWN_SUPPRESS_TEST_IF(condition) \ DAWN_SKIP_TEST_IF_BASE(!RunSuppressedTests() && condition, "suppressed", condition) -#define EXPECT_DEPRECATION_WARNINGS(statement, n) \ - do { \ - if (UsesWire()) { \ - statement; \ - } else { \ - size_t warningsBefore = \ - dawn_native::GetDeprecationWarningCountForTesting(device.Get()); \ - statement; \ - size_t warningsAfter = \ - dawn_native::GetDeprecationWarningCountForTesting(device.Get()); \ - EXPECT_EQ(mLastWarningCount, warningsBefore); \ - if (!HasToggleEnabled("skip_validation")) { \ - EXPECT_EQ(warningsAfter, warningsBefore + n); \ - } \ - mLastWarningCount = warningsAfter; \ - } \ +#define EXPECT_DEPRECATION_WARNINGS(statement, n) \ + do { \ + if (UsesWire()) { \ + statement; \ + } else { \ + size_t warningsBefore = \ + dawn::native::GetDeprecationWarningCountForTesting(device.Get()); \ + statement; \ + size_t warningsAfter = \ + dawn::native::GetDeprecationWarningCountForTesting(device.Get()); \ + EXPECT_EQ(mLastWarningCount, warningsBefore); \ + if (!HasToggleEnabled("skip_validation")) { \ + EXPECT_EQ(warningsAfter, warningsBefore + n); \ + } \ + mLastWarningCount = warningsAfter; \ + } \ } while (0) #define EXPECT_DEPRECATION_WARNING(statement) EXPECT_DEPRECATION_WARNINGS(statement, 1) diff --git a/src/tests/end2end/AdapterDiscoveryTests.cpp b/src/tests/end2end/AdapterDiscoveryTests.cpp index a15fb70e6f..8957ee4731 100644 --- a/src/tests/end2end/AdapterDiscoveryTests.cpp +++ b/src/tests/end2end/AdapterDiscoveryTests.cpp @@ -48,9 +48,9 @@ namespace { #if defined(DAWN_ENABLE_BACKEND_VULKAN) // Test only discovering the SwiftShader adapter TEST(AdapterDiscoveryTests, OnlySwiftShader) { - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::vulkan::AdapterDiscoveryOptions options; + dawn::native::vulkan::AdapterDiscoveryOptions options; options.forceSwiftShader = true; instance.DiscoverAdapters(&options); @@ -68,9 +68,9 @@ namespace { // Test discovering only Vulkan adapters TEST(AdapterDiscoveryTests, OnlyVulkan) { - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::vulkan::AdapterDiscoveryOptions options; + dawn::native::vulkan::AdapterDiscoveryOptions options; instance.DiscoverAdapters(&options); const auto& adapters = instance.GetAdapters(); @@ -86,9 +86,9 @@ namespace { #if defined(DAWN_ENABLE_BACKEND_D3D12) // Test discovering only D3D12 adapters TEST(AdapterDiscoveryTests, OnlyD3D12) { - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::d3d12::AdapterDiscoveryOptions options; + dawn::native::d3d12::AdapterDiscoveryOptions options; instance.DiscoverAdapters(&options); const auto& adapters = instance.GetAdapters(); @@ -114,9 +114,9 @@ namespace { break; // No more adapters to enumerate. } - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::d3d12::AdapterDiscoveryOptions options; + dawn::native::d3d12::AdapterDiscoveryOptions options; options.dxgiAdapter = std::move(dxgiAdapter); instance.DiscoverAdapters(&options); @@ -134,9 +134,9 @@ namespace { #if defined(DAWN_ENABLE_BACKEND_METAL) // Test discovering only Metal adapters TEST(AdapterDiscoveryTests, OnlyMetal) { - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::metal::AdapterDiscoveryOptions options; + dawn::native::metal::AdapterDiscoveryOptions options; instance.DiscoverAdapters(&options); const auto& adapters = instance.GetAdapters(); @@ -166,9 +166,9 @@ namespace { glfwCreateWindow(400, 400, "Dawn OpenGL test window", nullptr, nullptr); glfwMakeContextCurrent(window); - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::opengl::AdapterDiscoveryOptions options; + dawn::native::opengl::AdapterDiscoveryOptions options; options.getProc = reinterpret_cast(glfwGetProcAddress); instance.DiscoverAdapters(&options); glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE); @@ -207,9 +207,9 @@ namespace { glfwCreateWindow(400, 400, "Dawn OpenGLES test window", nullptr, nullptr); glfwMakeContextCurrent(window); - dawn_native::Instance instance; + dawn::native::Instance instance; - dawn_native::opengl::AdapterDiscoveryOptionsES options; + dawn::native::opengl::AdapterDiscoveryOptionsES options; options.getProc = reinterpret_cast(glfwGetProcAddress); instance.DiscoverAdapters(&options); glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE); @@ -230,10 +230,10 @@ namespace { // Test discovering the Metal backend, then the Vulkan backend // does not duplicate adapters. TEST(AdapterDiscoveryTests, OneBackendThenTheOther) { - dawn_native::Instance instance; + dawn::native::Instance instance; uint32_t metalAdapterCount = 0; { - dawn_native::metal::AdapterDiscoveryOptions options; + dawn::native::metal::AdapterDiscoveryOptions options; instance.DiscoverAdapters(&options); const auto& adapters = instance.GetAdapters(); @@ -246,7 +246,7 @@ namespace { } } { - dawn_native::vulkan::AdapterDiscoveryOptions options; + dawn::native::vulkan::AdapterDiscoveryOptions options; instance.DiscoverAdapters(&options); uint32_t metalAdapterCount2 = 0; diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp index 76f51fecae..dfda1fd714 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -19,16 +19,16 @@ #include "utils/TestUtils.h" #include "utils/WGPUHelpers.h" -#define EXPECT_LAZY_CLEAR(N, statement) \ - do { \ - if (UsesWire()) { \ - statement; \ - } else { \ - size_t lazyClearsBefore = dawn_native::GetLazyClearCountForTesting(device.Get()); \ - statement; \ - size_t lazyClearsAfter = dawn_native::GetLazyClearCountForTesting(device.Get()); \ - EXPECT_EQ(N, lazyClearsAfter - lazyClearsBefore); \ - } \ +#define EXPECT_LAZY_CLEAR(N, statement) \ + do { \ + if (UsesWire()) { \ + statement; \ + } else { \ + size_t lazyClearsBefore = dawn::native::GetLazyClearCountForTesting(device.Get()); \ + statement; \ + size_t lazyClearsAfter = dawn::native::GetLazyClearCountForTesting(device.Get()); \ + EXPECT_EQ(N, lazyClearsAfter - lazyClearsBefore); \ + } \ } while (0) namespace { diff --git a/src/tests/end2end/D3D12ResourceWrappingTests.cpp b/src/tests/end2end/D3D12ResourceWrappingTests.cpp index 81a6b526b1..8d780cb2fc 100644 --- a/src/tests/end2end/D3D12ResourceWrappingTests.cpp +++ b/src/tests/end2end/D3D12ResourceWrappingTests.cpp @@ -27,7 +27,7 @@ using Microsoft::WRL::ComPtr; namespace { - using dawn_native::d3d12::kDXGIKeyedMutexAcquireReleaseKey; + using dawn::native::d3d12::kDXGIKeyedMutexAcquireReleaseKey; class D3D12ResourceTestBase : public DawnTest { protected: @@ -43,7 +43,7 @@ namespace { } // Create the D3D11 device/contexts that will be used in subsequent tests - ComPtr d3d12Device = dawn_native::d3d12::GetD3D12Device(device.Get()); + ComPtr d3d12Device = dawn::native::d3d12::GetD3D12Device(device.Get()); const LUID adapterLuid = d3d12Device->GetAdapterLuid(); @@ -94,7 +94,7 @@ namespace { const D3D11_TEXTURE2D_DESC* baseD3dDescriptor, wgpu::Texture* dawnTexture, ID3D11Texture2D** d3d11TextureOut, - std::unique_ptr* + std::unique_ptr* externalImageOut = nullptr) const { ComPtr d3d11Texture; HRESULT hr = mD3d11Device->CreateTexture2D(baseD3dDescriptor, nullptr, &d3d11Texture); @@ -110,13 +110,13 @@ namespace { &sharedHandle); ASSERT_EQ(hr, S_OK); - dawn_native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc; + dawn::native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc; externalImageDesc.cTextureDescriptor = reinterpret_cast(dawnDesc); externalImageDesc.sharedHandle = sharedHandle; - std::unique_ptr externalImage = - dawn_native::d3d12::ExternalImageDXGI::Create(device.Get(), &externalImageDesc); + std::unique_ptr externalImage = + dawn::native::d3d12::ExternalImageDXGI::Create(device.Get(), &externalImageDesc); // Now that we've created all of our resources, we can close the handle // since we no longer need it. @@ -127,7 +127,7 @@ namespace { return; } - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.usage = static_cast(dawnDesc->usage); *dawnTexture = wgpu::Texture::Acquire( @@ -377,15 +377,15 @@ class D3D12SharedHandleUsageTests : public D3D12ResourceTestBase { hr = dxgiKeyedMutex->ReleaseSync(kDXGIKeyedMutexAcquireReleaseKey); ASSERT_EQ(hr, S_OK); - dawn_native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc = {}; + dawn::native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc = {}; externalImageDesc.sharedHandle = sharedHandle; externalImageDesc.cTextureDescriptor = reinterpret_cast(dawnDescriptor); - std::unique_ptr externalImage = - dawn_native::d3d12::ExternalImageDXGI::Create(device.Get(), &externalImageDesc); + std::unique_ptr externalImage = + dawn::native::d3d12::ExternalImageDXGI::Create(device.Get(), &externalImageDesc); - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.isInitialized = isInitialized; externalAccessDesc.usage = static_cast(dawnDescriptor->usage); @@ -588,7 +588,7 @@ TEST_P(D3D12SharedHandleUsageTests, ReuseExternalImage) { // Create the first Dawn texture then clear it to red. wgpu::Texture texture; ComPtr d3d11Texture; - std::unique_ptr externalImage; + std::unique_ptr externalImage; WrapSharedHandle(&baseDawnDescriptor, &baseD3dDescriptor, &texture, &d3d11Texture, &externalImage); { @@ -604,7 +604,7 @@ TEST_P(D3D12SharedHandleUsageTests, ReuseExternalImage) { texture.Destroy(); // Create another Dawn texture then clear it with another color. - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.isInitialized = true; externalAccessDesc.usage = static_cast(baseDawnDescriptor.usage); @@ -630,7 +630,7 @@ TEST_P(D3D12SharedHandleUsageTests, RecursiveExternalImageAccess) { // Create the first Dawn texture then clear it to red. wgpu::Texture texture1; ComPtr d3d11Texture; - std::unique_ptr externalImage; + std::unique_ptr externalImage; WrapSharedHandle(&baseDawnDescriptor, &baseD3dDescriptor, &texture1, &d3d11Texture, &externalImage); { @@ -642,7 +642,7 @@ TEST_P(D3D12SharedHandleUsageTests, RecursiveExternalImageAccess) { } // Create another Dawn texture then clear it with another color. - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.isInitialized = true; externalAccessDesc.usage = static_cast(baseDawnDescriptor.usage); @@ -673,12 +673,12 @@ TEST_P(D3D12SharedHandleUsageTests, RecursiveExternalImageAccess) { TEST_P(D3D12SharedHandleUsageTests, ExternalImageUsage) { DAWN_TEST_UNSUPPORTED_IF(UsesWire()); - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.isInitialized = true; wgpu::Texture texture; ComPtr d3d11Texture; - std::unique_ptr externalImage; + std::unique_ptr externalImage; WrapSharedHandle(&baseDawnDescriptor, &baseD3dDescriptor, &texture, &d3d11Texture, &externalImage); ASSERT_NE(texture.Get(), nullptr); @@ -700,7 +700,7 @@ TEST_P(D3D12SharedHandleUsageTests, ReuseExternalImageWithMultipleDevices) { wgpu::Texture texture; ComPtr d3d11Texture; - std::unique_ptr externalImage; + std::unique_ptr externalImage; // Create the Dawn texture then clear it to red using the first (default) device. WrapSharedHandle(&baseDawnDescriptor, &baseD3dDescriptor, &texture, &d3d11Texture, @@ -715,7 +715,7 @@ TEST_P(D3D12SharedHandleUsageTests, ReuseExternalImageWithMultipleDevices) { texture.Destroy(); // Create the Dawn texture then clear it to blue using the second device. - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.usage = static_cast(baseDawnDescriptor.usage); wgpu::Device otherDevice = wgpu::Device::Acquire(GetAdapter().CreateDevice()); diff --git a/src/tests/end2end/DeviceInitializationTests.cpp b/src/tests/end2end/DeviceInitializationTests.cpp index 0eb1795473..0c342cc3dc 100644 --- a/src/tests/end2end/DeviceInitializationTests.cpp +++ b/src/tests/end2end/DeviceInitializationTests.cpp @@ -19,7 +19,7 @@ class DeviceInitializationTest : public testing::Test { void SetUp() override { - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); } void TearDown() override { @@ -34,9 +34,9 @@ TEST_F(DeviceInitializationTest, DeviceOutlivesInstance) { // We want to create a device on a fresh instance and adapter each time. std::vector availableAdapterProperties; { - auto instance = std::make_unique(); + auto instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - for (const dawn_native::Adapter& adapter : instance->GetAdapters()) { + for (const dawn::native::Adapter& adapter : instance->GetAdapters()) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); @@ -50,9 +50,9 @@ TEST_F(DeviceInitializationTest, DeviceOutlivesInstance) { for (const wgpu::AdapterProperties& desiredProperties : availableAdapterProperties) { wgpu::Device device; - auto instance = std::make_unique(); + auto instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - for (dawn_native::Adapter& adapter : instance->GetAdapters()) { + for (dawn::native::Adapter& adapter : instance->GetAdapters()) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index f8af8a0709..98781c416b 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -98,13 +98,13 @@ namespace { IOSurfaceRef ioSurface, uint32_t plane, bool isInitialized = true) { - dawn_native::metal::ExternalImageDescriptorIOSurface externDesc; + dawn::native::metal::ExternalImageDescriptorIOSurface externDesc; externDesc.cTextureDescriptor = reinterpret_cast(descriptor); externDesc.ioSurface = ioSurface; externDesc.plane = plane; externDesc.isInitialized = isInitialized; - WGPUTexture texture = dawn_native::metal::WrapIOSurface(device.Get(), &externDesc); + WGPUTexture texture = dawn::native::metal::WrapIOSurface(device.Get(), &externDesc); return wgpu::Texture::Acquire(texture); } }; @@ -362,7 +362,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { queue.Submit(1, &commands); // Wait for the commands touching the IOSurface to be scheduled - dawn_native::metal::WaitForCommandsToBeScheduled(device.Get()); + dawn::native::metal::WaitForCommandsToBeScheduled(device.Get()); // Check the correct data was written IOSurfaceLock(ioSurface, kIOSurfaceLockReadOnly, nullptr); diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index 63ccded767..403712bf9d 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -19,16 +19,16 @@ #include "utils/TestUtils.h" #include "utils/WGPUHelpers.h" -#define EXPECT_LAZY_CLEAR(N, statement) \ - do { \ - if (UsesWire()) { \ - statement; \ - } else { \ - size_t lazyClearsBefore = dawn_native::GetLazyClearCountForTesting(device.Get()); \ - statement; \ - size_t lazyClearsAfter = dawn_native::GetLazyClearCountForTesting(device.Get()); \ - EXPECT_EQ(N, lazyClearsAfter - lazyClearsBefore); \ - } \ +#define EXPECT_LAZY_CLEAR(N, statement) \ + do { \ + if (UsesWire()) { \ + statement; \ + } else { \ + size_t lazyClearsBefore = dawn::native::GetLazyClearCountForTesting(device.Get()); \ + statement; \ + size_t lazyClearsAfter = dawn::native::GetLazyClearCountForTesting(device.Get()); \ + EXPECT_EQ(N, lazyClearsAfter - lazyClearsBefore); \ + } \ } while (0) class TextureZeroInitTest : public DawnTest { @@ -136,7 +136,7 @@ TEST_P(TextureZeroInitTest, CopyTextureToBufferSource) { EXPECT_LAZY_CLEAR(1u, EXPECT_PIXEL_RGBA8_EQ(filledWithZeros, texture, 0, 0)); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // This tests that the code path of CopyTextureToBuffer with multiple texture array layers clears @@ -171,7 +171,8 @@ TEST_P(TextureZeroInitTest, CopyMultipleTextureArrayLayersToBufferSource) { EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commandBuffer)); // Expect texture subresource initialized to be true - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, kArrayLayers)); + EXPECT_TRUE( + dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, kArrayLayers)); const std::vector kExpectedAllZero(kSize * kSize, {0, 0, 0, 0}); for (uint32_t layer = 0; layer < kArrayLayers; ++layer) { @@ -220,7 +221,7 @@ TEST_P(TextureZeroInitTest, RenderingMipMapClearsToZero) { baseMipLevel); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( renderPass.color.Get(), baseMipLevel, 1, baseArrayLayer, 1)); } @@ -263,7 +264,7 @@ TEST_P(TextureZeroInitTest, RenderingArrayLayerClearsToZero) { baseMipLevel); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( renderPass.color.Get(), baseMipLevel, 1, baseArrayLayer, 1)); } @@ -295,7 +296,7 @@ TEST_P(TextureZeroInitTest, CopyBufferToTexture) { EXPECT_TEXTURE_EQ(expected.data(), texture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // Test for a copy only to a subset of the subresource, lazy init is necessary to clear the other @@ -330,7 +331,7 @@ TEST_P(TextureZeroInitTest, CopyBufferToTextureHalf) { EXPECT_TEXTURE_EQ(expectedZeros.data(), texture, {kSize / 2, 0}, {kSize / 2, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // This tests CopyBufferToTexture fully overwrites a range of subresources, so lazy initialization @@ -361,8 +362,8 @@ TEST_P(TextureZeroInitTest, CopyBufferToTextureMultipleArrayLayers) { EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands)); // Expect texture subresource initialized to be true - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, kBaseArrayLayer, - kCopyLayerCount)); + EXPECT_TRUE(dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, kBaseArrayLayer, + kCopyLayerCount)); const std::vector expected100(kSize * kSize, {100, 100, 100, 100}); for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) { @@ -402,8 +403,8 @@ TEST_P(TextureZeroInitTest, CopyTextureToTexture) { EXPECT_TEXTURE_EQ(expected.data(), dstTexture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(dstTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(dstTexture.Get(), 0, 1, 0, 1)); } // This Tests the CopyTextureToTexture's copy only to a subset of the subresource, lazy init is @@ -459,8 +460,8 @@ TEST_P(TextureZeroInitTest, CopyTextureToTextureHalf) { EXPECT_TEXTURE_EQ(expectedWithZeros.data(), dstTexture, {kSize / 2, 0}, {kSize / 2, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(dstTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(dstTexture.Get(), 0, 1, 0, 1)); } // This tests the texture with depth attachment and load op load will init depth stencil texture to @@ -502,7 +503,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepth) { EXPECT_TEXTURE_EQ(expected.data(), srcTexture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); } // This tests the texture with stencil attachment and load op load will init depth stencil texture @@ -544,7 +545,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingStencil) { EXPECT_TEXTURE_EQ(expected.data(), srcTexture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); } // This tests the texture with depth stencil attachment and load op load will init depth stencil @@ -583,7 +584,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencil) { EXPECT_TEXTURE_EQ(expected.data(), srcTexture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1)); } // Test that clear state is tracked independently for depth/stencil textures. @@ -615,11 +616,11 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) { } // "all" subresources are not initialized; Depth is not initialized - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_All)); - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // Now load both depth and stencil. Depth should be cleared and stencil should stay the same @@ -654,11 +655,11 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) { } // Everything is initialized now - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_All)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // TODO(crbug.com/dawn/439): Implement stencil copies on other platforms @@ -690,11 +691,11 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) { } // "all" subresources are not initialized; Stencil is not initialized - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_All)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // Now load both depth and stencil. Stencil should be cleared and depth should stay the same @@ -728,11 +729,11 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) { } // Everything is initialized now - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_All)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // TODO(crbug.com/dawn/439): Implement stencil copies on other platforms @@ -775,11 +776,11 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilCopyAfterDiscard) { } // "all" subresources are not initialized; Stencil is not initialized - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, - 0, 1, WGPUTextureAspect_All)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, 0, - 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized( + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, + 0, 1, WGPUTextureAspect_All)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( + depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized( depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // Check by copy that the stencil data is lazily cleared to 0. @@ -788,12 +789,12 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilCopyAfterDiscard) { {kSize, kSize}, 0, wgpu::TextureAspect::StencilOnly)); // Everything is initialized now - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, 0, - 1, WGPUTextureAspect_All)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, 0, - 1, WGPUTextureAspect_DepthOnly)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, 0, - 1, WGPUTextureAspect_StencilOnly)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, 1, + 0, 1, WGPUTextureAspect_All)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( + depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_DepthOnly)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( + depthStencilTexture.Get(), 0, 1, 0, 1, WGPUTextureAspect_StencilOnly)); // Now load both depth and stencil. Stencil should be cleared and depth should stay the same // at 0.3. @@ -846,7 +847,7 @@ TEST_P(TextureZeroInitTest, ColorAttachmentsClear) { // Expect texture subresource initialized to be true EXPECT_EQ(true, - dawn_native::IsTextureSubresourceInitialized(renderPass.color.Get(), 0, 1, 0, 1)); + dawn::native::IsTextureSubresourceInitialized(renderPass.color.Get(), 0, 1, 0, 1)); } // This tests the clearing of sampled textures in render pass @@ -890,7 +891,7 @@ TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) { EXPECT_TEXTURE_EQ(expectedWithZeros.data(), renderTexture, {0, 0}, {kSize, kSize}); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(renderTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(renderTexture.Get(), 0, 1, 0, 1)); } // This is a regression test for a bug where a texture wouldn't get clear for a pass if at least @@ -950,7 +951,7 @@ TEST_P(TextureZeroInitTest, TextureBothSampledAndAttachmentClear) { EXPECT_TEXTURE_EQ(&RGBA8::kZero, texture, {0, 0, 1}, {1, 1}); // The whole texture is now initialized. - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 2)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 2)); } // This tests the clearing of sampled textures during compute pass @@ -1012,7 +1013,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) { EXPECT_BUFFER_U32_RANGE_EQ(expectedWithZeros.data(), bufferTex, 0, kFormatBlockByteSize); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // This tests that the code path of CopyTextureToBuffer clears correctly for non-renderable textures @@ -1045,7 +1046,7 @@ TEST_P(TextureZeroInitTest, NonRenderableTextureClear) { EXPECT_BUFFER_U32_RANGE_EQ(expectedWithZeros.data(), bufferDst, 0, kSize); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // This tests that the code path of CopyTextureToBuffer clears correctly for non-renderable textures @@ -1080,7 +1081,7 @@ TEST_P(TextureZeroInitTest, NonRenderableTextureClearUnalignedSize) { EXPECT_BUFFER_U32_RANGE_EQ(expectedWithZeros.data(), bufferDst, 0, kUnalignedSize); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // This tests that the code path of CopyTextureToBuffer clears correctly for non-renderable textures @@ -1114,7 +1115,7 @@ TEST_P(TextureZeroInitTest, NonRenderableTextureClearWithMultiArrayLayers) { EXPECT_BUFFER_U32_RANGE_EQ(expectedWithZeros.data(), bufferDst, 0, 8); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 1, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 1, 1)); } // This tests that storeOp clear resets resource state to uninitialized. @@ -1178,8 +1179,8 @@ TEST_P(TextureZeroInitTest, RenderPassStoreOpClear) { 1u, EXPECT_TEXTURE_EQ(expectedWithZeros.data(), renderTexture, {0, 0}, {kSize, kSize})); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(renderTexture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(renderTexture.Get(), 0, 1, 0, 1)); } // This tests storeOp Clear on depth and stencil textures. @@ -1232,8 +1233,8 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) { // Expect texture subresource initialized to be false since storeop is clear, sets // subresource as uninitialized - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, - 1, 0, 1)); + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, + 1, 0, 1)); } // Now we put the depth stencil texture back into renderpass, it should be cleared by loadop @@ -1257,8 +1258,8 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) { // Expect texture subresource initialized to be false since storeop is clear, sets // subresource as uninitialized - EXPECT_EQ(false, dawn_native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, - 1, 0, 1)); + EXPECT_EQ(false, dawn::native::IsTextureSubresourceInitialized(depthStencilTexture.Get(), 0, + 1, 0, 1)); } } @@ -1335,7 +1336,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedMip) { {mipSize, mipSize}, 1)); // Expect the whole texture to be initialized - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 2, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 2, 0, 1)); } // Test that if one layer of a texture is initialized and another is uninitialized, lazy clearing @@ -1419,7 +1420,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedArrayLayer) { 0u, EXPECT_TEXTURE_EQ(expectedWithTwos.data(), sampleTexture, {0, 0, 1}, {kSize, kSize})); // Expect the whole texture to be initialized - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 1, 0, 2)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 1, 0, 2)); } // This is a regression test for crbug.com/dawn/451 where the lazy texture @@ -1461,7 +1462,7 @@ TEST_P(TextureZeroInitTest, CopyTextureToBufferNonRenderableUnaligned) { } // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); } // In this test WriteTexture fully overwrites a texture @@ -1490,7 +1491,7 @@ TEST_P(TextureZeroInitTest, WriteWholeTexture) { &textureDataLayout, ©Size)); // Expect texture initialized to be true - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_TRUE(dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); EXPECT_TEXTURE_EQ(data.data(), texture, {0, 0}, {kSize, kSize}); } @@ -1524,7 +1525,7 @@ TEST_P(TextureZeroInitTest, WriteTextureHalf) { &textureDataLayout, ©Size)); // Expect texture initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1)); std::vector expectedZeros((kSize / 2) * kSize, {0, 0, 0, 0}); // first half filled with 100, by the data @@ -1565,8 +1566,8 @@ TEST_P(TextureZeroInitTest, WriteWholeTextureArray) { &textureDataLayout, ©Size)); // Expect texture subresource initialized to be true - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, kBaseArrayLayer, - kCopyLayerCount)); + EXPECT_TRUE(dawn::native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, kBaseArrayLayer, + kCopyLayerCount)); for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) { EXPECT_TEXTURE_EQ(data.data(), texture, {0, 0, layer}, {kSize, kSize}); @@ -1606,8 +1607,8 @@ TEST_P(TextureZeroInitTest, WriteTextureArrayHalf) { &textureDataLayout, ©Size)); // Expect texture subresource initialized to be true - EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, - kBaseArrayLayer, kCopyLayerCount)); + EXPECT_EQ(true, dawn::native::IsTextureSubresourceInitialized( + texture.Get(), 0, 1, kBaseArrayLayer, kCopyLayerCount)); std::vector expectedZeros((kSize / 2) * kSize, {0, 0, 0, 0}); for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) { @@ -1648,7 +1649,7 @@ TEST_P(TextureZeroInitTest, WriteWholeTextureAtMipLevel) { &textureDataLayout, ©Size)); // Expect texture initialized to be true - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1)); + EXPECT_TRUE(dawn::native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1)); EXPECT_TEXTURE_EQ(data.data(), texture, {0, 0}, {kMipSize, kMipSize}, kMipLevel); } @@ -1687,7 +1688,7 @@ TEST_P(TextureZeroInitTest, WriteTextureHalfAtMipLevel) { // Expect texture initialized to be true EXPECT_EQ(true, - dawn_native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1)); + dawn::native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1)); std::vector expectedZeros((kMipSize / 2) * kMipSize, {0, 0, 0, 0}); // first half filled with 100, by the data @@ -1823,8 +1824,8 @@ class CompressedTextureZeroInitTest : public TextureZeroInitTest { {0x00, 0x20, 0x08, 0xFF}); EXPECT_TEXTURE_EQ(expected.data(), renderPass.color, {0, 0}, {nonPaddedCopyExtent.width, nonPaddedCopyExtent.height}); - EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(bcTexture.Get(), viewMipmapLevel, - 1, baseArrayLayer, 1)); + EXPECT_TRUE(dawn::native::IsTextureSubresourceInitialized(bcTexture.Get(), viewMipmapLevel, + 1, baseArrayLayer, 1)); // If we only copied to half the texture, check the other half is initialized to black if (halfCopyTest) { diff --git a/src/tests/end2end/VideoViewsTests_gbm.cpp b/src/tests/end2end/VideoViewsTests_gbm.cpp index 946eb848aa..a2540e9e4f 100644 --- a/src/tests/end2end/VideoViewsTests_gbm.cpp +++ b/src/tests/end2end/VideoViewsTests_gbm.cpp @@ -158,7 +158,7 @@ class VideoViewsTestBackendGbm : public VideoViewsTestBackend { internalDesc.internalUsage = wgpu::TextureUsage::CopySrc; textureDesc.nextInChain = &internalDesc; - dawn_native::vulkan::ExternalImageDescriptorDmaBuf descriptor = {}; + dawn::native::vulkan::ExternalImageDescriptorDmaBuf descriptor = {}; descriptor.cTextureDescriptor = reinterpret_cast(&textureDesc); descriptor.isInitialized = true; @@ -169,16 +169,16 @@ class VideoViewsTestBackendGbm : public VideoViewsTestBackend { descriptor.waitFDs = {}; return std::make_unique( - wgpu::Texture::Acquire(dawn_native::vulkan::WrapVulkanImage(mWGPUDevice, &descriptor)), + wgpu::Texture::Acquire(dawn::native::vulkan::WrapVulkanImage(mWGPUDevice, &descriptor)), gbmBo); } void DestroyVideoTextureForTest( std::unique_ptr&& platformTexture) override { // Exports the signal and ignores it. - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(platformTexture->wgpuTexture.Get(), - VK_IMAGE_LAYOUT_GENERAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(platformTexture->wgpuTexture.Get(), + VK_IMAGE_LAYOUT_GENERAL, &exportInfo); for (int fd : exportInfo.semaphoreHandles) { ASSERT_NE(fd, -1); close(fd); diff --git a/src/tests/end2end/VideoViewsTests_win.cpp b/src/tests/end2end/VideoViewsTests_win.cpp index 18b63a08c8..1d38e8ff21 100644 --- a/src/tests/end2end/VideoViewsTests_win.cpp +++ b/src/tests/end2end/VideoViewsTests_win.cpp @@ -43,7 +43,7 @@ class VideoViewsTestBackendWin : public VideoViewsTestBackend { mWGPUDevice = device; // Create the D3D11 device/contexts that will be used in subsequent tests - ComPtr d3d12Device = dawn_native::d3d12::GetD3D12Device(device); + ComPtr d3d12Device = dawn::native::d3d12::GetD3D12Device(device); const LUID adapterLuid = d3d12Device->GetAdapterLuid(); @@ -144,7 +144,7 @@ class VideoViewsTestBackendWin : public VideoViewsTestBackend { hr = d3d11Texture.As(&dxgiKeyedMutex); ASSERT(hr == S_OK); - using dawn_native::d3d12::kDXGIKeyedMutexAcquireReleaseKey; + using dawn::native::d3d12::kDXGIKeyedMutexAcquireReleaseKey; hr = dxgiKeyedMutex->AcquireSync(kDXGIKeyedMutexAcquireReleaseKey, INFINITE); ASSERT(hr == S_OK); @@ -153,18 +153,18 @@ class VideoViewsTestBackendWin : public VideoViewsTestBackend { // Open the DX11 texture in Dawn from the shared handle and return it as a WebGPU // texture. - dawn_native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc; + dawn::native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc; externalImageDesc.cTextureDescriptor = reinterpret_cast(&textureDesc); externalImageDesc.sharedHandle = sharedHandle; - std::unique_ptr externalImage = - dawn_native::d3d12::ExternalImageDXGI::Create(mWGPUDevice, &externalImageDesc); + std::unique_ptr externalImage = + dawn::native::d3d12::ExternalImageDXGI::Create(mWGPUDevice, &externalImageDesc); // Handle is no longer needed once resources are created. ::CloseHandle(sharedHandle); - dawn_native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; + dawn::native::d3d12::ExternalImageAccessDescriptorDXGIKeyedMutex externalAccessDesc; externalAccessDesc.isInitialized = true; externalAccessDesc.usage = static_cast(textureDesc.usage); diff --git a/src/tests/end2end/WindowSurfaceTests.cpp b/src/tests/end2end/WindowSurfaceTests.cpp index c6b548180f..d8160b60f3 100644 --- a/src/tests/end2end/WindowSurfaceTests.cpp +++ b/src/tests/end2end/WindowSurfaceTests.cpp @@ -50,7 +50,7 @@ class WindowSurfaceInstanceTests : public testing::Test { }); DAWN_TEST_UNSUPPORTED_IF(!glfwInit()); - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); mInstance = wgpu::CreateInstance(); } diff --git a/src/tests/unittests/AsyncTaskTests.cpp b/src/tests/unittests/AsyncTaskTests.cpp index 0593d4c7ce..2eb0b055fa 100644 --- a/src/tests/unittests/AsyncTaskTests.cpp +++ b/src/tests/unittests/AsyncTaskTests.cpp @@ -13,7 +13,7 @@ // limitations under the License. // // AsyncTaskTests: -// Simple tests for dawn_native::AsyncTask and dawn_native::AsnycTaskManager. +// Simple tests for dawn::native::AsyncTask and dawn::native::AsnycTaskManager. #include @@ -67,13 +67,13 @@ TEST_F(AsyncTaskTest, Basic) { dawn::platform::Platform platform; std::unique_ptr pool = platform.CreateWorkerTaskPool(); - dawn_native::AsyncTaskManager taskManager(pool.get()); + dawn::native::AsyncTaskManager taskManager(pool.get()); ConcurrentTaskResultQueue taskResultQueue; constexpr size_t kTaskCount = 4u; std::set idset; for (uint32_t i = 0; i < kTaskCount; ++i) { - dawn_native::AsyncTask asyncTask([&taskResultQueue, i] { DoTask(&taskResultQueue, i); }); + dawn::native::AsyncTask asyncTask([&taskResultQueue, i] { DoTask(&taskResultQueue, i); }); taskManager.PostTask(std::move(asyncTask)); idset.insert(i); } diff --git a/src/tests/unittests/BuddyAllocatorTests.cpp b/src/tests/unittests/BuddyAllocatorTests.cpp index 5d46630372..7e4c282aac 100644 --- a/src/tests/unittests/BuddyAllocatorTests.cpp +++ b/src/tests/unittests/BuddyAllocatorTests.cpp @@ -15,7 +15,7 @@ #include #include "dawn_native/BuddyAllocator.h" -using namespace dawn_native; +using namespace dawn::native; constexpr uint64_t BuddyAllocator::kInvalidOffset; diff --git a/src/tests/unittests/BuddyMemoryAllocatorTests.cpp b/src/tests/unittests/BuddyMemoryAllocatorTests.cpp index 3876ad8763..0bc198f01f 100644 --- a/src/tests/unittests/BuddyMemoryAllocatorTests.cpp +++ b/src/tests/unittests/BuddyMemoryAllocatorTests.cpp @@ -21,7 +21,7 @@ #include #include -using namespace dawn_native; +using namespace dawn::native; class DummyResourceHeapAllocator : public ResourceHeapAllocator { public: diff --git a/src/tests/unittests/ChainUtilsTests.cpp b/src/tests/unittests/ChainUtilsTests.cpp index 2d437298f8..aa4c274a08 100644 --- a/src/tests/unittests/ChainUtilsTests.cpp +++ b/src/tests/unittests/ChainUtilsTests.cpp @@ -19,21 +19,21 @@ // Checks that we cannot find any structs in an empty chain TEST(ChainUtilsTests, FindEmptyChain) { - const dawn_native::PrimitiveDepthClampingState* info = nullptr; - dawn_native::FindInChain(nullptr, &info); + const dawn::native::PrimitiveDepthClampingState* info = nullptr; + dawn::native::FindInChain(nullptr, &info); ASSERT_EQ(nullptr, info); } // Checks that searching a chain for a present struct returns that struct TEST(ChainUtilsTests, FindPresentInChain) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; chain1.nextInChain = &chain2; - const dawn_native::PrimitiveDepthClampingState* info1 = nullptr; - const dawn_native::ShaderModuleSPIRVDescriptor* info2 = nullptr; - dawn_native::FindInChain(&chain1, &info1); - dawn_native::FindInChain(&chain1, &info2); + const dawn::native::PrimitiveDepthClampingState* info1 = nullptr; + const dawn::native::ShaderModuleSPIRVDescriptor* info2 = nullptr; + dawn::native::FindInChain(&chain1, &info1); + dawn::native::FindInChain(&chain1, &info2); ASSERT_NE(nullptr, info1); ASSERT_NE(nullptr, info2); @@ -41,40 +41,41 @@ TEST(ChainUtilsTests, FindPresentInChain) { // Checks that searching a chain for a struct that doesn't exist returns a nullptr TEST(ChainUtilsTests, FindMissingInChain) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; chain1.nextInChain = &chain2; - const dawn_native::SurfaceDescriptorFromMetalLayer* info = nullptr; - dawn_native::FindInChain(&chain1, &info); + const dawn::native::SurfaceDescriptorFromMetalLayer* info = nullptr; + dawn::native::FindInChain(&chain1, &info); ASSERT_EQ(nullptr, info); } // Checks that validation rejects chains with duplicate STypes TEST(ChainUtilsTests, ValidateDuplicateSTypes) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; - dawn_native::PrimitiveDepthClampingState chain3; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::PrimitiveDepthClampingState chain3; chain1.nextInChain = &chain2; chain2.nextInChain = &chain3; - dawn_native::MaybeError result = dawn_native::ValidateSTypes(&chain1, {}); + dawn::native::MaybeError result = dawn::native::ValidateSTypes(&chain1, {}); ASSERT_TRUE(result.IsError()); result.AcquireError(); } // Checks that validation rejects chains that contain unspecified STypes TEST(ChainUtilsTests, ValidateUnspecifiedSTypes) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; - dawn_native::ShaderModuleWGSLDescriptor chain3; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::ShaderModuleWGSLDescriptor chain3; chain1.nextInChain = &chain2; chain2.nextInChain = &chain3; - dawn_native::MaybeError result = dawn_native::ValidateSTypes(&chain1, { - {wgpu::SType::PrimitiveDepthClampingState}, - {wgpu::SType::ShaderModuleSPIRVDescriptor}, - }); + dawn::native::MaybeError result = + dawn::native::ValidateSTypes(&chain1, { + {wgpu::SType::PrimitiveDepthClampingState}, + {wgpu::SType::ShaderModuleSPIRVDescriptor}, + }); ASSERT_TRUE(result.IsError()); result.AcquireError(); } @@ -82,13 +83,14 @@ TEST(ChainUtilsTests, ValidateUnspecifiedSTypes) { // Checks that validation rejects chains that contain multiple STypes from the same oneof // constraint. TEST(ChainUtilsTests, ValidateOneOfFailure) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; - dawn_native::ShaderModuleWGSLDescriptor chain3; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::ShaderModuleWGSLDescriptor chain3; chain1.nextInChain = &chain2; chain2.nextInChain = &chain3; - dawn_native::MaybeError result = dawn_native::ValidateSTypes(&chain1, + dawn::native::MaybeError result = dawn::native::ValidateSTypes( + &chain1, {{wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::ShaderModuleWGSLDescriptor}}); ASSERT_TRUE(result.IsError()); result.AcquireError(); @@ -96,86 +98,89 @@ TEST(ChainUtilsTests, ValidateOneOfFailure) { // Checks that validation accepts chains that match the constraints. TEST(ChainUtilsTests, ValidateSuccess) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; chain1.nextInChain = &chain2; - dawn_native::MaybeError result = dawn_native::ValidateSTypes(&chain1, { - {wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::ShaderModuleWGSLDescriptor}, - {wgpu::SType::PrimitiveDepthClampingState}, - {wgpu::SType::SurfaceDescriptorFromMetalLayer}, - }); + dawn::native::MaybeError result = dawn::native::ValidateSTypes( + &chain1, + { + {wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::ShaderModuleWGSLDescriptor}, + {wgpu::SType::PrimitiveDepthClampingState}, + {wgpu::SType::SurfaceDescriptorFromMetalLayer}, + }); ASSERT_TRUE(result.IsSuccess()); } // Checks that validation always passes on empty chains. TEST(ChainUtilsTests, ValidateEmptyChain) { - dawn_native::MaybeError result = dawn_native::ValidateSTypes(nullptr, { - {wgpu::SType::ShaderModuleSPIRVDescriptor}, - {wgpu::SType::PrimitiveDepthClampingState}, - }); + dawn::native::MaybeError result = + dawn::native::ValidateSTypes(nullptr, { + {wgpu::SType::ShaderModuleSPIRVDescriptor}, + {wgpu::SType::PrimitiveDepthClampingState}, + }); ASSERT_TRUE(result.IsSuccess()); - result = dawn_native::ValidateSTypes(nullptr, {}); + result = dawn::native::ValidateSTypes(nullptr, {}); ASSERT_TRUE(result.IsSuccess()); } // Checks that singleton validation always passes on empty chains. TEST(ChainUtilsTests, ValidateSingleEmptyChain) { - dawn_native::MaybeError result = dawn_native::ValidateSingleSType(nullptr, - wgpu::SType::ShaderModuleSPIRVDescriptor); + dawn::native::MaybeError result = + dawn::native::ValidateSingleSType(nullptr, wgpu::SType::ShaderModuleSPIRVDescriptor); ASSERT_TRUE(result.IsSuccess()); - result = dawn_native::ValidateSingleSType(nullptr, - wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::PrimitiveDepthClampingState); + result = dawn::native::ValidateSingleSType(nullptr, wgpu::SType::ShaderModuleSPIRVDescriptor, + wgpu::SType::PrimitiveDepthClampingState); ASSERT_TRUE(result.IsSuccess()); } // Checks that singleton validation always fails on chains with multiple children. TEST(ChainUtilsTests, ValidateSingleMultiChain) { - dawn_native::PrimitiveDepthClampingState chain1; - dawn_native::ShaderModuleSPIRVDescriptor chain2; + dawn::native::PrimitiveDepthClampingState chain1; + dawn::native::ShaderModuleSPIRVDescriptor chain2; chain1.nextInChain = &chain2; - dawn_native::MaybeError result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::PrimitiveDepthClampingState); + dawn::native::MaybeError result = + dawn::native::ValidateSingleSType(&chain1, wgpu::SType::PrimitiveDepthClampingState); ASSERT_TRUE(result.IsError()); result.AcquireError(); - result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::PrimitiveDepthClampingState, wgpu::SType::ShaderModuleSPIRVDescriptor); + result = dawn::native::ValidateSingleSType(&chain1, wgpu::SType::PrimitiveDepthClampingState, + wgpu::SType::ShaderModuleSPIRVDescriptor); ASSERT_TRUE(result.IsError()); result.AcquireError(); } // Checks that singleton validation passes when the oneof constraint is met. TEST(ChainUtilsTests, ValidateSingleSatisfied) { - dawn_native::ShaderModuleWGSLDescriptor chain1; + dawn::native::ShaderModuleWGSLDescriptor chain1; - dawn_native::MaybeError result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::ShaderModuleWGSLDescriptor); + dawn::native::MaybeError result = + dawn::native::ValidateSingleSType(&chain1, wgpu::SType::ShaderModuleWGSLDescriptor); ASSERT_TRUE(result.IsSuccess()); - result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::ShaderModuleWGSLDescriptor); + result = dawn::native::ValidateSingleSType(&chain1, wgpu::SType::ShaderModuleSPIRVDescriptor, + wgpu::SType::ShaderModuleWGSLDescriptor); ASSERT_TRUE(result.IsSuccess()); - result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::ShaderModuleWGSLDescriptor, wgpu::SType::ShaderModuleSPIRVDescriptor); + result = dawn::native::ValidateSingleSType(&chain1, wgpu::SType::ShaderModuleWGSLDescriptor, + wgpu::SType::ShaderModuleSPIRVDescriptor); ASSERT_TRUE(result.IsSuccess()); } // Checks that singleton validation passes when the oneof constraint is not met. TEST(ChainUtilsTests, ValidateSingleUnsatisfied) { - dawn_native::PrimitiveDepthClampingState chain1; + dawn::native::PrimitiveDepthClampingState chain1; - dawn_native::MaybeError result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::ShaderModuleWGSLDescriptor); + dawn::native::MaybeError result = + dawn::native::ValidateSingleSType(&chain1, wgpu::SType::ShaderModuleWGSLDescriptor); ASSERT_TRUE(result.IsError()); result.AcquireError(); - result = dawn_native::ValidateSingleSType(&chain1, - wgpu::SType::ShaderModuleSPIRVDescriptor, wgpu::SType::ShaderModuleWGSLDescriptor); + result = dawn::native::ValidateSingleSType(&chain1, wgpu::SType::ShaderModuleSPIRVDescriptor, + wgpu::SType::ShaderModuleWGSLDescriptor); ASSERT_TRUE(result.IsError()); result.AcquireError(); } diff --git a/src/tests/unittests/CommandAllocatorTests.cpp b/src/tests/unittests/CommandAllocatorTests.cpp index 5d1ca9dbd6..70bfc51365 100644 --- a/src/tests/unittests/CommandAllocatorTests.cpp +++ b/src/tests/unittests/CommandAllocatorTests.cpp @@ -18,7 +18,7 @@ #include -using namespace dawn_native; +using namespace dawn::native; // Definition of the command types used in the tests enum class CommandType { diff --git a/src/tests/unittests/ConcurrentCacheTests.cpp b/src/tests/unittests/ConcurrentCacheTests.cpp index 957e4dd430..b733397b54 100644 --- a/src/tests/unittests/ConcurrentCacheTests.cpp +++ b/src/tests/unittests/ConcurrentCacheTests.cpp @@ -55,7 +55,7 @@ class ConcurrentCacheTest : public testing::Test { protected: dawn::platform::Platform mPlatform; std::unique_ptr mPool; - dawn_native::AsyncTaskManager mTaskManager; + dawn::native::AsyncTaskManager mTaskManager; ConcurrentCache mCache; }; @@ -69,10 +69,10 @@ TEST_F(ConcurrentCacheTest, InsertAtSameTime) { std::pair anotherInsertOutput = {}; ConcurrentCache* cachePtr = &mCache; - dawn_native::AsyncTask asyncTask1([&insertOutput, cachePtr, &cachedObject] { + dawn::native::AsyncTask asyncTask1([&insertOutput, cachePtr, &cachedObject] { insertOutput = cachePtr->Insert(&cachedObject); }); - dawn_native::AsyncTask asyncTask2([&anotherInsertOutput, cachePtr, &anotherCachedObject] { + dawn::native::AsyncTask asyncTask2([&anotherInsertOutput, cachePtr, &anotherCachedObject] { anotherInsertOutput = cachePtr->Insert(&anotherCachedObject); }); mTaskManager.PostTask(std::move(asyncTask1)); @@ -91,12 +91,12 @@ TEST_F(ConcurrentCacheTest, EraseAfterInsertion) { std::pair insertOutput = {}; ConcurrentCache* cachePtr = &mCache; - dawn_native::AsyncTask insertTask([&insertOutput, cachePtr, &cachedObject] { + dawn::native::AsyncTask insertTask([&insertOutput, cachePtr, &cachedObject] { insertOutput = cachePtr->Insert(&cachedObject); }); size_t erasedObjectCount = 0; - dawn_native::AsyncTask eraseTask([&erasedObjectCount, cachePtr, &cachedObject] { + dawn::native::AsyncTask eraseTask([&erasedObjectCount, cachePtr, &cachedObject] { while (cachePtr->Find(&cachedObject) == nullptr) { utils::USleep(100); } diff --git a/src/tests/unittests/EnumMaskIteratorTests.cpp b/src/tests/unittests/EnumMaskIteratorTests.cpp index d5e0bb58e2..59b008f807 100644 --- a/src/tests/unittests/EnumMaskIteratorTests.cpp +++ b/src/tests/unittests/EnumMaskIteratorTests.cpp @@ -16,7 +16,7 @@ #include "gtest/gtest.h" -namespace dawn_native { +namespace dawn::native { enum class TestAspect : uint8_t { Color = 1, @@ -29,18 +29,18 @@ namespace dawn_native { static constexpr unsigned value = 3; }; -} // namespace dawn_native +} // namespace dawn::native namespace dawn { template <> - struct IsDawnBitmask { + struct IsDawnBitmask { static constexpr bool enable = true; }; } // namespace dawn -namespace dawn_native { +namespace dawn::native { static_assert(EnumBitmaskSize::value == 3, ""); @@ -69,4 +69,4 @@ namespace dawn_native { } } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/tests/unittests/ErrorTests.cpp b/src/tests/unittests/ErrorTests.cpp index ff7b7fe556..bd1bf8c741 100644 --- a/src/tests/unittests/ErrorTests.cpp +++ b/src/tests/unittests/ErrorTests.cpp @@ -17,7 +17,7 @@ #include "dawn_native/Error.h" #include "dawn_native/ErrorData.h" -using namespace dawn_native; +using namespace dawn::native; namespace { diff --git a/src/tests/unittests/FeatureTests.cpp b/src/tests/unittests/FeatureTests.cpp index 4e1e7970dc..d7844ffd4a 100644 --- a/src/tests/unittests/FeatureTests.cpp +++ b/src/tests/unittests/FeatureTests.cpp @@ -22,24 +22,24 @@ class FeatureTests : public testing::Test { public: FeatureTests() : testing::Test(), - mInstanceBase(dawn_native::InstanceBase::Create()), + mInstanceBase(dawn::native::InstanceBase::Create()), mAdapterBase(mInstanceBase.Get()) { } std::vector GetAllFeatureNames() { std::vector allFeatureNames(kTotalFeaturesCount); for (size_t i = 0; i < kTotalFeaturesCount; ++i) { - allFeatureNames[i] = FeatureEnumToAPIFeature(static_cast(i)); + allFeatureNames[i] = FeatureEnumToAPIFeature(static_cast(i)); } return allFeatureNames; } static constexpr size_t kTotalFeaturesCount = - static_cast(dawn_native::Feature::EnumCount); + static_cast(dawn::native::Feature::EnumCount); protected: - Ref mInstanceBase; - dawn_native::null::Adapter mAdapterBase; + Ref mInstanceBase; + dawn::native::null::Adapter mAdapterBase; }; // Test the creation of a device will fail if the requested feature is not supported on the @@ -47,13 +47,13 @@ class FeatureTests : public testing::Test { TEST_F(FeatureTests, AdapterWithRequiredFeatureDisabled) { const std::vector kAllFeatureNames = GetAllFeatureNames(); for (size_t i = 0; i < kTotalFeaturesCount; ++i) { - dawn_native::Feature notSupportedFeature = static_cast(i); + dawn::native::Feature notSupportedFeature = static_cast(i); std::vector featureNamesWithoutOne = kAllFeatureNames; featureNamesWithoutOne.erase(featureNamesWithoutOne.begin() + i); mAdapterBase.SetSupportedFeatures(featureNamesWithoutOne); - dawn_native::Adapter adapterWithoutFeature(&mAdapterBase); + dawn::native::Adapter adapterWithoutFeature(&mAdapterBase); wgpu::DeviceDescriptor deviceDescriptor; wgpu::FeatureName featureName = FeatureEnumToAPIFeature(notSupportedFeature); @@ -68,16 +68,16 @@ TEST_F(FeatureTests, AdapterWithRequiredFeatureDisabled) { // Test Device.GetEnabledFeatures() can return the names of the enabled features correctly. TEST_F(FeatureTests, GetEnabledFeatures) { - dawn_native::Adapter adapter(&mAdapterBase); + dawn::native::Adapter adapter(&mAdapterBase); for (size_t i = 0; i < kTotalFeaturesCount; ++i) { - dawn_native::Feature feature = static_cast(i); + dawn::native::Feature feature = static_cast(i); wgpu::FeatureName featureName = FeatureEnumToAPIFeature(feature); wgpu::DeviceDescriptor deviceDescriptor; deviceDescriptor.requiredFeatures = &featureName; deviceDescriptor.requiredFeaturesCount = 1; - dawn_native::DeviceBase* deviceBase = dawn_native::FromAPI( + dawn::native::DeviceBase* deviceBase = dawn::native::FromAPI( adapter.CreateDevice(reinterpret_cast(&deviceDescriptor))); ASSERT_EQ(1u, deviceBase->APIEnumerateFeatures(nullptr)); diff --git a/src/tests/unittests/GetProcAddressTests.cpp b/src/tests/unittests/GetProcAddressTests.cpp index 1305dbc8b9..abf65d34cb 100644 --- a/src/tests/unittests/GetProcAddressTests.cpp +++ b/src/tests/unittests/GetProcAddressTests.cpp @@ -51,7 +51,7 @@ namespace { public: GetProcAddressTests() : testing::TestWithParam(), - mNativeInstance(dawn_native::InstanceBase::Create()), + mNativeInstance(dawn::native::InstanceBase::Create()), mNativeAdapter(mNativeInstance.Get()) { } @@ -60,7 +60,7 @@ namespace { case DawnFlavor::Native: { mDevice = wgpu::Device::Acquire( reinterpret_cast(mNativeAdapter.APICreateDevice())); - mProcs = dawn_native::GetProcs(); + mProcs = dawn::native::GetProcs(); break; } @@ -90,8 +90,8 @@ namespace { } protected: - Ref mNativeInstance; - dawn_native::null::Adapter mNativeAdapter; + Ref mNativeInstance; + dawn::native::null::Adapter mNativeAdapter; std::unique_ptr mC2sBuf; std::unique_ptr mWireClient; @@ -155,7 +155,7 @@ namespace { testing::PrintToStringParamName()); TEST(GetProcAddressInternalTests, CheckDawnNativeProcMapOrder) { - std::vector names = dawn_native::GetProcMapNamesForTesting(); + std::vector names = dawn::native::GetProcMapNamesForTesting(); for (size_t i = 1; i < names.size(); i++) { ASSERT_LT(std::string(names[i - 1]), std::string(names[i])); } diff --git a/src/tests/unittests/LimitsTests.cpp b/src/tests/unittests/LimitsTests.cpp index e931855dc1..88ac3561a4 100644 --- a/src/tests/unittests/LimitsTests.cpp +++ b/src/tests/unittests/LimitsTests.cpp @@ -18,10 +18,10 @@ // Test |GetDefaultLimits| returns the default. TEST(Limits, GetDefaultLimits) { - dawn_native::Limits limits = {}; + dawn::native::Limits limits = {}; EXPECT_NE(limits.maxBindGroups, 4u); - dawn_native::GetDefaultLimits(&limits); + dawn::native::GetDefaultLimits(&limits); EXPECT_EQ(limits.maxBindGroups, 4u); } @@ -29,11 +29,11 @@ TEST(Limits, GetDefaultLimits) { // Test |ReifyDefaultLimits| populates the default if // values are undefined. TEST(Limits, ReifyDefaultLimits_PopulatesDefault) { - dawn_native::Limits limits; + dawn::native::Limits limits; limits.maxComputeWorkgroupStorageSize = wgpu::kLimitU32Undefined; limits.maxStorageBufferBindingSize = wgpu::kLimitU64Undefined; - dawn_native::Limits reified = dawn_native::ReifyDefaultLimits(limits); + dawn::native::Limits reified = dawn::native::ReifyDefaultLimits(limits); EXPECT_EQ(reified.maxComputeWorkgroupStorageSize, 16352u); EXPECT_EQ(reified.maxStorageBufferBindingSize, 134217728ul); } @@ -41,11 +41,11 @@ TEST(Limits, ReifyDefaultLimits_PopulatesDefault) { // Test |ReifyDefaultLimits| clamps to the default if // values are worse than the default. TEST(Limits, ReifyDefaultLimits_Clamps) { - dawn_native::Limits limits; + dawn::native::Limits limits; limits.maxStorageBuffersPerShaderStage = 4; limits.minUniformBufferOffsetAlignment = 512; - dawn_native::Limits reified = dawn_native::ReifyDefaultLimits(limits); + dawn::native::Limits reified = dawn::native::ReifyDefaultLimits(limits); EXPECT_EQ(reified.maxStorageBuffersPerShaderStage, 8u); EXPECT_EQ(reified.minUniformBufferOffsetAlignment, 256u); } @@ -54,19 +54,19 @@ TEST(Limits, ReifyDefaultLimits_Clamps) { // than supported. TEST(Limits, ValidateLimits) { // Start with the default for supported. - dawn_native::Limits defaults; - dawn_native::GetDefaultLimits(&defaults); + dawn::native::Limits defaults; + dawn::native::GetDefaultLimits(&defaults); // Test supported == required is valid. { - dawn_native::Limits required = defaults; + dawn::native::Limits required = defaults; EXPECT_TRUE(ValidateLimits(defaults, required).IsSuccess()); } // Test supported == required is valid, when they are not default. { - dawn_native::Limits supported = defaults; - dawn_native::Limits required = defaults; + dawn::native::Limits supported = defaults; + dawn::native::Limits required = defaults; supported.maxBindGroups += 1; required.maxBindGroups += 1; EXPECT_TRUE(ValidateLimits(supported, required).IsSuccess()); @@ -74,38 +74,38 @@ TEST(Limits, ValidateLimits) { // Test that default-initialized (all undefined) is valid. { - dawn_native::Limits required = {}; + dawn::native::Limits required = {}; EXPECT_TRUE(ValidateLimits(defaults, required).IsSuccess()); } // Test that better than max is invalid. { - dawn_native::Limits required = {}; + dawn::native::Limits required = {}; required.maxTextureDimension3D = defaults.maxTextureDimension3D + 1; - dawn_native::MaybeError err = ValidateLimits(defaults, required); + dawn::native::MaybeError err = ValidateLimits(defaults, required); EXPECT_TRUE(err.IsError()); err.AcquireError(); } // Test that worse than max is valid. { - dawn_native::Limits required = {}; + dawn::native::Limits required = {}; required.maxComputeWorkgroupSizeX = defaults.maxComputeWorkgroupSizeX - 1; EXPECT_TRUE(ValidateLimits(defaults, required).IsSuccess()); } // Test that better than min is invalid. { - dawn_native::Limits required = {}; + dawn::native::Limits required = {}; required.minUniformBufferOffsetAlignment = defaults.minUniformBufferOffsetAlignment / 2; - dawn_native::MaybeError err = ValidateLimits(defaults, required); + dawn::native::MaybeError err = ValidateLimits(defaults, required); EXPECT_TRUE(err.IsError()); err.AcquireError(); } // Test that worse than min is valid. { - dawn_native::Limits required = {}; + dawn::native::Limits required = {}; required.minStorageBufferOffsetAlignment = defaults.minStorageBufferOffsetAlignment * 2; EXPECT_TRUE(ValidateLimits(defaults, required).IsSuccess()); } @@ -113,38 +113,38 @@ TEST(Limits, ValidateLimits) { // Test that |ApplyLimitTiers| degrades limits to the next best tier. TEST(Limits, ApplyLimitTiers) { - auto SetLimitsStorageBufferBindingSizeTier2 = [](dawn_native::Limits* limits) { + auto SetLimitsStorageBufferBindingSizeTier2 = [](dawn::native::Limits* limits) { limits->maxStorageBufferBindingSize = 1073741824; }; - dawn_native::Limits limitsStorageBufferBindingSizeTier2; - dawn_native::GetDefaultLimits(&limitsStorageBufferBindingSizeTier2); + dawn::native::Limits limitsStorageBufferBindingSizeTier2; + dawn::native::GetDefaultLimits(&limitsStorageBufferBindingSizeTier2); SetLimitsStorageBufferBindingSizeTier2(&limitsStorageBufferBindingSizeTier2); - auto SetLimitsStorageBufferBindingSizeTier3 = [](dawn_native::Limits* limits) { + auto SetLimitsStorageBufferBindingSizeTier3 = [](dawn::native::Limits* limits) { limits->maxStorageBufferBindingSize = 2147483647; }; - dawn_native::Limits limitsStorageBufferBindingSizeTier3; - dawn_native::GetDefaultLimits(&limitsStorageBufferBindingSizeTier3); + dawn::native::Limits limitsStorageBufferBindingSizeTier3; + dawn::native::GetDefaultLimits(&limitsStorageBufferBindingSizeTier3); SetLimitsStorageBufferBindingSizeTier3(&limitsStorageBufferBindingSizeTier3); - auto SetLimitsComputeWorkgroupStorageSizeTier1 = [](dawn_native::Limits* limits) { + auto SetLimitsComputeWorkgroupStorageSizeTier1 = [](dawn::native::Limits* limits) { limits->maxComputeWorkgroupStorageSize = 16352; }; - dawn_native::Limits limitsComputeWorkgroupStorageSizeTier1; - dawn_native::GetDefaultLimits(&limitsComputeWorkgroupStorageSizeTier1); + dawn::native::Limits limitsComputeWorkgroupStorageSizeTier1; + dawn::native::GetDefaultLimits(&limitsComputeWorkgroupStorageSizeTier1); SetLimitsComputeWorkgroupStorageSizeTier1(&limitsComputeWorkgroupStorageSizeTier1); - auto SetLimitsComputeWorkgroupStorageSizeTier3 = [](dawn_native::Limits* limits) { + auto SetLimitsComputeWorkgroupStorageSizeTier3 = [](dawn::native::Limits* limits) { limits->maxComputeWorkgroupStorageSize = 65536; }; - dawn_native::Limits limitsComputeWorkgroupStorageSizeTier3; - dawn_native::GetDefaultLimits(&limitsComputeWorkgroupStorageSizeTier3); + dawn::native::Limits limitsComputeWorkgroupStorageSizeTier3; + dawn::native::GetDefaultLimits(&limitsComputeWorkgroupStorageSizeTier3); SetLimitsComputeWorkgroupStorageSizeTier3(&limitsComputeWorkgroupStorageSizeTier3); // Test that applying tiers to limits that are exactly // equal to a tier returns the same values. { - dawn_native::Limits limits = limitsStorageBufferBindingSizeTier2; + dawn::native::Limits limits = limitsStorageBufferBindingSizeTier2; EXPECT_EQ(ApplyLimitTiers(limits), limits); limits = limitsStorageBufferBindingSizeTier3; @@ -153,7 +153,7 @@ TEST(Limits, ApplyLimitTiers) { // Test all limits slightly worse than tier 3. { - dawn_native::Limits limits = limitsStorageBufferBindingSizeTier3; + dawn::native::Limits limits = limitsStorageBufferBindingSizeTier3; limits.maxStorageBufferBindingSize -= 1; EXPECT_EQ(ApplyLimitTiers(limits), limitsStorageBufferBindingSizeTier2); } @@ -161,28 +161,28 @@ TEST(Limits, ApplyLimitTiers) { // Test that limits may match one tier exactly and be degraded in another tier. // Degrading to one tier does not affect the other tier. { - dawn_native::Limits limits = limitsComputeWorkgroupStorageSizeTier3; + dawn::native::Limits limits = limitsComputeWorkgroupStorageSizeTier3; // Set tier 3 and change one limit to be insufficent. SetLimitsStorageBufferBindingSizeTier3(&limits); limits.maxStorageBufferBindingSize -= 1; - dawn_native::Limits tiered = ApplyLimitTiers(limits); + dawn::native::Limits tiered = ApplyLimitTiers(limits); // Check that |tiered| has the limits of memorySize tier 2 - dawn_native::Limits tieredWithMemorySizeTier2 = tiered; + dawn::native::Limits tieredWithMemorySizeTier2 = tiered; SetLimitsStorageBufferBindingSizeTier2(&tieredWithMemorySizeTier2); EXPECT_EQ(tiered, tieredWithMemorySizeTier2); // Check that |tiered| has the limits of bindingSpace tier 3 - dawn_native::Limits tieredWithBindingSpaceTier3 = tiered; + dawn::native::Limits tieredWithBindingSpaceTier3 = tiered; SetLimitsComputeWorkgroupStorageSizeTier3(&tieredWithBindingSpaceTier3); EXPECT_EQ(tiered, tieredWithBindingSpaceTier3); } // Test that limits may be simultaneously degraded in two tiers independently. { - dawn_native::Limits limits; - dawn_native::GetDefaultLimits(&limits); + dawn::native::Limits limits; + dawn::native::GetDefaultLimits(&limits); SetLimitsComputeWorkgroupStorageSizeTier3(&limits); SetLimitsStorageBufferBindingSizeTier3(&limits); limits.maxComputeWorkgroupStorageSize = @@ -190,9 +190,9 @@ TEST(Limits, ApplyLimitTiers) { limits.maxStorageBufferBindingSize = limitsStorageBufferBindingSizeTier2.maxStorageBufferBindingSize + 1; - dawn_native::Limits tiered = ApplyLimitTiers(limits); + dawn::native::Limits tiered = ApplyLimitTiers(limits); - dawn_native::Limits expected = tiered; + dawn::native::Limits expected = tiered; SetLimitsComputeWorkgroupStorageSizeTier1(&expected); SetLimitsStorageBufferBindingSizeTier2(&expected); EXPECT_EQ(tiered, expected); diff --git a/src/tests/unittests/PerStageTests.cpp b/src/tests/unittests/PerStageTests.cpp index dcecd83dc0..736bb7677f 100644 --- a/src/tests/unittests/PerStageTests.cpp +++ b/src/tests/unittests/PerStageTests.cpp @@ -16,7 +16,7 @@ #include "dawn_native/PerStage.h" -using namespace dawn_native; +using namespace dawn::native; // Tests for StageBit TEST(PerStage, StageBit) { diff --git a/src/tests/unittests/PerThreadProcTests.cpp b/src/tests/unittests/PerThreadProcTests.cpp index 6151a6c8aa..47b29342e2 100644 --- a/src/tests/unittests/PerThreadProcTests.cpp +++ b/src/tests/unittests/PerThreadProcTests.cpp @@ -25,14 +25,14 @@ class PerThreadProcTests : public testing::Test { public: PerThreadProcTests() - : mNativeInstance(dawn_native::InstanceBase::Create()), + : mNativeInstance(dawn::native::InstanceBase::Create()), mNativeAdapter(mNativeInstance.Get()) { } ~PerThreadProcTests() override = default; protected: - Ref mNativeInstance; - dawn_native::null::Adapter mNativeAdapter; + Ref mNativeInstance; + dawn::native::null::Adapter mNativeAdapter; }; // Test that procs can be set per thread. This test overrides deviceCreateBuffer with a dummy proc @@ -63,7 +63,7 @@ TEST_F(PerThreadProcTests, DispatchesPerThread) { wgpu::Device::Acquire(reinterpret_cast(mNativeAdapter.APICreateDevice())); std::thread threadA([&]() { - DawnProcTable procs = dawn_native::GetProcs(); + DawnProcTable procs = dawn::native::GetProcs(); procs.deviceCreateBuffer = [](WGPUDevice device, WGPUBufferDescriptor const* descriptor) -> WGPUBuffer { EXPECT_EQ(std::this_thread::get_id(), threadIdA); @@ -84,7 +84,7 @@ TEST_F(PerThreadProcTests, DispatchesPerThread) { }); std::thread threadB([&]() { - DawnProcTable procs = dawn_native::GetProcs(); + DawnProcTable procs = dawn::native::GetProcs(); procs.deviceCreateBuffer = [](WGPUDevice device, WGPUBufferDescriptor const* bufferDesc) -> WGPUBuffer { EXPECT_EQ(std::this_thread::get_id(), threadIdB); diff --git a/src/tests/unittests/RingBufferAllocatorTests.cpp b/src/tests/unittests/RingBufferAllocatorTests.cpp index aa14e7c7cf..3787ba3ded 100644 --- a/src/tests/unittests/RingBufferAllocatorTests.cpp +++ b/src/tests/unittests/RingBufferAllocatorTests.cpp @@ -16,7 +16,7 @@ #include "dawn_native/RingBufferAllocator.h" -using namespace dawn_native; +using namespace dawn::native; constexpr uint64_t RingBufferAllocator::kInvalidOffset; diff --git a/src/tests/unittests/SubresourceStorageTests.cpp b/src/tests/unittests/SubresourceStorageTests.cpp index b9b4fc3963..f1e28b3542 100644 --- a/src/tests/unittests/SubresourceStorageTests.cpp +++ b/src/tests/unittests/SubresourceStorageTests.cpp @@ -18,7 +18,7 @@ #include "common/Log.h" -using namespace dawn_native; +using namespace dawn::native; // A fake class that replicates the behavior of SubresourceStorage but without any compression and // is used to compare the results of operations on SubresourceStorage against the "ground truth" of diff --git a/src/tests/unittests/ToBackendTests.cpp b/src/tests/unittests/ToBackendTests.cpp index 01bbc17127..76513503db 100644 --- a/src/tests/unittests/ToBackendTests.cpp +++ b/src/tests/unittests/ToBackendTests.cpp @@ -20,11 +20,11 @@ #include // Make our own Base - Backend object pair, reusing the AdapterBase name -namespace dawn_native { +namespace dawn::native { class AdapterBase : public RefCounted {}; -} // namespace dawn_native +} // namespace dawn::native -using namespace dawn_native; +using namespace dawn::native; class MyAdapter : public AdapterBase {}; diff --git a/src/tests/unittests/d3d12/CopySplitTests.cpp b/src/tests/unittests/d3d12/CopySplitTests.cpp index f8feafe766..0e265a2926 100644 --- a/src/tests/unittests/d3d12/CopySplitTests.cpp +++ b/src/tests/unittests/d3d12/CopySplitTests.cpp @@ -23,7 +23,7 @@ #include "dawn_native/d3d12/d3d12_platform.h" #include "utils/TestUtils.h" -using namespace dawn_native::d3d12; +using namespace dawn::native::d3d12; namespace { diff --git a/src/tests/unittests/native/CommandBufferEncodingTests.cpp b/src/tests/unittests/native/CommandBufferEncodingTests.cpp index c1ca2d993b..6515067474 100644 --- a/src/tests/unittests/native/CommandBufferEncodingTests.cpp +++ b/src/tests/unittests/native/CommandBufferEncodingTests.cpp @@ -21,11 +21,11 @@ class CommandBufferEncodingTests : public DawnNativeTest { protected: - void ExpectCommands(dawn_native::CommandIterator* commands, - std::vector>> + void ExpectCommands(dawn::native::CommandIterator* commands, + std::vector>> expectedCommands) { - dawn_native::Command commandId; + dawn::native::Command commandId; for (uint32_t commandIndex = 0; commands->NextCommandId(&commandId); ++commandIndex) { ASSERT_LT(commandIndex, expectedCommands.size()) << "Unexpected command"; ASSERT_EQ(commandId, expectedCommands[commandIndex].first) @@ -38,7 +38,7 @@ class CommandBufferEncodingTests : public DawnNativeTest { // Indirect dispatch validation changes the bind groups in the middle // of a pass. Test that bindings are restored after the validation runs. TEST_F(CommandBufferEncodingTests, ComputePassEncoderIndirectDispatchStateRestoration) { - using namespace dawn_native; + using namespace dawn::native; wgpu::BindGroupLayout staticLayout = utils::MakeBindGroupLayout(device, {{ @@ -274,7 +274,7 @@ TEST_F(CommandBufferEncodingTests, ComputePassEncoderIndirectDispatchStateRestor // and does not leak state changes that occured between a snapshot and the // state restoration. TEST_F(CommandBufferEncodingTests, StateNotLeakedAfterRestore) { - using namespace dawn_native; + using namespace dawn::native; wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); diff --git a/src/tests/unittests/native/DestroyObjectTests.cpp b/src/tests/unittests/native/DestroyObjectTests.cpp index 99acf28005..bff48204e7 100644 --- a/src/tests/unittests/native/DestroyObjectTests.cpp +++ b/src/tests/unittests/native/DestroyObjectTests.cpp @@ -32,7 +32,7 @@ #include "tests/DawnNativeTest.h" #include "utils/ComboRenderPipelineDescriptor.h" -namespace dawn_native { namespace { +namespace dawn::native { namespace { using ::testing::_; using ::testing::ByMove; @@ -754,4 +754,4 @@ namespace dawn_native { namespace { EXPECT_FALSE(textureView->IsAlive()); } -}} // namespace dawn_native:: +}} // namespace dawn::native:: diff --git a/src/tests/unittests/native/DeviceCreationTests.cpp b/src/tests/unittests/native/DeviceCreationTests.cpp index 64022861dd..1a8ddb6c08 100644 --- a/src/tests/unittests/native/DeviceCreationTests.cpp +++ b/src/tests/unittests/native/DeviceCreationTests.cpp @@ -27,11 +27,11 @@ namespace { class DeviceCreationTest : public testing::Test { protected: void SetUp() override { - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); - instance = std::make_unique(); + instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - for (dawn_native::Adapter& nativeAdapter : instance->GetAdapters()) { + for (dawn::native::Adapter& nativeAdapter : instance->GetAdapters()) { wgpu::AdapterProperties properties; nativeAdapter.GetProperties(&properties); @@ -49,7 +49,7 @@ namespace { dawnProcSetProcs(nullptr); } - std::unique_ptr instance; + std::unique_ptr instance; wgpu::Adapter adapter; }; @@ -79,7 +79,7 @@ namespace { wgpu::Device device = adapter.CreateDevice(&desc); EXPECT_NE(device, nullptr); - auto toggles = dawn_native::GetTogglesUsed(device.Get()); + auto toggles = dawn::native::GetTogglesUsed(device.Get()); EXPECT_THAT(toggles, testing::Contains(testing::StrEq(toggle))); } diff --git a/src/tests/unittests/native/mocks/BindGroupLayoutMock.h b/src/tests/unittests/native/mocks/BindGroupLayoutMock.h index 56df3749b2..841e5c8ccd 100644 --- a/src/tests/unittests/native/mocks/BindGroupLayoutMock.h +++ b/src/tests/unittests/native/mocks/BindGroupLayoutMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class BindGroupLayoutMock final : public BindGroupLayoutBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUPLAYOUT_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/BindGroupMock.h b/src/tests/unittests/native/mocks/BindGroupMock.h index bc5e234051..6faec4eb6a 100644 --- a/src/tests/unittests/native/mocks/BindGroupMock.h +++ b/src/tests/unittests/native/mocks/BindGroupMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class BindGroupMock : public BindGroupBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUP_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/BufferMock.h b/src/tests/unittests/native/mocks/BufferMock.h index 4b6685456e..9b69e2a1a7 100644 --- a/src/tests/unittests/native/mocks/BufferMock.h +++ b/src/tests/unittests/native/mocks/BufferMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class BufferMock : public BufferBase { public: @@ -44,6 +44,6 @@ namespace dawn_native { MOCK_METHOD(bool, IsCPUWritableAtCreation, (), (const, override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUP_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/CommandBufferMock.h b/src/tests/unittests/native/mocks/CommandBufferMock.h index 88caa23945..7b0ee0876d 100644 --- a/src/tests/unittests/native/mocks/CommandBufferMock.h +++ b/src/tests/unittests/native/mocks/CommandBufferMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class CommandBufferMock : public CommandBufferBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_COMMANDBUFFER_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/ComputePipelineMock.h b/src/tests/unittests/native/mocks/ComputePipelineMock.h index 84b6278fe9..c6208d835c 100644 --- a/src/tests/unittests/native/mocks/ComputePipelineMock.h +++ b/src/tests/unittests/native/mocks/ComputePipelineMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class ComputePipelineMock : public ComputePipelineBase { public: @@ -36,6 +36,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_COMPUTEPIPELINE_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/DeviceMock.h b/src/tests/unittests/native/mocks/DeviceMock.h index 97df57f616..4e673f34d2 100644 --- a/src/tests/unittests/native/mocks/DeviceMock.h +++ b/src/tests/unittests/native/mocks/DeviceMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class DeviceMock : public DeviceBase { public: @@ -112,6 +112,6 @@ namespace dawn_native { MOCK_METHOD(MaybeError, WaitForIdleForDestruction, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_DEVICE_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/ExternalTextureMock.h b/src/tests/unittests/native/mocks/ExternalTextureMock.h index 57c0c9f332..3e3ba2cd23 100644 --- a/src/tests/unittests/native/mocks/ExternalTextureMock.h +++ b/src/tests/unittests/native/mocks/ExternalTextureMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class ExternalTextureMock : public ExternalTextureBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_EXTERNALTEXTURE_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/PipelineLayoutMock.h b/src/tests/unittests/native/mocks/PipelineLayoutMock.h index c35d5ed259..5201f3b3dc 100644 --- a/src/tests/unittests/native/mocks/PipelineLayoutMock.h +++ b/src/tests/unittests/native/mocks/PipelineLayoutMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class PipelineLayoutMock : public PipelineLayoutBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_PIPELINELAYOUT_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/QuerySetMock.h b/src/tests/unittests/native/mocks/QuerySetMock.h index 1554fff9ae..138b143074 100644 --- a/src/tests/unittests/native/mocks/QuerySetMock.h +++ b/src/tests/unittests/native/mocks/QuerySetMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class QuerySetMock : public QuerySetBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_QUERYSET_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/RenderPipelineMock.h b/src/tests/unittests/native/mocks/RenderPipelineMock.h index 12701c3b05..f573dcda94 100644 --- a/src/tests/unittests/native/mocks/RenderPipelineMock.h +++ b/src/tests/unittests/native/mocks/RenderPipelineMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class RenderPipelineMock : public RenderPipelineBase { public: @@ -36,6 +36,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_RENDERPIPELINE_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/SamplerMock.h b/src/tests/unittests/native/mocks/SamplerMock.h index 56df161a27..4103398e45 100644 --- a/src/tests/unittests/native/mocks/SamplerMock.h +++ b/src/tests/unittests/native/mocks/SamplerMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class SamplerMock : public SamplerBase { public: @@ -34,6 +34,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_SAMPLER_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/ShaderModuleMock.cpp b/src/tests/unittests/native/mocks/ShaderModuleMock.cpp index 9b5ab09dff..4c7da22f09 100644 --- a/src/tests/unittests/native/mocks/ShaderModuleMock.cpp +++ b/src/tests/unittests/native/mocks/ShaderModuleMock.cpp @@ -14,7 +14,7 @@ #include "ShaderModuleMock.h" -namespace dawn_native { +namespace dawn::native { ShaderModuleMock::ShaderModuleMock(DeviceBase* device) : ShaderModuleBase(device) { ON_CALL(*this, DestroyImpl).WillByDefault([this]() { @@ -37,4 +37,4 @@ namespace dawn_native { return AcquireRef(mock); } -} // namespace dawn_native +} // namespace dawn::native diff --git a/src/tests/unittests/native/mocks/ShaderModuleMock.h b/src/tests/unittests/native/mocks/ShaderModuleMock.h index 0b3e650058..349377a09d 100644 --- a/src/tests/unittests/native/mocks/ShaderModuleMock.h +++ b/src/tests/unittests/native/mocks/ShaderModuleMock.h @@ -23,7 +23,7 @@ #include -namespace dawn_native { +namespace dawn::native { class ShaderModuleMock : public ShaderModuleBase { public: @@ -36,6 +36,6 @@ namespace dawn_native { static ResultOrError> Create(DeviceBase* device, const char* source); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_SHADERMODULE_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/SwapChainMock.h b/src/tests/unittests/native/mocks/SwapChainMock.h index 233da739ce..4619c576c2 100644 --- a/src/tests/unittests/native/mocks/SwapChainMock.h +++ b/src/tests/unittests/native/mocks/SwapChainMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class SwapChainMock : public SwapChainBase { public: @@ -41,6 +41,6 @@ namespace dawn_native { MOCK_METHOD(void, APIPresent, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_SWAPCHAIN_MOCK_H_ diff --git a/src/tests/unittests/native/mocks/TextureMock.h b/src/tests/unittests/native/mocks/TextureMock.h index 95e53bee0b..181bd551ec 100644 --- a/src/tests/unittests/native/mocks/TextureMock.h +++ b/src/tests/unittests/native/mocks/TextureMock.h @@ -20,7 +20,7 @@ #include -namespace dawn_native { +namespace dawn::native { class TextureMock : public TextureBase { public: @@ -44,6 +44,6 @@ namespace dawn_native { MOCK_METHOD(void, DestroyImpl, (), (override)); }; -} // namespace dawn_native +} // namespace dawn::native #endif // TESTS_UNITTESTS_NATIVE_MOCKS_TEXTURE_MOCK_H_ diff --git a/src/tests/unittests/validation/CommandBufferValidationTests.cpp b/src/tests/unittests/validation/CommandBufferValidationTests.cpp index 7ec37afa21..e6e2818f39 100644 --- a/src/tests/unittests/validation/CommandBufferValidationTests.cpp +++ b/src/tests/unittests/validation/CommandBufferValidationTests.cpp @@ -318,7 +318,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.EndPass(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished.")); } @@ -327,13 +327,13 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.EndPass(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); } // Destroyed encoder should allow encoding, and emit error on finish. { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.EndPass(); ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished.")); @@ -342,7 +342,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) { // Destroyed encoder should allow encoding and shouldn't emit an error if never finished. { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.EndPass(); } @@ -353,21 +353,21 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) { wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); pass.EndPass(); encoder.Finish(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); } // Destroying an encoder twice should not emit any errors. { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - dawn_native::FromAPI(encoder.Get())->Destroy(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); } // Destroying an encoder twice and then calling finish should fail. { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - dawn_native::FromAPI(encoder.Get())->Destroy(); - dawn_native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); + dawn::native::FromAPI(encoder.Get())->Destroy(); ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished.")); } } diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp index 62ccab97b8..625f29ea05 100644 --- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp +++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp @@ -234,50 +234,50 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) { }; // Textures not used default to non-filtering - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, unusedTextureFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, unusedTextureFragmentModule).Get(), filteringBGL.Get())); // Textures used with textureLoad default to non-filtering - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, textureLoadFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, textureLoadFragmentModule).Get(), filteringBGL.Get())); // Textures used with textureLoad on both stages default to non-filtering - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureLoadVertexModule, textureLoadFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureLoadVertexModule, textureLoadFragmentModule).Get(), filteringBGL.Get())); // Textures used with textureSample default to filtering - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, textureSampleFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(emptyVertexModule, textureSampleFragmentModule).Get(), filteringBGL.Get())); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureSampleVertexModule, unusedTextureFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureSampleVertexModule, unusedTextureFragmentModule).Get(), filteringBGL.Get())); // Textures used with both textureLoad and textureSample default to filtering - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureLoadVertexModule, textureSampleFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureLoadVertexModule, textureSampleFragmentModule).Get(), filteringBGL.Get())); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureSampleVertexModule, textureLoadFragmentModule).Get(), nonFilteringBGL.Get())); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( BGLFromModules(textureSampleVertexModule, textureLoadFragmentModule).Get(), filteringBGL.Get())); } @@ -317,7 +317,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) { desc.entryCount = 1; desc.entries = &binding; - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -351,7 +351,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { var pos : vec4 = ssbo.pos; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } { @@ -365,7 +365,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { var pos : vec4 = uniforms.pos; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -380,7 +380,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { var pos : vec4 = ssbo.pos; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -394,7 +394,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -406,7 +406,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -419,7 +419,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[stage(fragment)]] fn main() { _ = mySampler; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } } @@ -447,7 +447,7 @@ TEST_F(GetBindGroupLayoutTests, ExternalTextureBindingType) { [[stage(fragment)]] fn main() { _ = myExternalTexture; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -475,7 +475,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -487,7 +487,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -499,7 +499,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -511,7 +511,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -523,7 +523,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -535,7 +535,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } } @@ -563,7 +563,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -575,7 +575,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -587,7 +587,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { [[stage(fragment)]] fn main() { textureDimensions(myTexture); })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } } @@ -620,7 +620,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[stage(fragment)]] fn main() { var pos : vec4 = uniforms.pos; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -635,7 +635,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[stage(fragment)]] fn main() { var pos : vec4 = uniforms.pos; })"); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } @@ -650,7 +650,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[stage(fragment)]] fn main() { var pos : vec4 = uniforms.pos; })"); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); } } @@ -762,7 +762,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { descriptor.vertex.module = vsModule4; descriptor.cFragment.module = fsModule4; wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), bgl4.Get())); } @@ -771,7 +771,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { descriptor.vertex.module = vsModule64; descriptor.cFragment.module = fsModule4; wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), bgl64.Get())); } @@ -780,7 +780,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { descriptor.vertex.module = vsModule4; descriptor.cFragment.module = fsModule64; wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), bgl64.Get())); } } @@ -834,7 +834,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); binding.visibility = wgpu::ShaderStage::Vertex; - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), device.CreateBindGroupLayout(&desc).Get())); } @@ -845,7 +845,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); binding.visibility = wgpu::ShaderStage::Fragment; - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), device.CreateBindGroupLayout(&desc).Get())); } @@ -856,7 +856,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); binding.visibility = wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Vertex; - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), device.CreateBindGroupLayout(&desc).Get())); } } @@ -1005,13 +1005,13 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) { wgpu::BindGroupLayout emptyBindGroupLayout = device.CreateBindGroupLayout(&desc); - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(0).Get(), emptyBindGroupLayout.Get())); // Used - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(1).Get(), emptyBindGroupLayout.Get())); // Not Used. - EXPECT_FALSE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_FALSE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(2).Get(), emptyBindGroupLayout.Get())); // Used. - EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( + EXPECT_TRUE(dawn::native::BindGroupLayoutBindingsEqualForTesting( pipeline.GetBindGroupLayout(3).Get(), emptyBindGroupLayout.Get())); // Not used } diff --git a/src/tests/unittests/validation/LabelTests.cpp b/src/tests/unittests/validation/LabelTests.cpp index f8fd3b6a23..f05d0e168c 100644 --- a/src/tests/unittests/validation/LabelTests.cpp +++ b/src/tests/unittests/validation/LabelTests.cpp @@ -33,7 +33,7 @@ TEST_F(LabelTest, BindGroup) { // The label should be empty if one was not set. { wgpu::BindGroup bindGroup = device.CreateBindGroup(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroup.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroup.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -41,7 +41,7 @@ TEST_F(LabelTest, BindGroup) { { wgpu::BindGroup bindGroup = device.CreateBindGroup(&descriptor); bindGroup.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroup.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroup.Get()); ASSERT_EQ(label, readbackLabel); } @@ -49,7 +49,7 @@ TEST_F(LabelTest, BindGroup) { { descriptor.label = label.c_str(); wgpu::BindGroup bindGroup = device.CreateBindGroup(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroup.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroup.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -65,7 +65,7 @@ TEST_F(LabelTest, BindGroupLayout) { // The label should be empty if one was not set. { wgpu::BindGroupLayout bindGroupLayout = device.CreateBindGroupLayout(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroupLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroupLayout.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -73,7 +73,7 @@ TEST_F(LabelTest, BindGroupLayout) { { wgpu::BindGroupLayout bindGroupLayout = device.CreateBindGroupLayout(&descriptor); bindGroupLayout.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroupLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroupLayout.Get()); ASSERT_EQ(label, readbackLabel); } @@ -81,7 +81,7 @@ TEST_F(LabelTest, BindGroupLayout) { { descriptor.label = label.c_str(); wgpu::BindGroupLayout bindGroupLayout = device.CreateBindGroupLayout(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(bindGroupLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(bindGroupLayout.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -96,7 +96,7 @@ TEST_F(LabelTest, Buffer) { // The label should be empty if one was not set. { wgpu::Buffer buffer = device.CreateBuffer(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(buffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(buffer.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -104,7 +104,7 @@ TEST_F(LabelTest, Buffer) { { wgpu::Buffer buffer = device.CreateBuffer(&descriptor); buffer.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(buffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(buffer.Get()); ASSERT_EQ(label, readbackLabel); } @@ -112,7 +112,7 @@ TEST_F(LabelTest, Buffer) { { descriptor.label = label.c_str(); wgpu::Buffer buffer = device.CreateBuffer(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(buffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(buffer.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -126,7 +126,7 @@ TEST_F(LabelTest, CommandBuffer) { { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandBuffer commandBuffer = encoder.Finish(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(commandBuffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(commandBuffer.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -135,7 +135,7 @@ TEST_F(LabelTest, CommandBuffer) { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandBuffer commandBuffer = encoder.Finish(&descriptor); commandBuffer.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(commandBuffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(commandBuffer.Get()); ASSERT_EQ(label, readbackLabel); } @@ -144,7 +144,7 @@ TEST_F(LabelTest, CommandBuffer) { descriptor.label = label.c_str(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandBuffer commandBuffer = encoder.Finish(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(commandBuffer.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(commandBuffer.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -157,7 +157,7 @@ TEST_F(LabelTest, CommandEncoder) { // The label should be empty if one was not set. { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -165,7 +165,7 @@ TEST_F(LabelTest, CommandEncoder) { { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(&descriptor); encoder.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); } @@ -173,7 +173,7 @@ TEST_F(LabelTest, CommandEncoder) { { descriptor.label = label.c_str(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -188,7 +188,7 @@ TEST_F(LabelTest, ComputePassEncoder) { // The label should be empty if one was not set. { wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_TRUE(readbackLabel.empty()); encoder.EndPass(); } @@ -197,7 +197,7 @@ TEST_F(LabelTest, ComputePassEncoder) { { wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor); encoder.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); encoder.EndPass(); } @@ -206,7 +206,7 @@ TEST_F(LabelTest, ComputePassEncoder) { { descriptor.label = label.c_str(); wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); encoder.EndPass(); } @@ -234,7 +234,7 @@ TEST_F(LabelTest, ExternalTexture) { // The label should be empty if one was not set. { wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(externalTexture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(externalTexture.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -242,7 +242,7 @@ TEST_F(LabelTest, ExternalTexture) { { wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&descriptor); externalTexture.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(externalTexture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(externalTexture.Get()); ASSERT_EQ(label, readbackLabel); } @@ -250,7 +250,7 @@ TEST_F(LabelTest, ExternalTexture) { { descriptor.label = label.c_str(); wgpu::ExternalTexture externalTexture = device.CreateExternalTexture(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(externalTexture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(externalTexture.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -267,7 +267,7 @@ TEST_F(LabelTest, PipelineLayout) { // The label should be empty if one was not set. { wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipelineLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipelineLayout.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -275,7 +275,7 @@ TEST_F(LabelTest, PipelineLayout) { { wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&descriptor); pipelineLayout.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipelineLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipelineLayout.Get()); ASSERT_EQ(label, readbackLabel); } @@ -283,7 +283,7 @@ TEST_F(LabelTest, PipelineLayout) { { descriptor.label = label.c_str(); wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipelineLayout.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipelineLayout.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -298,7 +298,7 @@ TEST_F(LabelTest, QuerySet) { // The label should be empty if one was not set. { wgpu::QuerySet querySet = device.CreateQuerySet(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(querySet.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(querySet.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -306,7 +306,7 @@ TEST_F(LabelTest, QuerySet) { { wgpu::QuerySet querySet = device.CreateQuerySet(&descriptor); querySet.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(querySet.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(querySet.Get()); ASSERT_EQ(label, readbackLabel); } @@ -314,7 +314,7 @@ TEST_F(LabelTest, QuerySet) { { descriptor.label = label.c_str(); wgpu::QuerySet querySet = device.CreateQuerySet(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(querySet.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(querySet.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -330,7 +330,7 @@ TEST_F(LabelTest, RenderBundleEncoder) { // The label should be empty if one was not set. { wgpu::RenderBundleEncoder encoder = device.CreateRenderBundleEncoder(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -338,7 +338,7 @@ TEST_F(LabelTest, RenderBundleEncoder) { { wgpu::RenderBundleEncoder encoder = device.CreateRenderBundleEncoder(&descriptor); encoder.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); } @@ -346,7 +346,7 @@ TEST_F(LabelTest, RenderBundleEncoder) { { descriptor.label = label.c_str(); wgpu::RenderBundleEncoder encoder = device.CreateRenderBundleEncoder(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -367,7 +367,7 @@ TEST_F(LabelTest, RenderPassEncoder) { // The label should be empty if one was not set. { wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_TRUE(readbackLabel.empty()); encoder.EndPass(); } @@ -376,7 +376,7 @@ TEST_F(LabelTest, RenderPassEncoder) { { wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor); encoder.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); encoder.EndPass(); } @@ -385,7 +385,7 @@ TEST_F(LabelTest, RenderPassEncoder) { { descriptor.label = label.c_str(); wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(encoder.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); ASSERT_EQ(label, readbackLabel); encoder.EndPass(); } @@ -399,7 +399,7 @@ TEST_F(LabelTest, Sampler) { // The label should be empty if one was not set. { wgpu::Sampler sampler = device.CreateSampler(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(sampler.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(sampler.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -407,7 +407,7 @@ TEST_F(LabelTest, Sampler) { { wgpu::Sampler sampler = device.CreateSampler(&descriptor); sampler.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(sampler.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(sampler.Get()); ASSERT_EQ(label, readbackLabel); } @@ -415,7 +415,7 @@ TEST_F(LabelTest, Sampler) { { descriptor.label = label.c_str(); wgpu::Sampler sampler = device.CreateSampler(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(sampler.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(sampler.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -436,7 +436,7 @@ TEST_F(LabelTest, Texture) { // The label should be empty if one was not set. { wgpu::Texture texture = device.CreateTexture(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(texture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(texture.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -444,7 +444,7 @@ TEST_F(LabelTest, Texture) { { wgpu::Texture texture = device.CreateTexture(&descriptor); texture.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(texture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(texture.Get()); ASSERT_EQ(label, readbackLabel); } @@ -452,7 +452,7 @@ TEST_F(LabelTest, Texture) { { descriptor.label = label.c_str(); wgpu::Texture texture = device.CreateTexture(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(texture.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(texture.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -475,7 +475,7 @@ TEST_F(LabelTest, TextureView) { // The label should be empty if one was not set. { wgpu::TextureView textureView = texture.CreateView(); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(textureView.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(textureView.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -483,7 +483,7 @@ TEST_F(LabelTest, TextureView) { { wgpu::TextureView textureView = texture.CreateView(); textureView.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(textureView.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(textureView.Get()); ASSERT_EQ(label, readbackLabel); } @@ -492,7 +492,7 @@ TEST_F(LabelTest, TextureView) { wgpu::TextureViewDescriptor viewDescriptor; viewDescriptor.label = label.c_str(); wgpu::TextureView textureView = texture.CreateView(&viewDescriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(textureView.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(textureView.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -518,7 +518,7 @@ TEST_F(LabelTest, RenderPipeline) { // The label should be empty if one was not set. { wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -526,7 +526,7 @@ TEST_F(LabelTest, RenderPipeline) { { wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); pipeline.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_EQ(label, readbackLabel); } @@ -534,7 +534,7 @@ TEST_F(LabelTest, RenderPipeline) { { descriptor.label = label.c_str(); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -555,7 +555,7 @@ TEST_F(LabelTest, ComputePipeline) { // The label should be empty if one was not set. { wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -563,7 +563,7 @@ TEST_F(LabelTest, ComputePipeline) { { wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&descriptor); pipeline.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_EQ(label, readbackLabel); } @@ -571,7 +571,7 @@ TEST_F(LabelTest, ComputePipeline) { { descriptor.label = label.c_str(); wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(pipeline.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(pipeline.Get()); ASSERT_EQ(label, readbackLabel); } } @@ -592,7 +592,7 @@ TEST_F(LabelTest, ShaderModule) { // The label should be empty if one was not set. { wgpu::ShaderModule shaderModule = device.CreateShaderModule(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(shaderModule.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(shaderModule.Get()); ASSERT_TRUE(readbackLabel.empty()); } @@ -600,7 +600,7 @@ TEST_F(LabelTest, ShaderModule) { { wgpu::ShaderModule shaderModule = device.CreateShaderModule(&descriptor); shaderModule.SetLabel(label.c_str()); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(shaderModule.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(shaderModule.Get()); ASSERT_EQ(label, readbackLabel); } @@ -608,7 +608,7 @@ TEST_F(LabelTest, ShaderModule) { { descriptor.label = label.c_str(); wgpu::ShaderModule shaderModule = device.CreateShaderModule(&descriptor); - std::string readbackLabel = dawn_native::GetObjectLabelForTesting(shaderModule.Get()); + std::string readbackLabel = dawn::native::GetObjectLabelForTesting(shaderModule.Get()); ASSERT_EQ(label, readbackLabel); } } \ No newline at end of file diff --git a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp index 4ff0edb0a4..e0da854291 100644 --- a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -158,7 +158,7 @@ TEST_F(ShaderModuleValidationTest, MultisampledArrayTexture) { // Tests that shader module compilation messages can be queried. TEST_F(ShaderModuleValidationTest, GetCompilationMessages) { - // This test works assuming ShaderModule is backed by a dawn_native::ShaderModuleBase, which + // This test works assuming ShaderModule is backed by a dawn::native::ShaderModuleBase, which // is not the case on the wire. DAWN_SKIP_TEST_IF(UsesWire()); @@ -167,8 +167,8 @@ TEST_F(ShaderModuleValidationTest, GetCompilationMessages) { return vec4(0.0, 1.0, 0.0, 1.0); })"); - dawn_native::ShaderModuleBase* shaderModuleBase = dawn_native::FromAPI(shaderModule.Get()); - dawn_native::OwnedCompilationMessages* messages = shaderModuleBase->GetCompilationMessages(); + dawn::native::ShaderModuleBase* shaderModuleBase = dawn::native::FromAPI(shaderModule.Get()); + dawn::native::OwnedCompilationMessages* messages = shaderModuleBase->GetCompilationMessages(); messages->ClearMessages(); messages->AddMessageForTesting("Info Message"); messages->AddMessageForTesting("Warning Message", wgpu::CompilationMessageType::Warning); diff --git a/src/tests/unittests/validation/ToggleValidationTests.cpp b/src/tests/unittests/validation/ToggleValidationTests.cpp index 9a8b22ae1e..4e32af798c 100644 --- a/src/tests/unittests/validation/ToggleValidationTests.cpp +++ b/src/tests/unittests/validation/ToggleValidationTests.cpp @@ -18,12 +18,12 @@ namespace { class ToggleValidationTest : public ValidationTest {}; - // Tests querying the detail of a toggle from dawn_native::InstanceBase works correctly. + // Tests querying the detail of a toggle from dawn::native::InstanceBase works correctly. TEST_F(ToggleValidationTest, QueryToggleInfo) { // Query with a valid toggle name { const char* kValidToggleName = "emulate_store_and_msaa_resolve"; - const dawn_native::ToggleInfo* toggleInfo = instance->GetToggleInfo(kValidToggleName); + const dawn::native::ToggleInfo* toggleInfo = instance->GetToggleInfo(kValidToggleName); ASSERT_NE(nullptr, toggleInfo); ASSERT_NE(nullptr, toggleInfo->name); ASSERT_NE(nullptr, toggleInfo->description); @@ -33,7 +33,8 @@ namespace { // Query with an invalid toggle name { const char* kInvalidToggleName = "!@#$%^&*"; - const dawn_native::ToggleInfo* toggleInfo = instance->GetToggleInfo(kInvalidToggleName); + const dawn::native::ToggleInfo* toggleInfo = + instance->GetToggleInfo(kInvalidToggleName); ASSERT_EQ(nullptr, toggleInfo); } } @@ -50,7 +51,7 @@ namespace { togglesDesc.forceEnabledTogglesCount = 1; WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor); - std::vector toggleNames = dawn_native::GetTogglesUsed(deviceWithToggle); + std::vector toggleNames = dawn::native::GetTogglesUsed(deviceWithToggle); bool validToggleExists = false; for (const char* toggle : toggleNames) { if (strcmp(toggle, kValidToggleName) == 0) { @@ -70,7 +71,7 @@ namespace { togglesDesc.forceEnabledTogglesCount = 1; WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor); - std::vector toggleNames = dawn_native::GetTogglesUsed(deviceWithToggle); + std::vector toggleNames = dawn::native::GetTogglesUsed(deviceWithToggle); bool InvalidToggleExists = false; for (const char* toggle : toggleNames) { if (strcmp(toggle, kInvalidToggleName) == 0) { @@ -90,7 +91,7 @@ namespace { togglesDesc.forceEnabledTogglesCount = 1; WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor); - std::vector toggleNames = dawn_native::GetTogglesUsed(deviceWithToggle); + std::vector toggleNames = dawn::native::GetTogglesUsed(deviceWithToggle); bool validToggleExists = false; for (const char* toggle : toggleNames) { if (strcmp(toggle, kValidToggleName) == 0) { diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp index f7bb69b1e6..4bbe6f271d 100644 --- a/src/tests/unittests/validation/ValidationTest.cpp +++ b/src/tests/unittests/validation/ValidationTest.cpp @@ -83,10 +83,10 @@ ValidationTest::ValidationTest() } void ValidationTest::SetUp() { - instance = std::make_unique(); + instance = std::make_unique(); instance->DiscoverDefaultAdapters(); - std::vector adapters = instance->GetAdapters(); + std::vector adapters = instance->GetAdapters(); // Validation tests run against the null backend, find the corresponding adapter bool foundNullAdapter = false; @@ -125,7 +125,7 @@ void ValidationTest::TearDown() { if (device) { EXPECT_EQ(mLastWarningCount, - dawn_native::GetDeprecationWarningCountForTesting(backendDevice)); + dawn::native::GetDeprecationWarningCountForTesting(backendDevice)); } } @@ -180,7 +180,7 @@ void ValidationTest::WaitForAllOperations(const wgpu::Device& device) { } bool ValidationTest::HasToggleEnabled(const char* toggle) const { - auto toggles = dawn_native::GetTogglesUsed(backendDevice); + auto toggles = dawn::native::GetTogglesUsed(backendDevice); return std::find_if(toggles.begin(), toggles.end(), [toggle](const char* name) { return strcmp(toggle, name) == 0; }) != toggles.end(); @@ -189,7 +189,7 @@ bool ValidationTest::HasToggleEnabled(const char* toggle) const { wgpu::SupportedLimits ValidationTest::GetSupportedLimits() { WGPUSupportedLimits supportedLimits; supportedLimits.nextInChain = nullptr; - dawn_native::GetProcs().deviceGetLimits(backendDevice, &supportedLimits); + dawn::native::GetProcs().deviceGetLimits(backendDevice, &supportedLimits); return *reinterpret_cast(&supportedLimits); } diff --git a/src/tests/unittests/validation/ValidationTest.h b/src/tests/unittests/validation/ValidationTest.h index 4550b42668..8a8e9f6d04 100644 --- a/src/tests/unittests/validation/ValidationTest.h +++ b/src/tests/unittests/validation/ValidationTest.h @@ -72,16 +72,16 @@ } \ } while (0) -#define EXPECT_DEPRECATION_WARNINGS(statement, n) \ - do { \ - FlushWire(); \ - size_t warningsBefore = dawn_native::GetDeprecationWarningCountForTesting(backendDevice); \ - EXPECT_EQ(mLastWarningCount, warningsBefore); \ - statement; \ - FlushWire(); \ - size_t warningsAfter = dawn_native::GetDeprecationWarningCountForTesting(backendDevice); \ - EXPECT_EQ(warningsAfter, warningsBefore + n); \ - mLastWarningCount = warningsAfter; \ +#define EXPECT_DEPRECATION_WARNINGS(statement, n) \ + do { \ + FlushWire(); \ + size_t warningsBefore = dawn::native::GetDeprecationWarningCountForTesting(backendDevice); \ + EXPECT_EQ(mLastWarningCount, warningsBefore); \ + statement; \ + FlushWire(); \ + size_t warningsAfter = dawn::native::GetDeprecationWarningCountForTesting(backendDevice); \ + EXPECT_EQ(warningsAfter, warningsBefore + n); \ + mLastWarningCount = warningsAfter; \ } while (0) #define EXPECT_DEPRECATION_WARNING(statement) EXPECT_DEPRECATION_WARNINGS(statement, 1) @@ -135,8 +135,8 @@ class ValidationTest : public testing::Test { protected: virtual WGPUDevice CreateTestDevice(); - std::unique_ptr instance; - dawn_native::Adapter adapter; + std::unique_ptr instance; + dawn::native::Adapter adapter; wgpu::Device device; WGPUDevice backendDevice; diff --git a/src/tests/white_box/BufferAllocatedSizeTests.cpp b/src/tests/white_box/BufferAllocatedSizeTests.cpp index 15c14370f3..e100dc7ac0 100644 --- a/src/tests/white_box/BufferAllocatedSizeTests.cpp +++ b/src/tests/white_box/BufferAllocatedSizeTests.cpp @@ -53,7 +53,7 @@ TEST_P(BufferAllocatedSizeTests, UniformUsage) { { const uint32_t bufferSize = kMinBufferSize; wgpu::Buffer buffer = CreateBuffer(wgpu::BufferUsage::Uniform, bufferSize); - EXPECT_EQ(dawn_native::GetAllocatedSizeForTesting(buffer.Get()), + EXPECT_EQ(dawn::native::GetAllocatedSizeForTesting(buffer.Get()), Align(bufferSize, requiredBufferAlignment)); } @@ -63,7 +63,7 @@ TEST_P(BufferAllocatedSizeTests, UniformUsage) { const uint32_t bufferSize = std::max(1u + requiredBufferAlignment, kMinBufferSize); wgpu::Buffer buffer = CreateBuffer(wgpu::BufferUsage::Uniform | wgpu::BufferUsage::Storage, bufferSize); - EXPECT_EQ(dawn_native::GetAllocatedSizeForTesting(buffer.Get()), + EXPECT_EQ(dawn::native::GetAllocatedSizeForTesting(buffer.Get()), Align(bufferSize, requiredBufferAlignment)); } @@ -72,7 +72,7 @@ TEST_P(BufferAllocatedSizeTests, UniformUsage) { const uint32_t bufferSize = kMinBufferSize; wgpu::Buffer buffer = CreateBuffer(wgpu::BufferUsage::Uniform | wgpu::BufferUsage::Storage, bufferSize); - EXPECT_EQ(dawn_native::GetAllocatedSizeForTesting(buffer.Get()), + EXPECT_EQ(dawn::native::GetAllocatedSizeForTesting(buffer.Get()), Align(bufferSize, requiredBufferAlignment)); } } diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp index 14bf526714..3ea6ab887c 100644 --- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp +++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp @@ -30,7 +30,7 @@ constexpr uint32_t kRTSize = 4; // should be updated if the internals of Tick() change. constexpr uint32_t kFrameDepth = 2; -using namespace dawn_native::d3d12; +using namespace dawn::native::d3d12; class D3D12DescriptorHeapTests : public DawnTest { protected: @@ -108,7 +108,7 @@ class DummyStagingDescriptorAllocator { } CPUDescriptorHeapAllocation AllocateCPUDescriptors() { - dawn_native::ResultOrError result = + dawn::native::ResultOrError result = mAllocator.AllocateCPUDescriptors(); return (result.IsSuccess()) ? result.AcquireSuccess() : CPUDescriptorHeapAllocation{}; } @@ -124,7 +124,7 @@ class DummyStagingDescriptorAllocator { // Verify the shader visible view heaps switch over within a single submit. TEST_P(D3D12DescriptorHeapTests, SwitchOverViewHeap) { DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); utils::ComboRenderPipelineDescriptor renderPipelineDescriptor; @@ -224,7 +224,7 @@ TEST_P(D3D12DescriptorHeapTests, NoSwitchOverSamplerHeap) { TEST_P(D3D12DescriptorHeapTests, PoolHeapsInMultipleSubmits) { // Use small heaps to count only pool-allocated switches. DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); ShaderVisibleDescriptorAllocator* allocator = mD3DDevice->GetSamplerShaderVisibleDescriptorAllocator(); @@ -265,7 +265,7 @@ TEST_P(D3D12DescriptorHeapTests, PoolHeapsInMultipleSubmits) { TEST_P(D3D12DescriptorHeapTests, PoolHeapsInPendingSubmit) { // Use small heaps to count only pool-allocated switches. DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); constexpr uint32_t kNumOfSwitches = 5; @@ -297,7 +297,7 @@ TEST_P(D3D12DescriptorHeapTests, PoolHeapsInPendingSubmit) { TEST_P(D3D12DescriptorHeapTests, PoolHeapsInPendingAndMultipleSubmits) { // Use small heaps to count only pool-allocated switches. DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); constexpr uint32_t kNumOfSwitches = 5; @@ -435,7 +435,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBO) { // the result is the arithmetic sum of the sequence after the framebuffer is blended by // accumulation. By checking for this sum, we ensure each bindgroup was encoded correctly. DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); utils::BasicRenderPass renderPass = MakeRenderPass(kRTSize, kRTSize, wgpu::TextureFormat::R16Float); @@ -509,7 +509,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBO) { // descriptors. TEST_P(D3D12DescriptorHeapTests, EncodeUBOOverflowMultipleSubmit) { DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); // TODO(crbug.com/dawn/742): Test output is wrong with D3D12 + WARP. DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsWARP()); @@ -597,7 +597,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeUBOOverflowMultipleSubmit) { // in the heap. TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOOverflow) { DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); @@ -658,7 +658,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOOverflow) { // first descriptor at the same offset in the heap. TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOMultipleSubmits) { DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); @@ -738,7 +738,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOMultipleSubmits) { // Shader-visible heaps should switch out |kNumOfViewHeaps| times. TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) { DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled( - dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); + dawn::native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting)); // Create a solid filled texture. wgpu::TextureDescriptor descriptor; diff --git a/src/tests/white_box/D3D12ResidencyTests.cpp b/src/tests/white_box/D3D12ResidencyTests.cpp index 6622db1af1..f8812e3085 100644 --- a/src/tests/white_box/D3D12ResidencyTests.cpp +++ b/src/tests/white_box/D3D12ResidencyTests.cpp @@ -41,8 +41,8 @@ class D3D12ResidencyTestBase : public DawnTest { DAWN_TEST_UNSUPPORTED_IF(UsesWire()); // Restrict Dawn's budget to create an artificial budget. - dawn_native::d3d12::Device* d3dDevice = - dawn_native::d3d12::ToBackend(dawn_native::FromAPI((device.Get()))); + dawn::native::d3d12::Device* d3dDevice = + dawn::native::d3d12::ToBackend(dawn::native::FromAPI((device.Get()))); d3dDevice->GetResidencyManager()->RestrictBudgetForTesting(kRestrictedBudgetSize); // Initialize a source buffer on the GPU to serve as a source to quickly copy data to other @@ -92,20 +92,20 @@ class D3D12ResidencyTestBase : public DawnTest { class D3D12ResourceResidencyTests : public D3D12ResidencyTestBase { protected: bool CheckAllocationMethod(wgpu::Buffer buffer, - dawn_native::AllocationMethod allocationMethod) const { - dawn_native::d3d12::Buffer* d3dBuffer = - dawn_native::d3d12::ToBackend(dawn_native::FromAPI((buffer.Get()))); + dawn::native::AllocationMethod allocationMethod) const { + dawn::native::d3d12::Buffer* d3dBuffer = + dawn::native::d3d12::ToBackend(dawn::native::FromAPI((buffer.Get()))); return d3dBuffer->CheckAllocationMethodForTesting(allocationMethod); } bool CheckIfBufferIsResident(wgpu::Buffer buffer) const { - dawn_native::d3d12::Buffer* d3dBuffer = - dawn_native::d3d12::ToBackend(dawn_native::FromAPI((buffer.Get()))); + dawn::native::d3d12::Buffer* d3dBuffer = + dawn::native::d3d12::ToBackend(dawn::native::FromAPI((buffer.Get()))); return d3dBuffer->CheckIsResidentForTesting(); } bool IsUMA() const { - return dawn_native::d3d12::ToBackend(dawn_native::FromAPI(device.Get())) + return dawn::native::d3d12::ToBackend(dawn::native::FromAPI(device.Get())) ->GetDeviceInfo() .isUMA; } @@ -128,7 +128,7 @@ TEST_P(D3D12ResourceResidencyTests, OvercommitSmallResources) { for (uint32_t i = 0; i < bufferSet1.size(); i++) { EXPECT_TRUE(CheckIfBufferIsResident(bufferSet1[i])); EXPECT_TRUE( - CheckAllocationMethod(bufferSet1[i], dawn_native::AllocationMethod::kSubAllocated)); + CheckAllocationMethod(bufferSet1[i], dawn::native::AllocationMethod::kSubAllocated)); } // Create enough directly-allocated buffers to use the entire budget. @@ -166,7 +166,7 @@ TEST_P(D3D12ResourceResidencyTests, OvercommitLargeResources) { // allocated internally. for (uint32_t i = 0; i < bufferSet1.size(); i++) { EXPECT_TRUE(CheckIfBufferIsResident(bufferSet1[i])); - EXPECT_TRUE(CheckAllocationMethod(bufferSet1[i], dawn_native::AllocationMethod::kDirect)); + EXPECT_TRUE(CheckAllocationMethod(bufferSet1[i], dawn::native::AllocationMethod::kDirect)); } // Create enough directly-allocated buffers to use the entire budget. @@ -317,14 +317,14 @@ TEST_P(D3D12ResourceResidencyTests, OvercommitInASingleSubmit) { TEST_P(D3D12ResourceResidencyTests, SetExternalReservation) { // Set an external reservation of 20% the budget. We should succesfully reserve the amount we // request. - uint64_t amountReserved = dawn_native::d3d12::SetExternalMemoryReservation( - device.Get(), kRestrictedBudgetSize * .2, dawn_native::d3d12::MemorySegment::Local); + uint64_t amountReserved = dawn::native::d3d12::SetExternalMemoryReservation( + device.Get(), kRestrictedBudgetSize * .2, dawn::native::d3d12::MemorySegment::Local); EXPECT_EQ(amountReserved, kRestrictedBudgetSize * .2); // If we're on a non-UMA device, we should also check the NON_LOCAL memory segment. if (!IsUMA()) { - amountReserved = dawn_native::d3d12::SetExternalMemoryReservation( - device.Get(), kRestrictedBudgetSize * .2, dawn_native::d3d12::MemorySegment::NonLocal); + amountReserved = dawn::native::d3d12::SetExternalMemoryReservation( + device.Get(), kRestrictedBudgetSize * .2, dawn::native::d3d12::MemorySegment::NonLocal); EXPECT_EQ(amountReserved, kRestrictedBudgetSize * .2); } } @@ -368,14 +368,14 @@ TEST_P(D3D12DescriptorResidencyTests, SwitchedViewHeapResidency) { wgpu::Sampler sampler = device.CreateSampler(); - dawn_native::d3d12::Device* d3dDevice = - dawn_native::d3d12::ToBackend(dawn_native::FromAPI(device.Get())); + dawn::native::d3d12::Device* d3dDevice = + dawn::native::d3d12::ToBackend(dawn::native::FromAPI(device.Get())); - dawn_native::d3d12::ShaderVisibleDescriptorAllocator* allocator = + dawn::native::d3d12::ShaderVisibleDescriptorAllocator* allocator = d3dDevice->GetViewShaderVisibleDescriptorAllocator(); const uint64_t heapSize = allocator->GetShaderVisibleHeapSizeForTesting(); - const dawn_native::d3d12::HeapVersionID heapSerial = + const dawn::native::d3d12::HeapVersionID heapSerial = allocator->GetShaderVisibleHeapSerialForTesting(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); @@ -402,7 +402,7 @@ TEST_P(D3D12DescriptorResidencyTests, SwitchedViewHeapResidency) { // Check the heap serial to ensure the heap has switched. EXPECT_EQ(allocator->GetShaderVisibleHeapSerialForTesting(), - heapSerial + dawn_native::d3d12::HeapVersionID(1)); + heapSerial + dawn::native::d3d12::HeapVersionID(1)); // Check that currrently bound ShaderVisibleHeap is locked resident. EXPECT_TRUE(allocator->IsShaderVisibleHeapLockedResidentForTesting()); diff --git a/src/tests/white_box/D3D12ResourceHeapTests.cpp b/src/tests/white_box/D3D12ResourceHeapTests.cpp index 8f1155bf5e..f68c12fe8f 100644 --- a/src/tests/white_box/D3D12ResourceHeapTests.cpp +++ b/src/tests/white_box/D3D12ResourceHeapTests.cpp @@ -17,7 +17,7 @@ #include "dawn_native/d3d12/BufferD3D12.h" #include "dawn_native/d3d12/TextureD3D12.h" -using namespace dawn_native::d3d12; +using namespace dawn::native::d3d12; class D3D12ResourceHeapTests : public DawnTest { protected: diff --git a/src/tests/white_box/EGLImageWrappingTests.cpp b/src/tests/white_box/EGLImageWrappingTests.cpp index 7d7d71cbe3..7fb5fa6fcc 100644 --- a/src/tests/white_box/EGLImageWrappingTests.cpp +++ b/src/tests/white_box/EGLImageWrappingTests.cpp @@ -127,9 +127,9 @@ class EGLImageTestBase : public DawnTest { GLenum type, void* data, size_t size) { - dawn_native::opengl::Device* openglDevice = - dawn_native::opengl::ToBackend(dawn_native::FromAPI(device.Get())); - const dawn_native::opengl::OpenGLFunctions& gl = openglDevice->gl; + dawn::native::opengl::Device* openglDevice = + dawn::native::opengl::ToBackend(dawn::native::FromAPI(device.Get())); + const dawn::native::opengl::OpenGLFunctions& gl = openglDevice->gl; GLuint tex; gl.GenTextures(1, &tex); gl.BindTexture(GL_TEXTURE_2D, tex); @@ -144,10 +144,10 @@ class EGLImageTestBase : public DawnTest { return ScopedEGLImage(egl.DestroyImage, gl.DeleteTextures, dpy, eglImage, tex); } wgpu::Texture WrapEGLImage(const wgpu::TextureDescriptor* descriptor, EGLImage eglImage) { - dawn_native::opengl::ExternalImageDescriptorEGLImage externDesc; + dawn::native::opengl::ExternalImageDescriptorEGLImage externDesc; externDesc.cTextureDescriptor = reinterpret_cast(descriptor); externDesc.image = eglImage; - WGPUTexture texture = dawn_native::opengl::WrapExternalEGLImage(device.Get(), &externDesc); + WGPUTexture texture = dawn::native::opengl::WrapExternalEGLImage(device.Get(), &externDesc); return wgpu::Texture::Acquire(texture); } EGLFunctions egl; @@ -299,9 +299,9 @@ class EGLImageUsageTests : public EGLImageTestBase { GLenum glType, void* data, size_t dataSize) { - dawn_native::opengl::Device* openglDevice = - dawn_native::opengl::ToBackend(dawn_native::FromAPI(device.Get())); - const dawn_native::opengl::OpenGLFunctions& gl = openglDevice->gl; + dawn::native::opengl::Device* openglDevice = + dawn::native::opengl::ToBackend(dawn::native::FromAPI(device.Get())); + const dawn::native::opengl::OpenGLFunctions& gl = openglDevice->gl; // Get a texture view for the eglImage wgpu::TextureDescriptor textureDescriptor; diff --git a/src/tests/white_box/InternalResourceUsageTests.cpp b/src/tests/white_box/InternalResourceUsageTests.cpp index a260fe5dd6..db61b9c697 100644 --- a/src/tests/white_box/InternalResourceUsageTests.cpp +++ b/src/tests/white_box/InternalResourceUsageTests.cpp @@ -32,9 +32,9 @@ class InternalResourceUsageTests : public DawnTest { TEST_P(InternalResourceUsageTests, InternalBufferUsage) { DAWN_TEST_UNSUPPORTED_IF(HasToggleEnabled("skip_validation")); - ASSERT_DEVICE_ERROR(CreateBuffer(dawn_native::kReadOnlyStorageBuffer)); + ASSERT_DEVICE_ERROR(CreateBuffer(dawn::native::kReadOnlyStorageBuffer)); - ASSERT_DEVICE_ERROR(CreateBuffer(dawn_native::kInternalStorageBuffer)); + ASSERT_DEVICE_ERROR(CreateBuffer(dawn::native::kInternalStorageBuffer)); } DAWN_INSTANTIATE_TEST(InternalResourceUsageTests, NullBackend()); @@ -48,7 +48,7 @@ TEST_P(InternalBindingTypeTests, InternalStorageBufferBindingType) { wgpu::BindGroupLayoutEntry bglEntry; bglEntry.binding = 0; - bglEntry.buffer.type = dawn_native::kInternalStorageBufferBinding; + bglEntry.buffer.type = dawn::native::kInternalStorageBufferBinding; bglEntry.visibility = wgpu::ShaderStage::Compute; wgpu::BindGroupLayoutDescriptor bglDesc; diff --git a/src/tests/white_box/InternalStorageBufferBindingTests.cpp b/src/tests/white_box/InternalStorageBufferBindingTests.cpp index 8ee4f1aaee..745278ad37 100644 --- a/src/tests/white_box/InternalStorageBufferBindingTests.cpp +++ b/src/tests/white_box/InternalStorageBufferBindingTests.cpp @@ -44,22 +44,22 @@ class InternalStorageBufferBindingTests : public DawnTest { )"); // Create binding group layout with internal storage buffer binding type - dawn_native::BindGroupLayoutEntry bglEntry; + dawn::native::BindGroupLayoutEntry bglEntry; bglEntry.binding = 0; - bglEntry.buffer.type = dawn_native::kInternalStorageBufferBinding; + bglEntry.buffer.type = dawn::native::kInternalStorageBufferBinding; bglEntry.visibility = wgpu::ShaderStage::Compute; - dawn_native::BindGroupLayoutDescriptor bglDesc; + dawn::native::BindGroupLayoutDescriptor bglDesc; bglDesc.entryCount = 1; bglDesc.entries = &bglEntry; - dawn_native::DeviceBase* nativeDevice = dawn_native::FromAPI(device.Get()); + dawn::native::DeviceBase* nativeDevice = dawn::native::FromAPI(device.Get()); - Ref bglRef = + Ref bglRef = nativeDevice->CreateBindGroupLayout(&bglDesc, true).AcquireSuccess(); wgpu::BindGroupLayout bgl = - wgpu::BindGroupLayout::Acquire(dawn_native::ToAPI(bglRef.Detach())); + wgpu::BindGroupLayout::Acquire(dawn::native::ToAPI(bglRef.Detach())); // Create pipeline layout wgpu::PipelineLayoutDescriptor plDesc; diff --git a/src/tests/white_box/MetalAutoreleasePoolTests.mm b/src/tests/white_box/MetalAutoreleasePoolTests.mm index 1202307e85..3a741d50b7 100644 --- a/src/tests/white_box/MetalAutoreleasePoolTests.mm +++ b/src/tests/white_box/MetalAutoreleasePoolTests.mm @@ -16,7 +16,7 @@ #include "dawn_native/metal/DeviceMTL.h" -using namespace dawn_native::metal; +using namespace dawn::native::metal; class MetalAutoreleasePoolTests : public DawnTest { private: diff --git a/src/tests/white_box/QueryInternalShaderTests.cpp b/src/tests/white_box/QueryInternalShaderTests.cpp index 58d6a37d8d..5217998735 100644 --- a/src/tests/white_box/QueryInternalShaderTests.cpp +++ b/src/tests/white_box/QueryInternalShaderTests.cpp @@ -25,11 +25,11 @@ namespace { wgpu::Buffer timestamps, wgpu::Buffer availability, wgpu::Buffer params) { - ASSERT_TRUE(dawn_native::EncodeConvertTimestampsToNanoseconds( - dawn_native::FromAPI(encoder.Get()), dawn_native::FromAPI(timestamps.Get()), - dawn_native::FromAPI(availability.Get()), - dawn_native::FromAPI(params.Get())) - .IsSuccess()); + ASSERT_TRUE( + dawn::native::EncodeConvertTimestampsToNanoseconds( + dawn::native::FromAPI(encoder.Get()), dawn::native::FromAPI(timestamps.Get()), + dawn::native::FromAPI(availability.Get()), dawn::native::FromAPI(params.Get())) + .IsSuccess()); } class InternalShaderExpectation : public detail::Expectation { @@ -147,7 +147,7 @@ class QueryInternalShaderTests : public DawnTest { kQueryCount * sizeof(uint32_t), wgpu::BufferUsage::Storage); // The params uniform buffer - dawn_native::TimestampParams params = {firstQuery, queryCount, destinationOffset, kPeriod}; + dawn::native::TimestampParams params = {firstQuery, queryCount, destinationOffset, kPeriod}; wgpu::Buffer paramsBuffer = utils::CreateBufferFromData(device, ¶ms, sizeof(params), wgpu::BufferUsage::Uniform); diff --git a/src/tests/white_box/VulkanErrorInjectorTests.cpp b/src/tests/white_box/VulkanErrorInjectorTests.cpp index 2f3e33bc8a..e442279721 100644 --- a/src/tests/white_box/VulkanErrorInjectorTests.cpp +++ b/src/tests/white_box/VulkanErrorInjectorTests.cpp @@ -29,11 +29,11 @@ namespace { DawnTest::SetUp(); DAWN_TEST_UNSUPPORTED_IF(UsesWire()); - mDeviceVk = dawn_native::vulkan::ToBackend(dawn_native::FromAPI(device.Get())); + mDeviceVk = dawn::native::vulkan::ToBackend(dawn::native::FromAPI(device.Get())); } protected: - dawn_native::vulkan::Device* mDeviceVk; + dawn::native::vulkan::Device* mDeviceVk; }; } // anonymous namespace @@ -56,7 +56,7 @@ TEST_P(VulkanErrorInjectorTests, InjectErrorOnCreateBuffer) { auto CreateTestBuffer = [&]() -> bool { VkBuffer buffer = VK_NULL_HANDLE; - dawn_native::MaybeError err = CheckVkSuccess( + dawn::native::MaybeError err = CheckVkSuccess( mDeviceVk->fn.CreateBuffer(mDeviceVk->GetVkDevice(), &createInfo, nullptr, &buffer), "vkCreateBuffer"); if (err.IsError()) { @@ -78,45 +78,45 @@ TEST_P(VulkanErrorInjectorTests, InjectErrorOnCreateBuffer) { EXPECT_TRUE(CreateTestBuffer()); // The error injector call count should be empty - EXPECT_EQ(dawn_native::AcquireErrorInjectorCallCount(), 0u); + EXPECT_EQ(dawn::native::AcquireErrorInjectorCallCount(), 0u); } // Test error injection works. - dawn_native::EnableErrorInjector(); + dawn::native::EnableErrorInjector(); { EXPECT_TRUE(CreateTestBuffer()); EXPECT_TRUE(CreateTestBuffer()); // The error injector call count should be two. - EXPECT_EQ(dawn_native::AcquireErrorInjectorCallCount(), 2u); + EXPECT_EQ(dawn::native::AcquireErrorInjectorCallCount(), 2u); // Inject an error at index 0. The first should fail, the second succeed. { - dawn_native::InjectErrorAt(0u); + dawn::native::InjectErrorAt(0u); EXPECT_FALSE(CreateTestBuffer()); EXPECT_TRUE(CreateTestBuffer()); - dawn_native::ClearErrorInjector(); + dawn::native::ClearErrorInjector(); } // Inject an error at index 1. The second should fail, the first succeed. { - dawn_native::InjectErrorAt(1u); + dawn::native::InjectErrorAt(1u); EXPECT_TRUE(CreateTestBuffer()); EXPECT_FALSE(CreateTestBuffer()); - dawn_native::ClearErrorInjector(); + dawn::native::ClearErrorInjector(); } // Inject an error and then clear the injector. Calls should be successful. { - dawn_native::InjectErrorAt(0u); - dawn_native::DisableErrorInjector(); + dawn::native::InjectErrorAt(0u); + dawn::native::DisableErrorInjector(); EXPECT_TRUE(CreateTestBuffer()); EXPECT_TRUE(CreateTestBuffer()); - dawn_native::ClearErrorInjector(); + dawn::native::ClearErrorInjector(); } } } diff --git a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp index c0afd94dbe..709e0bcbaf 100644 --- a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp +++ b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp @@ -28,7 +28,7 @@ #include #include -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -44,7 +44,7 @@ namespace dawn_native::vulkan { DAWN_TEST_UNSUPPORTED_IF(UsesWire()); gbmDevice = CreateGbmDevice(); - deviceVk = dawn_native::vulkan::ToBackend(dawn_native::FromAPI(device.Get())); + deviceVk = dawn::native::vulkan::ToBackend(dawn::native::FromAPI(device.Get())); defaultGbmBo = CreateGbmBo(1, 1, true /* linear */); defaultStride = gbm_bo_get_stride_for_plane(defaultGbmBo, 0); @@ -116,7 +116,7 @@ namespace dawn_native::vulkan { std::vector waitFDs, bool isInitialized = true, bool expectValid = true) { - dawn_native::vulkan::ExternalImageDescriptorDmaBuf descriptor; + dawn::native::vulkan::ExternalImageDescriptorDmaBuf descriptor; return WrapVulkanImage(dawnDevice, textureDescriptor, memoryFd, stride, drmModifier, waitFDs, descriptor.releasedOldLayout, descriptor.releasedNewLayout, isInitialized, expectValid); @@ -132,7 +132,7 @@ namespace dawn_native::vulkan { VkImageLayout releasedNewLayout, bool isInitialized = true, bool expectValid = true) { - dawn_native::vulkan::ExternalImageDescriptorDmaBuf descriptor; + dawn::native::vulkan::ExternalImageDescriptorDmaBuf descriptor; descriptor.cTextureDescriptor = reinterpret_cast(textureDescriptor); descriptor.isInitialized = isInitialized; @@ -144,7 +144,7 @@ namespace dawn_native::vulkan { descriptor.releasedNewLayout = releasedNewLayout; WGPUTexture texture = - dawn_native::vulkan::WrapVulkanImage(dawnDevice.Get(), &descriptor); + dawn::native::vulkan::WrapVulkanImage(dawnDevice.Get(), &descriptor); if (expectValid) { EXPECT_NE(texture, nullptr) << "Failed to wrap image, are external memory / " @@ -160,8 +160,9 @@ namespace dawn_native::vulkan { // We have to export the signal before destroying the wrapped texture else it's an // assertion failure void IgnoreSignalSemaphore(wgpu::Texture wrappedTexture) { - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_GENERAL, &exportInfo); for (int handle : exportInfo.semaphoreHandles) { ASSERT_NE(handle, -1); close(handle); @@ -169,7 +170,7 @@ namespace dawn_native::vulkan { } protected: - dawn_native::vulkan::Device* deviceVk; + dawn::native::vulkan::Device* deviceVk; gbm_device* gbmDevice; wgpu::TextureDescriptor defaultDescriptor; gbm_bo* defaultGbmBo; @@ -267,8 +268,8 @@ namespace dawn_native::vulkan { ASSERT_NE(texture.Get(), nullptr); IgnoreSignalSemaphore(texture); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -280,8 +281,8 @@ namespace dawn_native::vulkan { wgpu::Texture texture = device.CreateTexture(&defaultDescriptor); ASSERT_NE(texture.Get(), nullptr); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -294,8 +295,8 @@ namespace dawn_native::vulkan { ASSERT_NE(texture.Get(), nullptr); texture.Destroy(); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -311,7 +312,7 @@ namespace dawn_native::vulkan { } // Create another device based on the original - backendAdapter = dawn_native::vulkan::ToBackend(deviceVk->GetAdapter()); + backendAdapter = dawn::native::vulkan::ToBackend(deviceVk->GetAdapter()); deviceDescriptor.nextInChain = &togglesDesc; togglesDesc.forceEnabledToggles = GetParam().forceEnabledWorkarounds.data(); togglesDesc.forceEnabledTogglesCount = GetParam().forceEnabledWorkarounds.size(); @@ -319,17 +320,17 @@ namespace dawn_native::vulkan { togglesDesc.forceDisabledTogglesCount = GetParam().forceDisabledWorkarounds.size(); secondDeviceVk = - dawn_native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); - secondDevice = wgpu::Device::Acquire(dawn_native::ToAPI(secondDeviceVk)); + dawn::native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); + secondDevice = wgpu::Device::Acquire(dawn::native::ToAPI(secondDeviceVk)); } protected: - dawn_native::vulkan::Adapter* backendAdapter; - dawn_native::DeviceDescriptor deviceDescriptor; - dawn_native::DawnTogglesDeviceDescriptor togglesDesc; + dawn::native::vulkan::Adapter* backendAdapter; + dawn::native::DeviceDescriptor deviceDescriptor; + dawn::native::DawnTogglesDeviceDescriptor togglesDesc; wgpu::Device secondDevice; - dawn_native::vulkan::Device* secondDeviceVk; + dawn::native::vulkan::Device* secondDeviceVk; // Clear a texture on a given device void ClearImage(wgpu::Device dawnDevice, @@ -382,9 +383,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on signalFd int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -410,9 +411,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on signalFd int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -440,9 +441,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on |signalFd| int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -481,9 +482,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |device| ClearImage(device, wrappedTexture, {5 / 255.0f, 6 / 255.0f, 7 / 255.0f, 8 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &exportInfo); // Import the image to |secondDevice|, making sure we wait on |signalFd| int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -502,10 +503,10 @@ namespace dawn_native::vulkan { secondDeviceWrappedTexture); // Re-import back into |device|, waiting on |secondDevice|'s signal - dawn_native::vulkan::ExternalImageExportInfoDmaBuf secondExportInfo; - dawn_native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - &secondExportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf secondExportInfo; + dawn::native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + &secondExportInfo); nextFd = gbm_bo_get_fd(defaultGbmBo); wgpu::Texture nextWrappedTexture = @@ -532,9 +533,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on |signalFd| int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -585,9 +586,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |device| ClearImage(device, wrappedTexture, {5 / 255.0f, 6 / 255.0f, 7 / 255.0f, 8 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |secondDevice|, making sure we wait on |signalFd| int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -616,10 +617,10 @@ namespace dawn_native::vulkan { secondDeviceQueue.Submit(1, &commands); // Re-import back into |device|, waiting on |secondDevice|'s signal - dawn_native::vulkan::ExternalImageExportInfoDmaBuf secondExportInfo; - dawn_native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - &secondExportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf secondExportInfo; + dawn::native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + &secondExportInfo); nextFd = gbm_bo_get_fd(defaultGbmBo); wgpu::Texture nextWrappedTexture = @@ -647,9 +648,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on |signalFd| int nextFd = gbm_bo_get_fd(defaultGbmBo); @@ -694,9 +695,9 @@ namespace dawn_native::vulkan { // device 1 = |device| // device 2 = |secondDevice| // Create device 3 - dawn_native::vulkan::Device* thirdDeviceVk = - dawn_native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); - wgpu::Device thirdDevice = wgpu::Device::Acquire(dawn_native::ToAPI(thirdDeviceVk)); + dawn::native::vulkan::Device* thirdDeviceVk = + dawn::native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); + wgpu::Device thirdDevice = wgpu::Device::Acquire(dawn::native::ToAPI(thirdDeviceVk)); // Make queue for device 2 and 3 wgpu::Queue secondDeviceQueue = secondDevice.GetQueue(); @@ -735,8 +736,8 @@ namespace dawn_native::vulkan { SimpleCopyTextureToTexture(thirdDevice, thirdDeviceQueue, wrappedTexADevice3, wrappedTexBDevice3); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfoTexBDevice3; - dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfoTexBDevice3; + dawn::native::vulkan::ExportVulkanImage( wrappedTexBDevice3.Get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfoTexBDevice3); IgnoreSignalSemaphore(wrappedTexADevice3); @@ -755,8 +756,8 @@ namespace dawn_native::vulkan { SimpleCopyTextureToTexture(secondDevice, secondDeviceQueue, wrappedTexBDevice2, wrappedTexCDevice2); - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfoTexCDevice2; - dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfoTexCDevice2; + dawn::native::vulkan::ExportVulkanImage( wrappedTexCDevice2.Get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfoTexCDevice2); IgnoreSignalSemaphore(wrappedTexBDevice2); @@ -845,9 +846,9 @@ namespace dawn_native::vulkan { wgpu::CommandBuffer commands = encoder.Finish(); secondDeviceQueue.Submit(1, &commands); } - dawn_native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoDmaBuf exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); int nextFd = gbm_bo_get_fd(gbmBo); // Import the image on |device| @@ -884,4 +885,4 @@ namespace dawn_native::vulkan { DAWN_INSTANTIATE_TEST(VulkanImageWrappingValidationTests, VulkanBackend()); DAWN_INSTANTIATE_TEST(VulkanImageWrappingUsageTests, VulkanBackend()); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp index c0923c992a..cb045d5629 100644 --- a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp +++ b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp @@ -25,7 +25,7 @@ #include "utils/SystemUtils.h" #include "utils/WGPUHelpers.h" -namespace dawn_native::vulkan { +namespace dawn::native::vulkan { namespace { @@ -40,11 +40,11 @@ namespace dawn_native::vulkan { DawnTest::SetUp(); DAWN_TEST_UNSUPPORTED_IF(UsesWire()); - deviceVk = dawn_native::vulkan::ToBackend(dawn_native::FromAPI(device.Get())); + deviceVk = dawn::native::vulkan::ToBackend(dawn::native::FromAPI(device.Get())); } // Creates a VkImage with external memory - ::VkResult CreateImage(dawn_native::vulkan::Device* deviceVk, + ::VkResult CreateImage(dawn::native::vulkan::Device* deviceVk, uint32_t width, uint32_t height, VkFormat format, @@ -79,7 +79,7 @@ namespace dawn_native::vulkan { } // Allocates memory for an image - ::VkResult AllocateMemory(dawn_native::vulkan::Device* deviceVk, + ::VkResult AllocateMemory(dawn::native::vulkan::Device* deviceVk, VkImage handle, VkDeviceMemory* allocation, VkDeviceSize* allocationSize, @@ -111,14 +111,14 @@ namespace dawn_native::vulkan { } // Binds memory to an image - ::VkResult BindMemory(dawn_native::vulkan::Device* deviceVk, + ::VkResult BindMemory(dawn::native::vulkan::Device* deviceVk, VkImage handle, VkDeviceMemory* memory) { return deviceVk->fn.BindImageMemory(deviceVk->GetVkDevice(), handle, *memory, 0); } // Extracts a file descriptor representing memory on a device - int GetMemoryFd(dawn_native::vulkan::Device* deviceVk, VkDeviceMemory memory) { + int GetMemoryFd(dawn::native::vulkan::Device* deviceVk, VkDeviceMemory memory) { VkMemoryGetFdInfoKHR getFdInfo; getFdInfo.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR; getFdInfo.pNext = nullptr; @@ -133,7 +133,7 @@ namespace dawn_native::vulkan { } // Prepares and exports memory for an image on a given device - void CreateBindExportImage(dawn_native::vulkan::Device* deviceVk, + void CreateBindExportImage(dawn::native::vulkan::Device* deviceVk, uint32_t width, uint32_t height, VkFormat format, @@ -164,7 +164,7 @@ namespace dawn_native::vulkan { std::vector waitFDs, bool isInitialized = true, bool expectValid = true) { - dawn_native::vulkan::ExternalImageDescriptorOpaqueFD descriptor; + dawn::native::vulkan::ExternalImageDescriptorOpaqueFD descriptor; return WrapVulkanImage(dawnDevice, textureDescriptor, memoryFd, allocationSize, memoryTypeIndex, waitFDs, descriptor.releasedOldLayout, descriptor.releasedNewLayout, isInitialized, expectValid); @@ -180,7 +180,7 @@ namespace dawn_native::vulkan { VkImageLayout releasedNewLayout, bool isInitialized = true, bool expectValid = true) { - dawn_native::vulkan::ExternalImageDescriptorOpaqueFD descriptor; + dawn::native::vulkan::ExternalImageDescriptorOpaqueFD descriptor; descriptor.cTextureDescriptor = reinterpret_cast(textureDescriptor); descriptor.isInitialized = isInitialized; @@ -192,7 +192,7 @@ namespace dawn_native::vulkan { descriptor.releasedNewLayout = releasedNewLayout; WGPUTexture texture = - dawn_native::vulkan::WrapVulkanImage(dawnDevice.Get(), &descriptor); + dawn::native::vulkan::WrapVulkanImage(dawnDevice.Get(), &descriptor); if (expectValid) { EXPECT_NE(texture, nullptr) << "Failed to wrap image, are external memory / " @@ -208,9 +208,9 @@ namespace dawn_native::vulkan { // We have to export the signal before destroying the wrapped texture else it's an // assertion failure void IgnoreSignalSemaphore(wgpu::Texture wrappedTexture) { - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD info; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_GENERAL, &info); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD info; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_GENERAL, &info); for (int handle : info.semaphoreHandles) { ASSERT_NE(handle, -1); close(handle); @@ -218,7 +218,7 @@ namespace dawn_native::vulkan { } protected: - dawn_native::vulkan::Device* deviceVk; + dawn::native::vulkan::Device* deviceVk; }; } // anonymous namespace @@ -344,8 +344,8 @@ namespace dawn_native::vulkan { ASSERT_NE(texture.Get(), nullptr); IgnoreSignalSemaphore(texture); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -355,8 +355,8 @@ namespace dawn_native::vulkan { wgpu::Texture texture = device.CreateTexture(&defaultDescriptor); ASSERT_NE(texture.Get(), nullptr); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -367,8 +367,8 @@ namespace dawn_native::vulkan { ASSERT_NE(texture.Get(), nullptr); texture.Destroy(); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - ASSERT_DEVICE_ERROR(bool success = dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + ASSERT_DEVICE_ERROR(bool success = dawn::native::vulkan::ExportVulkanImage( texture.Get(), VK_IMAGE_LAYOUT_GENERAL, &exportInfo)); ASSERT_FALSE(success); } @@ -382,7 +382,7 @@ namespace dawn_native::vulkan { DAWN_TEST_UNSUPPORTED_IF(UsesWire()); // Create another device based on the original - backendAdapter = dawn_native::vulkan::ToBackend(deviceVk->GetAdapter()); + backendAdapter = dawn::native::vulkan::ToBackend(deviceVk->GetAdapter()); deviceDescriptor.nextInChain = &togglesDesc; togglesDesc.forceEnabledToggles = GetParam().forceEnabledWorkarounds.data(); togglesDesc.forceEnabledTogglesCount = GetParam().forceEnabledWorkarounds.size(); @@ -390,8 +390,8 @@ namespace dawn_native::vulkan { togglesDesc.forceDisabledTogglesCount = GetParam().forceDisabledWorkarounds.size(); secondDeviceVk = - dawn_native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); - secondDevice = wgpu::Device::Acquire(dawn_native::ToAPI(secondDeviceVk)); + dawn::native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); + secondDevice = wgpu::Device::Acquire(dawn::native::ToAPI(secondDeviceVk)); CreateBindExportImage(deviceVk, 1, 1, VK_FORMAT_R8G8B8A8_UNORM, &defaultImage, &defaultAllocation, &defaultAllocationSize, @@ -418,11 +418,11 @@ namespace dawn_native::vulkan { protected: wgpu::Device secondDevice; - dawn_native::vulkan::Device* secondDeviceVk; + dawn::native::vulkan::Device* secondDeviceVk; - dawn_native::vulkan::Adapter* backendAdapter; - dawn_native::DeviceDescriptor deviceDescriptor; - dawn_native::DawnTogglesDeviceDescriptor togglesDesc; + dawn::native::vulkan::Adapter* backendAdapter; + dawn::native::DeviceDescriptor deviceDescriptor; + dawn::native::DawnTogglesDeviceDescriptor togglesDesc; wgpu::TextureDescriptor defaultDescriptor; VkImage defaultImage; @@ -488,9 +488,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on signalFd int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -517,9 +517,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on the semaphore int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -547,9 +547,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on the semaphore int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -587,9 +587,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |device| ClearImage(device, wrappedTexture, {5 / 255.0f, 6 / 255.0f, 7 / 255.0f, 8 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &exportInfo); // Import the image to |secondDevice|, making sure we wait on the semaphore int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -608,10 +608,10 @@ namespace dawn_native::vulkan { secondDeviceWrappedTexture); // Re-import back into |device|, waiting on |secondDevice|'s signal - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD secondExportInfo; - dawn_native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - &secondExportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD secondExportInfo; + dawn::native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + &secondExportInfo); memoryFd = GetMemoryFd(deviceVk, defaultAllocation); wgpu::Texture nextWrappedTexture = @@ -638,9 +638,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on the semaphore int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -691,9 +691,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |device| ClearImage(device, wrappedTexture, {5 / 255.0f, 6 / 255.0f, 7 / 255.0f, 8 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |secondDevice|, making sure we wait on |signalFd| int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -722,10 +722,10 @@ namespace dawn_native::vulkan { secondDeviceQueue.Submit(1, &commands); // Re-import back into |device|, waiting on |secondDevice|'s signal - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD secondExportInfo; - dawn_native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - &secondExportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD secondExportInfo; + dawn::native::vulkan::ExportVulkanImage(secondDeviceWrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + &secondExportInfo); memoryFd = GetMemoryFd(deviceVk, defaultAllocation); wgpu::Texture nextWrappedTexture = @@ -753,9 +753,9 @@ namespace dawn_native::vulkan { // Clear |wrappedTexture| on |secondDevice| ClearImage(secondDevice, wrappedTexture, {1 / 255.0f, 2 / 255.0f, 3 / 255.0f, 4 / 255.0f}); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); // Import the image to |device|, making sure we wait on the semaphore int memoryFd = GetMemoryFd(deviceVk, defaultAllocation); @@ -800,9 +800,9 @@ namespace dawn_native::vulkan { // device 1 = |device| // device 2 = |secondDevice| // Create device 3 - dawn_native::vulkan::Device* thirdDeviceVk = - dawn_native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); - wgpu::Device thirdDevice = wgpu::Device::Acquire(dawn_native::ToAPI(thirdDeviceVk)); + dawn::native::vulkan::Device* thirdDeviceVk = + dawn::native::vulkan::ToBackend(backendAdapter->APICreateDevice(&deviceDescriptor)); + wgpu::Device thirdDevice = wgpu::Device::Acquire(dawn::native::ToAPI(thirdDeviceVk)); // Make queue for device 2 and 3 wgpu::Queue secondDeviceQueue = secondDevice.GetQueue(); @@ -850,8 +850,8 @@ namespace dawn_native::vulkan { SimpleCopyTextureToTexture(thirdDevice, thirdDeviceQueue, wrappedTexADevice3, wrappedTexBDevice3); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfoTexBDevice3; - dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfoTexBDevice3; + dawn::native::vulkan::ExportVulkanImage( wrappedTexBDevice3.Get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfoTexBDevice3); IgnoreSignalSemaphore(wrappedTexADevice3); @@ -871,8 +871,8 @@ namespace dawn_native::vulkan { SimpleCopyTextureToTexture(secondDevice, secondDeviceQueue, wrappedTexBDevice2, wrappedTexCDevice2); - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfoTexCDevice2; - dawn_native::vulkan::ExportVulkanImage( + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfoTexCDevice2; + dawn::native::vulkan::ExportVulkanImage( wrappedTexCDevice2.Get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfoTexCDevice2); IgnoreSignalSemaphore(wrappedTexBDevice2); @@ -973,9 +973,9 @@ namespace dawn_native::vulkan { secondDeviceQueue.Submit(1, &commands); } - dawn_native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; - dawn_native::vulkan::ExportVulkanImage(wrappedTexture.Get(), - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); + dawn::native::vulkan::ExternalImageExportInfoOpaqueFD exportInfo; + dawn::native::vulkan::ExportVulkanImage(wrappedTexture.Get(), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &exportInfo); int memoryFd = GetMemoryFd(secondDeviceVk, allocationA); @@ -1016,4 +1016,4 @@ namespace dawn_native::vulkan { DAWN_INSTANTIATE_TEST(VulkanImageWrappingValidationTests, VulkanBackend()); DAWN_INSTANTIATE_TEST(VulkanImageWrappingUsageTests, VulkanBackend()); -} // namespace dawn_native::vulkan +} // namespace dawn::native::vulkan diff --git a/src/utils/BackendBinding.cpp b/src/utils/BackendBinding.cpp index 15562de02e..d5de4bc125 100644 --- a/src/utils/BackendBinding.cpp +++ b/src/utils/BackendBinding.cpp @@ -44,7 +44,7 @@ namespace utils { : mWindow(window), mDevice(device) { } - void DiscoverAdapter(dawn_native::Instance* instance, + void DiscoverAdapter(dawn::native::Instance* instance, GLFWwindow* window, wgpu::BackendType type) { DAWN_UNUSED(type); @@ -55,11 +55,11 @@ namespace utils { glfwMakeContextCurrent(window); auto getProc = reinterpret_cast(glfwGetProcAddress); if (type == wgpu::BackendType::OpenGL) { - dawn_native::opengl::AdapterDiscoveryOptions adapterOptions; + dawn::native::opengl::AdapterDiscoveryOptions adapterOptions; adapterOptions.getProc = getProc; instance->DiscoverAdapters(&adapterOptions); } else { - dawn_native::opengl::AdapterDiscoveryOptionsES adapterOptions; + dawn::native::opengl::AdapterDiscoveryOptionsES adapterOptions; adapterOptions.getProc = getProc; instance->DiscoverAdapters(&adapterOptions); } diff --git a/src/utils/BackendBinding.h b/src/utils/BackendBinding.h index ca1c91ffb9..175bb5d185 100644 --- a/src/utils/BackendBinding.h +++ b/src/utils/BackendBinding.h @@ -36,7 +36,7 @@ namespace utils { WGPUDevice mDevice = nullptr; }; - void DiscoverAdapter(dawn_native::Instance* instance, + void DiscoverAdapter(dawn::native::Instance* instance, GLFWwindow* window, wgpu::BackendType type); BackendBinding* CreateBinding(wgpu::BackendType type, GLFWwindow* window, WGPUDevice device); diff --git a/src/utils/D3D12Binding.cpp b/src/utils/D3D12Binding.cpp index 1708b14782..99a34b9dc2 100644 --- a/src/utils/D3D12Binding.cpp +++ b/src/utils/D3D12Binding.cpp @@ -34,14 +34,14 @@ namespace utils { if (mSwapchainImpl.userData == nullptr) { HWND win32Window = glfwGetWin32Window(mWindow); mSwapchainImpl = - dawn_native::d3d12::CreateNativeSwapChainImpl(mDevice, win32Window); + dawn::native::d3d12::CreateNativeSwapChainImpl(mDevice, win32Window); } return reinterpret_cast(&mSwapchainImpl); } WGPUTextureFormat GetPreferredSwapChainTextureFormat() override { ASSERT(mSwapchainImpl.userData != nullptr); - return dawn_native::d3d12::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); + return dawn::native::d3d12::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); } private: diff --git a/src/utils/NullBinding.cpp b/src/utils/NullBinding.cpp index f47b81c674..2060655609 100644 --- a/src/utils/NullBinding.cpp +++ b/src/utils/NullBinding.cpp @@ -28,7 +28,7 @@ namespace utils { uint64_t GetSwapChainImplementation() override { if (mSwapchainImpl.userData == nullptr) { - mSwapchainImpl = dawn_native::null::CreateNativeSwapChainImpl(); + mSwapchainImpl = dawn::native::null::CreateNativeSwapChainImpl(); } return reinterpret_cast(&mSwapchainImpl); } diff --git a/src/utils/OpenGLBinding.cpp b/src/utils/OpenGLBinding.cpp index f48f426c7c..d40793362d 100644 --- a/src/utils/OpenGLBinding.cpp +++ b/src/utils/OpenGLBinding.cpp @@ -32,7 +32,7 @@ namespace utils { uint64_t GetSwapChainImplementation() override { if (mSwapchainImpl.userData == nullptr) { - mSwapchainImpl = dawn_native::opengl::CreateNativeSwapChainImpl( + mSwapchainImpl = dawn::native::opengl::CreateNativeSwapChainImpl( mDevice, [](void* userdata) { glfwSwapBuffers(static_cast(userdata)); }, mWindow); @@ -41,7 +41,7 @@ namespace utils { } WGPUTextureFormat GetPreferredSwapChainTextureFormat() override { - return dawn_native::opengl::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); + return dawn::native::opengl::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); } private: diff --git a/src/utils/VulkanBinding.cpp b/src/utils/VulkanBinding.cpp index 577c3bce6b..b4cc02a271 100644 --- a/src/utils/VulkanBinding.cpp +++ b/src/utils/VulkanBinding.cpp @@ -32,18 +32,18 @@ namespace utils { uint64_t GetSwapChainImplementation() override { if (mSwapchainImpl.userData == nullptr) { VkSurfaceKHR surface = VK_NULL_HANDLE; - if (glfwCreateWindowSurface(dawn_native::vulkan::GetInstance(mDevice), mWindow, + if (glfwCreateWindowSurface(dawn::native::vulkan::GetInstance(mDevice), mWindow, nullptr, &surface) != VK_SUCCESS) { ASSERT(false); } - mSwapchainImpl = dawn_native::vulkan::CreateNativeSwapChainImpl(mDevice, surface); + mSwapchainImpl = dawn::native::vulkan::CreateNativeSwapChainImpl(mDevice, surface); } return reinterpret_cast(&mSwapchainImpl); } WGPUTextureFormat GetPreferredSwapChainTextureFormat() override { ASSERT(mSwapchainImpl.userData != nullptr); - return dawn_native::vulkan::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); + return dawn::native::vulkan::GetNativeSwapChainPreferredFormat(&mSwapchainImpl); } private: diff --git a/src/utils/WireHelper.cpp b/src/utils/WireHelper.cpp index 698385e3d5..4745f0165f 100644 --- a/src/utils/WireHelper.cpp +++ b/src/utils/WireHelper.cpp @@ -82,7 +82,7 @@ namespace utils { class WireHelperDirect : public WireHelper { public: WireHelperDirect() { - dawnProcSetProcs(&dawn_native::GetProcs()); + dawnProcSetProcs(&dawn::native::GetProcs()); } std::pair RegisterDevice(WGPUDevice backendDevice) override { @@ -109,7 +109,7 @@ namespace utils { mS2cBuf = std::make_unique(); dawn::wire::WireServerDescriptor serverDesc = {}; - serverDesc.procs = &dawn_native::GetProcs(); + serverDesc.procs = &dawn::native::GetProcs(); serverDesc.serializer = mS2cBuf.get(); mWireServer.reset(new dawn::wire::WireServer(serverDesc)); @@ -134,7 +134,7 @@ namespace utils { auto reservation = mWireClient->ReserveDevice(); mWireServer->InjectDevice(backendDevice, reservation.id, reservation.generation); - dawn_native::GetProcs().deviceRelease(backendDevice); + dawn::native::GetProcs().deviceRelease(backendDevice); return std::make_pair(wgpu::Device::Acquire(reservation.device), backendDevice); }