Autoformat everything except tests/examples

Done by:
- Appending an extra newline at the end of src/**/*.{cpp,h,mm,gn}
  except src/tests/*
- Running git cl format --full to format the full contents of every
  changed file

Bug: none
Change-Id: Id88fc5ed0c5efbbc93b2c6a305c2f98465fe646d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Kai Ninomiya 2020-07-10 18:19:38 +00:00 committed by Commit Bot service account
parent d82ef86b79
commit 6328356129
44 changed files with 53 additions and 78 deletions

View File

@ -197,4 +197,4 @@ class LinkedList {
private: private:
LinkNode<T> root_; LinkNode<T> root_;
}; };
#endif // COMMON_LINKED_LIST_H #endif // COMMON_LINKED_LIST_H

View File

@ -159,4 +159,4 @@ uint64_t RoundUp(uint64_t n, uint64_t m) {
ASSERT(n > 0); ASSERT(n > 0);
ASSERT(m <= std::numeric_limits<uint64_t>::max() - n); ASSERT(m <= std::numeric_limits<uint64_t>::max() - n);
return ((n + m - 1) / m) * m; return ((n + m - 1) / m) * m;
} }

View File

@ -280,8 +280,8 @@ SerialStorage<Derived>::ConstIterator::ConstIterator(
} }
template <typename Derived> template <typename Derived>
typename SerialStorage<Derived>::ConstIterator& SerialStorage<Derived>::ConstIterator:: typename SerialStorage<Derived>::ConstIterator&
operator++() { SerialStorage<Derived>::ConstIterator::operator++() {
const Value* vectorData = mStorageIterator->second.data(); const Value* vectorData = mStorageIterator->second.data();
if (mSerialIterator == nullptr) { if (mSerialIterator == nullptr) {

View File

@ -39,9 +39,7 @@ dawn_json_generator("emscripten_bits_gen") {
source_set("dawn_headers") { source_set("dawn_headers") {
all_dependent_configs = [ "${dawn_root}/src/common:dawn_public_include_dirs" ] all_dependent_configs = [ "${dawn_root}/src/common:dawn_public_include_dirs" ]
public_deps = [ public_deps = [ ":dawn_headers_gen" ]
":dawn_headers_gen",
]
sources = get_target_outputs(":dawn_headers_gen") sources = get_target_outputs(":dawn_headers_gen")
sources += [ "${dawn_root}/src/include/dawn/dawn_wsi.h" ] sources += [ "${dawn_root}/src/include/dawn/dawn_wsi.h" ]
@ -53,9 +51,7 @@ source_set("dawn_headers") {
dawn_json_generator("dawncpp_headers_gen") { dawn_json_generator("dawncpp_headers_gen") {
target = "dawncpp_headers" target = "dawncpp_headers"
outputs = [ outputs = [ "src/include/dawn/webgpu_cpp.h" ]
"src/include/dawn/webgpu_cpp.h",
]
} }
source_set("dawncpp_headers") { source_set("dawncpp_headers") {
@ -74,9 +70,7 @@ source_set("dawncpp_headers") {
dawn_json_generator("dawncpp_gen") { dawn_json_generator("dawncpp_gen") {
target = "dawncpp" target = "dawncpp"
outputs = [ outputs = [ "src/dawn/webgpu_cpp.cpp" ]
"src/dawn/webgpu_cpp.cpp",
]
} }
source_set("dawncpp") { source_set("dawncpp") {
@ -93,20 +87,14 @@ source_set("dawncpp") {
dawn_json_generator("dawn_proc_gen") { dawn_json_generator("dawn_proc_gen") {
target = "dawn_proc" target = "dawn_proc"
outputs = [ outputs = [ "src/dawn/dawn_proc.c" ]
"src/dawn/dawn_proc.c",
]
} }
dawn_component("dawn_proc") { dawn_component("dawn_proc") {
DEFINE_PREFIX = "WGPU" DEFINE_PREFIX = "WGPU"
public_deps = [ public_deps = [ ":dawn_headers" ]
":dawn_headers", deps = [ ":dawn_proc_gen" ]
]
deps = [
":dawn_proc_gen",
]
sources = get_target_outputs(":dawn_proc_gen") sources = get_target_outputs(":dawn_proc_gen")
sources += [ "${dawn_root}/src/include/dawn/dawn_proc.h" ] sources += [ "${dawn_root}/src/include/dawn/dawn_proc.h" ]
} }

View File

@ -415,7 +415,7 @@ namespace dawn_native {
} }
if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) { if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) {
mBindingInfo[i].viewDimension = wgpu::TextureViewDimension::e2D; mBindingInfo[i].viewDimension = wgpu::TextureViewDimension::e2D;
} else { } else {
mBindingInfo[i].viewDimension = binding.viewDimension; mBindingInfo[i].viewDimension = binding.viewDimension;
} }

View File

@ -108,4 +108,4 @@ namespace dawn_native {
} }
mReleasedStagingBuffers.ClearUpTo(lastCompletedSerial); mReleasedStagingBuffers.ClearUpTo(lastCompletedSerial);
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -145,7 +145,7 @@ namespace dawn_native {
# if defined(DAWN_ENABLE_SWIFTSHADER) # if defined(DAWN_ENABLE_SWIFTSHADER)
Register(vulkan::Connect(this, true), wgpu::BackendType::Vulkan); Register(vulkan::Connect(this, true), wgpu::BackendType::Vulkan);
# endif // defined(DAWN_ENABLE_SWIFTSHADER) # endif // defined(DAWN_ENABLE_SWIFTSHADER)
#endif // defined(DAWN_ENABLE_BACKEND_VULKAN) #endif // defined(DAWN_ENABLE_BACKEND_VULKAN)
#if defined(DAWN_ENABLE_BACKEND_OPENGL) #if defined(DAWN_ENABLE_BACKEND_OPENGL)
Register(opengl::Connect(this), wgpu::BackendType::OpenGL); Register(opengl::Connect(this), wgpu::BackendType::OpenGL);
#endif // defined(DAWN_ENABLE_BACKEND_OPENGL) #endif // defined(DAWN_ENABLE_BACKEND_OPENGL)

View File

@ -43,4 +43,4 @@ namespace dawn_native {
} }
mInflightRequests.ClearUpTo(finishedSerial); mInflightRequests.ClearUpTo(finishedSerial);
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -102,4 +102,4 @@ namespace dawn_native {
return bgl; return bgl;
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -316,4 +316,4 @@ namespace dawn_native {
return true; return true;
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -28,4 +28,4 @@ namespace dawn_native {
} // namespace dawn_native } // namespace dawn_native
#endif // DAWNNATIVE_RESOURCEHEAP_H_ #endif // DAWNNATIVE_RESOURCEHEAP_H_

View File

@ -50,4 +50,4 @@ namespace dawn_native {
mResourceHeap = nullptr; mResourceHeap = nullptr;
mInfo = {}; mInfo = {};
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -56,4 +56,4 @@ namespace dawn_native {
}; };
} // namespace dawn_native } // namespace dawn_native
#endif // DAWNNATIVE_RINGBUFFERALLOCATOR_H_ #endif // DAWNNATIVE_RINGBUFFERALLOCATOR_H_

View File

@ -26,4 +26,4 @@ namespace dawn_native {
void* StagingBufferBase::GetMappedPointer() const { void* StagingBufferBase::GetMappedPointer() const {
return mMappedPointer; return mMappedPointer;
} }
} // namespace dawn_native } // namespace dawn_native

View File

@ -38,4 +38,4 @@ namespace dawn_native {
} // namespace dawn_native } // namespace dawn_native
#endif // DAWNNATIVE_STAGINGBUFFER_H_ #endif // DAWNNATIVE_STAGINGBUFFER_H_

View File

@ -47,4 +47,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BACKENDD3D12_H_ #endif // DAWNNATIVE_D3D12_BACKENDD3D12_H_

View File

@ -50,4 +50,4 @@ namespace dawn_native { namespace d3d12 {
mBaseDescriptor = {0}; mBaseDescriptor = {0};
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -44,4 +44,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_

View File

@ -42,4 +42,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_D3D12ERROR_H_ #endif // DAWNNATIVE_D3D12_D3D12ERROR_H_

View File

@ -37,4 +37,4 @@ namespace dawn_native { namespace d3d12 {
ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter); ResultOrError<D3D12DeviceInfo> GatherDeviceInfo(const Adapter& adapter);
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_D3D12INFO_H_ #endif // DAWNNATIVE_D3D12_D3D12INFO_H_

View File

@ -36,4 +36,4 @@ namespace dawn_native { namespace d3d12 {
Serial GPUDescriptorHeapAllocation::GetHeapSerial() const { Serial GPUDescriptorHeapAllocation::GetHeapSerial() const {
return mHeapSerial; return mHeapSerial;
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -40,4 +40,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_ #endif // DAWNNATIVE_D3D12_CPUDESCRIPTORHEAPALLOCATION_H_

View File

@ -28,4 +28,4 @@ namespace dawn_native { namespace d3d12 {
return mD3d12Heap.Get(); return mD3d12Heap.Get();
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -37,4 +37,4 @@ namespace dawn_native { namespace d3d12 {
}; };
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_HEAPD3D12_H_ #endif // DAWNNATIVE_D3D12_HEAPD3D12_H_

View File

@ -73,4 +73,4 @@ namespace dawn_native { namespace d3d12 {
bool Pageable::IsResidencyLocked() const { bool Pageable::IsResidencyLocked() const {
return mResidencyLockRefCount != 0; return mResidencyLockRefCount != 0;
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -234,4 +234,4 @@ namespace dawn_native { namespace d3d12 {
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS; D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS;
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -88,4 +88,4 @@ namespace dawn_native { namespace d3d12 {
}; };
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RENDERPASSBUILDERD3D12_H_ #endif // DAWNNATIVE_D3D12_RENDERPASSBUILDERD3D12_H_

View File

@ -327,7 +327,6 @@ namespace dawn_native { namespace d3d12 {
wgpu::ShaderStage renderStages = wgpu::ShaderStage::Vertex | wgpu::ShaderStage::Fragment; wgpu::ShaderStage renderStages = wgpu::ShaderStage::Vertex | wgpu::ShaderStage::Fragment;
for (auto stage : IterateStages(renderStages)) { for (auto stage : IterateStages(renderStages)) {
std::string hlslSource; std::string hlslSource;
DAWN_TRY_ASSIGN(hlslSource, modules[stage]->GetHLSLSource(ToBackend(GetLayout()))); DAWN_TRY_ASSIGN(hlslSource, modules[stage]->GetHLSLSource(ToBackend(GetLayout())));

View File

@ -367,4 +367,4 @@ namespace dawn_native { namespace d3d12 {
} }
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -80,4 +80,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_RESIDENCYMANAGERD3D12_H_ #endif // DAWNNATIVE_D3D12_RESIDENCYMANAGERD3D12_H_

View File

@ -164,4 +164,4 @@ namespace dawn_native { namespace d3d12 {
const SamplerHeapCacheEntry* b) const { const SamplerHeapCacheEntry* b) const {
return a->mSamplers == b->mSamplers; return a->mSamplers == b->mSamplers;
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -105,4 +105,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SAMPLERHEAPCACHE_H_ #endif // DAWNNATIVE_D3D12_SAMPLERHEAPCACHE_H_

View File

@ -209,4 +209,4 @@ namespace dawn_native { namespace d3d12 {
ID3D12DescriptorHeap* ShaderVisibleDescriptorHeap::GetD3D12DescriptorHeap() const { ID3D12DescriptorHeap* ShaderVisibleDescriptorHeap::GetD3D12DescriptorHeap() const {
return mD3d12DescriptorHeap.Get(); return mD3d12DescriptorHeap.Get();
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -94,4 +94,4 @@ namespace dawn_native { namespace d3d12 {
}; };
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATOR_H_ #endif // DAWNNATIVE_D3D12_SHADERVISIBLEDESCRIPTORALLOCATOR_H_

View File

@ -149,4 +149,4 @@ namespace dawn_native { namespace d3d12 {
mAllocationsToDelete.ClearUpTo(completedSerial); mAllocationsToDelete.ClearUpTo(completedSerial);
} }
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12

View File

@ -82,4 +82,4 @@ namespace dawn_native { namespace d3d12 {
}} // namespace dawn_native::d3d12 }} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_STAGINGDESCRIPTORALLOCATOR_H_ #endif // DAWNNATIVE_D3D12_STAGINGDESCRIPTORALLOCATOR_H_

View File

@ -49,9 +49,7 @@ namespace dawn_native { namespace metal {
Device::Device(AdapterBase* adapter, Device::Device(AdapterBase* adapter,
id<MTLDevice> mtlDevice, id<MTLDevice> mtlDevice,
const DeviceDescriptor* descriptor) const DeviceDescriptor* descriptor)
: DeviceBase(adapter, descriptor), : DeviceBase(adapter, descriptor), mMtlDevice([mtlDevice retain]), mCompletedSerial(0) {
mMtlDevice([mtlDevice retain]),
mCompletedSerial(0) {
[mMtlDevice retain]; [mMtlDevice retain];
} }

View File

@ -24,7 +24,5 @@ source_set("dawn_platform") {
"tracing/TraceEvent.h", "tracing/TraceEvent.h",
] ]
deps = [ deps = [ "${dawn_root}/src/common" ]
"${dawn_root}/src/common",
]
} }

View File

@ -20,9 +20,7 @@
namespace dawn_wire { namespace client { namespace dawn_wire { namespace client {
Client::Client(CommandSerializer* serializer, MemoryTransferService* memoryTransferService) Client::Client(CommandSerializer* serializer, MemoryTransferService* memoryTransferService)
: ClientBase(), : ClientBase(), mSerializer(serializer), mMemoryTransferService(memoryTransferService) {
mSerializer(serializer),
mMemoryTransferService(memoryTransferService) {
if (mMemoryTransferService == nullptr) { if (mMemoryTransferService == nullptr) {
// If a MemoryTransferService is not provided, fall back to inline memory. // If a MemoryTransferService is not provided, fall back to inline memory.
mOwnedMemoryTransferService = CreateInlineMemoryTransferService(); mOwnedMemoryTransferService = CreateInlineMemoryTransferService();

View File

@ -23,6 +23,7 @@
#include <vector> #include <vector>
namespace dawn_native { namespace vulkan { namespace dawn_native { namespace vulkan {
DAWN_NATIVE_EXPORT VkInstance GetInstance(WGPUDevice device); DAWN_NATIVE_EXPORT VkInstance GetInstance(WGPUDevice device);
DAWN_NATIVE_EXPORT PFN_vkVoidFunction GetInstanceProcAddr(WGPUDevice device, const char* pName); DAWN_NATIVE_EXPORT PFN_vkVoidFunction GetInstanceProcAddr(WGPUDevice device, const char* pName);
@ -75,6 +76,7 @@ namespace dawn_native { namespace vulkan {
DAWN_NATIVE_EXPORT WGPUTexture WrapVulkanImage(WGPUDevice cDevice, DAWN_NATIVE_EXPORT WGPUTexture WrapVulkanImage(WGPUDevice cDevice,
const ExternalImageDescriptor* descriptor); const ExternalImageDescriptor* descriptor);
#endif // __linux__ #endif // __linux__
}} // namespace dawn_native::vulkan }} // namespace dawn_native::vulkan
#endif // DAWNNATIVE_VULKANBACKEND_H_ #endif // DAWNNATIVE_VULKANBACKEND_H_

View File

@ -26,7 +26,7 @@ namespace dawn_wire {
namespace client { namespace client {
class Client; class Client;
class MemoryTransferService; class MemoryTransferService;
} } // namespace client
struct ReservedTexture { struct ReservedTexture {
WGPUTexture texture; WGPUTexture texture;

View File

@ -26,7 +26,7 @@ namespace dawn_wire {
namespace server { namespace server {
class Server; class Server;
class MemoryTransferService; class MemoryTransferService;
} } // namespace server
struct DAWN_WIRE_EXPORT WireServerDescriptor { struct DAWN_WIRE_EXPORT WireServerDescriptor {
WGPUDevice device; WGPUDevice device;

View File

@ -25,9 +25,7 @@ import("${dawn_root}/scripts/dawn_features.gni")
# use the real library from third_party/. # use the real library from third_party/.
if (dawn_supports_glfw_for_windowing) { if (dawn_supports_glfw_for_windowing) {
group("dawn_glfw") { group("dawn_glfw") {
public_deps = [ public_deps = [ "${dawn_root}/third_party/gn/glfw" ]
"${dawn_root}/third_party/gn/glfw",
]
} }
} else if (is_fuchsia) { } else if (is_fuchsia) {
# The mock implementation of GLFW on Fuchsia # The mock implementation of GLFW on Fuchsia
@ -52,9 +50,7 @@ if (dawn_supports_glfw_for_windowing) {
"Glfw3Fuchsia.cpp", "Glfw3Fuchsia.cpp",
] ]
public_configs = [ ":dawn_glfw_public_config" ] public_configs = [ ":dawn_glfw_public_config" ]
deps = [ deps = [ "${dawn_root}/src/common" ]
"${dawn_root}/src/common",
]
} }
} else { } else {
# Just skip GLFW on other systems # Just skip GLFW on other systems
@ -118,9 +114,7 @@ static_library("dawn_utils") {
} }
} }
public_deps = [ public_deps = [ "${dawn_root}/src/dawn:dawncpp_headers" ]
"${dawn_root}/src/dawn:dawncpp_headers",
]
} }
############################################################################### ###############################################################################
@ -137,9 +131,7 @@ if (dawn_standalone) {
"BackendBinding.h", "BackendBinding.h",
] ]
public_deps = [ public_deps = [ "${dawn_root}/src/dawn:dawn_headers" ]
"${dawn_root}/src/dawn:dawn_headers",
]
deps = [ deps = [
":dawn_glfw", ":dawn_glfw",

View File

@ -20,4 +20,4 @@ namespace utils {
void USleep(unsigned int usecs); void USleep(unsigned int usecs);
} }
#endif // UTILS_SYSTEMUTILS_H_ #endif // UTILS_SYSTEMUTILS_H_