Run the code formatter.
clang-format was recently changed to the version pulled in from build/
DEPS instead of Dawn DEPS. This is a slightly different version of
clang-format so formats slightly differently.
This CL is the result of running `tools/format` over the repo.
Change-Id: I145d0080b0167b50b1e0d5daac7ad0e31534d9aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/191160
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/dawn/native/opengl/DeviceGL.cpp b/src/dawn/native/opengl/DeviceGL.cpp
index f58c583..6195811 100644
--- a/src/dawn/native/opengl/DeviceGL.cpp
+++ b/src/dawn/native/opengl/DeviceGL.cpp
@@ -103,10 +103,9 @@
}
if (type == GL_DEBUG_TYPE_ERROR) {
- dawn::WarningLog() << "OpenGL error:"
- << "\n Source: " << sourceText //
- << "\n ID: " << id //
- << "\n Severity: " << severityText //
+ dawn::WarningLog() << "OpenGL error:" << "\n Source: " << sourceText //
+ << "\n ID: " << id //
+ << "\n Severity: " << severityText //
<< "\n Message: " << message;
// Abort on an error when in Debug mode.
diff --git a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
index 4ea9821..b53b28e 100644
--- a/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
+++ b/src/dawn/tests/end2end/DepthStencilCopyTests.cpp
@@ -1543,8 +1543,7 @@
ExpectAttachmentDepthTestData(dst, GetParam().mTextureFormat, mipWidth,
mipHeight, dstArrayLayer + z, mipLevel,
GetExpectedDepthData(mipLevel))
- << "depth aspect"
- << "\nmipLevelCount: " << mipLevelCount
+ << "depth aspect" << "\nmipLevelCount: " << mipLevelCount
<< "\narrayLayerCount: " << arrayLayerCount
<< "\nmipLevel: " << mipLevel
<< "\nsrcArrayLayer: " << srcArrayLayer + z
@@ -1555,8 +1554,7 @@
ExpectAttachmentStencilTestData(dst, GetParam().mTextureFormat,
mipWidth, mipHeight, dstArrayLayer + z,
mipLevel, stencilValue)
- << "stencil aspect"
- << "\nmipLevelCount: " << mipLevelCount
+ << "stencil aspect" << "\nmipLevelCount: " << mipLevelCount
<< "\narrayLayerCount: " << arrayLayerCount
<< "\nmipLevel: " << mipLevel
<< "\nsrcArrayLayer: " << srcArrayLayer + z
diff --git a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp
index a105959..8a75ed2 100644
--- a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp
+++ b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp
@@ -465,13 +465,11 @@
return testing::AssertionSuccess();
}
- return testing::AssertionFailure() << "Expected stencil data to be "
- << "(" << ssss[0] << ", " << ssss[1] << ", "
- << ssss[2] << ", " << ssss[3] << ") or "
- << "(" << s001[0] << ", " << s001[1] << ", "
- << s001[2] << ", " << s001[3] << "). Got "
- << "(" << data[0] << ", " << data[1] << ", "
- << data[2] << ", " << data[3] << ").";
+ return testing::AssertionFailure()
+ << "Expected stencil data to be " << "(" << ssss[0] << ", " << ssss[1] << ", "
+ << ssss[2] << ", " << ssss[3] << ") or " << "(" << s001[0] << ", " << s001[1]
+ << ", " << s001[2] << ", " << s001[3] << "). Got " << "(" << data[0] << ", "
+ << data[1] << ", " << data[2] << ", " << data[3] << ").";
}
private:
diff --git a/src/dawn/tests/end2end/MaxLimitTests.cpp b/src/dawn/tests/end2end/MaxLimitTests.cpp
index 1741cf6..c80a342 100644
--- a/src/dawn/tests/end2end/MaxLimitTests.cpp
+++ b/src/dawn/tests/end2end/MaxLimitTests.cpp
@@ -594,13 +594,13 @@
wgpu::TextureFormat::R8Unorm, expectedValue, wgpu::TextureUsage::TextureBinding);
bgEntries.push_back({nullptr, binding, nullptr, 0, 0, nullptr, texture.CreateView()});
- interface << "@group(0) @binding(" << binding++ << ") "
- << "var tex" << i << " : texture_2d<f32>;\n";
+ interface << "@group(0) @binding(" << binding++ << ") " << "var tex" << i
+ << " : texture_2d<f32>;\n";
bgEntries.push_back({nullptr, binding, nullptr, 0, 0, device.CreateSampler(), nullptr});
- interface << "@group(0) @binding(" << binding++ << ")"
- << "var samp" << i << " : sampler;\n";
+ interface << "@group(0) @binding(" << binding++ << ")" << "var samp" << i
+ << " : sampler;\n";
body << "if (abs(textureSampleLevel(tex" << i << ", samp" << i
<< ", vec2f(0.5, 0.5), 0.0).r - " << expectedValue++ << ".0 / 255.0) > 0.0001) {\n";
@@ -612,8 +612,8 @@
wgpu::TextureFormat::R32Uint, expectedValue, wgpu::TextureUsage::StorageBinding);
bgEntries.push_back({nullptr, binding, nullptr, 0, 0, nullptr, texture.CreateView()});
- interface << "@group(0) @binding(" << binding++ << ") "
- << "var image" << i << " : texture_storage_2d<r32uint, write>;\n";
+ interface << "@group(0) @binding(" << binding++ << ") " << "var image" << i
+ << " : texture_storage_2d<r32uint, write>;\n";
body << "_ = image" << i << ";";
}
@@ -627,8 +627,8 @@
value : u32
}
)";
- interface << "@group(0) @binding(" << binding++ << ") "
- << "var<uniform> ubuf" << i << " : UniformBuffer" << i << ";\n";
+ interface << "@group(0) @binding(" << binding++ << ") " << "var<uniform> ubuf" << i
+ << " : UniformBuffer" << i << ";\n";
body << "if (ubuf" << i << ".value != " << expectedValue++ << "u) {\n";
body << " return;\n";
@@ -644,8 +644,8 @@
value : u32
}
)";
- interface << "@group(0) @binding(" << binding++ << ") "
- << "var<storage, read> sbuf" << i << " : ReadOnlyStorageBuffer" << i << ";\n";
+ interface << "@group(0) @binding(" << binding++ << ") " << "var<storage, read> sbuf" << i
+ << " : ReadOnlyStorageBuffer" << i << ";\n";
body << "if (sbuf" << i << ".value != " << expectedValue++ << "u) {\n";
body << " return;\n";
diff --git a/src/dawn/tests/end2end/RenderPassTests.cpp b/src/dawn/tests/end2end/RenderPassTests.cpp
index f11aa93..b0c1330 100644
--- a/src/dawn/tests/end2end/RenderPassTests.cpp
+++ b/src/dawn/tests/end2end/RenderPassTests.cpp
@@ -365,8 +365,8 @@
std::vector<uint16_t> data(mipWidth * mipHeight, 0xCCCC);
EXPECT_TEXTURE_EQ(data.data(), tex, {0, 0, layer}, {mipWidth, mipHeight},
level)
- << "cleared texture data should have been 0xCCCC at:"
- << "\nlayer: " << layer << "\nlevel: " << level;
+ << "cleared texture data should have been 0xCCCC at:" << "\nlayer: "
+ << layer << "\nlevel: " << level;
} else {
// Otherwise, check the other subresources have the orignal contents.
// Without the workaround, they are 0.
@@ -375,8 +375,8 @@
std::vector<uint16_t> data(mipWidth * mipHeight, value);
EXPECT_TEXTURE_EQ(data.data(), tex, {0, 0, layer}, {mipWidth, mipHeight},
level)
- << "written texture data should still be " << value << " at:"
- << "\nlayer: " << layer << "\nlevel: " << level;
+ << "written texture data should still be " << value
+ << " at:" << "\nlayer: " << layer << "\nlevel: " << level;
}
}
}
diff --git a/src/dawn/tests/end2end/StorageTextureTests.cpp b/src/dawn/tests/end2end/StorageTextureTests.cpp
index 6ac476f..e92ab47 100644
--- a/src/dawn/tests/end2end/StorageTextureTests.cpp
+++ b/src/dawn/tests/end2end/StorageTextureTests.cpp
@@ -190,8 +190,8 @@
wgpu::TextureViewDimension dimension,
uint32_t binding) {
std::ostringstream ostream;
- ostream << "@group(0) @binding(" << binding << ") "
- << "var storageImage" << binding << " : ";
+ ostream << "@group(0) @binding(" << binding << ") " << "var storageImage" << binding
+ << " : ";
switch (dimension) {
case wgpu::TextureViewDimension::e1D:
ostream << "texture_storage_1d";
diff --git a/src/dawn/tests/end2end/SwapChainTests.cpp b/src/dawn/tests/end2end/SwapChainTests.cpp
index 636a101..ad626ee 100644
--- a/src/dawn/tests/end2end/SwapChainTests.cpp
+++ b/src/dawn/tests/end2end/SwapChainTests.cpp
@@ -431,8 +431,9 @@
auto desc = baseDescriptor;
desc.usage = supportedUsages | wgpu::TextureUsage::StorageBinding;
- ASSERT_DEVICE_ERROR_MSG({ auto swapchain = CreateSwapChain(surface, &desc); },
- testing::HasSubstr("is not supported"));
+ ASSERT_DEVICE_ERROR_MSG(
+ { auto swapchain = CreateSwapChain(surface, &desc); },
+ testing::HasSubstr("is not supported"));
}
// Test copying to a swapchain texture when it is supported.
diff --git a/src/dawn/tests/end2end/VertexFormatTests.cpp b/src/dawn/tests/end2end/VertexFormatTests.cpp
index 744b2a9..37147bd 100644
--- a/src/dawn/tests/end2end/VertexFormatTests.cpp
+++ b/src/dawn/tests/end2end/VertexFormatTests.cpp
@@ -391,8 +391,8 @@
vs << " var " << testVal << " : " << expectedDataType << ";\n";
vs << " var " << expectedVal << " : " << expectedDataType << ";\n";
vs << " " << testVal << " = input.test" << suffix << ";\n";
- vs << " " << expectedVal << " = expected[input.VertexIndex]"
- << "[" << component << "];\n";
+ vs << " " << expectedVal << " = expected[input.VertexIndex]" << "[" << component
+ << "];\n";
if (!isInputTypeFloat) { // Integer / unsigned integer need to match exactly.
vs << " success = success && (" << testVal << " == " << expectedVal << ");\n";
} else {
diff --git a/src/dawn/tests/perf_tests/DawnPerfTest.cpp b/src/dawn/tests/perf_tests/DawnPerfTest.cpp
index a78c66a..c5178ed 100644
--- a/src/dawn/tests/perf_tests/DawnPerfTest.cpp
+++ b/src/dawn/tests/perf_tests/DawnPerfTest.cpp
@@ -69,15 +69,10 @@
uint64_t microseconds = static_cast<uint64_t>(traceEvent.timestamp * 1000.0 * 1000.0);
- outFile << ", { "
- << "\"name\": \"" << traceEvent.name << "\", "
- << "\"cat\": \"" << category << "\", "
- << "\"ph\": \"" << traceEvent.phase << "\", "
- << "\"id\": " << traceEvent.id << ", "
- << "\"tid\": " << traceEvent.threadId << ", "
- << "\"ts\": " << microseconds << ", "
- << "\"pid\": \"Dawn\""
- << " }";
+ outFile << ", { " << "\"name\": \"" << traceEvent.name << "\", " << "\"cat\": \""
+ << category << "\", " << "\"ph\": \"" << traceEvent.phase << "\", "
+ << "\"id\": " << traceEvent.id << ", " << "\"tid\": " << traceEvent.threadId << ", "
+ << "\"ts\": " << microseconds << ", " << "\"pid\": \"Dawn\"" << " }";
}
outFile.close();
}
diff --git a/src/dawn/tests/perf_tests/MatrixVectorMultiplyPerf.cpp b/src/dawn/tests/perf_tests/MatrixVectorMultiplyPerf.cpp
index a6b022f..2aa0929 100644
--- a/src/dawn/tests/perf_tests/MatrixVectorMultiplyPerf.cpp
+++ b/src/dawn/tests/perf_tests/MatrixVectorMultiplyPerf.cpp
@@ -344,8 +344,7 @@
"@builtin(subgroup_size) sg_size : u32, "
"@builtin(subgroup_invocation_id) sg_id : u32"
") {\n";
- code << " var sum : vec4<AccType>"
- << ";\n";
+ code << " var sum : vec4<AccType>" << ";\n";
code << GenerateSubgroupCase(4) << " else " << GenerateSubgroupCase(8) << " else "
<< GenerateSubgroupCase(16) << " else " << GenerateSubgroupCase(32) << " else "
<< GenerateSubgroupCase(64);
@@ -354,10 +353,8 @@
} else {
code << "@compute @workgroup_size(64) fn main(@builtin(global_invocation_id) global_id : "
"vec3u) {\n";
- code << " var sum : vec4<AccType>"
- << ";\n";
- code << " for (var col = 0u; col < uniforms.packedCols; col++) {"
- << ";\n";
+ code << " var sum : vec4<AccType>" << ";\n";
+ code << " for (var col = 0u; col < uniforms.packedCols; col++) {" << ";\n";
code << " let v = " << valueLoad("col") << ";\n";
code << " " << loopBody("") << "\n";
code << " }\n";
diff --git a/src/dawn/tests/unittests/d3d12/CopySplitTests.cpp b/src/dawn/tests/unittests/d3d12/CopySplitTests.cpp
index 00cfe0d..7956e42 100644
--- a/src/dawn/tests/unittests/d3d12/CopySplitTests.cpp
+++ b/src/dawn/tests/unittests/d3d12/CopySplitTests.cpp
@@ -254,10 +254,9 @@
}
std::ostream& operator<<(std::ostream& os, const TextureSpec& textureSpec) {
- os << "TextureSpec("
- << "[(" << textureSpec.x << ", " << textureSpec.y << ", " << textureSpec.z << "), ("
- << textureSpec.width << ", " << textureSpec.height << ", " << textureSpec.depthOrArrayLayers
- << ")], " << textureSpec.texelBlockSizeInBytes << ")";
+ os << "TextureSpec(" << "[(" << textureSpec.x << ", " << textureSpec.y << ", " << textureSpec.z
+ << "), (" << textureSpec.width << ", " << textureSpec.height << ", "
+ << textureSpec.depthOrArrayLayers << ")], " << textureSpec.texelBlockSizeInBytes << ")";
return os;
}
diff --git a/src/dawn/tests/unittests/validation/WritableBufferBindingAliasingValidationTests.cpp b/src/dawn/tests/unittests/validation/WritableBufferBindingAliasingValidationTests.cpp
index 281d531..f8aac5e 100644
--- a/src/dawn/tests/unittests/validation/WritableBufferBindingAliasingValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/WritableBufferBindingAliasingValidationTests.cpp
@@ -62,9 +62,7 @@
size_t groupIndex = 0;
for (const auto& bindings : bindingsGroups) {
for (const BindingDescriptor& b : bindings) {
- ostream << "struct S" << index << " { "
- << "buffer : array<f32>"
- << "}\n";
+ ostream << "struct S" << index << " { " << "buffer : array<f32>" << "}\n";
ostream << "@group(" << groupIndex << ") @binding(" << b.binding.binding << ") ";
switch (b.type) {
case wgpu::BufferBindingType::Uniform:
@@ -93,9 +91,7 @@
for (const auto& bindings : bindingsGroups) {
for (const BindingDescriptor& b : bindings) {
if (b.visibility & stage) {
- ostream << "_ = b" << index << "."
- << "buffer[0]"
- << ";\n";
+ ostream << "_ = b" << index << "." << "buffer[0]" << ";\n";
}
index++;
}
diff --git a/src/dawn/tests/unittests/validation/WritableTextureBindingAliasingValidationTests.cpp b/src/dawn/tests/unittests/validation/WritableTextureBindingAliasingValidationTests.cpp
index 32f592c..21c295d 100644
--- a/src/dawn/tests/unittests/validation/WritableTextureBindingAliasingValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/WritableTextureBindingAliasingValidationTests.cpp
@@ -71,8 +71,8 @@
for (const auto& entries : descriptors) {
for (uint32_t bindingIndex = 0; bindingIndex < entries.size(); bindingIndex++) {
// All texture view binding format uses RGBA8Unorm in this test.
- ostream << "@group(" << groupIndex << ") @binding(" << bindingIndex << ") "
- << "var b" << index << " : texture_storage_2d_array<rgba8unorm, write>;\n";
+ ostream << "@group(" << groupIndex << ") @binding(" << bindingIndex << ") " << "var b"
+ << index << " : texture_storage_2d_array<rgba8unorm, write>;\n";
index++;
}
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index b2dc66c..caba468 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -1313,8 +1313,7 @@
}
if (!WriteFile(options.output_file, "wb", ToStdVector(pb.Get()))) {
- std::cerr << "Failed to write protobuf binary out to file"
- << "\n";
+ std::cerr << "Failed to write protobuf binary out to file" << "\n";
return false;
}
@@ -1342,8 +1341,7 @@
}
if (!WriteFile(options.output_file, "w", pb.Get())) {
- std::cerr << "Failed to write protobuf debug text out to file"
- << "\n";
+ std::cerr << "Failed to write protobuf debug text out to file" << "\n";
return false;
}
diff --git a/src/tint/lang/core/constant/eval.cc b/src/tint/lang/core/constant/eval.cc
index ee896b7..a8e1f84 100644
--- a/src/tint/lang/core/constant/eval.cc
+++ b/src/tint/lang/core/constant/eval.cc
@@ -195,16 +195,15 @@
template <typename VALUE_TY>
std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
StringStream ss;
- ss << "value " << value << " cannot be represented as "
- << "'" << target_ty << "'";
+ ss << "value " << value << " cannot be represented as " << "'" << target_ty << "'";
return ss.str();
}
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT exp) {
StringStream ss;
- ss << base << "^" << exp << " cannot be represented as "
- << "'" << FriendlyName<NumberT>() << "'";
+ ss << base << "^" << exp << " cannot be represented as " << "'" << FriendlyName<NumberT>()
+ << "'";
return ss.str();
}
diff --git a/src/tint/lang/core/constant/eval_test.h b/src/tint/lang/core/constant/eval_test.h
index 2158453..2cd60d0 100644
--- a/src/tint/lang/core/constant/eval_test.h
+++ b/src/tint/lang/core/constant/eval_test.h
@@ -253,8 +253,7 @@
template <typename VALUE_TY>
std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
StringStream ss;
- ss << "value " << value << " cannot be represented as "
- << "'" << target_ty << "'";
+ ss << "value " << value << " cannot be represented as " << "'" << target_ty << "'";
return ss.str();
}
@@ -262,8 +261,8 @@
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT exp) {
StringStream ss;
- ss << base << "^" << exp << " cannot be represented as "
- << "'" << FriendlyName<NumberT>() << "'";
+ ss << base << "^" << exp << " cannot be represented as " << "'" << FriendlyName<NumberT>()
+ << "'";
return ss.str();
}
diff --git a/src/tint/lang/core/type/input_attachment.cc b/src/tint/lang/core/type/input_attachment.cc
index 6697e33..11c96be 100644
--- a/src/tint/lang/core/type/input_attachment.cc
+++ b/src/tint/lang/core/type/input_attachment.cc
@@ -54,8 +54,7 @@
std::string InputAttachment::FriendlyName() const {
StringStream out;
- out << "input_attachment"
- << "<" << type_->FriendlyName() << ">";
+ out << "input_attachment" << "<" << type_->FriendlyName() << ">";
return out.str();
}
diff --git a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
index c292f98..b70890f 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -2367,8 +2367,7 @@
if (auto* vec = builtin->ReturnType()->As<core::type::Vector>()) {
width = std::to_string(vec->Width());
}
- out << "f16tof32(f32tof16"
- << "(";
+ out << "f16tof32(f32tof16" << "(";
if (!EmitExpression(out, expr->args[0])) {
return false;
}
diff --git a/src/tint/lang/spirv/reader/ast_parser/function.h b/src/tint/lang/spirv/reader/ast_parser/function.h
index f8f6bb9..5ac2cf0 100644
--- a/src/tint/lang/spirv/reader/ast_parser/function.h
+++ b/src/tint/lang/spirv/reader/ast_parser/function.h
@@ -198,8 +198,8 @@
/// @returns the stream so calls can be chained
template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
auto& operator<<(STREAM& o, const BlockInfo& bi) {
- o << "BlockInfo{"
- << " id: " << bi.id << " pos: " << bi.pos << " merge_for_header: " << bi.merge_for_header
+ o << "BlockInfo{" << " id: " << bi.id << " pos: " << bi.pos
+ << " merge_for_header: " << bi.merge_for_header
<< " continue_for_header: " << bi.continue_for_header
<< " header_for_merge: " << bi.header_for_merge
<< " is_continue_entire_loop: " << int(bi.is_continue_entire_loop) << "}";
@@ -374,8 +374,7 @@
/// @returns the stream so calls can be chained
template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
auto& operator<<(STREAM& o, const DefInfo& di) {
- o << "DefInfo{"
- << " inst.result_id: " << di.inst.result_id();
+ o << "DefInfo{" << " inst.result_id: " << di.inst.result_id();
if (di.local.has_value()) {
const auto& dil = di.local.value();
o << " block_pos: " << dil.block_pos << " num_uses: " << dil.num_uses
diff --git a/src/tint/lang/wgsl/intrinsic/table_test.cc b/src/tint/lang/wgsl/intrinsic/table_test.cc
index 0393998..82170f5 100644
--- a/src/tint/lang/wgsl/intrinsic/table_test.cc
+++ b/src/tint/lang/wgsl/intrinsic/table_test.cc
@@ -1189,10 +1189,9 @@
Case::Create<AInt, AInt, AInt, AInt, AInt>()
)); // clang-format on
-INSTANTIATE_TEST_SUITE_P(
- VecAFloat_VecAInt,
- IntrinsicTableAbstractBinaryTest,
- testing::Values( // clang-format off
+INSTANTIATE_TEST_SUITE_P(VecAFloat_VecAInt,
+ IntrinsicTableAbstractBinaryTest,
+ testing::Values( // clang-format off
// result | param lhs | param rhs | arg lhs | arg rhs
Case::Create<AFloatV, AFloatV, AFloatV, AFloatV, AFloatV>(),
Case::Create<AFloatV, AFloatV, AFloatV, AFloatV, AIntV>(),
@@ -1216,37 +1215,33 @@
Case::Create<f32V, f32V, f32V, f32V, AFloatV>()
)); // clang-format on
-INSTANTIATE_TEST_SUITE_P(
- AFloat_i32,
- IntrinsicTableAbstractBinaryTest,
- testing::Values( // clang-format off
+INSTANTIATE_TEST_SUITE_P(AFloat_i32,
+ IntrinsicTableAbstractBinaryTest,
+ testing::Values( // clang-format off
// result | param lhs | param rhs | arg lhs | arg rhs
Case::Create<void, void, void, AFloat, i32>(false),
Case::Create<void, void, void, i32, AFloat>(false)
)); // clang-format on
-INSTANTIATE_TEST_SUITE_P(
- VecAFloat_Veci32,
- IntrinsicTableAbstractBinaryTest,
- testing::Values( // clang-format off
+INSTANTIATE_TEST_SUITE_P(VecAFloat_Veci32,
+ IntrinsicTableAbstractBinaryTest,
+ testing::Values( // clang-format off
// result | param lhs | param rhs | arg lhs | arg rhs
Case::Create<void, void, void, AFloatV, i32V>(false),
Case::Create<void, void, void, i32V, AFloatV>(false)
)); // clang-format on
-INSTANTIATE_TEST_SUITE_P(
- AFloat_u32,
- IntrinsicTableAbstractBinaryTest,
- testing::Values( // clang-format off
+INSTANTIATE_TEST_SUITE_P(AFloat_u32,
+ IntrinsicTableAbstractBinaryTest,
+ testing::Values( // clang-format off
// result | param lhs | param rhs | arg lhs | arg rhs
Case::Create<void, void, void, AFloat, u32>(false),
Case::Create<void, void, void, u32, AFloat>(false)
)); // clang-format on
-INSTANTIATE_TEST_SUITE_P(
- VecAFloat_Vecu32,
- IntrinsicTableAbstractBinaryTest,
- testing::Values( // clang-format off
+INSTANTIATE_TEST_SUITE_P(VecAFloat_Vecu32,
+ IntrinsicTableAbstractBinaryTest,
+ testing::Values( // clang-format off
// result | param lhs | param rhs | arg lhs | arg rhs
Case::Create<void, void, void, AFloatV, u32V>(false),
Case::Create<void, void, void, u32V, AFloatV>(false)
diff --git a/src/tint/lang/wgsl/resolver/uniformity_test.cc b/src/tint/lang/wgsl/resolver/uniformity_test.cc
index 092cfd0..f4f7614 100644
--- a/src/tint/lang/wgsl/resolver/uniformity_test.cc
+++ b/src/tint/lang/wgsl/resolver/uniformity_test.cc
@@ -9095,8 +9095,7 @@
TEST_P(UniformityAnalysisDiagnosticFilterTest, Directive) {
auto& param = GetParam();
StringStream ss;
- ss << "diagnostic(" << param << ", derivative_uniformity);"
- << R"(
+ ss << "diagnostic(" << param << ", derivative_uniformity);" << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
@@ -9126,9 +9125,8 @@
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
-)"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- <<
+)" << "@diagnostic("
+ << param << ", derivative_uniformity)" <<
R"(fn foo() {
if (non_uniform == 42) {
let color = textureSample(t, s, vec2(0, 0));
@@ -9155,8 +9153,7 @@
@group(0) @binding(2) var s : sampler;
fn foo() {
if (non_uniform == 42))"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"({
+ << "@diagnostic(" << param << ", derivative_uniformity)" << R"({
let color = textureSample(t, s, vec2(0, 0));
}
}
@@ -9178,8 +9175,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)"
<< R"(for (var b = (non_uniform == 42 && dpdx(1.0) > 0.0); false;) {
}
}
@@ -9201,9 +9198,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(for (; non_uniform == 42 && dpdx(1.0) > 0.0;) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(for (; non_uniform == 42 && dpdx(1.0) > 0.0;) {
}
}
)";
@@ -9224,8 +9220,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)"
<< R"(for (var b = false; false; b = (non_uniform == 42 && dpdx(1.0) > 0.0)) {
}
}
@@ -9249,9 +9245,8 @@
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(for (; non_uniform == 42;) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(for (; non_uniform == 42;) {
let color = textureSample(t, s, vec2(0, 0));
}
}
@@ -9273,9 +9268,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(if (non_uniform == 42 && dpdx(1.0) > 0.0) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(if (non_uniform == 42 && dpdx(1.0) > 0.0) {
}
}
)";
@@ -9298,9 +9292,8 @@
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(if (non_uniform == 42) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(if (non_uniform == 42) {
let color = textureSample(t, s, vec2(0, 0));
}
}
@@ -9324,9 +9317,8 @@
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(if (non_uniform == 42) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(if (non_uniform == 42) {
} else {
let color = textureSample(t, s, vec2(0, 0));
}
@@ -9349,9 +9341,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(loop {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(loop {
_ = dpdx(1.0);
continuing {
break if non_uniform == 0;
@@ -9376,9 +9367,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(loop {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(loop {
continuing {
_ = dpdx(1.0);
break if non_uniform == 0;
@@ -9404,8 +9394,7 @@
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
loop )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"( {
+ << "@diagnostic(" << param << ", derivative_uniformity)" << R"( {
_ = dpdx(1.0);
continuing {
break if non_uniform == 0;
@@ -9431,8 +9420,7 @@
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
loop )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"( {
+ << "@diagnostic(" << param << ", derivative_uniformity)" << R"( {
continuing {
_ = dpdx(1.0);
break if non_uniform == 0;
@@ -9459,8 +9447,7 @@
fn foo() {
loop {
continuing )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"( {
+ << "@diagnostic(" << param << ", derivative_uniformity)" << R"( {
_ = dpdx(1.0);
break if non_uniform == 0;
}
@@ -9484,8 +9471,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)"
<< R"(switch (i32(non_uniform == 42 && dpdx(1.0) > 0.0)) {
default {}
}
@@ -9510,9 +9497,8 @@
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(switch (non_uniform) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(switch (non_uniform) {
default {
let color = textureSample(t, s, vec2(0, 0));
}
@@ -9539,8 +9525,7 @@
@group(0) @binding(2) var s : sampler;
fn foo() {
switch (non_uniform))"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"( {
+ << "@diagnostic(" << param << ", derivative_uniformity)" << R"( {
default {
let color = textureSample(t, s, vec2(0, 0));
}
@@ -9564,9 +9549,8 @@
ss << R"(
@group(0) @binding(0) var<storage, read_write> non_uniform : i32;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(while (non_uniform == 42 && dpdx(1.0) > 0.0) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(while (non_uniform == 42 && dpdx(1.0) > 0.0) {
}
}
)";
@@ -9589,9 +9573,8 @@
@group(0) @binding(1) var t : texture_2d<f32>;
@group(0) @binding(2) var s : sampler;
fn foo() {
- )"
- << "@diagnostic(" << param << ", derivative_uniformity)"
- << R"(while (non_uniform == 42) {
+ )" << "@diagnostic("
+ << param << ", derivative_uniformity)" << R"(while (non_uniform == 42) {
let color = textureSample(t, s, vec2(0, 0));
}
}