From 9aa4b11281402662e03b0af6ef588a76f90d0657 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 19 Apr 2022 14:02:15 +0000 Subject: [PATCH] Add explicit to D3D12 specific files. This CL updates the d3d12 files to add explicit to single parameter constructors. Bug: dawn:1339 Change-Id: I7896fa37a5eed90fb4184951bd4d823f96d8e88b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86642 Kokoro: Kokoro Reviewed-by: Ben Clayton Reviewed-by: Corentin Wallez Commit-Queue: Dan Sinclair Auto-Submit: Dan Sinclair --- src/dawn/native/d3d12/BackendD3D12.h | 2 +- src/dawn/native/d3d12/CommandAllocatorManager.h | 2 +- src/dawn/native/d3d12/CommandBufferD3D12.cpp | 2 +- src/dawn/native/d3d12/D3D11on12Util.h | 2 +- src/dawn/native/d3d12/RenderPassBuilderD3D12.h | 2 +- src/dawn/native/d3d12/ResidencyManagerD3D12.h | 2 +- src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h | 2 +- src/dawn/native/d3d12/SamplerHeapCacheD3D12.h | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dawn/native/d3d12/BackendD3D12.h b/src/dawn/native/d3d12/BackendD3D12.h index 4d0ff7c748..213f461d95 100644 --- a/src/dawn/native/d3d12/BackendD3D12.h +++ b/src/dawn/native/d3d12/BackendD3D12.h @@ -25,7 +25,7 @@ namespace dawn::native::d3d12 { class Backend : public BackendConnection { public: - Backend(InstanceBase* instance); + explicit Backend(InstanceBase* instance); MaybeError Initialize(); diff --git a/src/dawn/native/d3d12/CommandAllocatorManager.h b/src/dawn/native/d3d12/CommandAllocatorManager.h index baec984bcb..8f34cc3095 100644 --- a/src/dawn/native/d3d12/CommandAllocatorManager.h +++ b/src/dawn/native/d3d12/CommandAllocatorManager.h @@ -29,7 +29,7 @@ namespace dawn::native::d3d12 { class CommandAllocatorManager { public: - CommandAllocatorManager(Device* device); + explicit CommandAllocatorManager(Device* device); // A CommandAllocator that is reserved must be used on the next ExecuteCommandLists // otherwise its commands may be reset before execution has completed on the GPU diff --git a/src/dawn/native/d3d12/CommandBufferD3D12.cpp b/src/dawn/native/d3d12/CommandBufferD3D12.cpp index 86022c72e2..2c74c0d662 100644 --- a/src/dawn/native/d3d12/CommandBufferD3D12.cpp +++ b/src/dawn/native/d3d12/CommandBufferD3D12.cpp @@ -312,7 +312,7 @@ namespace dawn::native::d3d12 { using Base = BindGroupTrackerBase; public: - BindGroupStateTracker(Device* device) + explicit BindGroupStateTracker(Device* device) : BindGroupTrackerBase(), mDevice(device), mViewAllocator(device->GetViewShaderVisibleDescriptorAllocator()), diff --git a/src/dawn/native/d3d12/D3D11on12Util.h b/src/dawn/native/d3d12/D3D11on12Util.h index 4d960ff3b1..d6a2413baa 100644 --- a/src/dawn/native/d3d12/D3D11on12Util.h +++ b/src/dawn/native/d3d12/D3D11on12Util.h @@ -31,7 +31,7 @@ namespace dawn::native::d3d12 { // Wraps 11 wrapped resources in a cache. class D3D11on12ResourceCacheEntry : public RefCounted { public: - D3D11on12ResourceCacheEntry(ComPtr d3d11on12Device); + explicit D3D11on12ResourceCacheEntry(ComPtr d3d11on12Device); D3D11on12ResourceCacheEntry(ComPtr d3d11on12Resource, ComPtr d3d11on12Device); ~D3D11on12ResourceCacheEntry(); diff --git a/src/dawn/native/d3d12/RenderPassBuilderD3D12.h b/src/dawn/native/d3d12/RenderPassBuilderD3D12.h index 0e7dcad68f..6dc0e28be8 100644 --- a/src/dawn/native/d3d12/RenderPassBuilderD3D12.h +++ b/src/dawn/native/d3d12/RenderPassBuilderD3D12.h @@ -35,7 +35,7 @@ namespace dawn::native::d3d12 { // operations is extracted from the descriptors. class RenderPassBuilder { public: - RenderPassBuilder(bool hasUAV); + explicit RenderPassBuilder(bool hasUAV); // Returns the highest color attachment index + 1. If there is no color attachment, returns // 0. Range: [0, kMaxColorAttachments + 1) diff --git a/src/dawn/native/d3d12/ResidencyManagerD3D12.h b/src/dawn/native/d3d12/ResidencyManagerD3D12.h index 490e487510..e4255455b7 100644 --- a/src/dawn/native/d3d12/ResidencyManagerD3D12.h +++ b/src/dawn/native/d3d12/ResidencyManagerD3D12.h @@ -30,7 +30,7 @@ namespace dawn::native::d3d12 { class ResidencyManager { public: - ResidencyManager(Device* device); + explicit ResidencyManager(Device* device); MaybeError LockAllocation(Pageable* pageable); void UnlockAllocation(Pageable* pageable); diff --git a/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h b/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h index 2e3d0f264b..3536bbd8f8 100644 --- a/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h +++ b/src/dawn/native/d3d12/ResourceAllocatorManagerD3D12.h @@ -57,7 +57,7 @@ namespace dawn::native::d3d12 { // multiple allocation methods. class ResourceAllocatorManager { public: - ResourceAllocatorManager(Device* device); + explicit ResourceAllocatorManager(Device* device); ResultOrError AllocateMemory( D3D12_HEAP_TYPE heapType, diff --git a/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h b/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h index 28c6fae54e..d032d6e247 100644 --- a/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h +++ b/src/dawn/native/d3d12/SamplerHeapCacheD3D12.h @@ -45,7 +45,7 @@ namespace dawn::native::d3d12 { class SamplerHeapCacheEntry : public RefCounted { public: SamplerHeapCacheEntry() = default; - SamplerHeapCacheEntry(std::vector samplers); + explicit SamplerHeapCacheEntry(std::vector samplers); SamplerHeapCacheEntry(SamplerHeapCache* cache, StagingDescriptorAllocator* allocator, std::vector samplers, @@ -83,7 +83,7 @@ namespace dawn::native::d3d12 { // BindGroup. class SamplerHeapCache { public: - SamplerHeapCache(Device* device); + explicit SamplerHeapCache(Device* device); ~SamplerHeapCache(); ResultOrError> GetOrCreate(