From b02535557e29ec15018e7a062b79716b1169c9ef Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 19 Apr 2022 20:38:44 +0000 Subject: [PATCH] Fixup build/include_order issues in src/dawn. This Cl moves the cpp includes to above the project includes fixing up the build/include_order issues and enabling the lint check. A couple includes are marked as NOLINT as the c header has to come after the project header due to setting defines. Bug: dawn:1339 Change-Id: Ia47499c94fff99106397b83f6c5c7fe100c44a0e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86513 Reviewed-by: Corentin Wallez Commit-Queue: Dan Sinclair --- src/dawn/CPPLINT.cfg | 1 - src/dawn/common/Assert.cpp | 3 ++- src/dawn/common/BitSetIterator.h | 6 +++--- src/dawn/common/ConcurrentCache.h | 4 ++-- src/dawn/common/CoreFoundationRef.h | 4 ++-- src/dawn/common/DynamicLib.h | 4 ++-- src/dawn/common/GPUInfo.cpp | 6 +++--- src/dawn/common/HashUtils.h | 6 +++--- src/dawn/common/IOKitRef.h | 4 ++-- src/dawn/common/Log.cpp | 4 ++-- src/dawn/common/Math.cpp | 6 +++--- src/dawn/common/Math.h | 4 ++-- src/dawn/common/RefBase.h | 6 +++--- src/dawn/common/RefCounted.cpp | 4 ++-- src/dawn/common/RefCounted.h | 4 ++-- src/dawn/common/Result.h | 6 +++--- src/dawn/common/SerialMap.h | 4 ++-- src/dawn/common/SerialQueue.h | 4 ++-- src/dawn/common/SerialStorage.h | 4 ++-- src/dawn/common/SlabAllocator.cpp | 6 +++--- src/dawn/common/SlabAllocator.h | 4 ++-- src/dawn/common/StackContainer.h | 4 ++-- src/dawn/common/SystemUtils.h | 4 ++-- src/dawn/common/TypedInteger.h | 6 +++--- src/dawn/common/WindowsUtils.cpp | 4 ++-- src/dawn/common/ityp_array.h | 6 +++--- src/dawn/common/ityp_span.h | 4 ++-- src/dawn/common/ityp_vector.h | 6 +++--- src/dawn/common/vulkan_platform.h | 4 ++-- src/dawn/fuzzers/DawnWireServerFuzzer.cpp | 6 +++--- src/dawn/fuzzers/DawnWireServerFuzzer.h | 4 ++-- src/dawn/native/Adapter.h | 4 ++-- src/dawn/native/AttachmentState.h | 6 +++--- src/dawn/native/BackendConnection.h | 4 ++-- src/dawn/native/BindGroup.h | 4 ++-- src/dawn/native/BindGroupLayout.cpp | 8 ++++---- src/dawn/native/BindGroupLayout.h | 6 +++--- src/dawn/native/BindGroupTracker.h | 6 +++--- src/dawn/native/BindingInfo.h | 4 ++-- src/dawn/native/BuddyMemoryAllocator.h | 6 +++--- src/dawn/native/Buffer.cpp | 8 ++++---- src/dawn/native/Buffer.h | 4 ++-- src/dawn/native/CacheKey.h | 6 +++--- src/dawn/native/CachedObject.h | 6 +++--- src/dawn/native/CommandAllocator.cpp | 6 +++--- src/dawn/native/CommandAllocator.h | 8 ++++---- src/dawn/native/CommandEncoder.h | 4 ++-- src/dawn/native/CommandValidation.h | 4 ++-- src/dawn/native/Commands.h | 6 +++--- src/dawn/native/CompilationMessages.cpp | 2 +- src/dawn/native/CompilationMessages.h | 6 +++--- src/dawn/native/CopyTextureForBrowserHelper.cpp | 4 ++-- src/dawn/native/Device.cpp | 8 ++++---- src/dawn/native/Device.h | 6 +++--- src/dawn/native/EncodingContext.h | 4 ++-- src/dawn/native/Error.h | 4 ++-- src/dawn/native/ErrorData.h | 4 ++-- src/dawn/native/ErrorScope.h | 4 ++-- src/dawn/native/ExternalTexture.h | 4 ++-- src/dawn/native/Format.cpp | 4 ++-- src/dawn/native/Format.h | 4 ++-- src/dawn/native/IndirectDrawMetadata.cpp | 6 +++--- src/dawn/native/IndirectDrawMetadata.h | 12 ++++++------ .../native/IndirectDrawValidationEncoder.cpp | 6 +++--- src/dawn/native/Instance.h | 10 +++++----- 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/ObjectBase.cpp | 4 ++-- src/dawn/native/ObjectBase.h | 4 ++-- src/dawn/native/ObjectContentHasher.h | 4 ++-- src/dawn/native/PassResourceUsage.h | 6 +++--- src/dawn/native/PassResourceUsageTracker.cpp | 4 ++-- src/dawn/native/PassResourceUsageTracker.h | 4 ++-- src/dawn/native/PerStage.h | 4 ++-- src/dawn/native/PersistentCache.h | 4 ++-- src/dawn/native/Pipeline.h | 6 +++--- src/dawn/native/PipelineLayout.h | 6 +++--- src/dawn/native/PooledResourceMemoryAllocator.h | 4 ++-- src/dawn/native/ProgrammableEncoder.cpp | 4 ++-- src/dawn/native/QueryHelper.cpp | 4 ++-- src/dawn/native/QuerySet.cpp | 4 ++-- src/dawn/native/Queue.cpp | 4 ++-- src/dawn/native/RenderBundle.h | 4 ++-- src/dawn/native/RenderEncoderBase.cpp | 6 +++--- src/dawn/native/RenderPassEncoder.cpp | 6 +++--- src/dawn/native/RenderPipeline.cpp | 6 +++--- src/dawn/native/RenderPipeline.h | 6 +++--- src/dawn/native/ResourceHeapAllocator.h | 4 ++-- src/dawn/native/RingBufferAllocator.h | 6 +++--- src/dawn/native/Sampler.cpp | 4 ++-- src/dawn/native/ScratchBuffer.h | 4 ++-- src/dawn/native/ShaderModule.cpp | 6 +++--- src/dawn/native/ShaderModule.h | 12 ++++++------ src/dawn/native/SpirvValidation.cpp | 4 ++-- src/dawn/native/SpirvValidation.h | 4 ++-- src/dawn/native/SubresourceStorage.h | 10 +++++----- src/dawn/native/Texture.h | 4 ++-- src/dawn/native/TintUtils.cpp | 3 ++- src/dawn/native/VertexFormat.cpp | 4 ++-- src/dawn/native/d3d12/AdapterD3D12.cpp | 4 ++-- src/dawn/native/d3d12/CommandAllocatorManager.h | 4 ++-- .../native/d3d12/CommandRecordingContext.cpp | 6 +++--- src/dawn/native/d3d12/CommandRecordingContext.h | 4 ++-- src/dawn/native/d3d12/D3D11on12Util.h | 8 ++++---- src/dawn/native/d3d12/DeviceD3D12.cpp | 4 ++-- src/dawn/native/d3d12/IntegerTypes.h | 4 ++-- .../native/d3d12/NativeSwapChainImplD3D12.h | 4 ++-- src/dawn/native/d3d12/PlatformFunctions.cpp | 4 ++-- src/dawn/native/d3d12/PlatformFunctions.h | 4 ++-- src/dawn/native/d3d12/RenderPassBuilderD3D12.h | 4 ++-- src/dawn/native/d3d12/RenderPipelineD3D12.cpp | 4 ++-- .../d3d12/ResourceAllocatorManagerD3D12.h | 4 ++-- .../d3d12/ResourceHeapAllocationD3D12.cpp | 4 ++-- src/dawn/native/d3d12/SamplerHeapCacheD3D12.h | 4 ++-- src/dawn/native/d3d12/ShaderModuleD3D12.cpp | 13 +++++++------ .../ShaderVisibleDescriptorAllocatorD3D12.h | 4 ++-- .../d3d12/StagingDescriptorAllocatorD3D12.h | 4 ++-- src/dawn/native/d3d12/SwapChainD3D12.cpp | 7 +++---- src/dawn/native/d3d12/TextureCopySplitter.h | 4 ++-- src/dawn/native/d3d12/UtilsD3D12.cpp | 4 ++-- src/dawn/native/d3d12/d3d12_platform.h | 17 +++++++++-------- src/dawn/native/metal/DeviceMTL.h | 8 ++++---- src/dawn/native/metal/TextureMTL.h | 6 +++--- src/dawn/native/opengl/BackendGL.cpp | 4 ++-- src/dawn/native/opengl/CommandBufferGL.cpp | 4 ++-- src/dawn/native/opengl/DeviceGL.h | 4 ++-- src/dawn/native/opengl/PipelineGL.cpp | 6 +++--- src/dawn/native/opengl/PipelineGL.h | 4 ++-- src/dawn/native/opengl/RenderPipelineGL.h | 4 ++-- src/dawn/native/opengl/ShaderModuleGL.cpp | 6 +++--- src/dawn/native/utils/WGPUHelpers.cpp | 12 ++++++------ src/dawn/native/utils/WGPUHelpers.h | 3 +-- src/dawn/native/vulkan/BindGroupLayoutVk.cpp | 4 ++-- src/dawn/native/vulkan/BindGroupLayoutVk.h | 4 ++-- src/dawn/native/vulkan/BufferVk.cpp | 4 ++-- src/dawn/native/vulkan/CacheKeyVk.cpp | 4 ++-- src/dawn/native/vulkan/CacheKeyVk.h | 4 ++-- src/dawn/native/vulkan/CommandBufferVk.cpp | 4 ++-- src/dawn/native/vulkan/ComputePipelineVk.cpp | 4 ++-- src/dawn/native/vulkan/DescriptorSetAllocator.h | 6 +++--- src/dawn/native/vulkan/DeviceVk.h | 6 +++--- .../native/vulkan/NativeSwapChainImplVk.cpp | 4 ++-- src/dawn/native/vulkan/RenderPassCache.h | 10 +++++----- .../native/vulkan/ResourceMemoryAllocatorVk.h | 6 +++--- src/dawn/native/vulkan/ShaderModuleVk.cpp | 5 +++-- src/dawn/native/vulkan/ShaderModuleVk.h | 13 +++++++------ src/dawn/native/vulkan/SwapChainVk.cpp | 4 ++-- src/dawn/native/vulkan/SwapChainVk.h | 4 ++-- src/dawn/native/vulkan/VulkanExtensions.cpp | 6 +++--- src/dawn/native/vulkan/VulkanExtensions.h | 4 ++-- src/dawn/native/vulkan/VulkanInfo.cpp | 4 ++-- src/dawn/native/vulkan/VulkanInfo.h | 4 ++-- src/dawn/node/binding/GPU.cpp | 4 ++-- src/dawn/node/interop/Core.h | 6 ++++-- src/dawn/node/utils/Debug.h | 6 ++++-- src/dawn/platform/tracing/EventTracer.h | 4 ++-- src/dawn/samples/Animometer.cpp | 8 ++++---- src/dawn/samples/ComputeBoids.cpp | 8 ++++---- src/dawn/samples/CppHelloTriangle.cpp | 4 ++-- src/dawn/samples/ManualSwapChainTest.cpp | 13 ++++++------- src/dawn/samples/SampleUtils.cpp | 6 +++--- src/dawn/tests/DawnTest.cpp | 16 ++++++++-------- src/dawn/tests/DawnTest.h | 15 +++++++-------- src/dawn/tests/MockCallback.h | 8 ++++---- src/dawn/tests/UnittestsMain.cpp | 2 +- src/dawn/tests/end2end/BufferTests.cpp | 4 ++-- .../end2end/ComputeCopyStorageBufferTests.cpp | 4 ++-- src/dawn/tests/end2end/ComputeDispatchTests.cpp | 4 ++-- .../end2end/ComputeLayoutMemoryBufferTests.cpp | 6 +++--- .../tests/end2end/ComputeSharedMemoryTests.cpp | 4 ++-- src/dawn/tests/end2end/CopyTests.cpp | 3 ++- .../end2end/D3D12ResourceWrappingTests.cpp | 4 ++-- src/dawn/tests/end2end/DeprecatedAPITests.cpp | 4 ++-- .../tests/end2end/DepthStencilCopyTests.cpp | 3 ++- src/dawn/tests/end2end/DeviceLostTests.cpp | 7 ++++--- .../tests/end2end/DynamicBufferOffsetTests.cpp | 4 ++-- .../tests/end2end/FirstIndexOffsetTests.cpp | 4 ++-- .../tests/end2end/IOSurfaceWrappingTests.cpp | 8 ++++---- .../end2end/NonzeroBufferCreationTests.cpp | 4 ++-- src/dawn/tests/end2end/PipelineLayoutTests.cpp | 4 ++-- .../tests/end2end/RenderPassLoadOpTests.cpp | 4 ++-- src/dawn/tests/end2end/ShaderTests.cpp | 6 +++--- src/dawn/tests/end2end/TextureFormatTests.cpp | 6 +++--- src/dawn/tests/end2end/TextureViewTests.cpp | 4 ++-- src/dawn/tests/end2end/VideoViewsTests.h | 4 ++-- src/dawn/tests/end2end/VideoViewsTests_gbm.cpp | 6 +++--- src/dawn/tests/end2end/VideoViewsTests_mac.cpp | 8 ++++---- src/dawn/tests/end2end/VideoViewsTests_win.cpp | 10 +++++----- src/dawn/tests/end2end/WindowSurfaceTests.cpp | 6 +++--- .../tests/perf_tests/DawnPerfTestPlatform.h | 4 ++-- .../unittests/BuddyMemoryAllocatorTests.cpp | 8 ++++---- .../tests/unittests/CommandAllocatorTests.cpp | 6 +++--- src/dawn/tests/unittests/ITypBitsetTests.cpp | 6 +++--- src/dawn/tests/unittests/ITypSpanTests.cpp | 6 +++--- src/dawn/tests/unittests/LinkedListTests.cpp | 6 +++--- src/dawn/tests/unittests/MathTests.cpp | 5 +++-- src/dawn/tests/unittests/PerThreadProcTests.cpp | 9 +++++---- .../tests/unittests/StackContainerTests.cpp | 8 ++++---- src/dawn/tests/unittests/ToBackendTests.cpp | 6 +++--- .../unittests/native/DeviceCreationTests.cpp | 4 ++-- .../native/mocks/BindGroupLayoutMock.h | 4 ++-- .../unittests/native/mocks/BindGroupMock.h | 4 ++-- .../tests/unittests/native/mocks/BufferMock.h | 4 ++-- .../unittests/native/mocks/CommandBufferMock.h | 4 ++-- .../native/mocks/ComputePipelineMock.h | 4 ++-- .../tests/unittests/native/mocks/DeviceMock.h | 4 ++-- .../native/mocks/ExternalTextureMock.h | 4 ++-- .../unittests/native/mocks/PipelineLayoutMock.h | 4 ++-- .../tests/unittests/native/mocks/QuerySetMock.h | 4 ++-- .../unittests/native/mocks/RenderPipelineMock.h | 4 ++-- .../tests/unittests/native/mocks/SamplerMock.h | 4 ++-- .../unittests/native/mocks/ShaderModuleMock.h | 8 ++++---- .../unittests/native/mocks/SwapChainMock.h | 4 ++-- .../tests/unittests/native/mocks/TextureMock.h | 4 ++-- .../validation/BufferValidationTests.cpp | 8 ++++---- .../DynamicStateCommandValidationTests.cpp | 4 ++-- .../validation/ErrorScopeValidationTests.cpp | 4 ++-- .../QueueOnSubmittedWorkDoneValidationTests.cpp | 4 ++-- .../RenderPassDescriptorValidationTests.cpp | 4 ++-- .../RenderPipelineValidationTests.cpp | 6 +++--- .../validation/SamplerValidationTests.cpp | 4 ++-- .../validation/ShaderModuleValidationTests.cpp | 4 ++-- .../validation/TextureViewValidationTests.cpp | 4 ++-- .../unittests/validation/ValidationTest.cpp | 4 ++-- .../tests/unittests/validation/ValidationTest.h | 6 +++--- .../tests/unittests/wire/WireAdapterTests.cpp | 7 ++++--- .../tests/unittests/wire/WireArgumentTests.cpp | 4 ++-- .../tests/unittests/wire/WireInstanceTests.cpp | 7 ++++--- src/dawn/tests/unittests/wire/WireTest.h | 4 ++-- .../wire/WireWGPUDevicePropertiesTests.cpp | 4 ++-- .../white_box/BufferAllocatedSizeTests.cpp | 4 ++-- .../tests/white_box/D3D12ResidencyTests.cpp | 4 ++-- .../tests/white_box/EGLImageWrappingTests.cpp | 4 ++-- .../tests/white_box/VulkanImageWrappingTests.h | 6 +++--- .../VulkanImageWrappingTests_OpaqueFD.cpp | 7 ++++--- .../utils/ComboRenderBundleEncoderDescriptor.h | 5 ++--- src/dawn/utils/ComboRenderPipelineDescriptor.h | 5 ++--- src/dawn/utils/D3D12Binding.cpp | 4 ++-- src/dawn/utils/GLFWUtils.cpp | 4 ++-- src/dawn/utils/GLFWUtils.h | 4 ++-- src/dawn/utils/Glfw3Fuchsia.cpp | 6 +++--- src/dawn/utils/NullBinding.cpp | 4 ++-- src/dawn/utils/OSXTimer.cpp | 4 ++-- src/dawn/utils/OpenGLBinding.cpp | 3 ++- src/dawn/utils/PosixTimer.cpp | 4 ++-- src/dawn/utils/ScopedAutoreleasePool.h | 4 ++-- src/dawn/utils/TestUtils.cpp | 4 ++-- src/dawn/utils/VulkanBinding.cpp | 4 ++-- src/dawn/utils/WGPUHelpers.cpp | 10 +++++----- src/dawn/utils/WGPUHelpers.h | 3 +-- src/dawn/utils/WindowsDebugLogger.cpp | 6 +++--- src/dawn/utils/WindowsTimer.cpp | 4 ++-- src/dawn/utils/WireHelper.cpp | 14 +++++++------- src/dawn/utils/WireHelper.h | 4 ++-- src/dawn/wire/BufferConsumer.h | 4 ++-- src/dawn/wire/ChunkedCommandHandler.cpp | 4 ++-- src/dawn/wire/ChunkedCommandHandler.h | 6 +++--- src/dawn/wire/ChunkedCommandSerializer.h | 8 ++++---- src/dawn/wire/WireDeserializeAllocator.h | 4 ++-- src/dawn/wire/client/ClientDoers.cpp | 4 ++-- .../ClientInlineMemoryTransferService.cpp | 4 ++-- src/dawn/wire/client/Device.h | 5 ++--- src/dawn/wire/client/LimitsAndFeatures.h | 4 ++-- src/dawn/wire/client/ObjectAllocator.h | 8 ++++---- src/dawn/wire/client/RequestTracker.h | 6 +++--- src/dawn/wire/server/ObjectStorage.h | 6 +++--- src/dawn/wire/server/ServerBuffer.cpp | 4 ++-- .../ServerInlineMemoryTransferService.cpp | 4 ++-- src/dawn/wire/server/ServerInstance.cpp | 4 ++-- src/dawn/wire/server/ServerShaderModule.cpp | 4 ++-- src/tint/bench/benchmark.h | 1 + src/tint/reader/wgsl/token.h | 3 ++- 274 files changed, 716 insertions(+), 704 deletions(-) diff --git a/src/dawn/CPPLINT.cfg b/src/dawn/CPPLINT.cfg index 1ce2ca4480..d263a48146 100644 --- a/src/dawn/CPPLINT.cfg +++ b/src/dawn/CPPLINT.cfg @@ -1,4 +1,3 @@ -filter=-build/include_order filter=-build/include_what_you_use filter=-build/namespaces filter=-readability/casting diff --git a/src/dawn/common/Assert.cpp b/src/dawn/common/Assert.cpp index 95d2efd30b..2599e12417 100644 --- a/src/dawn/common/Assert.cpp +++ b/src/dawn/common/Assert.cpp @@ -13,10 +13,11 @@ // limitations under the License. #include "dawn/common/Assert.h" -#include "dawn/common/Log.h" #include +#include "dawn/common/Log.h" + void HandleAssertionFailure(const char* file, const char* function, int line, diff --git a/src/dawn/common/BitSetIterator.h b/src/dawn/common/BitSetIterator.h index 05f2916af8..5f250d5abb 100644 --- a/src/dawn/common/BitSetIterator.h +++ b/src/dawn/common/BitSetIterator.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_COMMON_BITSETITERATOR_H_ #define SRC_DAWN_COMMON_BITSETITERATOR_H_ +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/Math.h" #include "dawn/common/UnderlyingType.h" -#include -#include - // This is ANGLE's BitSetIterator class with a customizable return type // TODO(crbug.com/dawn/306): it could be optimized, in particular when N <= 64 diff --git a/src/dawn/common/ConcurrentCache.h b/src/dawn/common/ConcurrentCache.h index 87543ef8fe..99c41ac6b4 100644 --- a/src/dawn/common/ConcurrentCache.h +++ b/src/dawn/common/ConcurrentCache.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_COMMON_CONCURRENTCACHE_H_ #define SRC_DAWN_COMMON_CONCURRENTCACHE_H_ -#include "dawn/common/NonCopyable.h" - #include #include #include +#include "dawn/common/NonCopyable.h" + template class ConcurrentCache : public NonMovable { public: diff --git a/src/dawn/common/CoreFoundationRef.h b/src/dawn/common/CoreFoundationRef.h index f77e8e08c5..d790c4db55 100644 --- a/src/dawn/common/CoreFoundationRef.h +++ b/src/dawn/common/CoreFoundationRef.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_COMMON_COREFOUNDATIONREF_H_ #define SRC_DAWN_COMMON_COREFOUNDATIONREF_H_ -#include "dawn/common/RefBase.h" - #include +#include "dawn/common/RefBase.h" + template struct CoreFoundationRefTraits { static constexpr T kNullValue = nullptr; diff --git a/src/dawn/common/DynamicLib.h b/src/dawn/common/DynamicLib.h index 00f3960194..a5980f5fc2 100644 --- a/src/dawn/common/DynamicLib.h +++ b/src/dawn/common/DynamicLib.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_DYNAMICLIB_H_ #define SRC_DAWN_COMMON_DYNAMICLIB_H_ -#include "dawn/common/Assert.h" - #include #include +#include "dawn/common/Assert.h" + class DynamicLib { public: DynamicLib() = default; diff --git a/src/dawn/common/GPUInfo.cpp b/src/dawn/common/GPUInfo.cpp index ddd8459703..5b7351775b 100644 --- a/src/dawn/common/GPUInfo.cpp +++ b/src/dawn/common/GPUInfo.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/common/GPUInfo.h" #include "dawn/common/Assert.h" -#include -#include - namespace gpu_info { namespace { // Intel diff --git a/src/dawn/common/HashUtils.h b/src/dawn/common/HashUtils.h index 3aaa960fd3..aed3cff720 100644 --- a/src/dawn/common/HashUtils.h +++ b/src/dawn/common/HashUtils.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_COMMON_HASHUTILS_H_ #define SRC_DAWN_COMMON_HASHUTILS_H_ +#include +#include + #include "dawn/common/Platform.h" #include "dawn/common/TypedInteger.h" #include "dawn/common/ityp_bitset.h" -#include -#include - // Wrapper around std::hash to make it a templated function instead of a functor. It is marginally // nicer, and avoids adding to the std namespace to add hashing of other types. template diff --git a/src/dawn/common/IOKitRef.h b/src/dawn/common/IOKitRef.h index 43119a4619..d8fe9604bb 100644 --- a/src/dawn/common/IOKitRef.h +++ b/src/dawn/common/IOKitRef.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_COMMON_IOKITREF_H_ #define SRC_DAWN_COMMON_IOKITREF_H_ -#include "dawn/common/RefBase.h" - #include +#include "dawn/common/RefBase.h" + template struct IOKitRefTraits { static constexpr T kNullValue = IO_OBJECT_NULL; diff --git a/src/dawn/common/Log.cpp b/src/dawn/common/Log.cpp index b85094b76f..1505f96e93 100644 --- a/src/dawn/common/Log.cpp +++ b/src/dawn/common/Log.cpp @@ -14,11 +14,11 @@ #include "dawn/common/Log.h" +#include + #include "dawn/common/Assert.h" #include "dawn/common/Platform.h" -#include - #if defined(DAWN_PLATFORM_ANDROID) # include #endif diff --git a/src/dawn/common/Math.cpp b/src/dawn/common/Math.cpp index bd936a8f71..1215eb8b55 100644 --- a/src/dawn/common/Math.cpp +++ b/src/dawn/common/Math.cpp @@ -14,13 +14,13 @@ #include "dawn/common/Math.h" -#include "dawn/common/Assert.h" -#include "dawn/common/Platform.h" - #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Platform.h" + #if defined(DAWN_COMPILER_MSVC) # include #endif diff --git a/src/dawn/common/Math.h b/src/dawn/common/Math.h index 59384430ff..9984c4b0b0 100644 --- a/src/dawn/common/Math.h +++ b/src/dawn/common/Math.h @@ -15,8 +15,6 @@ #ifndef SRC_DAWN_COMMON_MATH_H_ #define SRC_DAWN_COMMON_MATH_H_ -#include "dawn/common/Assert.h" - #include #include #include @@ -24,6 +22,8 @@ #include #include +#include "dawn/common/Assert.h" + // The following are not valid for 0 uint32_t ScanForward(uint32_t bits); uint32_t Log2(uint32_t value); diff --git a/src/dawn/common/RefBase.h b/src/dawn/common/RefBase.h index fca12d600d..95892084d2 100644 --- a/src/dawn/common/RefBase.h +++ b/src/dawn/common/RefBase.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_COMMON_REFBASE_H_ #define SRC_DAWN_COMMON_REFBASE_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/Compiler.h" - #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Compiler.h" + // A common class for various smart-pointers acting on referenceable/releasable pointer-like // objects. Logic for each specialization can be customized using a Traits type that looks // like the following: diff --git a/src/dawn/common/RefCounted.cpp b/src/dawn/common/RefCounted.cpp index 6950d13450..0d77d3f5d2 100644 --- a/src/dawn/common/RefCounted.cpp +++ b/src/dawn/common/RefCounted.cpp @@ -14,10 +14,10 @@ #include "dawn/common/RefCounted.h" -#include "dawn/common/Assert.h" - #include +#include "dawn/common/Assert.h" + static constexpr size_t kPayloadBits = 1; static constexpr uint64_t kPayloadMask = (uint64_t(1) << kPayloadBits) - 1; static constexpr uint64_t kRefCountIncrement = (uint64_t(1) << kPayloadBits); diff --git a/src/dawn/common/RefCounted.h b/src/dawn/common/RefCounted.h index ef70d4df40..0593544565 100644 --- a/src/dawn/common/RefCounted.h +++ b/src/dawn/common/RefCounted.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_REFCOUNTED_H_ #define SRC_DAWN_COMMON_REFCOUNTED_H_ -#include "dawn/common/RefBase.h" - #include #include +#include "dawn/common/RefBase.h" + class RefCounted { public: explicit RefCounted(uint64_t payload = 0); diff --git a/src/dawn/common/Result.h b/src/dawn/common/Result.h index d3ccbf1910..82ac894770 100644 --- a/src/dawn/common/Result.h +++ b/src/dawn/common/Result.h @@ -15,15 +15,15 @@ #ifndef SRC_DAWN_COMMON_RESULT_H_ #define SRC_DAWN_COMMON_RESULT_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/Compiler.h" - #include #include #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Compiler.h" + // Result is the following sum type (Haskell notation): // // data Result T E = Success T | Error E | Empty diff --git a/src/dawn/common/SerialMap.h b/src/dawn/common/SerialMap.h index 74a4657f6a..cd26099c5a 100644 --- a/src/dawn/common/SerialMap.h +++ b/src/dawn/common/SerialMap.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_SERIALMAP_H_ #define SRC_DAWN_COMMON_SERIALMAP_H_ -#include "dawn/common/SerialStorage.h" - #include #include +#include "dawn/common/SerialStorage.h" + template class SerialMap; diff --git a/src/dawn/common/SerialQueue.h b/src/dawn/common/SerialQueue.h index 0091ecaf30..e065254969 100644 --- a/src/dawn/common/SerialQueue.h +++ b/src/dawn/common/SerialQueue.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_COMMON_SERIALQUEUE_H_ #define SRC_DAWN_COMMON_SERIALQUEUE_H_ -#include "dawn/common/SerialStorage.h" - #include +#include "dawn/common/SerialStorage.h" + template class SerialQueue; diff --git a/src/dawn/common/SerialStorage.h b/src/dawn/common/SerialStorage.h index 9821659081..5194a21d35 100644 --- a/src/dawn/common/SerialStorage.h +++ b/src/dawn/common/SerialStorage.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_SERIALSTORAGE_H_ #define SRC_DAWN_COMMON_SERIALSTORAGE_H_ -#include "dawn/common/Assert.h" - #include #include +#include "dawn/common/Assert.h" + template struct SerialStorageTraits {}; diff --git a/src/dawn/common/SlabAllocator.cpp b/src/dawn/common/SlabAllocator.cpp index d680ee36c1..fad35d3870 100644 --- a/src/dawn/common/SlabAllocator.cpp +++ b/src/dawn/common/SlabAllocator.cpp @@ -14,14 +14,14 @@ #include "dawn/common/SlabAllocator.h" -#include "dawn/common/Assert.h" -#include "dawn/common/Math.h" - #include #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Math.h" + // IndexLinkNode SlabAllocatorImpl::IndexLinkNode::IndexLinkNode(Index index, Index nextIndex) diff --git a/src/dawn/common/SlabAllocator.h b/src/dawn/common/SlabAllocator.h index 3a6f3485d2..bcfadf0d54 100644 --- a/src/dawn/common/SlabAllocator.h +++ b/src/dawn/common/SlabAllocator.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_COMMON_SLABALLOCATOR_H_ #define SRC_DAWN_COMMON_SLABALLOCATOR_H_ -#include "dawn/common/PlacementAllocated.h" - #include #include #include +#include "dawn/common/PlacementAllocated.h" + // The SlabAllocator allocates objects out of one or more fixed-size contiguous "slabs" of memory. // This makes it very quick to allocate and deallocate fixed-size objects because the allocator only // needs to index an offset into pre-allocated memory. It is similar to a pool-allocator that diff --git a/src/dawn/common/StackContainer.h b/src/dawn/common/StackContainer.h index 1efcc054c7..e4b3584fe5 100644 --- a/src/dawn/common/StackContainer.h +++ b/src/dawn/common/StackContainer.h @@ -7,11 +7,11 @@ #ifndef SRC_DAWN_COMMON_STACKCONTAINER_H_ #define SRC_DAWN_COMMON_STACKCONTAINER_H_ -#include "dawn/common/Compiler.h" - #include #include +#include "dawn/common/Compiler.h" + // This allocator can be used with STL containers to provide a stack buffer // from which to allocate memory and overflows onto the heap. This stack buffer // would be allocated on the stack and allows us to avoid heap operations in diff --git a/src/dawn/common/SystemUtils.h b/src/dawn/common/SystemUtils.h index 31b39023e6..3a05ae7e11 100644 --- a/src/dawn/common/SystemUtils.h +++ b/src/dawn/common/SystemUtils.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_SYSTEMUTILS_H_ #define SRC_DAWN_COMMON_SYSTEMUTILS_H_ -#include "dawn/common/Platform.h" - #include #include +#include "dawn/common/Platform.h" + const char* GetPathSeparator(); // Returns a pair of the environment variable's value, and a boolean indicating whether the variable // was present. diff --git a/src/dawn/common/TypedInteger.h b/src/dawn/common/TypedInteger.h index d00160c350..3ee9724617 100644 --- a/src/dawn/common/TypedInteger.h +++ b/src/dawn/common/TypedInteger.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_COMMON_TYPEDINTEGER_H_ #define SRC_DAWN_COMMON_TYPEDINTEGER_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/UnderlyingType.h" - #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/UnderlyingType.h" + // TypedInteger is helper class that provides additional type safety in Debug. // - Integers of different (Tag, BaseIntegerType) may not be used interoperably // - Allows casts only to the underlying type. diff --git a/src/dawn/common/WindowsUtils.cpp b/src/dawn/common/WindowsUtils.cpp index fd924f4ae2..6a5b143d17 100644 --- a/src/dawn/common/WindowsUtils.cpp +++ b/src/dawn/common/WindowsUtils.cpp @@ -14,10 +14,10 @@ #include "dawn/common/WindowsUtils.h" -#include "dawn/common/windows_with_undefs.h" - #include +#include "dawn/common/windows_with_undefs.h" + std::string WCharToUTF8(const wchar_t* input) { // The -1 argument asks WideCharToMultiByte to use the null terminator to know the size of // input. It will return a size that includes the null terminator. diff --git a/src/dawn/common/ityp_array.h b/src/dawn/common/ityp_array.h index cb0d650e93..11f06bf794 100644 --- a/src/dawn/common/ityp_array.h +++ b/src/dawn/common/ityp_array.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_COMMON_ITYP_ARRAY_H_ #define SRC_DAWN_COMMON_ITYP_ARRAY_H_ -#include "dawn/common/TypedInteger.h" -#include "dawn/common/UnderlyingType.h" - #include #include #include +#include "dawn/common/TypedInteger.h" +#include "dawn/common/UnderlyingType.h" + namespace ityp { // ityp::array is a helper class that wraps std::array with the restriction that diff --git a/src/dawn/common/ityp_span.h b/src/dawn/common/ityp_span.h index 893982cf56..7b0bb2b457 100644 --- a/src/dawn/common/ityp_span.h +++ b/src/dawn/common/ityp_span.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_COMMON_ITYP_SPAN_H_ #define SRC_DAWN_COMMON_ITYP_SPAN_H_ +#include + #include "dawn/common/TypedInteger.h" #include "dawn/common/UnderlyingType.h" -#include - namespace ityp { // ityp::span is a helper class that wraps an unowned packed array of type |Value|. diff --git a/src/dawn/common/ityp_vector.h b/src/dawn/common/ityp_vector.h index dc4f4c97be..a1ff2e0da0 100644 --- a/src/dawn/common/ityp_vector.h +++ b/src/dawn/common/ityp_vector.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_COMMON_ITYP_VECTOR_H_ #define SRC_DAWN_COMMON_ITYP_VECTOR_H_ -#include "dawn/common/TypedInteger.h" -#include "dawn/common/UnderlyingType.h" - #include #include +#include "dawn/common/TypedInteger.h" +#include "dawn/common/UnderlyingType.h" + namespace ityp { // ityp::vector is a helper class that wraps std::vector with the restriction that diff --git a/src/dawn/common/vulkan_platform.h b/src/dawn/common/vulkan_platform.h index 097e4cb890..1217e0a567 100644 --- a/src/dawn/common/vulkan_platform.h +++ b/src/dawn/common/vulkan_platform.h @@ -22,11 +22,11 @@ # error "vulkan.h included before vulkan_platform.h" #endif -#include "dawn/common/Platform.h" - #include #include +#include "dawn/common/Platform.h" + // vulkan.h defines non-dispatchable handles to opaque pointers on 64bit architectures and uint64_t // on 32bit architectures. This causes a problem in 32bit where the handles cannot be used to // distinguish between overloads of the same function. diff --git a/src/dawn/fuzzers/DawnWireServerFuzzer.cpp b/src/dawn/fuzzers/DawnWireServerFuzzer.cpp index 17b5d23482..8b895047c6 100644 --- a/src/dawn/fuzzers/DawnWireServerFuzzer.cpp +++ b/src/dawn/fuzzers/DawnWireServerFuzzer.cpp @@ -14,6 +14,9 @@ #include "dawn/fuzzers/DawnWireServerFuzzer.h" +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/Log.h" #include "dawn/common/SystemUtils.h" @@ -23,9 +26,6 @@ #include "dawn/webgpu_cpp.h" #include "dawn/wire/WireServer.h" -#include -#include - namespace { class DevNull : public dawn::wire::CommandSerializer { diff --git a/src/dawn/fuzzers/DawnWireServerFuzzer.h b/src/dawn/fuzzers/DawnWireServerFuzzer.h index 19510ef9ea..d6349cef35 100644 --- a/src/dawn/fuzzers/DawnWireServerFuzzer.h +++ b/src/dawn/fuzzers/DawnWireServerFuzzer.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_FUZZERS_DAWNWIRESERVERFUZZER_H_ #define SRC_DAWN_FUZZERS_DAWNWIRESERVERFUZZER_H_ -#include "dawn/webgpu_cpp.h" - #include #include +#include "dawn/webgpu_cpp.h" + namespace dawn::native { class Instance; diff --git a/src/dawn/native/Adapter.h b/src/dawn/native/Adapter.h index 99b68e7318..d0f7cf15b5 100644 --- a/src/dawn/native/Adapter.h +++ b/src/dawn/native/Adapter.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_ADAPTER_H_ #define SRC_DAWN_NATIVE_ADAPTER_H_ +#include + #include "dawn/native/DawnNative.h" #include "dawn/common/RefCounted.h" @@ -24,8 +26,6 @@ #include "dawn/native/Limits.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/AttachmentState.h b/src/dawn/native/AttachmentState.h index 63c5defb17..c1e64458c3 100644 --- a/src/dawn/native/AttachmentState.h +++ b/src/dawn/native/AttachmentState.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_ATTACHMENTSTATE_H_ #define SRC_DAWN_NATIVE_ATTACHMENTSTATE_H_ +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/common/ityp_bitset.h" @@ -24,9 +27,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/BackendConnection.h b/src/dawn/native/BackendConnection.h index 45b0709fb9..26725dcbd3 100644 --- a/src/dawn/native/BackendConnection.h +++ b/src/dawn/native/BackendConnection.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_BACKENDCONNECTION_H_ #define SRC_DAWN_NATIVE_BACKENDCONNECTION_H_ +#include + #include "dawn/native/Adapter.h" #include "dawn/native/DawnNative.h" -#include - namespace dawn::native { // An common interface for all backends. Mostly used to create adapters for a particular diff --git a/src/dawn/native/BindGroup.h b/src/dawn/native/BindGroup.h index 2664c4f30f..839b71ef1e 100644 --- a/src/dawn/native/BindGroup.h +++ b/src/dawn/native/BindGroup.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_BINDGROUP_H_ #define SRC_DAWN_NATIVE_BINDGROUP_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/native/BindGroupLayout.h" @@ -24,8 +26,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/BindGroupLayout.cpp b/src/dawn/native/BindGroupLayout.cpp index 5db20417e7..8774e007f2 100644 --- a/src/dawn/native/BindGroupLayout.cpp +++ b/src/dawn/native/BindGroupLayout.cpp @@ -14,6 +14,10 @@ #include "dawn/native/BindGroupLayout.h" +#include +#include +#include + #include "dawn/common/BitSetIterator.h" #include "dawn/native/ChainUtils_autogen.h" @@ -24,10 +28,6 @@ #include "dawn/native/PerStage.h" #include "dawn/native/ValidationUtils_autogen.h" -#include -#include -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/BindGroupLayout.h b/src/dawn/native/BindGroupLayout.h index c8cb27c111..9bae62a07a 100644 --- a/src/dawn/native/BindGroupLayout.h +++ b/src/dawn/native/BindGroupLayout.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_BINDGROUPLAYOUT_H_ #define SRC_DAWN_NATIVE_BINDGROUPLAYOUT_H_ +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/common/SlabAllocator.h" @@ -28,9 +31,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { // TODO(dawn:1082): Minor optimization to use BindingIndex instead of BindingNumber struct ExternalTextureBindingExpansion { diff --git a/src/dawn/native/BindGroupTracker.h b/src/dawn/native/BindGroupTracker.h index dd2f056c95..34b017881f 100644 --- a/src/dawn/native/BindGroupTracker.h +++ b/src/dawn/native/BindGroupTracker.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_BINDGROUPTRACKER_H_ #define SRC_DAWN_NATIVE_BINDGROUPTRACKER_H_ +#include +#include + #include "dawn/common/Constants.h" #include "dawn/native/BindGroupLayout.h" #include "dawn/native/Pipeline.h" #include "dawn/native/PipelineLayout.h" -#include -#include - namespace dawn::native { // Keeps track of the dirty bind groups so they can be lazily applied when we know the diff --git a/src/dawn/native/BindingInfo.h b/src/dawn/native/BindingInfo.h index e04d014afe..b5a8497c03 100644 --- a/src/dawn/native/BindingInfo.h +++ b/src/dawn/native/BindingInfo.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_BINDINGINFO_H_ #define SRC_DAWN_NATIVE_BINDINGINFO_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/native/Error.h" @@ -24,8 +26,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { // Not a real WebGPU limit, but the sum of the two limits is useful for internal optimizations. diff --git a/src/dawn/native/BuddyMemoryAllocator.h b/src/dawn/native/BuddyMemoryAllocator.h index e4d4f10b4c..299dc3d2ba 100644 --- a/src/dawn/native/BuddyMemoryAllocator.h +++ b/src/dawn/native/BuddyMemoryAllocator.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_BUDDYMEMORYALLOCATOR_H_ #define SRC_DAWN_NATIVE_BUDDYMEMORYALLOCATOR_H_ +#include +#include + #include "dawn/native/BuddyAllocator.h" #include "dawn/native/Error.h" #include "dawn/native/ResourceMemoryAllocation.h" -#include -#include - namespace dawn::native { class ResourceHeapAllocator; diff --git a/src/dawn/native/Buffer.cpp b/src/dawn/native/Buffer.cpp index 79a1bfaae2..ff1310fe10 100644 --- a/src/dawn/native/Buffer.cpp +++ b/src/dawn/native/Buffer.cpp @@ -14,6 +14,10 @@ #include "dawn/native/Buffer.h" +#include +#include +#include + #include "dawn/common/Alloc.h" #include "dawn/common/Assert.h" #include "dawn/native/Commands.h" @@ -26,10 +30,6 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include -#include -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/Buffer.h b/src/dawn/native/Buffer.h index 60a41bceee..41a9b55a11 100644 --- a/src/dawn/native/Buffer.h +++ b/src/dawn/native/Buffer.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_BUFFER_H_ #define SRC_DAWN_NATIVE_BUFFER_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/Forward.h" #include "dawn/native/IntegerTypes.h" @@ -22,8 +24,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { struct CopyTextureToBufferCmd; diff --git a/src/dawn/native/CacheKey.h b/src/dawn/native/CacheKey.h index 2d58d76cb6..5b528e5a98 100644 --- a/src/dawn/native/CacheKey.h +++ b/src/dawn/native/CacheKey.h @@ -15,9 +15,6 @@ #ifndef SRC_DAWN_NATIVE_CACHEKEY_H_ #define SRC_DAWN_NATIVE_CACHEKEY_H_ -#include "dawn/common/TypedInteger.h" -#include "dawn/common/ityp_array.h" - #include #include #include @@ -25,6 +22,9 @@ #include #include +#include "dawn/common/TypedInteger.h" +#include "dawn/common/ityp_array.h" + namespace dawn::native { // Forward declare classes because of co-dependency. diff --git a/src/dawn/native/CachedObject.h b/src/dawn/native/CachedObject.h index 5e485602be..f275e02e28 100644 --- a/src/dawn/native/CachedObject.h +++ b/src/dawn/native/CachedObject.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_CACHEDOBJECT_H_ #define SRC_DAWN_NATIVE_CACHEDOBJECT_H_ -#include "dawn/native/CacheKey.h" -#include "dawn/native/Forward.h" - #include #include +#include "dawn/native/CacheKey.h" +#include "dawn/native/Forward.h" + namespace dawn::native { // Some objects are cached so that instead of creating new duplicate objects, diff --git a/src/dawn/native/CommandAllocator.cpp b/src/dawn/native/CommandAllocator.cpp index 5d36aad0b4..eee4b6b188 100644 --- a/src/dawn/native/CommandAllocator.cpp +++ b/src/dawn/native/CommandAllocator.cpp @@ -14,14 +14,14 @@ #include "dawn/native/CommandAllocator.h" -#include "dawn/common/Assert.h" -#include "dawn/common/Math.h" - #include #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Math.h" + namespace dawn::native { // TODO(cwallez@chromium.org): figure out a way to have more type safety for the iterator diff --git a/src/dawn/native/CommandAllocator.h b/src/dawn/native/CommandAllocator.h index 4b7ea99a56..86c3d77fd9 100644 --- a/src/dawn/native/CommandAllocator.h +++ b/src/dawn/native/CommandAllocator.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_COMMANDALLOCATOR_H_ #define SRC_DAWN_NATIVE_COMMANDALLOCATOR_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/Math.h" -#include "dawn/common/NonCopyable.h" - #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Math.h" +#include "dawn/common/NonCopyable.h" + namespace dawn::native { // Allocation for command buffers should be fast. To avoid doing an allocation per command diff --git a/src/dawn/native/CommandEncoder.h b/src/dawn/native/CommandEncoder.h index 81263c0539..491f6eb007 100644 --- a/src/dawn/native/CommandEncoder.h +++ b/src/dawn/native/CommandEncoder.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_COMMANDENCODER_H_ #define SRC_DAWN_NATIVE_COMMANDENCODER_H_ +#include + #include "dawn/native/dawn_platform.h" #include "dawn/native/EncodingContext.h" @@ -22,8 +24,6 @@ #include "dawn/native/ObjectBase.h" #include "dawn/native/PassResourceUsage.h" -#include - namespace dawn::native { enum class UsageValidationMode; diff --git a/src/dawn/native/CommandValidation.h b/src/dawn/native/CommandValidation.h index c65e9837c6..91b98cf3e0 100644 --- a/src/dawn/native/CommandValidation.h +++ b/src/dawn/native/CommandValidation.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_COMMANDVALIDATION_H_ #define SRC_DAWN_NATIVE_COMMANDVALIDATION_H_ +#include + #include "dawn/native/CommandAllocator.h" #include "dawn/native/Error.h" #include "dawn/native/Texture.h" -#include - namespace dawn::native { class QuerySetBase; diff --git a/src/dawn/native/Commands.h b/src/dawn/native/Commands.h index be465fcf2c..0ab7dffe19 100644 --- a/src/dawn/native/Commands.h +++ b/src/dawn/native/Commands.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_COMMANDS_H_ #define SRC_DAWN_NATIVE_COMMANDS_H_ +#include +#include + #include "dawn/common/Constants.h" #include "dawn/native/AttachmentState.h" @@ -23,9 +26,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { // Definition of the commands that are present in the CommandIterator given by the diff --git a/src/dawn/native/CompilationMessages.cpp b/src/dawn/native/CompilationMessages.cpp index 47c3d0be32..ec9c245c80 100644 --- a/src/dawn/native/CompilationMessages.cpp +++ b/src/dawn/native/CompilationMessages.cpp @@ -17,7 +17,7 @@ #include "dawn/common/Assert.h" #include "dawn/native/dawn_platform.h" -#include +#include "tint/tint.h" namespace dawn::native { diff --git a/src/dawn/native/CompilationMessages.h b/src/dawn/native/CompilationMessages.h index 4697045ddc..e8c7dbc2f4 100644 --- a/src/dawn/native/CompilationMessages.h +++ b/src/dawn/native/CompilationMessages.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_COMPILATIONMESSAGES_H_ #define SRC_DAWN_NATIVE_COMPILATIONMESSAGES_H_ +#include +#include + #include "dawn/native/dawn_platform.h" #include "dawn/common/NonCopyable.h" -#include -#include - namespace tint::diag { class Diagnostic; class List; diff --git a/src/dawn/native/CopyTextureForBrowserHelper.cpp b/src/dawn/native/CopyTextureForBrowserHelper.cpp index a72cedce14..3e7b4eb9e5 100644 --- a/src/dawn/native/CopyTextureForBrowserHelper.cpp +++ b/src/dawn/native/CopyTextureForBrowserHelper.cpp @@ -14,6 +14,8 @@ #include "dawn/native/CopyTextureForBrowserHelper.h" +#include + #include "dawn/common/Log.h" #include "dawn/native/BindGroup.h" #include "dawn/native/BindGroupLayout.h" @@ -31,8 +33,6 @@ #include "dawn/native/ValidationUtils_autogen.h" #include "dawn/native/utils/WGPUHelpers.h" -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp index b032a6b510..aad5eb93bb 100644 --- a/src/dawn/native/Device.cpp +++ b/src/dawn/native/Device.cpp @@ -14,6 +14,10 @@ #include "dawn/native/Device.h" +#include +#include +#include + #include "dawn/common/Log.h" #include "dawn/native/Adapter.h" #include "dawn/native/AsyncTask.h" @@ -48,10 +52,6 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include -#include -#include - namespace dawn::native { // DeviceBase sub-structures diff --git a/src/dawn/native/Device.h b/src/dawn/native/Device.h index bbffcc9b52..e2fd4513da 100644 --- a/src/dawn/native/Device.h +++ b/src/dawn/native/Device.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_DEVICE_H_ #define SRC_DAWN_NATIVE_DEVICE_H_ +#include +#include + #include "dawn/native/CacheKey.h" #include "dawn/native/Commands.h" #include "dawn/native/ComputePipeline.h" @@ -31,9 +34,6 @@ #include "dawn/native/DawnNative.h" #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::platform { class WorkerTaskPool; } // namespace dawn::platform diff --git a/src/dawn/native/EncodingContext.h b/src/dawn/native/EncodingContext.h index 341cc10509..47c4875411 100644 --- a/src/dawn/native/EncodingContext.h +++ b/src/dawn/native/EncodingContext.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_ENCODINGCONTEXT_H_ #define SRC_DAWN_NATIVE_ENCODINGCONTEXT_H_ +#include + #include "dawn/native/CommandAllocator.h" #include "dawn/native/Error.h" #include "dawn/native/ErrorData.h" @@ -22,8 +24,6 @@ #include "dawn/native/PassResourceUsageTracker.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { class CommandEncoder; diff --git a/src/dawn/native/Error.h b/src/dawn/native/Error.h index 1a5ac313f8..d71929ac55 100644 --- a/src/dawn/native/Error.h +++ b/src/dawn/native/Error.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_ERROR_H_ #define SRC_DAWN_NATIVE_ERROR_H_ +#include + #include "absl/strings/str_format.h" #include "dawn/common/Result.h" #include "dawn/native/ErrorData.h" #include "dawn/native/webgpu_absl_format.h" -#include - namespace dawn::native { enum class InternalErrorType : uint32_t { Validation, DeviceLost, Internal, OutOfMemory }; diff --git a/src/dawn/native/ErrorData.h b/src/dawn/native/ErrorData.h index 6ad2e13576..e62decb51a 100644 --- a/src/dawn/native/ErrorData.h +++ b/src/dawn/native/ErrorData.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_ERRORDATA_H_ #define SRC_DAWN_NATIVE_ERRORDATA_H_ -#include "dawn/common/Compiler.h" - #include #include #include #include +#include "dawn/common/Compiler.h" + namespace wgpu { enum class ErrorType : uint32_t; } diff --git a/src/dawn/native/ErrorScope.h b/src/dawn/native/ErrorScope.h index 68a0dde1c2..f99c71d2b1 100644 --- a/src/dawn/native/ErrorScope.h +++ b/src/dawn/native/ErrorScope.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_ERRORSCOPE_H_ #define SRC_DAWN_NATIVE_ERRORSCOPE_H_ -#include "dawn/native/dawn_platform.h" - #include #include +#include "dawn/native/dawn_platform.h" + namespace dawn::native { class ErrorScope { diff --git a/src/dawn/native/ExternalTexture.h b/src/dawn/native/ExternalTexture.h index 771659b5c6..17977b4b4a 100644 --- a/src/dawn/native/ExternalTexture.h +++ b/src/dawn/native/ExternalTexture.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_EXTERNALTEXTURE_H_ #define SRC_DAWN_NATIVE_EXTERNALTEXTURE_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/Forward.h" #include "dawn/native/ObjectBase.h" #include "dawn/native/Subresource.h" -#include - namespace dawn::native { class TextureViewBase; diff --git a/src/dawn/native/Format.cpp b/src/dawn/native/Format.cpp index 946baf5a60..1fc6a1a51a 100644 --- a/src/dawn/native/Format.cpp +++ b/src/dawn/native/Format.cpp @@ -14,13 +14,13 @@ #include "dawn/native/Format.h" +#include + #include "dawn/native/Device.h" #include "dawn/native/EnumMaskIterator.h" #include "dawn/native/Features.h" #include "dawn/native/Texture.h" -#include - namespace dawn::native { // Format diff --git a/src/dawn/native/Format.h b/src/dawn/native/Format.h index 509e64bdc1..40a770a72a 100644 --- a/src/dawn/native/Format.h +++ b/src/dawn/native/Format.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_FORMAT_H_ #define SRC_DAWN_NATIVE_FORMAT_H_ +#include + #include "dawn/native/dawn_platform.h" #include "dawn/common/TypedInteger.h" @@ -24,8 +26,6 @@ #include "dawn/native/Error.h" #include "dawn/native/Subresource.h" -#include - // About multi-planar formats. // // Dawn supports additional multi-planar formats when the multiplanar-formats extension is enabled. diff --git a/src/dawn/native/IndirectDrawMetadata.cpp b/src/dawn/native/IndirectDrawMetadata.cpp index d6c8e63580..3caf9f30a7 100644 --- a/src/dawn/native/IndirectDrawMetadata.cpp +++ b/src/dawn/native/IndirectDrawMetadata.cpp @@ -14,15 +14,15 @@ #include "dawn/native/IndirectDrawMetadata.h" +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/RefCounted.h" #include "dawn/native/IndirectDrawValidationEncoder.h" #include "dawn/native/Limits.h" #include "dawn/native/RenderBundle.h" -#include -#include - namespace dawn::native { uint64_t ComputeMaxIndirectValidationBatchOffsetRange(const CombinedLimits& limits) { diff --git a/src/dawn/native/IndirectDrawMetadata.h b/src/dawn/native/IndirectDrawMetadata.h index 869fba6470..081c47b1fc 100644 --- a/src/dawn/native/IndirectDrawMetadata.h +++ b/src/dawn/native/IndirectDrawMetadata.h @@ -15,18 +15,18 @@ #ifndef SRC_DAWN_NATIVE_INDIRECTDRAWMETADATA_H_ #define SRC_DAWN_NATIVE_INDIRECTDRAWMETADATA_H_ -#include "dawn/common/NonCopyable.h" -#include "dawn/common/RefCounted.h" -#include "dawn/native/Buffer.h" -#include "dawn/native/CommandBufferStateTracker.h" -#include "dawn/native/Commands.h" - #include #include #include #include #include +#include "dawn/common/NonCopyable.h" +#include "dawn/common/RefCounted.h" +#include "dawn/native/Buffer.h" +#include "dawn/native/CommandBufferStateTracker.h" +#include "dawn/native/Commands.h" + namespace dawn::native { class RenderBundleBase; diff --git a/src/dawn/native/IndirectDrawValidationEncoder.cpp b/src/dawn/native/IndirectDrawValidationEncoder.cpp index 97e5a5252a..d8325da33b 100644 --- a/src/dawn/native/IndirectDrawValidationEncoder.cpp +++ b/src/dawn/native/IndirectDrawValidationEncoder.cpp @@ -14,6 +14,9 @@ #include "dawn/native/IndirectDrawValidationEncoder.h" +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/native/BindGroup.h" @@ -26,9 +29,6 @@ #include "dawn/native/Queue.h" #include "dawn/native/utils/WGPUHelpers.h" -#include -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/Instance.h b/src/dawn/native/Instance.h index b574f6335e..b3fe0d11fc 100644 --- a/src/dawn/native/Instance.h +++ b/src/dawn/native/Instance.h @@ -15,6 +15,11 @@ #ifndef SRC_DAWN_NATIVE_INSTANCE_H_ #define SRC_DAWN_NATIVE_INSTANCE_H_ +#include +#include +#include +#include + #include "dawn/common/RefCounted.h" #include "dawn/common/ityp_bitset.h" #include "dawn/native/Adapter.h" @@ -23,11 +28,6 @@ #include "dawn/native/Toggles.h" #include "dawn/native/dawn_platform.h" -#include -#include -#include -#include - namespace dawn::platform { class Platform; } // namespace dawn::platform diff --git a/src/dawn/native/IntegerTypes.h b/src/dawn/native/IntegerTypes.h index 48658e2882..221c2eaded 100644 --- a/src/dawn/native/IntegerTypes.h +++ b/src/dawn/native/IntegerTypes.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_INTEGERTYPES_H_ #define SRC_DAWN_NATIVE_INTEGERTYPES_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/common/TypedInteger.h" -#include - namespace dawn::native { // Binding numbers in the shader and BindGroup/BindGroupLayoutDescriptors using BindingNumber = TypedInteger; diff --git a/src/dawn/native/InternalPipelineStore.cpp b/src/dawn/native/InternalPipelineStore.cpp index a2532aa8a6..2f6f5be15a 100644 --- a/src/dawn/native/InternalPipelineStore.cpp +++ b/src/dawn/native/InternalPipelineStore.cpp @@ -14,13 +14,13 @@ #include "dawn/native/InternalPipelineStore.h" +#include + #include "dawn/native/ComputePipeline.h" #include "dawn/native/Device.h" #include "dawn/native/RenderPipeline.h" #include "dawn/native/ShaderModule.h" -#include - namespace dawn::native { class RenderPipelineBase; diff --git a/src/dawn/native/InternalPipelineStore.h b/src/dawn/native/InternalPipelineStore.h index 4f80d9db4b..9cceaa7127 100644 --- a/src/dawn/native/InternalPipelineStore.h +++ b/src/dawn/native/InternalPipelineStore.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_INTERNALPIPELINESTORE_H_ #define SRC_DAWN_NATIVE_INTERNALPIPELINESTORE_H_ +#include + #include "dawn/native/ObjectBase.h" #include "dawn/native/ScratchBuffer.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/Limits.cpp b/src/dawn/native/Limits.cpp index 3b006bdabe..7812fb1b63 100644 --- a/src/dawn/native/Limits.cpp +++ b/src/dawn/native/Limits.cpp @@ -14,11 +14,11 @@ #include "dawn/native/Limits.h" +#include + #include "dawn/common/Assert.h" #include "dawn/common/Math.h" -#include - // clang-format off // TODO(crbug.com/dawn/685): // For now, only expose these tiers until metrics can determine better ones. diff --git a/src/dawn/native/ObjectBase.cpp b/src/dawn/native/ObjectBase.cpp index 3cafdb79bb..57dd59d1ad 100644 --- a/src/dawn/native/ObjectBase.cpp +++ b/src/dawn/native/ObjectBase.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/native/ObjectBase.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { static constexpr uint64_t kErrorPayload = 0; diff --git a/src/dawn/native/ObjectBase.h b/src/dawn/native/ObjectBase.h index 4ea489c0d5..bf3ec14a93 100644 --- a/src/dawn/native/ObjectBase.h +++ b/src/dawn/native/ObjectBase.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_OBJECTBASE_H_ #define SRC_DAWN_NATIVE_OBJECTBASE_H_ +#include + #include "dawn/common/LinkedList.h" #include "dawn/common/RefCounted.h" #include "dawn/native/Forward.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/ObjectContentHasher.h b/src/dawn/native/ObjectContentHasher.h index 8a065a834f..152a603b62 100644 --- a/src/dawn/native/ObjectContentHasher.h +++ b/src/dawn/native/ObjectContentHasher.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_OBJECTCONTENTHASHER_H_ #define SRC_DAWN_NATIVE_OBJECTCONTENTHASHER_H_ -#include "dawn/common/HashUtils.h" - #include #include +#include "dawn/common/HashUtils.h" + namespace dawn::native { // ObjectContentHasher records a hash that can be used as a key to lookup a cached object in a diff --git a/src/dawn/native/PassResourceUsage.h b/src/dawn/native/PassResourceUsage.h index 307a7266f0..1e3ab56b89 100644 --- a/src/dawn/native/PassResourceUsage.h +++ b/src/dawn/native/PassResourceUsage.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_PASSRESOURCEUSAGE_H_ #define SRC_DAWN_NATIVE_PASSRESOURCEUSAGE_H_ -#include "dawn/native/SubresourceStorage.h" -#include "dawn/native/dawn_platform.h" - #include #include +#include "dawn/native/SubresourceStorage.h" +#include "dawn/native/dawn_platform.h" + namespace dawn::native { // This file declares various "ResourceUsage" structures. They are produced by the frontend diff --git a/src/dawn/native/PassResourceUsageTracker.cpp b/src/dawn/native/PassResourceUsageTracker.cpp index b4814cfa62..7f274e171e 100644 --- a/src/dawn/native/PassResourceUsageTracker.cpp +++ b/src/dawn/native/PassResourceUsageTracker.cpp @@ -14,6 +14,8 @@ #include "dawn/native/PassResourceUsageTracker.h" +#include + #include "dawn/native/BindGroup.h" #include "dawn/native/Buffer.h" #include "dawn/native/EnumMaskIterator.h" @@ -22,8 +24,6 @@ #include "dawn/native/QuerySet.h" #include "dawn/native/Texture.h" -#include - namespace dawn::native { void SyncScopeUsageTracker::BufferUsedAs(BufferBase* buffer, wgpu::BufferUsage usage) { diff --git a/src/dawn/native/PassResourceUsageTracker.h b/src/dawn/native/PassResourceUsageTracker.h index e6626f5a1e..97673197be 100644 --- a/src/dawn/native/PassResourceUsageTracker.h +++ b/src/dawn/native/PassResourceUsageTracker.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_PASSRESOURCEUSAGETRACKER_H_ #define SRC_DAWN_NATIVE_PASSRESOURCEUSAGETRACKER_H_ +#include + #include "dawn/native/PassResourceUsage.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { class BindGroupBase; diff --git a/src/dawn/native/PerStage.h b/src/dawn/native/PerStage.h index 43fbb74338..3441f1e57b 100644 --- a/src/dawn/native/PerStage.h +++ b/src/dawn/native/PerStage.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_PERSTAGE_H_ #define SRC_DAWN_NATIVE_PERSTAGE_H_ +#include + #include "dawn/common/Assert.h" #include "dawn/common/BitSetIterator.h" #include "dawn/common/Constants.h" @@ -22,8 +24,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { enum class SingleShaderStage { Vertex, Fragment, Compute }; diff --git a/src/dawn/native/PersistentCache.h b/src/dawn/native/PersistentCache.h index 24aa9d0ac5..779964c803 100644 --- a/src/dawn/native/PersistentCache.h +++ b/src/dawn/native/PersistentCache.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_PERSISTENTCACHE_H_ #define SRC_DAWN_NATIVE_PERSISTENTCACHE_H_ -#include "dawn/native/Error.h" - #include #include +#include "dawn/native/Error.h" + namespace dawn::platform { class CachingInterface; } diff --git a/src/dawn/native/Pipeline.h b/src/dawn/native/Pipeline.h index 4fffac5376..61a91a40f9 100644 --- a/src/dawn/native/Pipeline.h +++ b/src/dawn/native/Pipeline.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_PIPELINE_H_ #define SRC_DAWN_NATIVE_PIPELINE_H_ +#include +#include + #include "dawn/native/CachedObject.h" #include "dawn/native/Forward.h" #include "dawn/native/ObjectBase.h" @@ -24,9 +27,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { MaybeError ValidateProgrammableStage(DeviceBase* device, diff --git a/src/dawn/native/PipelineLayout.h b/src/dawn/native/PipelineLayout.h index 634c082aa1..bc5a294555 100644 --- a/src/dawn/native/PipelineLayout.h +++ b/src/dawn/native/PipelineLayout.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_PIPELINELAYOUT_H_ #define SRC_DAWN_NATIVE_PIPELINELAYOUT_H_ +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/common/ityp_bitset.h" @@ -26,9 +29,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { MaybeError ValidatePipelineLayoutDescriptor( diff --git a/src/dawn/native/PooledResourceMemoryAllocator.h b/src/dawn/native/PooledResourceMemoryAllocator.h index 04d41ba433..fcb7f6615a 100644 --- a/src/dawn/native/PooledResourceMemoryAllocator.h +++ b/src/dawn/native/PooledResourceMemoryAllocator.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_POOLEDRESOURCEMEMORYALLOCATOR_H_ #define SRC_DAWN_NATIVE_POOLEDRESOURCEMEMORYALLOCATOR_H_ +#include + #include "dawn/common/SerialQueue.h" #include "dawn/native/ResourceHeapAllocator.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/ProgrammableEncoder.cpp b/src/dawn/native/ProgrammableEncoder.cpp index 8bdc08b0c0..302e73ad54 100644 --- a/src/dawn/native/ProgrammableEncoder.cpp +++ b/src/dawn/native/ProgrammableEncoder.cpp @@ -14,6 +14,8 @@ #include "dawn/native/ProgrammableEncoder.h" +#include + #include "dawn/common/BitSetIterator.h" #include "dawn/common/ityp_array.h" #include "dawn/native/BindGroup.h" @@ -24,8 +26,6 @@ #include "dawn/native/ObjectType_autogen.h" #include "dawn/native/ValidationUtils_autogen.h" -#include - namespace dawn::native { ProgrammableEncoder::ProgrammableEncoder(DeviceBase* device, diff --git a/src/dawn/native/QueryHelper.cpp b/src/dawn/native/QueryHelper.cpp index c6d7541ed6..ea1f4f280b 100644 --- a/src/dawn/native/QueryHelper.cpp +++ b/src/dawn/native/QueryHelper.cpp @@ -14,6 +14,8 @@ #include "dawn/native/QueryHelper.h" +#include + #include "dawn/native/BindGroup.h" #include "dawn/native/BindGroupLayout.h" #include "dawn/native/Buffer.h" @@ -24,8 +26,6 @@ #include "dawn/native/InternalPipelineStore.h" #include "dawn/native/utils/WGPUHelpers.h" -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/QuerySet.cpp b/src/dawn/native/QuerySet.cpp index 0e5f90eb61..568d606c54 100644 --- a/src/dawn/native/QuerySet.cpp +++ b/src/dawn/native/QuerySet.cpp @@ -14,13 +14,13 @@ #include "dawn/native/QuerySet.h" +#include + #include "dawn/native/Device.h" #include "dawn/native/Features.h" #include "dawn/native/ObjectType_autogen.h" #include "dawn/native/ValidationUtils_autogen.h" -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/Queue.cpp b/src/dawn/native/Queue.cpp index 8b17a80cb5..31e8504044 100644 --- a/src/dawn/native/Queue.cpp +++ b/src/dawn/native/Queue.cpp @@ -14,6 +14,8 @@ #include "dawn/native/Queue.h" +#include + #include "dawn/common/Constants.h" #include "dawn/native/Buffer.h" #include "dawn/native/CommandBuffer.h" @@ -32,8 +34,6 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/RenderBundle.h b/src/dawn/native/RenderBundle.h index 0fa9ec5808..dceb4eebc3 100644 --- a/src/dawn/native/RenderBundle.h +++ b/src/dawn/native/RenderBundle.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_RENDERBUNDLE_H_ #define SRC_DAWN_NATIVE_RENDERBUNDLE_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/native/AttachmentState.h" #include "dawn/native/CommandAllocator.h" @@ -26,8 +28,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { struct RenderBundleDescriptor; diff --git a/src/dawn/native/RenderEncoderBase.cpp b/src/dawn/native/RenderEncoderBase.cpp index f186c162dc..a443c68261 100644 --- a/src/dawn/native/RenderEncoderBase.cpp +++ b/src/dawn/native/RenderEncoderBase.cpp @@ -14,6 +14,9 @@ #include "dawn/native/RenderEncoderBase.h" +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/Log.h" #include "dawn/native/Buffer.h" @@ -24,9 +27,6 @@ #include "dawn/native/RenderPipeline.h" #include "dawn/native/ValidationUtils_autogen.h" -#include -#include - namespace dawn::native { RenderEncoderBase::RenderEncoderBase(DeviceBase* device, diff --git a/src/dawn/native/RenderPassEncoder.cpp b/src/dawn/native/RenderPassEncoder.cpp index 31e740d689..0ea69d355d 100644 --- a/src/dawn/native/RenderPassEncoder.cpp +++ b/src/dawn/native/RenderPassEncoder.cpp @@ -14,6 +14,9 @@ #include "dawn/native/RenderPassEncoder.h" +#include +#include + #include "dawn/common/Constants.h" #include "dawn/native/Buffer.h" #include "dawn/native/CommandEncoder.h" @@ -25,9 +28,6 @@ #include "dawn/native/RenderBundle.h" #include "dawn/native/RenderPipeline.h" -#include -#include - namespace dawn::native { namespace { diff --git a/src/dawn/native/RenderPipeline.cpp b/src/dawn/native/RenderPipeline.cpp index c3410047b5..95ab3128f9 100644 --- a/src/dawn/native/RenderPipeline.cpp +++ b/src/dawn/native/RenderPipeline.cpp @@ -14,6 +14,9 @@ #include "dawn/native/RenderPipeline.h" +#include +#include + #include "dawn/common/BitSetIterator.h" #include "dawn/native/ChainUtils_autogen.h" #include "dawn/native/Commands.h" @@ -24,9 +27,6 @@ #include "dawn/native/ValidationUtils_autogen.h" #include "dawn/native/VertexFormat.h" -#include -#include - namespace dawn::native { // Helper functions diff --git a/src/dawn/native/RenderPipeline.h b/src/dawn/native/RenderPipeline.h index 9a3c8c5165..4e3c699716 100644 --- a/src/dawn/native/RenderPipeline.h +++ b/src/dawn/native/RenderPipeline.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_RENDERPIPELINE_H_ #define SRC_DAWN_NATIVE_RENDERPIPELINE_H_ +#include +#include + #include "dawn/common/TypedInteger.h" #include "dawn/native/AttachmentState.h" #include "dawn/native/Forward.h" @@ -23,9 +26,6 @@ #include "dawn/native/dawn_platform.h" -#include -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/ResourceHeapAllocator.h b/src/dawn/native/ResourceHeapAllocator.h index 42b922904c..cbeb0f71ef 100644 --- a/src/dawn/native/ResourceHeapAllocator.h +++ b/src/dawn/native/ResourceHeapAllocator.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_RESOURCEHEAPALLOCATOR_H_ #define SRC_DAWN_NATIVE_RESOURCEHEAPALLOCATOR_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/ResourceHeap.h" -#include - namespace dawn::native { // Interface for backend allocators that create memory heaps resoruces can be suballocated in. diff --git a/src/dawn/native/RingBufferAllocator.h b/src/dawn/native/RingBufferAllocator.h index 569521c8a0..e39555b9b4 100644 --- a/src/dawn/native/RingBufferAllocator.h +++ b/src/dawn/native/RingBufferAllocator.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_RINGBUFFERALLOCATOR_H_ #define SRC_DAWN_NATIVE_RINGBUFFERALLOCATOR_H_ -#include "dawn/common/SerialQueue.h" -#include "dawn/native/IntegerTypes.h" - #include #include +#include "dawn/common/SerialQueue.h" +#include "dawn/native/IntegerTypes.h" + // RingBufferAllocator is the front-end implementation used to manage a ring buffer in GPU memory. namespace dawn::native { diff --git a/src/dawn/native/Sampler.cpp b/src/dawn/native/Sampler.cpp index ffd8a724cb..d5861c379d 100644 --- a/src/dawn/native/Sampler.cpp +++ b/src/dawn/native/Sampler.cpp @@ -14,12 +14,12 @@ #include "dawn/native/Sampler.h" +#include + #include "dawn/native/Device.h" #include "dawn/native/ObjectContentHasher.h" #include "dawn/native/ValidationUtils_autogen.h" -#include - namespace dawn::native { MaybeError ValidateSamplerDescriptor(DeviceBase*, const SamplerDescriptor* descriptor) { diff --git a/src/dawn/native/ScratchBuffer.h b/src/dawn/native/ScratchBuffer.h index 45f2d7aade..9ecd81c865 100644 --- a/src/dawn/native/ScratchBuffer.h +++ b/src/dawn/native/ScratchBuffer.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_SCRATCHBUFFER_H_ #define SRC_DAWN_NATIVE_SCRATCHBUFFER_H_ +#include + #include "dawn/common/RefCounted.h" #include "dawn/native/Buffer.h" -#include - namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp index da4959e382..59eb070287 100644 --- a/src/dawn/native/ShaderModule.cpp +++ b/src/dawn/native/ShaderModule.cpp @@ -14,6 +14,8 @@ #include "dawn/native/ShaderModule.h" +#include + #include "absl/strings/str_format.h" #include "dawn/common/BitSetIterator.h" #include "dawn/common/Constants.h" @@ -28,9 +30,7 @@ #include "dawn/native/RenderPipeline.h" #include "dawn/native/TintUtils.h" -#include - -#include +#include "tint/tint.h" namespace dawn::native { diff --git a/src/dawn/native/ShaderModule.h b/src/dawn/native/ShaderModule.h index e69082146b..bb3f8bb03a 100644 --- a/src/dawn/native/ShaderModule.h +++ b/src/dawn/native/ShaderModule.h @@ -15,6 +15,12 @@ #ifndef SRC_DAWN_NATIVE_SHADERMODULE_H_ #define SRC_DAWN_NATIVE_SHADERMODULE_H_ +#include +#include +#include +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/native/BindingInfo.h" @@ -29,12 +35,6 @@ #include "dawn/native/VertexFormat.h" #include "dawn/native/dawn_platform.h" -#include -#include -#include -#include -#include - namespace tint { class Program; diff --git a/src/dawn/native/SpirvValidation.cpp b/src/dawn/native/SpirvValidation.cpp index 72eb8c15c5..c65400cfbc 100644 --- a/src/dawn/native/SpirvValidation.cpp +++ b/src/dawn/native/SpirvValidation.cpp @@ -14,11 +14,11 @@ #include "dawn/native/SpirvValidation.h" -#include "dawn/native/Device.h" - #include #include +#include "dawn/native/Device.h" + namespace dawn::native { MaybeError ValidateSpirv(DeviceBase* device, diff --git a/src/dawn/native/SpirvValidation.h b/src/dawn/native/SpirvValidation.h index 0b4f368938..3583990397 100644 --- a/src/dawn/native/SpirvValidation.h +++ b/src/dawn/native/SpirvValidation.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_NATIVE_SPIRVVALIDATION_H_ #define SRC_DAWN_NATIVE_SPIRVVALIDATION_H_ -#include "dawn/native/Error.h" - #include +#include "dawn/native/Error.h" + namespace dawn::native { class DeviceBase; diff --git a/src/dawn/native/SubresourceStorage.h b/src/dawn/native/SubresourceStorage.h index 9dc9d99f41..bdee929af9 100644 --- a/src/dawn/native/SubresourceStorage.h +++ b/src/dawn/native/SubresourceStorage.h @@ -15,16 +15,16 @@ #ifndef SRC_DAWN_NATIVE_SUBRESOURCESTORAGE_H_ #define SRC_DAWN_NATIVE_SUBRESOURCESTORAGE_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/TypeTraits.h" -#include "dawn/native/EnumMaskIterator.h" -#include "dawn/native/Subresource.h" - #include #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/TypeTraits.h" +#include "dawn/native/EnumMaskIterator.h" +#include "dawn/native/Subresource.h" + namespace dawn::native { // SubresourceStorage acts like a simple map from subresource (aspect, layer, level) to a diff --git a/src/dawn/native/Texture.h b/src/dawn/native/Texture.h index c2f14cf5de..5b6bba4d17 100644 --- a/src/dawn/native/Texture.h +++ b/src/dawn/native/Texture.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_TEXTURE_H_ #define SRC_DAWN_NATIVE_TEXTURE_H_ +#include + #include "dawn/common/ityp_array.h" #include "dawn/common/ityp_bitset.h" #include "dawn/native/Error.h" @@ -25,8 +27,6 @@ #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native { MaybeError ValidateTextureDescriptor(const DeviceBase* device, diff --git a/src/dawn/native/TintUtils.cpp b/src/dawn/native/TintUtils.cpp index d84c982af2..12062de095 100644 --- a/src/dawn/native/TintUtils.cpp +++ b/src/dawn/native/TintUtils.cpp @@ -13,9 +13,10 @@ // limitations under the License. #include "dawn/native/TintUtils.h" + #include "dawn/native/Device.h" -#include +#include "tint/tint.h" namespace dawn::native { diff --git a/src/dawn/native/VertexFormat.cpp b/src/dawn/native/VertexFormat.cpp index 2f2ae7f23d..61c7f23383 100644 --- a/src/dawn/native/VertexFormat.cpp +++ b/src/dawn/native/VertexFormat.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/native/VertexFormat.h" #include "dawn/common/Assert.h" -#include - namespace dawn::native { static constexpr std::array sVertexFormatTable = {{ diff --git a/src/dawn/native/d3d12/AdapterD3D12.cpp b/src/dawn/native/d3d12/AdapterD3D12.cpp index cbedea0dcd..e4ba00f482 100644 --- a/src/dawn/native/d3d12/AdapterD3D12.cpp +++ b/src/dawn/native/d3d12/AdapterD3D12.cpp @@ -14,6 +14,8 @@ #include "dawn/native/d3d12/AdapterD3D12.h" +#include + #include "dawn/common/Constants.h" #include "dawn/common/WindowsUtils.h" #include "dawn/native/Instance.h" @@ -22,8 +24,6 @@ #include "dawn/native/d3d12/DeviceD3D12.h" #include "dawn/native/d3d12/PlatformFunctions.h" -#include - namespace dawn::native::d3d12 { Adapter::Adapter(Backend* backend, ComPtr hardwareAdapter) diff --git a/src/dawn/native/d3d12/CommandAllocatorManager.h b/src/dawn/native/d3d12/CommandAllocatorManager.h index 8f34cc3095..6c2089a6ea 100644 --- a/src/dawn/native/d3d12/CommandAllocatorManager.h +++ b/src/dawn/native/d3d12/CommandAllocatorManager.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_D3D12_COMMANDALLOCATORMANAGER_H_ #define SRC_DAWN_NATIVE_D3D12_COMMANDALLOCATORMANAGER_H_ +#include + #include "dawn/native/d3d12/d3d12_platform.h" #include "dawn/common/SerialQueue.h" #include "dawn/native/Error.h" #include "dawn/native/IntegerTypes.h" -#include - namespace dawn::native::d3d12 { class Device; diff --git a/src/dawn/native/d3d12/CommandRecordingContext.cpp b/src/dawn/native/d3d12/CommandRecordingContext.cpp index bb8ef81300..85bcbc5aff 100644 --- a/src/dawn/native/d3d12/CommandRecordingContext.cpp +++ b/src/dawn/native/d3d12/CommandRecordingContext.cpp @@ -13,6 +13,9 @@ // limitations under the License. #include "dawn/native/d3d12/CommandRecordingContext.h" +#include +#include + #include "dawn/native/d3d12/CommandAllocatorManager.h" #include "dawn/native/d3d12/D3D12Error.h" #include "dawn/native/d3d12/DeviceD3D12.h" @@ -21,9 +24,6 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include -#include - namespace dawn::native::d3d12 { void CommandRecordingContext::AddToSharedTextureList(Texture* texture) { diff --git a/src/dawn/native/d3d12/CommandRecordingContext.h b/src/dawn/native/d3d12/CommandRecordingContext.h index 59c2ffaafe..95afdae68d 100644 --- a/src/dawn/native/d3d12/CommandRecordingContext.h +++ b/src/dawn/native/d3d12/CommandRecordingContext.h @@ -14,13 +14,13 @@ #ifndef SRC_DAWN_NATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_ #define SRC_DAWN_NATIVE_D3D12_COMMANDRECORDINGCONTEXT_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/IntegerTypes.h" #include "dawn/native/d3d12/BufferD3D12.h" #include "dawn/native/d3d12/d3d12_platform.h" -#include - namespace dawn::native::d3d12 { class CommandAllocatorManager; class Device; diff --git a/src/dawn/native/d3d12/D3D11on12Util.h b/src/dawn/native/d3d12/D3D11on12Util.h index a0e037389f..77b24376d0 100644 --- a/src/dawn/native/d3d12/D3D11on12Util.h +++ b/src/dawn/native/d3d12/D3D11on12Util.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_D3D12_D3D11ON12UTIL_H_ #define SRC_DAWN_NATIVE_D3D12_D3D11ON12UTIL_H_ -#include "dawn/common/RefCounted.h" -#include "dawn/native/Error.h" -#include "dawn/native/d3d12/d3d12_platform.h" - #include #include + +#include "dawn/common/RefCounted.h" #include "dawn/native/DawnNative.h" +#include "dawn/native/Error.h" +#include "dawn/native/d3d12/d3d12_platform.h" struct ID3D11On12Device; struct IDXGIKeyedMutex; diff --git a/src/dawn/native/d3d12/DeviceD3D12.cpp b/src/dawn/native/d3d12/DeviceD3D12.cpp index 409089018e..a64030e2f8 100644 --- a/src/dawn/native/d3d12/DeviceD3D12.cpp +++ b/src/dawn/native/d3d12/DeviceD3D12.cpp @@ -14,6 +14,8 @@ #include "dawn/native/d3d12/DeviceD3D12.h" +#include + #include "dawn/common/GPUInfo.h" #include "dawn/native/DynamicUploader.h" #include "dawn/native/Instance.h" @@ -44,8 +46,6 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include - namespace dawn::native::d3d12 { // TODO(dawn:155): Figure out these values. diff --git a/src/dawn/native/d3d12/IntegerTypes.h b/src/dawn/native/d3d12/IntegerTypes.h index eff3d0d789..6c72c07c43 100644 --- a/src/dawn/native/d3d12/IntegerTypes.h +++ b/src/dawn/native/d3d12/IntegerTypes.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_NATIVE_D3D12_INTEGERTYPES_H_ #define SRC_DAWN_NATIVE_D3D12_INTEGERTYPES_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/common/TypedInteger.h" -#include - namespace dawn::native::d3d12 { // An ID used to desambiguate between multiple uses of the same descriptor heap in the diff --git a/src/dawn/native/d3d12/NativeSwapChainImplD3D12.h b/src/dawn/native/d3d12/NativeSwapChainImplD3D12.h index 5eee004d67..a8ab3be466 100644 --- a/src/dawn/native/d3d12/NativeSwapChainImplD3D12.h +++ b/src/dawn/native/d3d12/NativeSwapChainImplD3D12.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_D3D12_NATIVESWAPCHAINIMPLD3D12_H_ #define SRC_DAWN_NATIVE_D3D12_NATIVESWAPCHAINIMPLD3D12_H_ +#include + #include "dawn/native/d3d12/d3d12_platform.h" #include "dawn/dawn_wsi.h" #include "dawn/native/IntegerTypes.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native::d3d12 { class Device; diff --git a/src/dawn/native/d3d12/PlatformFunctions.cpp b/src/dawn/native/d3d12/PlatformFunctions.cpp index 786ae5a33b..d2852ce4e5 100644 --- a/src/dawn/native/d3d12/PlatformFunctions.cpp +++ b/src/dawn/native/d3d12/PlatformFunctions.cpp @@ -14,12 +14,12 @@ #include "dawn/native/d3d12/PlatformFunctions.h" -#include "dawn/common/DynamicLib.h" - #include #include #include +#include "dawn/common/DynamicLib.h" + namespace dawn::native::d3d12 { namespace { // Extract Version from "10.0.{Version}.0" if possible, otherwise return 0. diff --git a/src/dawn/native/d3d12/PlatformFunctions.h b/src/dawn/native/d3d12/PlatformFunctions.h index a8218f7ab1..65e553b0c0 100644 --- a/src/dawn/native/d3d12/PlatformFunctions.h +++ b/src/dawn/native/d3d12/PlatformFunctions.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_D3D12_PLATFORMFUNCTIONS_H_ #define SRC_DAWN_NATIVE_D3D12_PLATFORMFUNCTIONS_H_ +#include + #include "dawn/native/d3d12/d3d12_platform.h" #include "dawn/common/DynamicLib.h" #include "dawn/native/Error.h" -#include - namespace dawn::native::d3d12 { // Loads the functions required from the platform dynamically so that we don't need to rely on diff --git a/src/dawn/native/d3d12/RenderPassBuilderD3D12.h b/src/dawn/native/d3d12/RenderPassBuilderD3D12.h index 6dc0e28be8..da6cd45313 100644 --- a/src/dawn/native/d3d12/RenderPassBuilderD3D12.h +++ b/src/dawn/native/d3d12/RenderPassBuilderD3D12.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_D3D12_RENDERPASSBUILDERD3D12_H_ #define SRC_DAWN_NATIVE_D3D12_RENDERPASSBUILDERD3D12_H_ +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/common/ityp_span.h" @@ -22,8 +24,6 @@ #include "dawn/native/d3d12/d3d12_platform.h" #include "dawn/native/dawn_platform.h" -#include - namespace dawn::native::d3d12 { class TextureView; diff --git a/src/dawn/native/d3d12/RenderPipelineD3D12.cpp b/src/dawn/native/d3d12/RenderPipelineD3D12.cpp index 7168454e6c..59dafef674 100644 --- a/src/dawn/native/d3d12/RenderPipelineD3D12.cpp +++ b/src/dawn/native/d3d12/RenderPipelineD3D12.cpp @@ -14,6 +14,8 @@ #include "dawn/native/d3d12/RenderPipelineD3D12.h" +#include + #include "dawn/common/Assert.h" #include "dawn/common/Log.h" #include "dawn/native/CreatePipelineAsyncTask.h" @@ -25,8 +27,6 @@ #include "dawn/native/d3d12/TextureD3D12.h" #include "dawn/native/d3d12/UtilsD3D12.h" -#include - namespace dawn::native::d3d12 { namespace { diff --git a/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h b/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h index 3536bbd8f8..20b3f3c3cc 100644 --- a/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h +++ b/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_D3D12_RESOURCEALLOCATORMANAGERD3D12_H_ #define SRC_DAWN_NATIVE_D3D12_RESOURCEALLOCATORMANAGERD3D12_H_ +#include + #include "dawn/common/SerialQueue.h" #include "dawn/native/BuddyMemoryAllocator.h" #include "dawn/native/IntegerTypes.h" @@ -22,8 +24,6 @@ #include "dawn/native/d3d12/HeapAllocatorD3D12.h" #include "dawn/native/d3d12/ResourceHeapAllocationD3D12.h" -#include - namespace dawn::native::d3d12 { class Device; diff --git a/src/dawn/native/d3d12/ResourceHeapAllocationD3D12.cpp b/src/dawn/native/d3d12/ResourceHeapAllocationD3D12.cpp index 910e4fb124..296ce773f8 100644 --- a/src/dawn/native/d3d12/ResourceHeapAllocationD3D12.cpp +++ b/src/dawn/native/d3d12/ResourceHeapAllocationD3D12.cpp @@ -14,11 +14,11 @@ #include "dawn/native/d3d12/ResourceHeapAllocationD3D12.h" +#include + #include "dawn/native/d3d12/D3D12Error.h" #include "dawn/native/d3d12/HeapD3D12.h" -#include - namespace dawn::native::d3d12 { ResourceHeapAllocation::ResourceHeapAllocation(const AllocationInfo& info, uint64_t offset, diff --git a/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h b/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h index d032d6e247..9e7d581914 100644 --- a/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h +++ b/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_D3D12_SAMPLERHEAPCACHED3D12_H_ #define SRC_DAWN_NATIVE_D3D12_SAMPLERHEAPCACHED3D12_H_ +#include + #include "dawn/common/RefCounted.h" #include "dawn/native/BindingInfo.h" #include "dawn/native/d3d12/CPUDescriptorHeapAllocationD3D12.h" #include "dawn/native/d3d12/GPUDescriptorHeapAllocationD3D12.h" -#include - // |SamplerHeapCacheEntry| maintains a cache of sampler descriptor heap allocations. // Each entry represents one or more sampler descriptors that co-exist in a CPU and // GPU descriptor heap. The CPU-side allocation is deallocated once the final reference diff --git a/src/dawn/native/d3d12/ShaderModuleD3D12.cpp b/src/dawn/native/d3d12/ShaderModuleD3D12.cpp index 0dea76e1d6..a1c9624fc8 100644 --- a/src/dawn/native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn/native/d3d12/ShaderModuleD3D12.cpp @@ -14,6 +14,12 @@ #include "dawn/native/d3d12/ShaderModuleD3D12.h" +#include + +#include +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/BitSetIterator.h" #include "dawn/common/Log.h" @@ -29,12 +35,7 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include - -#include -#include -#include -#include +#include "tint/tint.h" namespace dawn::native::d3d12 { diff --git a/src/dawn/native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h b/src/dawn/native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h index 38a182abd7..ea7ecf80a9 100644 --- a/src/dawn/native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h +++ b/src/dawn/native/d3d12/ShaderVisibleDescriptorAllocatorD3D12.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATORD3D12_H_ #define SRC_DAWN_NATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATORD3D12_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/RingBufferAllocator.h" #include "dawn/native/d3d12/IntegerTypes.h" #include "dawn/native/d3d12/PageableD3D12.h" #include "dawn/native/d3d12/d3d12_platform.h" -#include - // |ShaderVisibleDescriptorAllocator| allocates a variable-sized block of descriptors from a GPU // descriptor heap pool. // Internally, it manages a list of heaps using a ringbuffer block allocator. The heap is in one diff --git a/src/dawn/native/d3d12/StagingDescriptorAllocatorD3D12.h b/src/dawn/native/d3d12/StagingDescriptorAllocatorD3D12.h index 5c69589aad..8599342c89 100644 --- a/src/dawn/native/d3d12/StagingDescriptorAllocatorD3D12.h +++ b/src/dawn/native/d3d12/StagingDescriptorAllocatorD3D12.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_D3D12_STAGINGDESCRIPTORALLOCATORD3D12_H_ #define SRC_DAWN_NATIVE_D3D12_STAGINGDESCRIPTORALLOCATORD3D12_H_ +#include + #include "dawn/native/Error.h" #include "dawn/native/d3d12/CPUDescriptorHeapAllocationD3D12.h" -#include - // |StagingDescriptorAllocator| allocates a fixed-size block of descriptors from a CPU // descriptor heap pool. // Internally, it manages a list of heaps using a fixed-size block allocator. The fixed-size diff --git a/src/dawn/native/d3d12/SwapChainD3D12.cpp b/src/dawn/native/d3d12/SwapChainD3D12.cpp index c36b22a2f7..9411e400b7 100644 --- a/src/dawn/native/d3d12/SwapChainD3D12.cpp +++ b/src/dawn/native/d3d12/SwapChainD3D12.cpp @@ -14,15 +14,14 @@ #include "dawn/native/d3d12/SwapChainD3D12.h" +#include + +#include "dawn/dawn_wsi.h" #include "dawn/native/Surface.h" #include "dawn/native/d3d12/D3D12Error.h" #include "dawn/native/d3d12/DeviceD3D12.h" #include "dawn/native/d3d12/TextureD3D12.h" -#include "dawn/dawn_wsi.h" - -#include - namespace dawn::native::d3d12 { namespace { diff --git a/src/dawn/native/d3d12/TextureCopySplitter.h b/src/dawn/native/d3d12/TextureCopySplitter.h index 207e9165dc..19b02de5cc 100644 --- a/src/dawn/native/d3d12/TextureCopySplitter.h +++ b/src/dawn/native/d3d12/TextureCopySplitter.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_NATIVE_D3D12_TEXTURECOPYSPLITTER_H_ #define SRC_DAWN_NATIVE_D3D12_TEXTURECOPYSPLITTER_H_ -#include "dawn/native/dawn_platform.h" - #include +#include "dawn/native/dawn_platform.h" + namespace dawn::native { struct TexelBlockInfo; diff --git a/src/dawn/native/d3d12/UtilsD3D12.cpp b/src/dawn/native/d3d12/UtilsD3D12.cpp index 8d4749fd95..d7f51c3765 100644 --- a/src/dawn/native/d3d12/UtilsD3D12.cpp +++ b/src/dawn/native/d3d12/UtilsD3D12.cpp @@ -14,6 +14,8 @@ #include "dawn/native/d3d12/UtilsD3D12.h" +#include + #include "dawn/common/Assert.h" #include "dawn/native/Format.h" #include "dawn/native/d3d12/BufferD3D12.h" @@ -21,8 +23,6 @@ #include "dawn/native/d3d12/D3D12Error.h" #include "dawn/native/d3d12/DeviceD3D12.h" -#include - namespace dawn::native::d3d12 { ResultOrError ConvertStringToWstring(const char* str) { diff --git a/src/dawn/native/d3d12/d3d12_platform.h b/src/dawn/native/d3d12/d3d12_platform.h index 0622576b9b..59542bf883 100644 --- a/src/dawn/native/d3d12/d3d12_platform.h +++ b/src/dawn/native/d3d12/d3d12_platform.h @@ -18,19 +18,20 @@ // Pre-emptively include windows.h but remove its macros so that they aren't set when declaring the // COM interfaces. Otherwise ID3D12InfoQueue::GetMessage would be either GetMessageA or GetMessageW // which causes compilation errors. +// NOLINTNEXTLINE(build/include_order) #include "dawn/common/windows_with_undefs.h" -#include -#include -#include -#include -#include -#include +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) // DXProgrammableCapture.h takes a dependency on other platform header // files, so it must be defined after them. -#include -#include +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) using Microsoft::WRL::ComPtr; diff --git a/src/dawn/native/metal/DeviceMTL.h b/src/dawn/native/metal/DeviceMTL.h index 0e62bd451c..cbd362c9c3 100644 --- a/src/dawn/native/metal/DeviceMTL.h +++ b/src/dawn/native/metal/DeviceMTL.h @@ -15,6 +15,10 @@ #ifndef SRC_DAWN_NATIVE_METAL_DEVICEMTL_H_ #define SRC_DAWN_NATIVE_METAL_DEVICEMTL_H_ +#include +#include +#include + #include "dawn/native/dawn_platform.h" #include "dawn/native/Commands.h" @@ -26,10 +30,6 @@ #import #import -#include -#include -#include - namespace dawn::native::metal { namespace { diff --git a/src/dawn/native/metal/TextureMTL.h b/src/dawn/native/metal/TextureMTL.h index cf2e637484..484a1b43ee 100644 --- a/src/dawn/native/metal/TextureMTL.h +++ b/src/dawn/native/metal/TextureMTL.h @@ -15,15 +15,15 @@ #ifndef SRC_DAWN_NATIVE_METAL_TEXTUREMTL_H_ #define SRC_DAWN_NATIVE_METAL_TEXTUREMTL_H_ +#include +#import + #include "dawn/native/Texture.h" #include "dawn/common/CoreFoundationRef.h" #include "dawn/common/NSRef.h" #include "dawn/native/DawnNative.h" -#include -#import - namespace dawn::native::metal { class CommandRecordingContext; diff --git a/src/dawn/native/opengl/BackendGL.cpp b/src/dawn/native/opengl/BackendGL.cpp index aac0c14c50..d7bf1b52f1 100644 --- a/src/dawn/native/opengl/BackendGL.cpp +++ b/src/dawn/native/opengl/BackendGL.cpp @@ -14,14 +14,14 @@ #include "dawn/native/opengl/BackendGL.h" +#include + #include "dawn/common/GPUInfo.h" #include "dawn/common/Log.h" #include "dawn/native/Instance.h" #include "dawn/native/OpenGLBackend.h" #include "dawn/native/opengl/DeviceGL.h" -#include - namespace dawn::native::opengl { namespace { diff --git a/src/dawn/native/opengl/CommandBufferGL.cpp b/src/dawn/native/opengl/CommandBufferGL.cpp index ba5b8dd79c..59df81c9f2 100644 --- a/src/dawn/native/opengl/CommandBufferGL.cpp +++ b/src/dawn/native/opengl/CommandBufferGL.cpp @@ -14,6 +14,8 @@ #include "dawn/native/opengl/CommandBufferGL.h" +#include + #include "dawn/native/BindGroup.h" #include "dawn/native/BindGroupTracker.h" #include "dawn/native/CommandEncoder.h" @@ -32,8 +34,6 @@ #include "dawn/native/opengl/TextureGL.h" #include "dawn/native/opengl/UtilsGL.h" -#include - namespace dawn::native::opengl { namespace { diff --git a/src/dawn/native/opengl/DeviceGL.h b/src/dawn/native/opengl/DeviceGL.h index 3c9cd01f88..7221cdaccb 100644 --- a/src/dawn/native/opengl/DeviceGL.h +++ b/src/dawn/native/opengl/DeviceGL.h @@ -15,6 +15,8 @@ #ifndef SRC_DAWN_NATIVE_OPENGL_DEVICEGL_H_ #define SRC_DAWN_NATIVE_OPENGL_DEVICEGL_H_ +#include + #include "dawn/native/dawn_platform.h" #include "dawn/common/Platform.h" @@ -24,8 +26,6 @@ #include "dawn/native/opengl/GLFormat.h" #include "dawn/native/opengl/OpenGLFunctions.h" -#include - // Remove windows.h macros after glad's include of windows.h #if defined(DAWN_PLATFORM_WINDOWS) # include "dawn/common/windows_with_undefs.h" diff --git a/src/dawn/native/opengl/PipelineGL.cpp b/src/dawn/native/opengl/PipelineGL.cpp index 8890e6826c..dff1fdb3dd 100644 --- a/src/dawn/native/opengl/PipelineGL.cpp +++ b/src/dawn/native/opengl/PipelineGL.cpp @@ -14,6 +14,9 @@ #include "dawn/native/opengl/PipelineGL.h" +#include +#include + #include "dawn/common/BitSetIterator.h" #include "dawn/native/BindGroupLayout.h" #include "dawn/native/Device.h" @@ -24,9 +27,6 @@ #include "dawn/native/opengl/SamplerGL.h" #include "dawn/native/opengl/ShaderModuleGL.h" -#include -#include - namespace dawn::native::opengl { namespace { diff --git a/src/dawn/native/opengl/PipelineGL.h b/src/dawn/native/opengl/PipelineGL.h index da6fa281a6..6c18fcdb9d 100644 --- a/src/dawn/native/opengl/PipelineGL.h +++ b/src/dawn/native/opengl/PipelineGL.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_OPENGL_PIPELINEGL_H_ #define SRC_DAWN_NATIVE_OPENGL_PIPELINEGL_H_ +#include + #include "dawn/native/Pipeline.h" #include "dawn/native/PerStage.h" #include "dawn/native/opengl/opengl_platform.h" -#include - namespace dawn::native { struct ProgrammableStage; } // namespace dawn::native diff --git a/src/dawn/native/opengl/RenderPipelineGL.h b/src/dawn/native/opengl/RenderPipelineGL.h index c1cb7f27e8..37f3631569 100644 --- a/src/dawn/native/opengl/RenderPipelineGL.h +++ b/src/dawn/native/opengl/RenderPipelineGL.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_OPENGL_RENDERPIPELINEGL_H_ #define SRC_DAWN_NATIVE_OPENGL_RENDERPIPELINEGL_H_ +#include + #include "dawn/native/RenderPipeline.h" #include "dawn/native/opengl/PipelineGL.h" #include "dawn/native/opengl/opengl_platform.h" -#include - namespace dawn::native::opengl { class Device; diff --git a/src/dawn/native/opengl/ShaderModuleGL.cpp b/src/dawn/native/opengl/ShaderModuleGL.cpp index 6bda26bd08..6a6fd6a5d9 100644 --- a/src/dawn/native/opengl/ShaderModuleGL.cpp +++ b/src/dawn/native/opengl/ShaderModuleGL.cpp @@ -14,6 +14,8 @@ #include "dawn/native/opengl/ShaderModuleGL.h" +#include + #include "dawn/native/BindGroupLayout.h" #include "dawn/native/TintUtils.h" #include "dawn/native/opengl/DeviceGL.h" @@ -21,9 +23,7 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include - -#include +#include "tint/tint.h" namespace dawn::native::opengl { diff --git a/src/dawn/native/utils/WGPUHelpers.cpp b/src/dawn/native/utils/WGPUHelpers.cpp index a7ab910e51..1172ca935e 100644 --- a/src/dawn/native/utils/WGPUHelpers.cpp +++ b/src/dawn/native/utils/WGPUHelpers.cpp @@ -14,6 +14,12 @@ #include "dawn/native/utils/WGPUHelpers.h" +#include +#include +#include +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/Constants.h" #include "dawn/native/BindGroup.h" @@ -25,12 +31,6 @@ #include "dawn/native/Sampler.h" #include "dawn/native/ShaderModule.h" -#include -#include -#include -#include -#include - namespace dawn::native::utils { ResultOrError> CreateShaderModule(DeviceBase* device, diff --git a/src/dawn/native/utils/WGPUHelpers.h b/src/dawn/native/utils/WGPUHelpers.h index 2f4d8963c3..ad0eefc4f9 100644 --- a/src/dawn/native/utils/WGPUHelpers.h +++ b/src/dawn/native/utils/WGPUHelpers.h @@ -15,14 +15,13 @@ #ifndef SRC_DAWN_NATIVE_UTILS_WGPUHELPERS_H_ #define SRC_DAWN_NATIVE_UTILS_WGPUHELPERS_H_ -#include "dawn/native/dawn_platform.h" - #include #include #include #include "dawn/common/RefCounted.h" #include "dawn/native/Error.h" +#include "dawn/native/dawn_platform.h" namespace dawn::native::utils { diff --git a/src/dawn/native/vulkan/BindGroupLayoutVk.cpp b/src/dawn/native/vulkan/BindGroupLayoutVk.cpp index 8ed9b93a56..664596d416 100644 --- a/src/dawn/native/vulkan/BindGroupLayoutVk.cpp +++ b/src/dawn/native/vulkan/BindGroupLayoutVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/BindGroupLayoutVk.h" +#include + #include "dawn/common/BitSetIterator.h" #include "dawn/common/ityp_vector.h" #include "dawn/native/CacheKey.h" @@ -24,8 +26,6 @@ #include "dawn/native/vulkan/UtilsVulkan.h" #include "dawn/native/vulkan/VulkanError.h" -#include - namespace dawn::native::vulkan { namespace { diff --git a/src/dawn/native/vulkan/BindGroupLayoutVk.h b/src/dawn/native/vulkan/BindGroupLayoutVk.h index 8dc41c4911..4d85a34a9e 100644 --- a/src/dawn/native/vulkan/BindGroupLayoutVk.h +++ b/src/dawn/native/vulkan/BindGroupLayoutVk.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_BINDGROUPLAYOUTVK_H_ #define SRC_DAWN_NATIVE_VULKAN_BINDGROUPLAYOUTVK_H_ +#include + #include "dawn/native/BindGroupLayout.h" #include "dawn/common/SlabAllocator.h" #include "dawn/common/vulkan_platform.h" -#include - namespace dawn::native { class CacheKey; } // namespace dawn::native diff --git a/src/dawn/native/vulkan/BufferVk.cpp b/src/dawn/native/vulkan/BufferVk.cpp index 4045c50e75..2e6868df77 100644 --- a/src/dawn/native/vulkan/BufferVk.cpp +++ b/src/dawn/native/vulkan/BufferVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/BufferVk.h" +#include + #include "dawn/native/CommandBuffer.h" #include "dawn/native/vulkan/DeviceVk.h" #include "dawn/native/vulkan/FencedDeleter.h" @@ -22,8 +24,6 @@ #include "dawn/native/vulkan/UtilsVulkan.h" #include "dawn/native/vulkan/VulkanError.h" -#include - namespace dawn::native::vulkan { namespace { diff --git a/src/dawn/native/vulkan/CacheKeyVk.cpp b/src/dawn/native/vulkan/CacheKeyVk.cpp index 3930b54ca3..26118b56fe 100644 --- a/src/dawn/native/vulkan/CacheKeyVk.cpp +++ b/src/dawn/native/vulkan/CacheKeyVk.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/native/vulkan/CacheKeyVk.h" #include "dawn/native/vulkan/RenderPassCache.h" -#include - namespace dawn::native { template <> diff --git a/src/dawn/native/vulkan/CacheKeyVk.h b/src/dawn/native/vulkan/CacheKeyVk.h index 0569fadf3d..795d115af2 100644 --- a/src/dawn/native/vulkan/CacheKeyVk.h +++ b/src/dawn/native/vulkan/CacheKeyVk.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_CACHEKEYVK_H_ #define SRC_DAWN_NATIVE_VULKAN_CACHEKEYVK_H_ +#include + #include "dawn/common/Assert.h" #include "dawn/common/vulkan_platform.h" #include "dawn/native/CacheKey.h" #include "icd/generated/vk_typemap_helper.h" -#include - namespace dawn::native::vulkan { namespace detail { diff --git a/src/dawn/native/vulkan/CommandBufferVk.cpp b/src/dawn/native/vulkan/CommandBufferVk.cpp index 2e94f6a213..e0de398cf2 100644 --- a/src/dawn/native/vulkan/CommandBufferVk.cpp +++ b/src/dawn/native/vulkan/CommandBufferVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/CommandBufferVk.h" +#include + #include "dawn/native/BindGroupTracker.h" #include "dawn/native/CommandEncoder.h" #include "dawn/native/CommandValidation.h" @@ -36,8 +38,6 @@ #include "dawn/native/vulkan/UtilsVulkan.h" #include "dawn/native/vulkan/VulkanError.h" -#include - namespace dawn::native::vulkan { namespace { diff --git a/src/dawn/native/vulkan/ComputePipelineVk.cpp b/src/dawn/native/vulkan/ComputePipelineVk.cpp index 9a3fa8b676..6f81515143 100644 --- a/src/dawn/native/vulkan/ComputePipelineVk.cpp +++ b/src/dawn/native/vulkan/ComputePipelineVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/ComputePipelineVk.h" +#include + #include "dawn/native/CreatePipelineAsyncTask.h" #include "dawn/native/vulkan/DeviceVk.h" #include "dawn/native/vulkan/FencedDeleter.h" @@ -22,8 +24,6 @@ #include "dawn/native/vulkan/UtilsVulkan.h" #include "dawn/native/vulkan/VulkanError.h" -#include - namespace dawn::native::vulkan { // static diff --git a/src/dawn/native/vulkan/DescriptorSetAllocator.h b/src/dawn/native/vulkan/DescriptorSetAllocator.h index cc3a96edd7..f0212c6bc2 100644 --- a/src/dawn/native/vulkan/DescriptorSetAllocator.h +++ b/src/dawn/native/vulkan/DescriptorSetAllocator.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_DESCRIPTORSETALLOCATOR_H_ #define SRC_DAWN_NATIVE_VULKAN_DESCRIPTORSETALLOCATOR_H_ +#include +#include + #include "dawn/common/SerialQueue.h" #include "dawn/common/vulkan_platform.h" #include "dawn/native/Error.h" @@ -22,9 +25,6 @@ #include "dawn/native/ObjectBase.h" #include "dawn/native/vulkan/DescriptorSetAllocation.h" -#include -#include - namespace dawn::native::vulkan { class BindGroupLayout; diff --git a/src/dawn/native/vulkan/DeviceVk.h b/src/dawn/native/vulkan/DeviceVk.h index 7cfa9f0d6e..df55d2cf4d 100644 --- a/src/dawn/native/vulkan/DeviceVk.h +++ b/src/dawn/native/vulkan/DeviceVk.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_DEVICEVK_H_ #define SRC_DAWN_NATIVE_VULKAN_DEVICEVK_H_ +#include +#include + #include "dawn/native/dawn_platform.h" #include "dawn/common/SerialQueue.h" @@ -29,9 +32,6 @@ #include "dawn/native/vulkan/external_memory/MemoryService.h" #include "dawn/native/vulkan/external_semaphore/SemaphoreService.h" -#include -#include - namespace dawn::native::vulkan { class Adapter; diff --git a/src/dawn/native/vulkan/NativeSwapChainImplVk.cpp b/src/dawn/native/vulkan/NativeSwapChainImplVk.cpp index e16ae2caec..d73d3dfaf4 100644 --- a/src/dawn/native/vulkan/NativeSwapChainImplVk.cpp +++ b/src/dawn/native/vulkan/NativeSwapChainImplVk.cpp @@ -14,12 +14,12 @@ #include "dawn/native/vulkan/NativeSwapChainImplVk.h" +#include + #include "dawn/native/vulkan/DeviceVk.h" #include "dawn/native/vulkan/FencedDeleter.h" #include "dawn/native/vulkan/TextureVk.h" -#include - namespace dawn::native::vulkan { namespace { diff --git a/src/dawn/native/vulkan/RenderPassCache.h b/src/dawn/native/vulkan/RenderPassCache.h index 9e46d40871..4b2635b66a 100644 --- a/src/dawn/native/vulkan/RenderPassCache.h +++ b/src/dawn/native/vulkan/RenderPassCache.h @@ -15,6 +15,11 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_RENDERPASSCACHE_H_ #define SRC_DAWN_NATIVE_VULKAN_RENDERPASSCACHE_H_ +#include +#include +#include +#include + #include "dawn/common/Constants.h" #include "dawn/common/ityp_array.h" #include "dawn/common/ityp_bitset.h" @@ -23,11 +28,6 @@ #include "dawn/native/IntegerTypes.h" #include "dawn/native/dawn_platform.h" -#include -#include -#include -#include - namespace dawn::native::vulkan { class Device; diff --git a/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h b/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h index c846ed9f42..9616fd518a 100644 --- a/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h +++ b/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_RESOURCEMEMORYALLOCATORVK_H_ #define SRC_DAWN_NATIVE_VULKAN_RESOURCEMEMORYALLOCATORVK_H_ +#include +#include + #include "dawn/common/SerialQueue.h" #include "dawn/common/vulkan_platform.h" #include "dawn/native/Error.h" @@ -22,9 +25,6 @@ #include "dawn/native/PooledResourceMemoryAllocator.h" #include "dawn/native/ResourceMemoryAllocation.h" -#include -#include - namespace dawn::native::vulkan { class Device; diff --git a/src/dawn/native/vulkan/ShaderModuleVk.cpp b/src/dawn/native/vulkan/ShaderModuleVk.cpp index 81e136845f..6ea642ebcc 100644 --- a/src/dawn/native/vulkan/ShaderModuleVk.cpp +++ b/src/dawn/native/vulkan/ShaderModuleVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/ShaderModuleVk.h" +#include + #include "dawn/native/SpirvValidation.h" #include "dawn/native/TintUtils.h" #include "dawn/native/vulkan/BindGroupLayoutVk.h" @@ -25,8 +27,7 @@ #include "dawn/platform/DawnPlatform.h" #include "dawn/platform/tracing/TraceEvent.h" -#include -#include +#include "tint/tint.h" namespace dawn::native::vulkan { diff --git a/src/dawn/native/vulkan/ShaderModuleVk.h b/src/dawn/native/vulkan/ShaderModuleVk.h index 8688cccc61..5de08c9d01 100644 --- a/src/dawn/native/vulkan/ShaderModuleVk.h +++ b/src/dawn/native/vulkan/ShaderModuleVk.h @@ -15,17 +15,18 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_SHADERMODULEVK_H_ #define SRC_DAWN_NATIVE_VULKAN_SHADERMODULEVK_H_ +#include +#include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order)) +#include +#include + #include "dawn/native/ShaderModule.h" #include "dawn/common/vulkan_platform.h" #include "dawn/native/Error.h" -#include -#include -#include -#include -#include - namespace dawn::native::vulkan { class Device; diff --git a/src/dawn/native/vulkan/SwapChainVk.cpp b/src/dawn/native/vulkan/SwapChainVk.cpp index cd68c9a2a0..2da8168d75 100644 --- a/src/dawn/native/vulkan/SwapChainVk.cpp +++ b/src/dawn/native/vulkan/SwapChainVk.cpp @@ -14,6 +14,8 @@ #include "dawn/native/vulkan/SwapChainVk.h" +#include + #include "dawn/common/Compiler.h" #include "dawn/native/Instance.h" #include "dawn/native/Surface.h" @@ -24,8 +26,6 @@ #include "dawn/native/vulkan/TextureVk.h" #include "dawn/native/vulkan/VulkanError.h" -#include - #if defined(DAWN_USE_X11) # include "dawn/native/XlibXcbFunctions.h" #endif // defined(DAWN_USE_X11) diff --git a/src/dawn/native/vulkan/SwapChainVk.h b/src/dawn/native/vulkan/SwapChainVk.h index a3503ce491..1f1f9ca271 100644 --- a/src/dawn/native/vulkan/SwapChainVk.h +++ b/src/dawn/native/vulkan/SwapChainVk.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_SWAPCHAINVK_H_ #define SRC_DAWN_NATIVE_VULKAN_SWAPCHAINVK_H_ +#include + #include "dawn/native/SwapChain.h" #include "dawn/common/vulkan_platform.h" -#include - namespace dawn::native::vulkan { class Device; diff --git a/src/dawn/native/vulkan/VulkanExtensions.cpp b/src/dawn/native/vulkan/VulkanExtensions.cpp index 3f54e546fc..5262313a25 100644 --- a/src/dawn/native/vulkan/VulkanExtensions.cpp +++ b/src/dawn/native/vulkan/VulkanExtensions.cpp @@ -14,12 +14,12 @@ #include "dawn/native/vulkan/VulkanExtensions.h" -#include "dawn/common/Assert.h" -#include "dawn/common/vulkan_platform.h" - #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/vulkan_platform.h" + namespace dawn::native::vulkan { static constexpr uint32_t VulkanVersion_1_1 = VK_MAKE_VERSION(1, 1, 0); diff --git a/src/dawn/native/vulkan/VulkanExtensions.h b/src/dawn/native/vulkan/VulkanExtensions.h index 1aea2bc570..6ef8e4bb1b 100644 --- a/src/dawn/native/vulkan/VulkanExtensions.h +++ b/src/dawn/native/vulkan/VulkanExtensions.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_VULKANEXTENSIONS_H_ #define SRC_DAWN_NATIVE_VULKAN_VULKANEXTENSIONS_H_ -#include "dawn/common/ityp_bitset.h" - #include +#include "dawn/common/ityp_bitset.h" + namespace dawn::native::vulkan { // The list of known instance extensions. They must be in dependency order (this is checked diff --git a/src/dawn/native/vulkan/VulkanInfo.cpp b/src/dawn/native/vulkan/VulkanInfo.cpp index a734a9b6f4..9355e392b0 100644 --- a/src/dawn/native/vulkan/VulkanInfo.cpp +++ b/src/dawn/native/vulkan/VulkanInfo.cpp @@ -14,13 +14,13 @@ #include "dawn/native/vulkan/VulkanInfo.h" +#include + #include "dawn/native/vulkan/AdapterVk.h" #include "dawn/native/vulkan/BackendVk.h" #include "dawn/native/vulkan/UtilsVulkan.h" #include "dawn/native/vulkan/VulkanError.h" -#include - namespace dawn::native::vulkan { namespace { diff --git a/src/dawn/native/vulkan/VulkanInfo.h b/src/dawn/native/vulkan/VulkanInfo.h index f75a11f406..6abb7f47f8 100644 --- a/src/dawn/native/vulkan/VulkanInfo.h +++ b/src/dawn/native/vulkan/VulkanInfo.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_NATIVE_VULKAN_VULKANINFO_H_ #define SRC_DAWN_NATIVE_VULKAN_VULKANINFO_H_ +#include + #include "dawn/common/ityp_array.h" #include "dawn/common/vulkan_platform.h" #include "dawn/native/Error.h" #include "dawn/native/vulkan/VulkanExtensions.h" -#include - namespace dawn::native::vulkan { class Adapter; diff --git a/src/dawn/node/binding/GPU.cpp b/src/dawn/node/binding/GPU.cpp index 43472ec546..d0a90e0091 100644 --- a/src/dawn/node/binding/GPU.cpp +++ b/src/dawn/node/binding/GPU.cpp @@ -14,10 +14,10 @@ #include "src/dawn/node/binding/GPU.h" -#include "src/dawn/node/binding/GPUAdapter.h" - #include +#include "src/dawn/node/binding/GPUAdapter.h" + #if defined(_WIN32) # include #endif diff --git a/src/dawn/node/interop/Core.h b/src/dawn/node/interop/Core.h index e5d971fd16..402ea341e0 100644 --- a/src/dawn/node/interop/Core.h +++ b/src/dawn/node/interop/Core.h @@ -19,11 +19,13 @@ #define SRC_DAWN_NODE_INTEROP_CORE_H_ #include -#include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order) #include #include #include -#include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order) #include #include "src/dawn/node/interop/Napi.h" diff --git a/src/dawn/node/utils/Debug.h b/src/dawn/node/utils/Debug.h index bd7f4e4b2f..9cae4fbe75 100644 --- a/src/dawn/node/utils/Debug.h +++ b/src/dawn/node/utils/Debug.h @@ -16,10 +16,12 @@ #define SRC_DAWN_NODE_UTILS_DEBUG_H_ #include -#include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order) #include #include -#include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order) #include #include "dawn/webgpu_cpp_print.h" diff --git a/src/dawn/platform/tracing/EventTracer.h b/src/dawn/platform/tracing/EventTracer.h index 3c97f542b0..a7bf11f085 100644 --- a/src/dawn/platform/tracing/EventTracer.h +++ b/src/dawn/platform/tracing/EventTracer.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_PLATFORM_TRACING_EVENTTRACER_H_ #define SRC_DAWN_PLATFORM_TRACING_EVENTTRACER_H_ -#include "dawn/platform/dawn_platform_export.h" - #include +#include "dawn/platform/dawn_platform_export.h" + namespace dawn::platform { class Platform; diff --git a/src/dawn/samples/Animometer.cpp b/src/dawn/samples/Animometer.cpp index 2548529432..05bfb23d8a 100644 --- a/src/dawn/samples/Animometer.cpp +++ b/src/dawn/samples/Animometer.cpp @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include + #include "dawn/samples/SampleUtils.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" @@ -19,10 +23,6 @@ #include "dawn/utils/SystemUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include -#include - wgpu::Device device; wgpu::Queue queue; wgpu::SwapChain swapchain; diff --git a/src/dawn/samples/ComputeBoids.cpp b/src/dawn/samples/ComputeBoids.cpp index d91b4a4bd8..72b944affb 100644 --- a/src/dawn/samples/ComputeBoids.cpp +++ b/src/dawn/samples/ComputeBoids.cpp @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include + #include "dawn/samples/SampleUtils.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" @@ -19,10 +23,6 @@ #include "dawn/utils/SystemUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include -#include - wgpu::Device device; wgpu::Queue queue; wgpu::SwapChain swapchain; diff --git a/src/dawn/samples/CppHelloTriangle.cpp b/src/dawn/samples/CppHelloTriangle.cpp index 3c3ba51ace..66e1ec79d3 100644 --- a/src/dawn/samples/CppHelloTriangle.cpp +++ b/src/dawn/samples/CppHelloTriangle.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/samples/SampleUtils.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" @@ -19,8 +21,6 @@ #include "dawn/utils/SystemUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include - wgpu::Device device; wgpu::Buffer indexBuffer; diff --git a/src/dawn/samples/ManualSwapChainTest.cpp b/src/dawn/samples/ManualSwapChainTest.cpp index eef626818a..1cef69105f 100644 --- a/src/dawn/samples/ManualSwapChainTest.cpp +++ b/src/dawn/samples/ManualSwapChainTest.cpp @@ -51,21 +51,20 @@ // - TODO can't be tested yet: check cycling the same window over multiple devices. // - TODO can't be tested yet: check cycling the same window over multiple formats. +#include +#include + +#include "GLFW/glfw3.h" #include "dawn/common/Assert.h" #include "dawn/common/Log.h" +#include "dawn/dawn_proc.h" +#include "dawn/native/DawnNative.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/GLFWUtils.h" #include "dawn/utils/ScopedAutoreleasePool.h" #include "dawn/utils/WGPUHelpers.h" - -#include "GLFW/glfw3.h" -#include "dawn/dawn_proc.h" -#include "dawn/native/DawnNative.h" #include "dawn/webgpu_cpp.h" -#include -#include - struct WindowData { GLFWwindow* window = nullptr; uint64_t serial = 0; diff --git a/src/dawn/samples/SampleUtils.cpp b/src/dawn/samples/SampleUtils.cpp index bce64bc308..f1e0659788 100644 --- a/src/dawn/samples/SampleUtils.cpp +++ b/src/dawn/samples/SampleUtils.cpp @@ -14,6 +14,9 @@ #include "dawn/samples/SampleUtils.h" +#include +#include + #include "GLFW/glfw3.h" #include "dawn/common/Assert.h" #include "dawn/common/Log.h" @@ -27,9 +30,6 @@ #include "dawn/wire/WireClient.h" #include "dawn/wire/WireServer.h" -#include -#include - void PrintDeviceError(WGPUErrorType errorType, const char* message, void*) { const char* errorTypeName = ""; switch (errorType) { diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp index 1c04a19756..635d7d71ec 100644 --- a/src/dawn/tests/DawnTest.cpp +++ b/src/dawn/tests/DawnTest.cpp @@ -14,6 +14,14 @@ #include "dawn/tests/DawnTest.h" +#include +#include +#include +#include +#include +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/GPUInfo.h" #include "dawn/common/Log.h" @@ -31,14 +39,6 @@ #include "dawn/wire/WireClient.h" #include "dawn/wire/WireServer.h" -#include -#include -#include -#include -#include -#include -#include - #if defined(DAWN_ENABLE_BACKEND_OPENGL) # include "GLFW/glfw3.h" # include "dawn/native/OpenGLBackend.h" diff --git a/src/dawn/tests/DawnTest.h b/src/dawn/tests/DawnTest.h index 72d4ab3e0a..1bf396a708 100644 --- a/src/dawn/tests/DawnTest.h +++ b/src/dawn/tests/DawnTest.h @@ -15,25 +15,24 @@ #ifndef SRC_DAWN_TESTS_DAWNTEST_H_ #define SRC_DAWN_TESTS_DAWNTEST_H_ +#include +#include +#include + #include "dawn/common/Log.h" #include "dawn/common/Platform.h" #include "dawn/common/Preprocessor.h" #include "dawn/dawn_proc_table.h" #include "dawn/native/DawnNative.h" +#include "dawn/platform/DawnPlatform.h" #include "dawn/tests/ParamGenerator.h" #include "dawn/tests/ToggleParser.h" #include "dawn/utils/ScopedAutoreleasePool.h" #include "dawn/utils/TextureUtils.h" #include "dawn/webgpu_cpp.h" #include "dawn/webgpu_cpp_print.h" - -#include -#include -#include "dawn/platform/DawnPlatform.h" - -#include -#include -#include +#include "gmock/gmock.h" +#include "gtest/gtest.h" // Getting data back from Dawn is done in an async manners so all expectations are "deferred" // until the end of the test. Also expectations use a copy to a MapRead buffer to get the data diff --git a/src/dawn/tests/MockCallback.h b/src/dawn/tests/MockCallback.h index c41139caee..d6f2073634 100644 --- a/src/dawn/tests/MockCallback.h +++ b/src/dawn/tests/MockCallback.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_TESTS_MOCKCALLBACK_H_ #define SRC_DAWN_TESTS_MOCKCALLBACK_H_ -#include - -#include "dawn/common/Assert.h" - #include #include +#include "gmock/gmock.h" + +#include "dawn/common/Assert.h" + namespace testing { template diff --git a/src/dawn/tests/UnittestsMain.cpp b/src/dawn/tests/UnittestsMain.cpp index b98a616459..50da220356 100644 --- a/src/dawn/tests/UnittestsMain.cpp +++ b/src/dawn/tests/UnittestsMain.cpp @@ -14,7 +14,7 @@ #include "unittests/validation/ValidationTest.h" -#include +#include "gtest/gtest.h" int main(int argc, char** argv) { InitDawnValidationTestEnvironment(argc, argv); diff --git a/src/dawn/tests/end2end/BufferTests.cpp b/src/dawn/tests/end2end/BufferTests.cpp index 0d41e22cdf..2c2dc97508 100644 --- a/src/dawn/tests/end2end/BufferTests.cpp +++ b/src/dawn/tests/end2end/BufferTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/DawnTest.h" - #include #include +#include "dawn/tests/DawnTest.h" + class BufferMappingTests : public DawnTest { protected: void MapAsyncAndWait(const wgpu::Buffer& buffer, diff --git a/src/dawn/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/dawn/tests/end2end/ComputeCopyStorageBufferTests.cpp index 0fbb8210f5..1787752449 100644 --- a/src/dawn/tests/end2end/ComputeCopyStorageBufferTests.cpp +++ b/src/dawn/tests/end2end/ComputeCopyStorageBufferTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/utils/WGPUHelpers.h" -#include - class ComputeCopyStorageBufferTests : public DawnTest { public: static constexpr int kInstances = 4; diff --git a/src/dawn/tests/end2end/ComputeDispatchTests.cpp b/src/dawn/tests/end2end/ComputeDispatchTests.cpp index 2d566195b0..a82663f535 100644 --- a/src/dawn/tests/end2end/ComputeDispatchTests.cpp +++ b/src/dawn/tests/end2end/ComputeDispatchTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/utils/WGPUHelpers.h" -#include - constexpr static std::initializer_list kSentinelData{0, 0, 0}; class ComputeDispatchTests : public DawnTest { diff --git a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp index cc2be7dbfb..adda29d8a1 100644 --- a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp +++ b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Math.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include - namespace { // Helper for replacing all occurrences of substr in str with replacement diff --git a/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp b/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp index 5440544eda..c94370ae9e 100644 --- a/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp +++ b/src/dawn/tests/end2end/ComputeSharedMemoryTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/utils/WGPUHelpers.h" -#include - class ComputeSharedMemoryTests : public DawnTest { public: static constexpr uint32_t kInstances = 11; diff --git a/src/dawn/tests/end2end/CopyTests.cpp b/src/dawn/tests/end2end/CopyTests.cpp index d6920ddd81..46911c9ed4 100644 --- a/src/dawn/tests/end2end/CopyTests.cpp +++ b/src/dawn/tests/end2end/CopyTests.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" -#include #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/utils/TestUtils.h" diff --git a/src/dawn/tests/end2end/D3D12ResourceWrappingTests.cpp b/src/dawn/tests/end2end/D3D12ResourceWrappingTests.cpp index 519f64678f..521da957c1 100644 --- a/src/dawn/tests/end2end/D3D12ResourceWrappingTests.cpp +++ b/src/dawn/tests/end2end/D3D12ResourceWrappingTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/DawnTest.h" - #include #include #include #include +#include "dawn/tests/DawnTest.h" + #include "dawn/native/D3D12Backend.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" diff --git a/src/dawn/tests/end2end/DeprecatedAPITests.cpp b/src/dawn/tests/end2end/DeprecatedAPITests.cpp index d182bc4e05..0e8660caf6 100644 --- a/src/dawn/tests/end2end/DeprecatedAPITests.cpp +++ b/src/dawn/tests/end2end/DeprecatedAPITests.cpp @@ -17,14 +17,14 @@ // a deprecation warning is emitted when the "old" behavior is used, and tests that an error is // emitted when both the old and the new behavior are used (when applicable). +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Constants.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - class DeprecationTests : public DawnTest { protected: void SetUp() override { diff --git a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp index a74359ea87..80b4b90dbf 100644 --- a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp +++ b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" -#include #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" diff --git a/src/dawn/tests/end2end/DeviceLostTests.cpp b/src/dawn/tests/end2end/DeviceLostTests.cpp index e255a6d8ae..b443598a42 100644 --- a/src/dawn/tests/end2end/DeviceLostTests.cpp +++ b/src/dawn/tests/end2end/DeviceLostTests.cpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + +#include "gmock/gmock.h" + #include "dawn/tests/DawnTest.h" -#include #include "dawn/tests/MockCallback.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - using namespace testing; class MockDeviceLostCallback { diff --git a/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp b/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp index 3c11b1715d..363e2101af 100644 --- a/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/dawn/tests/end2end/DynamicBufferOffsetTests.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Math.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - constexpr uint32_t kRTSize = 400; constexpr uint32_t kBindingSize = 8; diff --git a/src/dawn/tests/end2end/FirstIndexOffsetTests.cpp b/src/dawn/tests/end2end/FirstIndexOffsetTests.cpp index 525cdaca38..165fe77e4f 100644 --- a/src/dawn/tests/end2end/FirstIndexOffsetTests.cpp +++ b/src/dawn/tests/end2end/FirstIndexOffsetTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/DawnTest.h" - #include #include +#include "dawn/tests/DawnTest.h" + #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" diff --git a/src/dawn/tests/end2end/IOSurfaceWrappingTests.cpp b/src/dawn/tests/end2end/IOSurfaceWrappingTests.cpp index a8aa59bf62..0fd8c5b8a3 100644 --- a/src/dawn/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/dawn/tests/end2end/IOSurfaceWrappingTests.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include + #include "dawn/tests/DawnTest.h" #include "dawn/native/MetalBackend.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include -#include - namespace { void AddIntegerValue(CFMutableDictionaryRef dictionary, const CFStringRef key, int32_t value) { diff --git a/src/dawn/tests/end2end/NonzeroBufferCreationTests.cpp b/src/dawn/tests/end2end/NonzeroBufferCreationTests.cpp index 55f238f663..2f33fae530 100644 --- a/src/dawn/tests/end2end/NonzeroBufferCreationTests.cpp +++ b/src/dawn/tests/end2end/NonzeroBufferCreationTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/DawnTest.h" - #include #include +#include "dawn/tests/DawnTest.h" + class NonzeroBufferCreationTests : public DawnTest { public: void MapReadAsyncAndWait(wgpu::Buffer buffer, uint64_t offset, uint64_t size) { diff --git a/src/dawn/tests/end2end/PipelineLayoutTests.cpp b/src/dawn/tests/end2end/PipelineLayoutTests.cpp index fef5f8103c..b9a61fb060 100644 --- a/src/dawn/tests/end2end/PipelineLayoutTests.cpp +++ b/src/dawn/tests/end2end/PipelineLayoutTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Constants.h" #include "dawn/tests/DawnTest.h" -#include - class PipelineLayoutTests : public DawnTest {}; // Test creating a PipelineLayout with multiple BGLs where the first BGL uses the max number of diff --git a/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp b/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp index 1ec75b74fe..f61e7d8b37 100644 --- a/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - constexpr static unsigned int kRTSize = 16; class DrawQuad { diff --git a/src/dawn/tests/end2end/ShaderTests.cpp b/src/dawn/tests/end2end/ShaderTests.cpp index 8951d9a8ce..d24e9ebc2d 100644 --- a/src/dawn/tests/end2end/ShaderTests.cpp +++ b/src/dawn/tests/end2end/ShaderTests.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/DawnTest.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include - class ShaderTests : public DawnTest { public: wgpu::Buffer CreateBuffer(const uint32_t count) { diff --git a/src/dawn/tests/end2end/TextureFormatTests.cpp b/src/dawn/tests/end2end/TextureFormatTests.cpp index 284f11209e..2e005a004e 100644 --- a/src/dawn/tests/end2end/TextureFormatTests.cpp +++ b/src/dawn/tests/end2end/TextureFormatTests.cpp @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Assert.h" @@ -20,9 +23,6 @@ #include "dawn/utils/TextureUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include - // An expectation for float buffer content that can correctly compare different NaN values and // supports a basic tolerance for comparison of finite values. class ExpectFloatWithTolerance : public detail::Expectation { diff --git a/src/dawn/tests/end2end/TextureViewTests.cpp b/src/dawn/tests/end2end/TextureViewTests.cpp index 33beacf4f3..155d666206 100644 --- a/src/dawn/tests/end2end/TextureViewTests.cpp +++ b/src/dawn/tests/end2end/TextureViewTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Assert.h" @@ -20,8 +22,6 @@ #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - constexpr static unsigned int kRTSize = 64; constexpr wgpu::TextureFormat kDefaultFormat = wgpu::TextureFormat::RGBA8Unorm; constexpr uint32_t kBytesPerTexel = 4; diff --git a/src/dawn/tests/end2end/VideoViewsTests.h b/src/dawn/tests/end2end/VideoViewsTests.h index 6c659bb4da..c1ff361cb7 100644 --- a/src/dawn/tests/end2end/VideoViewsTests.h +++ b/src/dawn/tests/end2end/VideoViewsTests.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_END2END_VIDEOVIEWSTESTS_H_ #define SRC_DAWN_TESTS_END2END_VIDEOVIEWSTESTS_H_ -#include "dawn/tests/DawnTest.h" - #include #include +#include "dawn/tests/DawnTest.h" + class VideoViewsTestBackend { public: static BackendTestConfig Backend(); diff --git a/src/dawn/tests/end2end/VideoViewsTests_gbm.cpp b/src/dawn/tests/end2end/VideoViewsTests_gbm.cpp index bd23f2e9de..196308cf22 100644 --- a/src/dawn/tests/end2end/VideoViewsTests_gbm.cpp +++ b/src/dawn/tests/end2end/VideoViewsTests_gbm.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "VideoViewsTests.h" #include "dawn/common/Assert.h" #include "dawn/native/VulkanBackend.h" -#include -#include - // "linux-chromeos-rel"'s gbm.h is too old to compile, missing this change at least: // https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1963001/10/gbm.h#244 #ifndef MINIGBM diff --git a/src/dawn/tests/end2end/VideoViewsTests_mac.cpp b/src/dawn/tests/end2end/VideoViewsTests_mac.cpp index 151c0b36c9..fbf006b119 100644 --- a/src/dawn/tests/end2end/VideoViewsTests_mac.cpp +++ b/src/dawn/tests/end2end/VideoViewsTests_mac.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include + #include "VideoViewsTests.h" #include "dawn/common/Assert.h" #include "dawn/common/CoreFoundationRef.h" #include "dawn/native/MetalBackend.h" -#include -#include -#include - namespace { void AddIntegerValue(CFMutableDictionaryRef dictionary, const CFStringRef key, int32_t value) { CFNumberRef number(CFNumberCreate(nullptr, kCFNumberSInt32Type, &value)); diff --git a/src/dawn/tests/end2end/VideoViewsTests_win.cpp b/src/dawn/tests/end2end/VideoViewsTests_win.cpp index 21889d832d..f33ddab314 100644 --- a/src/dawn/tests/end2end/VideoViewsTests_win.cpp +++ b/src/dawn/tests/end2end/VideoViewsTests_win.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "VideoViewsTests.h" - -#include "dawn/common/Assert.h" -#include "dawn/native/D3D12Backend.h" - #include #include #include #include +#include "VideoViewsTests.h" + +#include "dawn/common/Assert.h" +#include "dawn/native/D3D12Backend.h" + using Microsoft::WRL::ComPtr; class PlatformTextureWin : public VideoViewsTestBackend::PlatformTexture { diff --git a/src/dawn/tests/end2end/WindowSurfaceTests.cpp b/src/dawn/tests/end2end/WindowSurfaceTests.cpp index 89978f2dc6..8520907b45 100644 --- a/src/dawn/tests/end2end/WindowSurfaceTests.cpp +++ b/src/dawn/tests/end2end/WindowSurfaceTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Log.h" #include "dawn/common/Platform.h" #include "dawn/dawn_proc.h" @@ -19,9 +21,7 @@ #include "dawn/tests/DawnTest.h" #include "dawn/utils/GLFWUtils.h" -#include - -#include +#include "gtest/gtest.h" // Include windows.h before GLFW so GLFW's APIENTRY macro doesn't conflict with windows.h's. #if defined(DAWN_PLATFORM_WINDOWS) diff --git a/src/dawn/tests/perf_tests/DawnPerfTestPlatform.h b/src/dawn/tests/perf_tests/DawnPerfTestPlatform.h index adc567f106..6241fc6e91 100644 --- a/src/dawn/tests/perf_tests/DawnPerfTestPlatform.h +++ b/src/dawn/tests/perf_tests/DawnPerfTestPlatform.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_TESTS_PERF_TESTS_DAWNPERFTESTPLATFORM_H_ #define SRC_DAWN_TESTS_PERF_TESTS_DAWNPERFTESTPLATFORM_H_ -#include "dawn/platform/DawnPlatform.h" - #include #include #include #include #include +#include "dawn/platform/DawnPlatform.h" + namespace utils { class Timer; } diff --git a/src/dawn/tests/unittests/BuddyMemoryAllocatorTests.cpp b/src/dawn/tests/unittests/BuddyMemoryAllocatorTests.cpp index fbe523910e..d078f26837 100644 --- a/src/dawn/tests/unittests/BuddyMemoryAllocatorTests.cpp +++ b/src/dawn/tests/unittests/BuddyMemoryAllocatorTests.cpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include +#include + +#include "gtest/gtest.h" #include "dawn/native/BuddyMemoryAllocator.h" #include "dawn/native/PooledResourceMemoryAllocator.h" #include "dawn/native/ResourceHeapAllocator.h" -#include -#include - using namespace dawn::native; class DummyResourceHeapAllocator : public ResourceHeapAllocator { diff --git a/src/dawn/tests/unittests/CommandAllocatorTests.cpp b/src/dawn/tests/unittests/CommandAllocatorTests.cpp index 7fb047a63b..dae8478e9b 100644 --- a/src/dawn/tests/unittests/CommandAllocatorTests.cpp +++ b/src/dawn/tests/unittests/CommandAllocatorTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include "gtest/gtest.h" #include "dawn/native/CommandAllocator.h" -#include - using namespace dawn::native; // Definition of the command types used in the tests diff --git a/src/dawn/tests/unittests/ITypBitsetTests.cpp b/src/dawn/tests/unittests/ITypBitsetTests.cpp index ea4d0599f2..ac82acec4a 100644 --- a/src/dawn/tests/unittests/ITypBitsetTests.cpp +++ b/src/dawn/tests/unittests/ITypBitsetTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include "gtest/gtest.h" #include "dawn/common/TypedInteger.h" #include "dawn/common/ityp_bitset.h" -#include - class ITypBitsetTest : public testing::Test { protected: using Key = TypedInteger; diff --git a/src/dawn/tests/unittests/ITypSpanTests.cpp b/src/dawn/tests/unittests/ITypSpanTests.cpp index e04ba5a099..b050d7135f 100644 --- a/src/dawn/tests/unittests/ITypSpanTests.cpp +++ b/src/dawn/tests/unittests/ITypSpanTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include "gtest/gtest.h" #include "dawn/common/TypedInteger.h" #include "dawn/common/ityp_span.h" -#include - class ITypSpanTest : public testing::Test { protected: using Key = TypedInteger; diff --git a/src/dawn/tests/unittests/LinkedListTests.cpp b/src/dawn/tests/unittests/LinkedListTests.cpp index c4971d874f..ede86fc5e0 100644 --- a/src/dawn/tests/unittests/LinkedListTests.cpp +++ b/src/dawn/tests/unittests/LinkedListTests.cpp @@ -4,12 +4,12 @@ // This file is a copy of Chromium's /src/base/containers/linked_list_unittest.cc -#include +#include + +#include "gtest/gtest.h" #include "dawn/common/LinkedList.h" -#include - class Node : public LinkNode { public: explicit Node(int id) : id_(id) { diff --git a/src/dawn/tests/unittests/MathTests.cpp b/src/dawn/tests/unittests/MathTests.cpp index 4635b6438e..9891e144a3 100644 --- a/src/dawn/tests/unittests/MathTests.cpp +++ b/src/dawn/tests/unittests/MathTests.cpp @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include "gtest/gtest.h" #include "dawn/EnumClassBitmasks.h" #include "dawn/common/Math.h" -#include #include "dawn/webgpu_cpp.h" namespace wgpu { diff --git a/src/dawn/tests/unittests/PerThreadProcTests.cpp b/src/dawn/tests/unittests/PerThreadProcTests.cpp index f059e3e79c..f9a195b5b3 100644 --- a/src/dawn/tests/unittests/PerThreadProcTests.cpp +++ b/src/dawn/tests/unittests/PerThreadProcTests.cpp @@ -12,16 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + +#include "gtest/gtest.h" + #include "dawn/dawn_thread_dispatch_proc.h" #include "dawn/native/DawnNative.h" #include "dawn/native/Instance.h" #include "dawn/native/null/DeviceNull.h" #include "dawn/webgpu_cpp.h" -#include -#include -#include - class PerThreadProcTests : public testing::Test { public: PerThreadProcTests() diff --git a/src/dawn/tests/unittests/StackContainerTests.cpp b/src/dawn/tests/unittests/StackContainerTests.cpp index 3dd2d47b40..6dc62f99cc 100644 --- a/src/dawn/tests/unittests/StackContainerTests.cpp +++ b/src/dawn/tests/unittests/StackContainerTests.cpp @@ -4,14 +4,14 @@ // This file is a modified copy of Chromium's /src/base/containers/stack_container_unittest.cc -#include +#include +#include + +#include "gtest/gtest.h" #include "dawn/common/RefCounted.h" #include "dawn/common/StackContainer.h" -#include -#include - namespace { class Dummy : public RefCounted { diff --git a/src/dawn/tests/unittests/ToBackendTests.cpp b/src/dawn/tests/unittests/ToBackendTests.cpp index c143acd6dc..398a9e0fdf 100644 --- a/src/dawn/tests/unittests/ToBackendTests.cpp +++ b/src/dawn/tests/unittests/ToBackendTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include "gtest/gtest.h" #include "dawn/common/RefCounted.h" #include "dawn/native/ToBackend.h" -#include - // Make our own Base - Backend object pair, reusing the AdapterBase name namespace dawn::native { class AdapterBase : public RefCounted {}; diff --git a/src/dawn/tests/unittests/native/DeviceCreationTests.cpp b/src/dawn/tests/unittests/native/DeviceCreationTests.cpp index 5c65734a54..856a763699 100644 --- a/src/dawn/tests/unittests/native/DeviceCreationTests.cpp +++ b/src/dawn/tests/unittests/native/DeviceCreationTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "gtest/gtest.h" + #include "dawn/dawn_proc.h" #include "dawn/native/DawnNative.h" #include "dawn/native/Device.h" @@ -20,8 +22,6 @@ #include "dawn/utils/SystemUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include - namespace { using namespace testing; diff --git a/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h b/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h index 73d968536f..a1ab605e91 100644 --- a/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h +++ b/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUPLAYOUTMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUPLAYOUTMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/BindGroupLayout.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { class BindGroupLayoutMock final : public BindGroupLayoutBase { diff --git a/src/dawn/tests/unittests/native/mocks/BindGroupMock.h b/src/dawn/tests/unittests/native/mocks/BindGroupMock.h index 45af3cc358..5661f2f7e4 100644 --- a/src/dawn/tests/unittests/native/mocks/BindGroupMock.h +++ b/src/dawn/tests/unittests/native/mocks/BindGroupMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUPMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BINDGROUPMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/BindGroup.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { class BindGroupMock : public BindGroupBase { diff --git a/src/dawn/tests/unittests/native/mocks/BufferMock.h b/src/dawn/tests/unittests/native/mocks/BufferMock.h index 6955e7cc95..f44dd8b797 100644 --- a/src/dawn/tests/unittests/native/mocks/BufferMock.h +++ b/src/dawn/tests/unittests/native/mocks/BufferMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BUFFERMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_BUFFERMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Buffer.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { class BufferMock : public BufferBase { diff --git a/src/dawn/tests/unittests/native/mocks/CommandBufferMock.h b/src/dawn/tests/unittests/native/mocks/CommandBufferMock.h index b08069e5dc..5e16e0e5da 100644 --- a/src/dawn/tests/unittests/native/mocks/CommandBufferMock.h +++ b/src/dawn/tests/unittests/native/mocks/CommandBufferMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_COMMANDBUFFERMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_COMMANDBUFFERMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/CommandBuffer.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { class CommandBufferMock : public CommandBufferBase { diff --git a/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.h b/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.h index 0512c15e92..f4fd5a1d22 100644 --- a/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.h +++ b/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_COMPUTEPIPELINEMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_COMPUTEPIPELINEMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/ComputePipeline.h" #include "dawn/native/Device.h" -#include - namespace dawn::native { class ComputePipelineMock : public ComputePipelineBase { diff --git a/src/dawn/tests/unittests/native/mocks/DeviceMock.h b/src/dawn/tests/unittests/native/mocks/DeviceMock.h index 7639e81655..3fd16fbbd6 100644 --- a/src/dawn/tests/unittests/native/mocks/DeviceMock.h +++ b/src/dawn/tests/unittests/native/mocks/DeviceMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_DEVICEMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_DEVICEMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/RenderPipeline.h" -#include - namespace dawn::native { class DeviceMock : public DeviceBase { diff --git a/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.h b/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.h index 0f47ab1cc8..c5df066518 100644 --- a/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.h +++ b/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_EXTERNALTEXTUREMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_EXTERNALTEXTUREMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/ExternalTexture.h" -#include - namespace dawn::native { class ExternalTextureMock : public ExternalTextureBase { diff --git a/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.h b/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.h index 981594f0bf..090bee611c 100644 --- a/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.h +++ b/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_PIPELINELAYOUTMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_PIPELINELAYOUTMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/PipelineLayout.h" -#include - namespace dawn::native { class PipelineLayoutMock : public PipelineLayoutBase { diff --git a/src/dawn/tests/unittests/native/mocks/QuerySetMock.h b/src/dawn/tests/unittests/native/mocks/QuerySetMock.h index 5d10ab7f00..65c5726055 100644 --- a/src/dawn/tests/unittests/native/mocks/QuerySetMock.h +++ b/src/dawn/tests/unittests/native/mocks/QuerySetMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_QUERYSETMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_QUERYSETMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/QuerySet.h" -#include - namespace dawn::native { class QuerySetMock : public QuerySetBase { diff --git a/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.h b/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.h index f6449900e9..0aaa5e2e24 100644 --- a/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.h +++ b/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_RENDERPIPELINEMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_RENDERPIPELINEMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/RenderPipeline.h" -#include - namespace dawn::native { class RenderPipelineMock : public RenderPipelineBase { diff --git a/src/dawn/tests/unittests/native/mocks/SamplerMock.h b/src/dawn/tests/unittests/native/mocks/SamplerMock.h index 2e892f07a5..24270755d1 100644 --- a/src/dawn/tests/unittests/native/mocks/SamplerMock.h +++ b/src/dawn/tests/unittests/native/mocks/SamplerMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SAMPLERMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SAMPLERMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/Sampler.h" -#include - namespace dawn::native { class SamplerMock : public SamplerBase { diff --git a/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.h b/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.h index c7e457ec65..5857a6e528 100644 --- a/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.h +++ b/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SHADERMODULEMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SHADERMODULEMOCK_H_ +#include + +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/Error.h" #include "dawn/native/ShaderModule.h" -#include - -#include - namespace dawn::native { class ShaderModuleMock : public ShaderModuleBase { diff --git a/src/dawn/tests/unittests/native/mocks/SwapChainMock.h b/src/dawn/tests/unittests/native/mocks/SwapChainMock.h index d2ceea46d4..c0aa249221 100644 --- a/src/dawn/tests/unittests/native/mocks/SwapChainMock.h +++ b/src/dawn/tests/unittests/native/mocks/SwapChainMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SWAPCHAINMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_SWAPCHAINMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/SwapChain.h" -#include - namespace dawn::native { class SwapChainMock : public SwapChainBase { diff --git a/src/dawn/tests/unittests/native/mocks/TextureMock.h b/src/dawn/tests/unittests/native/mocks/TextureMock.h index b23c1fad90..a6ea6fb533 100644 --- a/src/dawn/tests/unittests/native/mocks/TextureMock.h +++ b/src/dawn/tests/unittests/native/mocks/TextureMock.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_TEXTUREMOCK_H_ #define SRC_DAWN_TESTS_UNITTESTS_NATIVE_MOCKS_TEXTUREMOCK_H_ +#include "gmock/gmock.h" + #include "dawn/native/Device.h" #include "dawn/native/Texture.h" -#include - namespace dawn::native { class TextureMock : public TextureBase { diff --git a/src/dawn/tests/unittests/validation/BufferValidationTests.cpp b/src/dawn/tests/unittests/validation/BufferValidationTests.cpp index 9ec4ae6710..dbfb2131d4 100644 --- a/src/dawn/tests/unittests/validation/BufferValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/BufferValidationTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/unittests/validation/ValidationTest.h" - -#include - #include +#include "gmock/gmock.h" + +#include "dawn/tests/unittests/validation/ValidationTest.h" + using namespace testing; class MockBufferMapAsyncCallback { diff --git a/src/dawn/tests/unittests/validation/DynamicStateCommandValidationTests.cpp b/src/dawn/tests/unittests/validation/DynamicStateCommandValidationTests.cpp index 7268c00f7f..8c2826f510 100644 --- a/src/dawn/tests/unittests/validation/DynamicStateCommandValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/DynamicStateCommandValidationTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/utils/WGPUHelpers.h" -#include - class SetViewportTest : public ValidationTest { protected: void TestViewportCall(bool success, diff --git a/src/dawn/tests/unittests/validation/ErrorScopeValidationTests.cpp b/src/dawn/tests/unittests/validation/ErrorScopeValidationTests.cpp index 808eba414b..8184dc0d75 100644 --- a/src/dawn/tests/unittests/validation/ErrorScopeValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/ErrorScopeValidationTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "gmock/gmock.h" + #include "dawn/tests/MockCallback.h" #include "dawn/tests/unittests/validation/ValidationTest.h" -#include - using namespace testing; class MockDevicePopErrorScopeCallback { diff --git a/src/dawn/tests/unittests/validation/QueueOnSubmittedWorkDoneValidationTests.cpp b/src/dawn/tests/unittests/validation/QueueOnSubmittedWorkDoneValidationTests.cpp index 1adb1d2fe7..23bb1b1e6b 100644 --- a/src/dawn/tests/unittests/validation/QueueOnSubmittedWorkDoneValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/QueueOnSubmittedWorkDoneValidationTests.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/unittests/validation/ValidationTest.h" +#include "gmock/gmock.h" -#include +#include "dawn/tests/unittests/validation/ValidationTest.h" using namespace testing; diff --git a/src/dawn/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp b/src/dawn/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp index d311f38a84..4ef9884f23 100644 --- a/src/dawn/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/common/Constants.h" #include "dawn/utils/WGPUHelpers.h" -#include - namespace { class RenderPassDescriptorValidationTest : public ValidationTest { diff --git a/src/dawn/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/dawn/tests/unittests/validation/RenderPipelineValidationTests.cpp index 8eddecccf8..9dfb367c3d 100644 --- a/src/dawn/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/common/Constants.h" #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include -#include - class RenderPipelineValidationTest : public ValidationTest { protected: void SetUp() override { diff --git a/src/dawn/tests/unittests/validation/SamplerValidationTests.cpp b/src/dawn/tests/unittests/validation/SamplerValidationTests.cpp index dbf3ebc8e1..b304d117ce 100644 --- a/src/dawn/tests/unittests/validation/SamplerValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/SamplerValidationTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/utils/WGPUHelpers.h" -#include - namespace { class SamplerValidationTest : public ValidationTest {}; diff --git a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp index 2cf4497fc0..83a84a1b9d 100644 --- a/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/unittests/validation/ValidationTest.h" #include "dawn/common/Constants.h" @@ -19,8 +21,6 @@ #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - class ShaderModuleValidationTest : public ValidationTest {}; // Test case with a simpler shader that should successfully be created diff --git a/src/dawn/tests/unittests/validation/TextureViewValidationTests.cpp b/src/dawn/tests/unittests/validation/TextureViewValidationTests.cpp index f1b16f20d7..51d1c066c0 100644 --- a/src/dawn/tests/unittests/validation/TextureViewValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/TextureViewValidationTests.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/tests/unittests/validation/ValidationTest.h" - #include +#include "dawn/tests/unittests/validation/ValidationTest.h" + namespace { class TextureViewValidationTest : public ValidationTest {}; diff --git a/src/dawn/tests/unittests/validation/ValidationTest.cpp b/src/dawn/tests/unittests/validation/ValidationTest.cpp index 716b8d198b..22b7bcb544 100644 --- a/src/dawn/tests/unittests/validation/ValidationTest.cpp +++ b/src/dawn/tests/unittests/validation/ValidationTest.cpp @@ -14,6 +14,8 @@ #include "dawn/tests/unittests/validation/ValidationTest.h" +#include + #include "dawn/common/Assert.h" #include "dawn/common/SystemUtils.h" #include "dawn/dawn_proc.h" @@ -22,8 +24,6 @@ #include "dawn/utils/WireHelper.h" #include "dawn/webgpu.h" -#include - namespace { bool gUseWire = false; diff --git a/src/dawn/tests/unittests/validation/ValidationTest.h b/src/dawn/tests/unittests/validation/ValidationTest.h index 63c950a5bf..636c8b54a0 100644 --- a/src/dawn/tests/unittests/validation/ValidationTest.h +++ b/src/dawn/tests/unittests/validation/ValidationTest.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_VALIDATION_VALIDATIONTEST_H_ #define SRC_DAWN_TESTS_UNITTESTS_VALIDATION_VALIDATIONTEST_H_ +#include "gmock/gmock.h" +#include "gtest/gtest.h" + #include "dawn/common/Log.h" #include "dawn/native/DawnNative.h" #include "dawn/webgpu_cpp.h" -#include -#include - // Argument helpers to allow macro overriding. #define UNIMPLEMENTED_MACRO(...) UNREACHABLE() #define GET_3RD_ARG_HELPER_(_1, _2, NAME, ...) NAME diff --git a/src/dawn/tests/unittests/wire/WireAdapterTests.cpp b/src/dawn/tests/unittests/wire/WireAdapterTests.cpp index c1d2d453c9..438c6e7a32 100644 --- a/src/dawn/tests/unittests/wire/WireAdapterTests.cpp +++ b/src/dawn/tests/unittests/wire/WireAdapterTests.cpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/MockCallback.h" #include "dawn/tests/unittests/wire/WireTest.h" #include "dawn/wire/WireClient.h" #include "dawn/wire/WireServer.h" -#include -#include -#include +#include "webgpu/webgpu_cpp.h" namespace { diff --git a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp index 72773010f3..4f3da076ea 100644 --- a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp +++ b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/unittests/wire/WireTest.h" #include "dawn/common/Constants.h" -#include - using namespace testing; using namespace dawn::wire; diff --git a/src/dawn/tests/unittests/wire/WireInstanceTests.cpp b/src/dawn/tests/unittests/wire/WireInstanceTests.cpp index ab6ec71920..7a98c27e6a 100644 --- a/src/dawn/tests/unittests/wire/WireInstanceTests.cpp +++ b/src/dawn/tests/unittests/wire/WireInstanceTests.cpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/tests/MockCallback.h" #include "dawn/tests/unittests/wire/WireTest.h" #include "dawn/wire/WireClient.h" #include "dawn/wire/WireServer.h" -#include -#include -#include +#include "webgpu/webgpu_cpp.h" namespace { diff --git a/src/dawn/tests/unittests/wire/WireTest.h b/src/dawn/tests/unittests/wire/WireTest.h index de01f8387d..cd91c3e786 100644 --- a/src/dawn/tests/unittests/wire/WireTest.h +++ b/src/dawn/tests/unittests/wire/WireTest.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_TESTS_UNITTESTS_WIRE_WIRETEST_H_ #define SRC_DAWN_TESTS_UNITTESTS_WIRE_WIRETEST_H_ +#include + #include "dawn/mock_webgpu.h" #include "gtest/gtest.h" -#include - // Definition of a "Lambda predicate matcher" for GMock to allow checking deep structures // are passed correctly by the wire. diff --git a/src/dawn/tests/unittests/wire/WireWGPUDevicePropertiesTests.cpp b/src/dawn/tests/unittests/wire/WireWGPUDevicePropertiesTests.cpp index 9f7cdf5b98..eba7569ce1 100644 --- a/src/dawn/tests/unittests/wire/WireWGPUDevicePropertiesTests.cpp +++ b/src/dawn/tests/unittests/wire/WireWGPUDevicePropertiesTests.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/wire/Wire.h" #include "gtest/gtest.h" -#include - class WireWGPUDevicePropertiesTests : public testing::Test {}; // Test that the serialization and deserialization of WGPUDeviceProperties can work correctly. diff --git a/src/dawn/tests/white_box/BufferAllocatedSizeTests.cpp b/src/dawn/tests/white_box/BufferAllocatedSizeTests.cpp index 991c14583d..cfa90260ab 100644 --- a/src/dawn/tests/white_box/BufferAllocatedSizeTests.cpp +++ b/src/dawn/tests/white_box/BufferAllocatedSizeTests.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/Math.h" #include "dawn/native/DawnNative.h" -#include - class BufferAllocatedSizeTests : public DawnTest { protected: wgpu::Buffer CreateBuffer(wgpu::BufferUsage usage, uint64_t size) { diff --git a/src/dawn/tests/white_box/D3D12ResidencyTests.cpp b/src/dawn/tests/white_box/D3D12ResidencyTests.cpp index d6008bde88..8bab67477c 100644 --- a/src/dawn/tests/white_box/D3D12ResidencyTests.cpp +++ b/src/dawn/tests/white_box/D3D12ResidencyTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/native/D3D12Backend.h" #include "dawn/native/d3d12/BufferD3D12.h" #include "dawn/native/d3d12/DeviceD3D12.h" @@ -21,8 +23,6 @@ #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - constexpr uint32_t kRestrictedBudgetSize = 100000000; // 100MB constexpr uint32_t kDirectlyAllocatedResourceSize = 5000000; // 5MB constexpr uint32_t kSuballocatedResourceSize = 1000000; // 1MB diff --git a/src/dawn/tests/white_box/EGLImageWrappingTests.cpp b/src/dawn/tests/white_box/EGLImageWrappingTests.cpp index e415da541f..bc2495ffbc 100644 --- a/src/dawn/tests/white_box/EGLImageWrappingTests.cpp +++ b/src/dawn/tests/white_box/EGLImageWrappingTests.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/tests/DawnTest.h" #include "dawn/common/DynamicLib.h" @@ -20,8 +22,6 @@ #include "dawn/utils/ComboRenderPipelineDescriptor.h" #include "dawn/utils/WGPUHelpers.h" -#include - namespace { class EGLFunctions { diff --git a/src/dawn/tests/white_box/VulkanImageWrappingTests.h b/src/dawn/tests/white_box/VulkanImageWrappingTests.h index 49b902695d..4cc34c6688 100644 --- a/src/dawn/tests/white_box/VulkanImageWrappingTests.h +++ b/src/dawn/tests/white_box/VulkanImageWrappingTests.h @@ -15,6 +15,9 @@ #ifndef SRC_DAWN_TESTS_WHITE_BOX_VULKANIMAGEWRAPPINGTESTS_H_ #define SRC_DAWN_TESTS_WHITE_BOX_VULKANIMAGEWRAPPINGTESTS_H_ +#include +#include + // This must be above all other includes otherwise VulkanBackend.h includes vulkan.h before we had // time to wrap it with vulkan_platform.h #include "dawn/common/vulkan_platform.h" @@ -23,9 +26,6 @@ #include "dawn/native/VulkanBackend.h" #include "dawn/webgpu_cpp.h" -#include -#include - namespace dawn::native::vulkan { struct ExternalImageDescriptorVkForTesting; diff --git a/src/dawn/tests/white_box/VulkanImageWrappingTests_OpaqueFD.cpp b/src/dawn/tests/white_box/VulkanImageWrappingTests_OpaqueFD.cpp index 99b5140e0a..310f13f3e6 100644 --- a/src/dawn/tests/white_box/VulkanImageWrappingTests_OpaqueFD.cpp +++ b/src/dawn/tests/white_box/VulkanImageWrappingTests_OpaqueFD.cpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + +#include "gtest/gtest.h" + #include "dawn/tests/white_box/VulkanImageWrappingTests.h" #include "dawn/native/vulkan/DeviceVk.h" #include "dawn/native/vulkan/FencedDeleter.h" #include "dawn/native/vulkan/ResourceMemoryAllocatorVk.h" -#include -#include - namespace dawn::native::vulkan { ExternalImageDescriptorVkForTesting::ExternalImageDescriptorVkForTesting() diff --git a/src/dawn/utils/ComboRenderBundleEncoderDescriptor.h b/src/dawn/utils/ComboRenderBundleEncoderDescriptor.h index 854391d68f..d91758be21 100644 --- a/src/dawn/utils/ComboRenderBundleEncoderDescriptor.h +++ b/src/dawn/utils/ComboRenderBundleEncoderDescriptor.h @@ -15,11 +15,10 @@ #ifndef SRC_DAWN_UTILS_COMBORENDERBUNDLEENCODERDESCRIPTOR_H_ #define SRC_DAWN_UTILS_COMBORENDERBUNDLEENCODERDESCRIPTOR_H_ -#include "dawn/webgpu_cpp.h" +#include #include "dawn/common/Constants.h" - -#include +#include "dawn/webgpu_cpp.h" namespace utils { diff --git a/src/dawn/utils/ComboRenderPipelineDescriptor.h b/src/dawn/utils/ComboRenderPipelineDescriptor.h index 8411161aea..71ae690869 100644 --- a/src/dawn/utils/ComboRenderPipelineDescriptor.h +++ b/src/dawn/utils/ComboRenderPipelineDescriptor.h @@ -15,11 +15,10 @@ #ifndef SRC_DAWN_UTILS_COMBORENDERPIPELINEDESCRIPTOR_H_ #define SRC_DAWN_UTILS_COMBORENDERPIPELINEDESCRIPTOR_H_ -#include "dawn/webgpu_cpp.h" +#include #include "dawn/common/Constants.h" - -#include +#include "dawn/webgpu_cpp.h" namespace utils { diff --git a/src/dawn/utils/D3D12Binding.cpp b/src/dawn/utils/D3D12Binding.cpp index 9ed65b2b77..cd7f278315 100644 --- a/src/dawn/utils/D3D12Binding.cpp +++ b/src/dawn/utils/D3D12Binding.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/utils/BackendBinding.h" #include "dawn/common/Assert.h" @@ -21,8 +23,6 @@ #define GLFW_EXPOSE_NATIVE_WIN32 #include "GLFW/glfw3native.h" -#include - namespace utils { class D3D12Binding : public BackendBinding { diff --git a/src/dawn/utils/GLFWUtils.cpp b/src/dawn/utils/GLFWUtils.cpp index d8c162c463..75f986a873 100644 --- a/src/dawn/utils/GLFWUtils.cpp +++ b/src/dawn/utils/GLFWUtils.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/utils/GLFWUtils.h" #include "GLFW/glfw3.h" #include "dawn/common/Platform.h" -#include - #if defined(DAWN_PLATFORM_WINDOWS) # define GLFW_EXPOSE_NATIVE_WIN32 #elif defined(DAWN_USE_X11) diff --git a/src/dawn/utils/GLFWUtils.h b/src/dawn/utils/GLFWUtils.h index 11ec67304a..7f796c901d 100644 --- a/src/dawn/utils/GLFWUtils.h +++ b/src/dawn/utils/GLFWUtils.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_UTILS_GLFWUTILS_H_ #define SRC_DAWN_UTILS_GLFWUTILS_H_ -#include "dawn/webgpu_cpp.h" - #include +#include "dawn/webgpu_cpp.h" + struct GLFWwindow; namespace utils { diff --git a/src/dawn/utils/Glfw3Fuchsia.cpp b/src/dawn/utils/Glfw3Fuchsia.cpp index 4caa7acc69..ed2a477efd 100644 --- a/src/dawn/utils/Glfw3Fuchsia.cpp +++ b/src/dawn/utils/Glfw3Fuchsia.cpp @@ -15,6 +15,8 @@ // A mock GLFW implementation that supports Fuchsia, but only implements // the functions called from Dawn. +#include + // NOTE: This must be included before GLFW/glfw3.h because the latter will // include and "common/vulkan_platform.h" wants to be // the first header to do so for sanity reasons (e.g. undefining weird @@ -22,11 +24,9 @@ // clang-format off #include "dawn/common/vulkan_platform.h" #include "dawn/common/Assert.h" -#include +#include "GLFW/glfw3.h" // clang-format on -#include - int glfwInit(void) { return GLFW_TRUE; } diff --git a/src/dawn/utils/NullBinding.cpp b/src/dawn/utils/NullBinding.cpp index c33b6dda40..f3f1728ef0 100644 --- a/src/dawn/utils/NullBinding.cpp +++ b/src/dawn/utils/NullBinding.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/utils/BackendBinding.h" #include "dawn/common/Assert.h" #include "dawn/native/NullBackend.h" -#include - namespace utils { class NullBinding : public BackendBinding { diff --git a/src/dawn/utils/OSXTimer.cpp b/src/dawn/utils/OSXTimer.cpp index 818b27bf71..28ff376c93 100644 --- a/src/dawn/utils/OSXTimer.cpp +++ b/src/dawn/utils/OSXTimer.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/utils/Timer.h" - #include #include #include +#include "dawn/utils/Timer.h" + namespace utils { class OSXTimer : public Timer { diff --git a/src/dawn/utils/OpenGLBinding.cpp b/src/dawn/utils/OpenGLBinding.cpp index 35972afc64..71db28609e 100644 --- a/src/dawn/utils/OpenGLBinding.cpp +++ b/src/dawn/utils/OpenGLBinding.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/utils/BackendBinding.h" #include "dawn/common/Assert.h" @@ -20,7 +22,6 @@ #include "dawn/dawn_wsi.h" #include "dawn/native/OpenGLBackend.h" -#include #include "GLFW/glfw3.h" namespace utils { diff --git a/src/dawn/utils/PosixTimer.cpp b/src/dawn/utils/PosixTimer.cpp index 18eb5e6bf9..1bbc8446c8 100644 --- a/src/dawn/utils/PosixTimer.cpp +++ b/src/dawn/utils/PosixTimer.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/utils/Timer.h" - #include #include +#include "dawn/utils/Timer.h" + namespace utils { namespace { diff --git a/src/dawn/utils/ScopedAutoreleasePool.h b/src/dawn/utils/ScopedAutoreleasePool.h index bad97041dd..412ad3ed9e 100644 --- a/src/dawn/utils/ScopedAutoreleasePool.h +++ b/src/dawn/utils/ScopedAutoreleasePool.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_UTILS_SCOPEDAUTORELEASEPOOL_H_ #define SRC_DAWN_UTILS_SCOPEDAUTORELEASEPOOL_H_ -#include "dawn/common/Compiler.h" - #include +#include "dawn/common/Compiler.h" + namespace utils { /** diff --git a/src/dawn/utils/TestUtils.cpp b/src/dawn/utils/TestUtils.cpp index 31535f2644..1556f47108 100644 --- a/src/dawn/utils/TestUtils.cpp +++ b/src/dawn/utils/TestUtils.cpp @@ -14,14 +14,14 @@ #include "dawn/utils/TestUtils.h" +#include + #include "dawn/common/Assert.h" #include "dawn/common/Constants.h" #include "dawn/common/Math.h" #include "dawn/utils/TextureUtils.h" #include "dawn/utils/WGPUHelpers.h" -#include - namespace utils { uint32_t GetMinimumBytesPerRow(wgpu::TextureFormat format, uint32_t width) { diff --git a/src/dawn/utils/VulkanBinding.cpp b/src/dawn/utils/VulkanBinding.cpp index fc94090a0b..ec2323c2cf 100644 --- a/src/dawn/utils/VulkanBinding.cpp +++ b/src/dawn/utils/VulkanBinding.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/utils/BackendBinding.h" #include "dawn/common/Assert.h" @@ -20,8 +22,6 @@ // Include GLFW after VulkanBackend so that it declares the Vulkan-specific functions #include "GLFW/glfw3.h" -#include - namespace utils { class VulkanBinding : public BackendBinding { diff --git a/src/dawn/utils/WGPUHelpers.cpp b/src/dawn/utils/WGPUHelpers.cpp index 537cdcbcdb..7c36d81428 100644 --- a/src/dawn/utils/WGPUHelpers.cpp +++ b/src/dawn/utils/WGPUHelpers.cpp @@ -14,17 +14,17 @@ #include "dawn/utils/WGPUHelpers.h" -#include "dawn/common/Constants.h" -#include "dawn/common/Log.h" - -#include "spirv-tools/optimizer.hpp" - #include #include #include #include #include +#include "dawn/common/Constants.h" +#include "dawn/common/Log.h" + +#include "spirv-tools/optimizer.hpp" + namespace utils { wgpu::ShaderModule CreateShaderModuleFromASM(const wgpu::Device& device, const char* source) { // Use SPIRV-Tools's C API to assemble the SPIR-V assembly text to binary. Because the types diff --git a/src/dawn/utils/WGPUHelpers.h b/src/dawn/utils/WGPUHelpers.h index 8ea55b4548..21d1239412 100644 --- a/src/dawn/utils/WGPUHelpers.h +++ b/src/dawn/utils/WGPUHelpers.h @@ -15,14 +15,13 @@ #ifndef SRC_DAWN_UTILS_WGPUHELPERS_H_ #define SRC_DAWN_UTILS_WGPUHELPERS_H_ -#include "dawn/webgpu_cpp.h" - #include #include #include #include "dawn/common/Constants.h" #include "dawn/utils/TextureUtils.h" +#include "dawn/webgpu_cpp.h" namespace utils { diff --git a/src/dawn/utils/WindowsDebugLogger.cpp b/src/dawn/utils/WindowsDebugLogger.cpp index 159c71a940..b4125bc3b6 100644 --- a/src/dawn/utils/WindowsDebugLogger.cpp +++ b/src/dawn/utils/WindowsDebugLogger.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + #include "dawn/utils/PlatformDebugLogger.h" #include "dawn/common/Assert.h" #include "dawn/common/windows_with_undefs.h" -#include -#include - namespace utils { class WindowsDebugLogger : public PlatformDebugLogger { diff --git a/src/dawn/utils/WindowsTimer.cpp b/src/dawn/utils/WindowsTimer.cpp index ca165d0275..4cb360beda 100644 --- a/src/dawn/utils/WindowsTimer.cpp +++ b/src/dawn/utils/WindowsTimer.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/utils/Timer.h" - #include +#include "dawn/utils/Timer.h" + namespace utils { class WindowsTimer : public Timer { diff --git a/src/dawn/utils/WireHelper.cpp b/src/dawn/utils/WireHelper.cpp index 73eed81899..73e548fe62 100644 --- a/src/dawn/utils/WireHelper.cpp +++ b/src/dawn/utils/WireHelper.cpp @@ -14,6 +14,13 @@ #include "dawn/utils/WireHelper.h" +#include +#include +#include +#include +#include +#include + #include "dawn/common/Assert.h" #include "dawn/common/Log.h" #include "dawn/common/SystemUtils.h" @@ -23,13 +30,6 @@ #include "dawn/wire/WireClient.h" #include "dawn/wire/WireServer.h" -#include -#include -#include -#include -#include -#include - namespace utils { namespace { diff --git a/src/dawn/utils/WireHelper.h b/src/dawn/utils/WireHelper.h index 740c4c0624..c321e650b7 100644 --- a/src/dawn/utils/WireHelper.h +++ b/src/dawn/utils/WireHelper.h @@ -15,11 +15,11 @@ #ifndef SRC_DAWN_UTILS_WIREHELPER_H_ #define SRC_DAWN_UTILS_WIREHELPER_H_ -#include "dawn/webgpu_cpp.h" - #include #include +#include "dawn/webgpu_cpp.h" + namespace utils { class WireHelper { diff --git a/src/dawn/wire/BufferConsumer.h b/src/dawn/wire/BufferConsumer.h index 48f88f81a1..34fe0d94eb 100644 --- a/src/dawn/wire/BufferConsumer.h +++ b/src/dawn/wire/BufferConsumer.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_WIRE_BUFFERCONSUMER_H_ #define SRC_DAWN_WIRE_BUFFERCONSUMER_H_ -#include "dawn/wire/WireResult.h" - #include +#include "dawn/wire/WireResult.h" + namespace dawn::wire { // BufferConsumer is a utility class that allows reading bytes from a buffer diff --git a/src/dawn/wire/ChunkedCommandHandler.cpp b/src/dawn/wire/ChunkedCommandHandler.cpp index 81136867a5..4d514c19af 100644 --- a/src/dawn/wire/ChunkedCommandHandler.cpp +++ b/src/dawn/wire/ChunkedCommandHandler.cpp @@ -14,11 +14,11 @@ #include "dawn/wire/ChunkedCommandHandler.h" -#include "dawn/common/Alloc.h" - #include #include +#include "dawn/common/Alloc.h" + namespace dawn::wire { ChunkedCommandHandler::~ChunkedCommandHandler() = default; diff --git a/src/dawn/wire/ChunkedCommandHandler.h b/src/dawn/wire/ChunkedCommandHandler.h index a0aaf4e7f5..8421585708 100644 --- a/src/dawn/wire/ChunkedCommandHandler.h +++ b/src/dawn/wire/ChunkedCommandHandler.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_WIRE_CHUNKEDCOMMANDHANDLER_H_ #define SRC_DAWN_WIRE_CHUNKEDCOMMANDHANDLER_H_ +#include +#include + #include "dawn/common/Assert.h" #include "dawn/wire/Wire.h" #include "dawn/wire/WireCmd_autogen.h" -#include -#include - namespace dawn::wire { class ChunkedCommandHandler : public CommandHandler { diff --git a/src/dawn/wire/ChunkedCommandSerializer.h b/src/dawn/wire/ChunkedCommandSerializer.h index 363d2990c2..b91862769d 100644 --- a/src/dawn/wire/ChunkedCommandSerializer.h +++ b/src/dawn/wire/ChunkedCommandSerializer.h @@ -15,15 +15,15 @@ #ifndef SRC_DAWN_WIRE_CHUNKEDCOMMANDSERIALIZER_H_ #define SRC_DAWN_WIRE_CHUNKEDCOMMANDSERIALIZER_H_ +#include +#include +#include + #include "dawn/common/Alloc.h" #include "dawn/common/Compiler.h" #include "dawn/wire/Wire.h" #include "dawn/wire/WireCmd_autogen.h" -#include -#include -#include - namespace dawn::wire { class ChunkedCommandSerializer { diff --git a/src/dawn/wire/WireDeserializeAllocator.h b/src/dawn/wire/WireDeserializeAllocator.h index 372b237a63..eb24fd3803 100644 --- a/src/dawn/wire/WireDeserializeAllocator.h +++ b/src/dawn/wire/WireDeserializeAllocator.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_WIRE_WIREDESERIALIZEALLOCATOR_H_ #define SRC_DAWN_WIRE_WIREDESERIALIZEALLOCATOR_H_ -#include "dawn/wire/WireCmd_autogen.h" - #include +#include "dawn/wire/WireCmd_autogen.h" + namespace dawn::wire { // A really really simple implementation of the DeserializeAllocator. It's main feature // is that it has some inline storage so as to avoid allocations for the majority of diff --git a/src/dawn/wire/client/ClientDoers.cpp b/src/dawn/wire/client/ClientDoers.cpp index 7b99dc60b4..862ad3e48b 100644 --- a/src/dawn/wire/client/ClientDoers.cpp +++ b/src/dawn/wire/client/ClientDoers.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Assert.h" #include "dawn/wire/client/Client.h" #include "dawn/wire/client/Device.h" -#include - namespace dawn::wire::client { bool Client::DoDeviceUncapturedErrorCallback(Device* device, diff --git a/src/dawn/wire/client/ClientInlineMemoryTransferService.cpp b/src/dawn/wire/client/ClientInlineMemoryTransferService.cpp index e04ce803f1..5b70c5b3f7 100644 --- a/src/dawn/wire/client/ClientInlineMemoryTransferService.cpp +++ b/src/dawn/wire/client/ClientInlineMemoryTransferService.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Alloc.h" #include "dawn/common/Assert.h" #include "dawn/wire/WireClient.h" #include "dawn/wire/client/Client.h" -#include - namespace dawn::wire::client { class InlineMemoryTransferService : public MemoryTransferService { diff --git a/src/dawn/wire/client/Device.h b/src/dawn/wire/client/Device.h index 70a8731309..10cd96ff77 100644 --- a/src/dawn/wire/client/Device.h +++ b/src/dawn/wire/client/Device.h @@ -15,17 +15,16 @@ #ifndef SRC_DAWN_WIRE_CLIENT_DEVICE_H_ #define SRC_DAWN_WIRE_CLIENT_DEVICE_H_ -#include "dawn/webgpu.h" +#include #include "dawn/common/LinkedList.h" +#include "dawn/webgpu.h" #include "dawn/wire/WireCmd_autogen.h" #include "dawn/wire/client/ApiObjects_autogen.h" #include "dawn/wire/client/LimitsAndFeatures.h" #include "dawn/wire/client/ObjectBase.h" #include "dawn/wire/client/RequestTracker.h" -#include - namespace dawn::wire::client { class Client; diff --git a/src/dawn/wire/client/LimitsAndFeatures.h b/src/dawn/wire/client/LimitsAndFeatures.h index ee44324d70..567d938198 100644 --- a/src/dawn/wire/client/LimitsAndFeatures.h +++ b/src/dawn/wire/client/LimitsAndFeatures.h @@ -15,10 +15,10 @@ #ifndef SRC_DAWN_WIRE_CLIENT_LIMITSANDFEATURES_H_ #define SRC_DAWN_WIRE_CLIENT_LIMITSANDFEATURES_H_ -#include "dawn/webgpu.h" - #include +#include "dawn/webgpu.h" + namespace dawn::wire::client { class LimitsAndFeatures { diff --git a/src/dawn/wire/client/ObjectAllocator.h b/src/dawn/wire/client/ObjectAllocator.h index 67ab46766c..edab9b84b5 100644 --- a/src/dawn/wire/client/ObjectAllocator.h +++ b/src/dawn/wire/client/ObjectAllocator.h @@ -15,14 +15,14 @@ #ifndef SRC_DAWN_WIRE_CLIENT_OBJECTALLOCATOR_H_ #define SRC_DAWN_WIRE_CLIENT_OBJECTALLOCATOR_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/Compiler.h" -#include "dawn/wire/WireCmd_autogen.h" - #include #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/Compiler.h" +#include "dawn/wire/WireCmd_autogen.h" + namespace dawn::wire::client { template diff --git a/src/dawn/wire/client/RequestTracker.h b/src/dawn/wire/client/RequestTracker.h index 31fe313bfa..c7df69033d 100644 --- a/src/dawn/wire/client/RequestTracker.h +++ b/src/dawn/wire/client/RequestTracker.h @@ -15,12 +15,12 @@ #ifndef SRC_DAWN_WIRE_CLIENT_REQUESTTRACKER_H_ #define SRC_DAWN_WIRE_CLIENT_REQUESTTRACKER_H_ -#include "dawn/common/Assert.h" -#include "dawn/common/NonCopyable.h" - #include #include +#include "dawn/common/Assert.h" +#include "dawn/common/NonCopyable.h" + namespace dawn::wire::client { class Device; diff --git a/src/dawn/wire/server/ObjectStorage.h b/src/dawn/wire/server/ObjectStorage.h index 5487735371..5672ec7022 100644 --- a/src/dawn/wire/server/ObjectStorage.h +++ b/src/dawn/wire/server/ObjectStorage.h @@ -15,13 +15,13 @@ #ifndef SRC_DAWN_WIRE_SERVER_OBJECTSTORAGE_H_ #define SRC_DAWN_WIRE_SERVER_OBJECTSTORAGE_H_ -#include "dawn/wire/WireCmd_autogen.h" -#include "dawn/wire/WireServer.h" - #include #include #include +#include "dawn/wire/WireCmd_autogen.h" +#include "dawn/wire/WireServer.h" + namespace dawn::wire::server { struct DeviceInfo { diff --git a/src/dawn/wire/server/ServerBuffer.cpp b/src/dawn/wire/server/ServerBuffer.cpp index 44664da819..c92afdbc44 100644 --- a/src/dawn/wire/server/ServerBuffer.cpp +++ b/src/dawn/wire/server/ServerBuffer.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Assert.h" #include "dawn/wire/BufferConsumer_impl.h" #include "dawn/wire/WireCmd_autogen.h" #include "dawn/wire/server/Server.h" -#include - namespace dawn::wire::server { bool Server::PreHandleBufferUnmap(const BufferUnmapCmd& cmd) { diff --git a/src/dawn/wire/server/ServerInlineMemoryTransferService.cpp b/src/dawn/wire/server/ServerInlineMemoryTransferService.cpp index 0e6b30aba6..3efe5e3b36 100644 --- a/src/dawn/wire/server/ServerInlineMemoryTransferService.cpp +++ b/src/dawn/wire/server/ServerInlineMemoryTransferService.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/common/Assert.h" #include "dawn/wire/WireServer.h" #include "dawn/wire/server/Server.h" -#include - namespace dawn::wire::server { class InlineMemoryTransferService : public MemoryTransferService { diff --git a/src/dawn/wire/server/ServerInstance.cpp b/src/dawn/wire/server/ServerInstance.cpp index d39dadec93..99498d0fa9 100644 --- a/src/dawn/wire/server/ServerInstance.cpp +++ b/src/dawn/wire/server/ServerInstance.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "dawn/wire/server/Server.h" #include "dawn/wire/SupportedFeatures.h" -#include - namespace dawn::wire::server { bool Server::DoInstanceRequestAdapter(ObjectId instanceId, diff --git a/src/dawn/wire/server/ServerShaderModule.cpp b/src/dawn/wire/server/ServerShaderModule.cpp index 8785e0d648..82b0461115 100644 --- a/src/dawn/wire/server/ServerShaderModule.cpp +++ b/src/dawn/wire/server/ServerShaderModule.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dawn/wire/server/Server.h" - #include +#include "dawn/wire/server/Server.h" + namespace dawn::wire::server { bool Server::DoShaderModuleGetCompilationInfo(ObjectId shaderModuleId, uint64_t requestSerial) { diff --git a/src/tint/bench/benchmark.h b/src/tint/bench/benchmark.h index 96a935d5ef..22605b2a3b 100644 --- a/src/tint/bench/benchmark.h +++ b/src/tint/bench/benchmark.h @@ -17,6 +17,7 @@ #include #include +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT #include // NOLINT: Found C system header after C++ system header. #include "benchmark/benchmark.h" diff --git a/src/tint/reader/wgsl/token.h b/src/tint/reader/wgsl/token.h index 7b5b6754ed..a3715eeb3c 100644 --- a/src/tint/reader/wgsl/token.h +++ b/src/tint/reader/wgsl/token.h @@ -17,7 +17,8 @@ #include #include -#include // NOLINT: cpplint doesn't recognise this +// TODO(https://crbug.com/dawn/1379) Update cpplint and remove NOLINT +#include // NOLINT(build/include_order)) #include "src/tint/source.h"