From 0d2aedf097a4c3732dff03fc901dfd73da909968 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 18 Nov 2022 11:57:37 +0000 Subject: [PATCH] Run ./tools/format Change-Id: I4a9f375f5c383d02917c2ade4c83c3d4fc458165 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110102 Commit-Queue: Ben Clayton Reviewed-by: Dan Sinclair Kokoro: Kokoro --- include/dawn/wire/WireClient.h | 3 +- src/dawn/native/metal/CommandBufferMTL.h | 2 +- src/dawn/native/metal/TextureMTL.mm | 3 +- .../end2end/DepthStencilSamplingTests.cpp | 28 +++++++++---------- .../InternalUsageValidationTests.cpp | 1 - src/tint/inspector/entry_point.cc | 1 - src/tint/number.cc | 4 +-- ...ule_scope_var_to_entry_point_param_test.cc | 4 +-- src/tint/utils/compiler_macros.h | 2 +- 9 files changed, 22 insertions(+), 26 deletions(-) diff --git a/include/dawn/wire/WireClient.h b/include/dawn/wire/WireClient.h index 93cc199990..02b4c075a4 100644 --- a/include/dawn/wire/WireClient.h +++ b/include/dawn/wire/WireClient.h @@ -70,8 +70,7 @@ class DAWN_WIRE_EXPORT WireClient : public CommandHandler { const volatile char* HandleCommands(const volatile char* commands, size_t size) override; - ReservedTexture ReserveTexture(WGPUDevice device, - const WGPUTextureDescriptor* descriptor); + ReservedTexture ReserveTexture(WGPUDevice device, const WGPUTextureDescriptor* descriptor); ReservedSwapChain ReserveSwapChain(WGPUDevice device); ReservedDevice ReserveDevice(); ReservedInstance ReserveInstance(); diff --git a/src/dawn/native/metal/CommandBufferMTL.h b/src/dawn/native/metal/CommandBufferMTL.h index 2976ec81dd..76499fe083 100644 --- a/src/dawn/native/metal/CommandBufferMTL.h +++ b/src/dawn/native/metal/CommandBufferMTL.h @@ -25,7 +25,7 @@ namespace dawn::native { class CommandEncoder; struct BeginComputePassCmd; struct BeginRenderPassCmd; -} +} // namespace dawn::native namespace dawn::native::metal { diff --git a/src/dawn/native/metal/TextureMTL.mm b/src/dawn/native/metal/TextureMTL.mm index 0df13ea02e..a26ad65b22 100644 --- a/src/dawn/native/metal/TextureMTL.mm +++ b/src/dawn/native/metal/TextureMTL.mm @@ -1090,8 +1090,7 @@ MaybeError TextureView::Initialize(const TextureViewDescriptor* descriptor) { if (@available(macOS 10.12, iOS 10.0, *)) { if (textureFormat == MTLPixelFormatDepth32Float_Stencil8) { viewFormat = MTLPixelFormatX32_Stencil8; - } - else { + } else { UNREACHABLE(); } } else { diff --git a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp index 9ea5600984..b99ac022a3 100644 --- a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp @@ -471,25 +471,25 @@ class DepthStencilSamplingTest : public DawnTestWithParams textureValues) { - DoSamplingTestImpl(aspectAndSamplerType, - CreateSamplingRenderPipeline({TestAspectAndSamplerType::StencilAsUint}, - {0, 1, 2, 3}), - format, textureValues, 4, [&](uint32_t expected, wgpu::Buffer buffer) { - EXPECT_BUFFER(buffer, 0, 4 * sizeof(uint32_t), - new ExtraStencilComponentsExpectation(expected)); - }); + DoSamplingTestImpl( + aspectAndSamplerType, + CreateSamplingRenderPipeline({TestAspectAndSamplerType::StencilAsUint}, {0, 1, 2, 3}), + format, textureValues, 4, [&](uint32_t expected, wgpu::Buffer buffer) { + EXPECT_BUFFER(buffer, 0, 4 * sizeof(uint32_t), + new ExtraStencilComponentsExpectation(expected)); + }); } void DoSamplingExtraStencilComponentsComputeTest(TestAspectAndSamplerType aspectAndSamplerType, wgpu::TextureFormat format, std::vector textureValues) { - DoSamplingTestImpl(aspectAndSamplerType, - CreateSamplingComputePipeline({TestAspectAndSamplerType::StencilAsUint}, - {0, 1, 2, 3}), - format, textureValues, 4, [&](uint32_t expected, wgpu::Buffer buffer) { - EXPECT_BUFFER(buffer, 0, 4 * sizeof(uint32_t), - new ExtraStencilComponentsExpectation(expected)); - }); + DoSamplingTestImpl( + aspectAndSamplerType, + CreateSamplingComputePipeline({TestAspectAndSamplerType::StencilAsUint}, {0, 1, 2, 3}), + format, textureValues, 4, [&](uint32_t expected, wgpu::Buffer buffer) { + EXPECT_BUFFER(buffer, 0, 4 * sizeof(uint32_t), + new ExtraStencilComponentsExpectation(expected)); + }); } static bool CompareFunctionPasses(float compareRef, diff --git a/src/dawn/tests/unittests/validation/InternalUsageValidationTests.cpp b/src/dawn/tests/unittests/validation/InternalUsageValidationTests.cpp index 7e03799d91..0283e256df 100644 --- a/src/dawn/tests/unittests/validation/InternalUsageValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/InternalUsageValidationTests.cpp @@ -219,7 +219,6 @@ TEST_F(TextureInternalUsageValidationTest, InternalUsagesAreNotReflected) { ASSERT_EQ(texture.GetUsage(), wgpu::TextureUsage::CopySrc); } - // Test the validation of internal usages against command encoders with and without // useInternalUsages. TEST_F(TextureInternalUsageValidationTest, CommandValidation) { diff --git a/src/tint/inspector/entry_point.cc b/src/tint/inspector/entry_point.cc index 8cbca14959..a6c3b8c4f0 100644 --- a/src/tint/inspector/entry_point.cc +++ b/src/tint/inspector/entry_point.cc @@ -35,5 +35,4 @@ EntryPoint::EntryPoint(EntryPoint&) = default; EntryPoint::EntryPoint(EntryPoint&&) = default; EntryPoint::~EntryPoint() = default; - } // namespace tint::inspector diff --git a/src/tint/number.cc b/src/tint/number.cc index da558512c8..629091b915 100644 --- a/src/tint/number.cc +++ b/src/tint/number.cc @@ -74,10 +74,10 @@ f16::type f16::Quantize(f16::type value) { uint32_t u32 = utils::Bitcast(value); if ((u32 & ~kF32SignMask) == 0) { - return value; // +/- zero + return value; // +/- zero } if ((u32 & kF32ExponentMask) == kF32ExponentMask) { // exponent all 1's - return value; // inf or nan + return value; // inf or nan } // We are now going to quantize a f32 number into subnormal f16 and store the result value back diff --git a/src/tint/transform/module_scope_var_to_entry_point_param_test.cc b/src/tint/transform/module_scope_var_to_entry_point_param_test.cc index 821542b990..7ae15be8a2 100644 --- a/src/tint/transform/module_scope_var_to_entry_point_param_test.cc +++ b/src/tint/transform/module_scope_var_to_entry_point_param_test.cc @@ -329,7 +329,7 @@ fn main() { EXPECT_EQ(expect, str(got)); } -// TODO(crbug.com/tint/1758): Requires support for workgroup pointer parameters, which is +// TODO(crbug.com/tint/1758): Requires support for workgroup pointer parameters, which is // unsupported until WGSL 1.1 TEST_F(ModuleScopeVarToEntryPointParamTest, DISABLED_FoldAddressOfDeref) { auto* src = R"( @@ -370,7 +370,7 @@ fn main() { EXPECT_EQ(expect, str(got)); } -// TODO(crbug.com/tint/1758): Requires support for workgroup pointer parameters, which is +// TODO(crbug.com/tint/1758): Requires support for workgroup pointer parameters, which is // unsupported until WGSL 1.1 TEST_F(ModuleScopeVarToEntryPointParamTest, DISABLED_FoldAddressOfDeref_OutOfOrder) { auto* src = R"( diff --git a/src/tint/utils/compiler_macros.h b/src/tint/utils/compiler_macros.h index b3cca3cb11..b0df241b68 100644 --- a/src/tint/utils/compiler_macros.h +++ b/src/tint/utils/compiler_macros.h @@ -50,7 +50,7 @@ #define TINT_DISABLE_WARNING_OLD_STYLE_CAST _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") #define TINT_DISABLE_WARNING_SIGN_CONVERSION \ _Pragma("clang diagnostic ignored \"-Wsign-conversion\"") -#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */ +#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */ #define TINT_DISABLE_WARNING_WEAK_VTABLES _Pragma("clang diagnostic ignored \"-Wweak-vtables\"") // clang-format off