Condense namespaces in tint/transform.

This PR condenses the namespaces in the tint/transform folder.

Change-Id: Idf448870ccf90f892b9186f7aab7bb0ac9deda17
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86029
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-07 16:55:14 +00:00 committed by Dawn LUCI CQ
parent bb19d4a24b
commit b5599d35f9
108 changed files with 230 additions and 445 deletions

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::AddEmptyEntryPoint); TINT_INSTANTIATE_TYPEINFO(tint::transform::AddEmptyEntryPoint);
namespace tint { namespace tint::transform {
namespace transform {
AddEmptyEntryPoint::AddEmptyEntryPoint() = default; AddEmptyEntryPoint::AddEmptyEntryPoint() = default;
@ -47,5 +46,4 @@ void AddEmptyEntryPoint::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Add an empty entry point to the module, if no other entry points exist. /// Add an empty entry point to the module, if no other entry points exist.
class AddEmptyEntryPoint final class AddEmptyEntryPoint final
@ -47,7 +46,6 @@ class AddEmptyEntryPoint final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_ADD_EMPTY_ENTRY_POINT_H_ #endif // SRC_TINT_TRANSFORM_ADD_EMPTY_ENTRY_POINT_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using AddEmptyEntryPointTest = TransformTest; using AddEmptyEntryPointTest = TransformTest;
@ -84,5 +83,4 @@ var<private> unused_entry_point : f32;
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -26,8 +26,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::AddSpirvBlockAttribute);
TINT_INSTANTIATE_TYPEINFO( TINT_INSTANTIATE_TYPEINFO(
tint::transform::AddSpirvBlockAttribute::SpirvBlockAttribute); tint::transform::AddSpirvBlockAttribute::SpirvBlockAttribute);
namespace tint { namespace tint::transform {
namespace transform {
AddSpirvBlockAttribute::AddSpirvBlockAttribute() = default; AddSpirvBlockAttribute::AddSpirvBlockAttribute() = default;
@ -118,5 +117,4 @@ AddSpirvBlockAttribute::SpirvBlockAttribute::Clone(CloneContext* ctx) const {
.Create<AddSpirvBlockAttribute::SpirvBlockAttribute>(ctx->dst->ID()); .Create<AddSpirvBlockAttribute::SpirvBlockAttribute>(ctx->dst->ID());
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/internal_attribute.h" #include "src/tint/ast/internal_attribute.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// AddSpirvBlockAttribute is a transform that adds an /// AddSpirvBlockAttribute is a transform that adds an
/// `@internal(spirv_block)` attribute to any structure that is used as the /// `@internal(spirv_block)` attribute to any structure that is used as the
@ -70,7 +69,6 @@ class AddSpirvBlockAttribute final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_ADD_SPIRV_BLOCK_ATTRIBUTE_H_ #endif // SRC_TINT_TRANSFORM_ADD_SPIRV_BLOCK_ATTRIBUTE_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using AddSpirvBlockAttributeTest = TransformTest; using AddSpirvBlockAttributeTest = TransformTest;
@ -611,5 +610,4 @@ struct Inner {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::ArrayLengthFromUniform);
TINT_INSTANTIATE_TYPEINFO(tint::transform::ArrayLengthFromUniform::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::ArrayLengthFromUniform::Config);
TINT_INSTANTIATE_TYPEINFO(tint::transform::ArrayLengthFromUniform::Result); TINT_INSTANTIATE_TYPEINFO(tint::transform::ArrayLengthFromUniform::Result);
namespace tint { namespace tint::transform {
namespace transform {
ArrayLengthFromUniform::ArrayLengthFromUniform() = default; ArrayLengthFromUniform::ArrayLengthFromUniform() = default;
ArrayLengthFromUniform::~ArrayLengthFromUniform() = default; ArrayLengthFromUniform::~ArrayLengthFromUniform() = default;
@ -229,5 +228,4 @@ ArrayLengthFromUniform::Result::Result(
ArrayLengthFromUniform::Result::Result(const Result&) = default; ArrayLengthFromUniform::Result::Result(const Result&) = default;
ArrayLengthFromUniform::Result::~Result() = default; ArrayLengthFromUniform::Result::~Result() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -21,12 +21,12 @@
#include "src/tint/sem/binding_point.h" #include "src/tint/sem/binding_point.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class CloneContext; class CloneContext;
}
namespace transform { namespace tint::transform {
/// ArrayLengthFromUniform is a transform that implements calls to arrayLength() /// ArrayLengthFromUniform is a transform that implements calls to arrayLength()
/// by calculating the length from the total size of the storage buffer, which /// by calculating the length from the total size of the storage buffer, which
@ -119,7 +119,6 @@ class ArrayLengthFromUniform final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_ARRAY_LENGTH_FROM_UNIFORM_H_ #endif // SRC_TINT_TRANSFORM_ARRAY_LENGTH_FROM_UNIFORM_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using ArrayLengthFromUniformTest = TransformTest; using ArrayLengthFromUniformTest = TransformTest;
@ -497,5 +496,4 @@ struct SB {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -26,8 +26,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::BindingRemapper); TINT_INSTANTIATE_TYPEINFO(tint::transform::BindingRemapper);
TINT_INSTANTIATE_TYPEINFO(tint::transform::BindingRemapper::Remappings); TINT_INSTANTIATE_TYPEINFO(tint::transform::BindingRemapper::Remappings);
namespace tint { namespace tint::transform {
namespace transform {
BindingRemapper::Remappings::Remappings(BindingPoints bp, BindingRemapper::Remappings::Remappings(BindingPoints bp,
AccessControls ac, AccessControls ac,
@ -159,5 +158,4 @@ void BindingRemapper::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/sem/binding_point.h" #include "src/tint/sem/binding_point.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// BindingPoint is an alias to sem::BindingPoint /// BindingPoint is an alias to sem::BindingPoint
using BindingPoint = sem::BindingPoint; using BindingPoint = sem::BindingPoint;
@ -86,7 +85,6 @@ class BindingRemapper final : public Castable<BindingRemapper, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_BINDING_REMAPPER_H_ #endif // SRC_TINT_TRANSFORM_BINDING_REMAPPER_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using BindingRemapperTest = TransformTest; using BindingRemapperTest = TransformTest;
@ -359,5 +358,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -24,8 +24,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::BuiltinPolyfill); TINT_INSTANTIATE_TYPEINFO(tint::transform::BuiltinPolyfill);
TINT_INSTANTIATE_TYPEINFO(tint::transform::BuiltinPolyfill::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::BuiltinPolyfill::Config);
namespace tint { namespace tint::transform {
namespace transform {
/// The PIMPL state for the BuiltinPolyfill transform /// The PIMPL state for the BuiltinPolyfill transform
struct BuiltinPolyfill::State { struct BuiltinPolyfill::State {
@ -598,5 +597,4 @@ BuiltinPolyfill::Config::Config(const Builtins& b) : builtins(b) {}
BuiltinPolyfill::Config::Config(const Config&) = default; BuiltinPolyfill::Config::Config(const Config&) = default;
BuiltinPolyfill::Config::~Config() = default; BuiltinPolyfill::Config::~Config() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Implements builtins for backends that do not have a native implementation. /// Implements builtins for backends that do not have a native implementation.
class BuiltinPolyfill final : public Castable<BuiltinPolyfill, Transform> { class BuiltinPolyfill final : public Castable<BuiltinPolyfill, Transform> {
@ -91,7 +90,6 @@ class BuiltinPolyfill final : public Castable<BuiltinPolyfill, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_BUILTIN_POLYFILL_H_ #endif // SRC_TINT_TRANSFORM_BUILTIN_POLYFILL_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using Level = BuiltinPolyfill::Level; using Level = BuiltinPolyfill::Level;
@ -1117,5 +1116,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -34,8 +34,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::CalculateArrayLength);
TINT_INSTANTIATE_TYPEINFO( TINT_INSTANTIATE_TYPEINFO(
tint::transform::CalculateArrayLength::BufferSizeIntrinsic); tint::transform::CalculateArrayLength::BufferSizeIntrinsic);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
@ -239,5 +238,4 @@ void CalculateArrayLength::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,12 +20,12 @@
#include "src/tint/ast/internal_attribute.h" #include "src/tint/ast/internal_attribute.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class CloneContext; class CloneContext;
}
namespace transform { namespace tint::transform {
/// CalculateArrayLength is a transform used to replace calls to arrayLength() /// CalculateArrayLength is a transform used to replace calls to arrayLength()
/// with a value calculated from the size of the storage buffer. /// with a value calculated from the size of the storage buffer.
@ -78,7 +78,6 @@ class CalculateArrayLength final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_CALCULATE_ARRAY_LENGTH_H_ #endif // SRC_TINT_TRANSFORM_CALCULATE_ARRAY_LENGTH_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using CalculateArrayLengthTest = TransformTest; using CalculateArrayLengthTest = TransformTest;
@ -549,5 +548,4 @@ struct SB2 {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::CanonicalizeEntryPointIO); TINT_INSTANTIATE_TYPEINFO(tint::transform::CanonicalizeEntryPointIO);
TINT_INSTANTIATE_TYPEINFO(tint::transform::CanonicalizeEntryPointIO::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::CanonicalizeEntryPointIO::Config);
namespace tint { namespace tint::transform {
namespace transform {
CanonicalizeEntryPointIO::CanonicalizeEntryPointIO() = default; CanonicalizeEntryPointIO::CanonicalizeEntryPointIO() = default;
CanonicalizeEntryPointIO::~CanonicalizeEntryPointIO() = default; CanonicalizeEntryPointIO::~CanonicalizeEntryPointIO() = default;
@ -775,5 +774,4 @@ CanonicalizeEntryPointIO::Config::Config(ShaderStyle style,
CanonicalizeEntryPointIO::Config::Config(const Config&) = default; CanonicalizeEntryPointIO::Config::Config(const Config&) = default;
CanonicalizeEntryPointIO::Config::~Config() = default; CanonicalizeEntryPointIO::Config::~Config() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// CanonicalizeEntryPointIO is a transform used to rewrite shader entry point /// CanonicalizeEntryPointIO is a transform used to rewrite shader entry point
/// interfaces into a form that the generators can handle. Each entry point /// interfaces into a form that the generators can handle. Each entry point
@ -143,7 +142,6 @@ class CanonicalizeEntryPointIO final
struct State; struct State;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_CANONICALIZE_ENTRY_POINT_IO_H_ #endif // SRC_TINT_TRANSFORM_CANONICALIZE_ENTRY_POINT_IO_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using CanonicalizeEntryPointIOTest = TransformTest; using CanonicalizeEntryPointIOTest = TransformTest;
@ -4037,5 +4036,4 @@ fn main() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -36,8 +36,7 @@ bool IsGlobal(const tint::sem::VariablePair& pair) {
} // namespace } // namespace
namespace tint { namespace tint::transform {
namespace transform {
CombineSamplers::BindingInfo::BindingInfo(const BindingMap& map, CombineSamplers::BindingInfo::BindingInfo(const BindingMap& map,
const sem::BindingPoint& placeholder) const sem::BindingPoint& placeholder)
@ -351,5 +350,4 @@ void CombineSamplers::Run(CloneContext& ctx,
State(ctx, binding_info).Run(); State(ctx, binding_info).Run();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/sem/sampler_texture_pair.h" #include "src/tint/sem/sampler_texture_pair.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// This transform converts all separate texture/sampler refences in a /// This transform converts all separate texture/sampler refences in a
/// program into combined texture/samplers. This is required for GLSL, /// program into combined texture/samplers. This is required for GLSL,
@ -104,7 +103,6 @@ class CombineSamplers final : public Castable<CombineSamplers, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_COMBINE_SAMPLERS_H_ #endif // SRC_TINT_TRANSFORM_COMBINE_SAMPLERS_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using CombineSamplersTest = TransformTest; using CombineSamplersTest = TransformTest;
@ -1008,5 +1007,4 @@ fn main() -> vec4<f32> {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -41,8 +41,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeMemoryAccess); TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeMemoryAccess);
TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeMemoryAccess::Intrinsic); TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeMemoryAccess::Intrinsic);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
@ -991,8 +990,7 @@ void DecomposeMemoryAccess::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint
TINT_INSTANTIATE_TYPEINFO(tint::transform::Offset); TINT_INSTANTIATE_TYPEINFO(tint::transform::Offset);
TINT_INSTANTIATE_TYPEINFO(tint::transform::OffsetLiteral); TINT_INSTANTIATE_TYPEINFO(tint::transform::OffsetLiteral);

View File

@ -20,12 +20,12 @@
#include "src/tint/ast/internal_attribute.h" #include "src/tint/ast/internal_attribute.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class CloneContext; class CloneContext;
}
namespace transform { namespace tint::transform {
/// DecomposeMemoryAccess is a transform used to replace storage and uniform /// DecomposeMemoryAccess is a transform used to replace storage and uniform
/// buffer accesses with a combination of load, store or atomic functions on /// buffer accesses with a combination of load, store or atomic functions on
@ -125,7 +125,6 @@ class DecomposeMemoryAccess final
struct State; struct State;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_DECOMPOSE_MEMORY_ACCESS_H_ #endif // SRC_TINT_TRANSFORM_DECOMPOSE_MEMORY_ACCESS_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using DecomposeMemoryAccessTest = TransformTest; using DecomposeMemoryAccessTest = TransformTest;
@ -2800,5 +2799,4 @@ struct S {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -29,8 +29,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeStridedArray); TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeStridedArray);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using DecomposedArrays = std::unordered_map<const sem::Array*, Symbol>; using DecomposedArrays = std::unordered_map<const sem::Array*, Symbol>;
@ -158,5 +157,4 @@ void DecomposeStridedArray::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// DecomposeStridedArray transforms replaces arrays with a non-default /// DecomposeStridedArray transforms replaces arrays with a non-default
/// `@stride` attribute with an array of structure elements, where the /// `@stride` attribute with an array of structure elements, where the
@ -55,7 +54,6 @@ class DecomposeStridedArray final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_DECOMPOSE_STRIDED_ARRAY_H_ #endif // SRC_TINT_TRANSFORM_DECOMPOSE_STRIDED_ARRAY_H_

View File

@ -23,8 +23,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using DecomposeStridedArrayTest = TransformTest; using DecomposeStridedArrayTest = TransformTest;
@ -694,5 +693,4 @@ fn f() {
EXPECT_EQ(expect, str(got)); EXPECT_EQ(expect, str(got));
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -27,8 +27,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeStridedMatrix); TINT_INSTANTIATE_TYPEINFO(tint::transform::DecomposeStridedMatrix);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
/// MatrixInfo describes a matrix member with a custom stride /// MatrixInfo describes a matrix member with a custom stride
@ -247,5 +246,4 @@ void DecomposeStridedMatrix::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// DecomposeStridedMatrix transforms replaces matrix members of storage or /// DecomposeStridedMatrix transforms replaces matrix members of storage or
/// uniform buffer structures, that have a stride attribute, into an array /// uniform buffer structures, that have a stride attribute, into an array
@ -55,7 +54,6 @@ class DecomposeStridedMatrix final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_DECOMPOSE_STRIDED_MATRIX_H_ #endif // SRC_TINT_TRANSFORM_DECOMPOSE_STRIDED_MATRIX_H_

View File

@ -24,8 +24,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using DecomposeStridedMatrixTest = TransformTest; using DecomposeStridedMatrixTest = TransformTest;
@ -667,5 +666,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -27,8 +27,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::ExpandCompoundAssignment); TINT_INSTANTIATE_TYPEINFO(tint::transform::ExpandCompoundAssignment);
namespace tint { namespace tint::transform {
namespace transform {
ExpandCompoundAssignment::ExpandCompoundAssignment() = default; ExpandCompoundAssignment::ExpandCompoundAssignment() = default;
@ -192,5 +191,4 @@ void ExpandCompoundAssignment::Run(CloneContext& ctx,
state.Finalize(); state.Finalize();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Converts compound assignment statements to regular assignment statements, /// Converts compound assignment statements to regular assignment statements,
/// hoisting the LHS expression if necessary. /// hoisting the LHS expression if necessary.
@ -65,7 +64,6 @@ class ExpandCompoundAssignment
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_EXPAND_COMPOUND_ASSIGNMENT_H_ #endif // SRC_TINT_TRANSFORM_EXPAND_COMPOUND_ASSIGNMENT_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using ExpandCompoundAssignmentTest = TransformTest; using ExpandCompoundAssignmentTest = TransformTest;
@ -742,5 +741,4 @@ fn main() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::FirstIndexOffset);
TINT_INSTANTIATE_TYPEINFO(tint::transform::FirstIndexOffset::BindingPoint); TINT_INSTANTIATE_TYPEINFO(tint::transform::FirstIndexOffset::BindingPoint);
TINT_INSTANTIATE_TYPEINFO(tint::transform::FirstIndexOffset::Data); TINT_INSTANTIATE_TYPEINFO(tint::transform::FirstIndexOffset::Data);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
// Uniform buffer member names // Uniform buffer member names
@ -184,5 +183,4 @@ void FirstIndexOffset::Run(CloneContext& ctx,
instance_index_offset); instance_index_offset);
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Adds firstVertex/Instance (injected via root constants) to /// Adds firstVertex/Instance (injected via root constants) to
/// vertex/instance index builtins. /// vertex/instance index builtins.
@ -137,7 +136,6 @@ class FirstIndexOffset final : public Castable<FirstIndexOffset, Transform> {
uint32_t group_ = 0; uint32_t group_ = 0;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_FIRST_INDEX_OFFSET_H_ #endif // SRC_TINT_TRANSFORM_FIRST_INDEX_OFFSET_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using FirstIndexOffsetTest = TransformTest; using FirstIndexOffsetTest = TransformTest;
@ -646,5 +645,4 @@ fn func(i : u32) -> u32 {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -26,8 +26,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::FoldConstants); TINT_INSTANTIATE_TYPEINFO(tint::transform::FoldConstants);
namespace tint { namespace tint::transform {
namespace transform {
FoldConstants::FoldConstants() = default; FoldConstants::FoldConstants() = default;
@ -95,5 +94,4 @@ void FoldConstants::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// FoldConstants transforms the AST by folding constant expressions /// FoldConstants transforms the AST by folding constant expressions
class FoldConstants final : public Castable<FoldConstants, Transform> { class FoldConstants final : public Castable<FoldConstants, Transform> {
@ -41,7 +40,6 @@ class FoldConstants final : public Castable<FoldConstants, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_FOLD_CONSTANTS_H_ #endif // SRC_TINT_TRANSFORM_FOLD_CONSTANTS_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using FoldConstantsTest = TransformTest; using FoldConstantsTest = TransformTest;
@ -423,5 +422,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -23,8 +23,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::FoldTrivialSingleUseLets); TINT_INSTANTIATE_TYPEINFO(tint::transform::FoldTrivialSingleUseLets);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
const ast::VariableDeclStatement* AsTrivialLetDecl(const ast::Statement* stmt) { const ast::VariableDeclStatement* AsTrivialLetDecl(const ast::Statement* stmt) {
@ -88,5 +87,4 @@ void FoldTrivialSingleUseLets::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// FoldTrivialSingleUseLets is an optimizer for folding away trivial `let` /// FoldTrivialSingleUseLets is an optimizer for folding away trivial `let`
/// statements into their single place of use. This transform is intended to /// statements into their single place of use. This transform is intended to
@ -55,7 +54,6 @@ class FoldTrivialSingleUseLets final
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_FOLD_TRIVIAL_SINGLE_USE_LETS_H_ #endif // SRC_TINT_TRANSFORM_FOLD_TRIVIAL_SINGLE_USE_LETS_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using FoldTrivialSingleUseLetsTest = TransformTest; using FoldTrivialSingleUseLetsTest = TransformTest;
@ -184,5 +183,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::ForLoopToLoop); TINT_INSTANTIATE_TYPEINFO(tint::transform::ForLoopToLoop);
namespace tint { namespace tint::transform {
namespace transform {
ForLoopToLoop::ForLoopToLoop() = default; ForLoopToLoop::ForLoopToLoop() = default;
ForLoopToLoop::~ForLoopToLoop() = default; ForLoopToLoop::~ForLoopToLoop() = default;
@ -72,5 +71,4 @@ void ForLoopToLoop::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// ForLoopToLoop is a Transform that converts a for-loop statement into a loop /// ForLoopToLoop is a Transform that converts a for-loop statement into a loop
/// statement. This is required by the SPIR-V writer. /// statement. This is required by the SPIR-V writer.
@ -48,7 +47,6 @@ class ForLoopToLoop final : public Castable<ForLoopToLoop, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_FOR_LOOP_TO_LOOP_H_ #endif // SRC_TINT_TRANSFORM_FOR_LOOP_TO_LOOP_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using ForLoopToLoopTest = TransformTest; using ForLoopToLoopTest = TransformTest;
@ -370,5 +369,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -42,8 +42,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::Glsl); TINT_INSTANTIATE_TYPEINFO(tint::transform::Glsl);
TINT_INSTANTIATE_TYPEINFO(tint::transform::Glsl::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::Glsl::Config);
namespace tint { namespace tint::transform {
namespace transform {
Glsl::Glsl() = default; Glsl::Glsl() = default;
Glsl::~Glsl() = default; Glsl::~Glsl() = default;
@ -143,5 +142,4 @@ Glsl::Config::Config(const std::string& entry_point_in,
Glsl::Config::Config(const Config&) = default; Glsl::Config::Config(const Config&) = default;
Glsl::Config::~Config() = default; Glsl::Config::~Config() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -19,12 +19,12 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class CloneContext; class CloneContext;
}
namespace transform { namespace tint::transform {
/// Glsl is a transform used to sanitize a Program for use with the Glsl writer. /// Glsl is a transform used to sanitize a Program for use with the Glsl writer.
/// Passing a non-sanitized Program to the Glsl writer will result in undefined /// Passing a non-sanitized Program to the Glsl writer will result in undefined
@ -70,7 +70,6 @@ class Glsl final : public Castable<Glsl, Transform> {
Output Run(const Program* program, const DataMap& data = {}) const override; Output Run(const Program* program, const DataMap& data = {}) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_GLSL_H_ #endif // SRC_TINT_TRANSFORM_GLSL_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using GlslTest = TransformTest; using GlslTest = TransformTest;
@ -37,5 +36,4 @@ fn unused_entry_point() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -30,8 +30,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::LocalizeStructArrayAssignment); TINT_INSTANTIATE_TYPEINFO(tint::transform::LocalizeStructArrayAssignment);
namespace tint { namespace tint::transform {
namespace transform {
/// Private implementation of LocalizeStructArrayAssignment transform /// Private implementation of LocalizeStructArrayAssignment transform
class LocalizeStructArrayAssignment::State { class LocalizeStructArrayAssignment::State {
@ -220,5 +219,4 @@ void LocalizeStructArrayAssignment::Run(CloneContext& ctx,
state.Run(); state.Run();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// This transforms replaces assignment to dynamically-indexed fixed-size arrays /// This transforms replaces assignment to dynamically-indexed fixed-size arrays
/// in structs on shader-local variables with code that copies the arrays to a /// in structs on shader-local variables with code that copies the arrays to a
@ -52,7 +51,6 @@ class LocalizeStructArrayAssignment
class State; class State;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_LOCALIZE_STRUCT_ARRAY_ASSIGNMENT_H_ #endif // SRC_TINT_TRANSFORM_LOCALIZE_STRUCT_ARRAY_ASSIGNMENT_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using LocalizeStructArrayAssignmentTest = TransformTest; using LocalizeStructArrayAssignmentTest = TransformTest;
@ -865,5 +864,4 @@ fn main() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -25,8 +25,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::LoopToForLoop); TINT_INSTANTIATE_TYPEINFO(tint::transform::LoopToForLoop);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
bool IsBlockWithSingleBreak(const ast::BlockStatement* block) { bool IsBlockWithSingleBreak(const ast::BlockStatement* block) {
@ -141,5 +140,4 @@ void LoopToForLoop::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// LoopToForLoop is a Transform that attempts to convert WGSL `loop {}` /// LoopToForLoop is a Transform that attempts to convert WGSL `loop {}`
/// statements into a for-loop statement. /// statements into a for-loop statement.
@ -48,7 +47,6 @@ class LoopToForLoop : public Castable<LoopToForLoop, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_LOOP_TO_FOR_LOOP_H_ #endif // SRC_TINT_TRANSFORM_LOOP_TO_FOR_LOOP_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using LoopToForLoopTest = TransformTest; using LoopToForLoopTest = TransformTest;
@ -304,5 +303,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -26,8 +26,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::Manager); TINT_INSTANTIATE_TYPEINFO(tint::transform::Manager);
namespace tint { namespace tint::transform {
namespace transform {
Manager::Manager() = default; Manager::Manager() = default;
Manager::~Manager() = default; Manager::~Manager() = default;
@ -82,5 +81,4 @@ Output Manager::Run(const Program* program, const DataMap& data) const {
return out; return out;
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// A collection of Transforms that act as a single Transform. /// A collection of Transforms that act as a single Transform.
/// The inner transforms will execute in the appended order. /// The inner transforms will execute in the appended order.
@ -58,7 +57,6 @@ class Manager : public Castable<Manager, Transform> {
std::vector<std::unique_ptr<Transform>> transforms_; std::vector<std::unique_ptr<Transform>> transforms_;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_MANAGER_H_ #endif // SRC_TINT_TRANSFORM_MANAGER_H_

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::ModuleScopeVarToEntryPointParam); TINT_INSTANTIATE_TYPEINFO(tint::transform::ModuleScopeVarToEntryPointParam);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
// Returns `true` if `type` is or contains a matrix type. // Returns `true` if `type` is or contains a matrix type.
bool ContainsMatrix(const sem::Type* type) { bool ContainsMatrix(const sem::Type* type) {
@ -395,5 +394,4 @@ void ModuleScopeVarToEntryPointParam::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Move module-scope variables into the entry point as parameters. /// Move module-scope variables into the entry point as parameters.
/// ///
@ -90,7 +89,6 @@ class ModuleScopeVarToEntryPointParam
struct State; struct State;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_MODULE_SCOPE_VAR_TO_ENTRY_POINT_PARAM_H_ #endif // SRC_TINT_TRANSFORM_MODULE_SCOPE_VAR_TO_ENTRY_POINT_PARAM_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using ModuleScopeVarToEntryPointParamTest = TransformTest; using ModuleScopeVarToEntryPointParamTest = TransformTest;
@ -1166,5 +1165,4 @@ TEST_F(ModuleScopeVarToEntryPointParamTest, EmtpyModule) {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -27,8 +27,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::MultiplanarExternalTexture);
TINT_INSTANTIATE_TYPEINFO( TINT_INSTANTIATE_TYPEINFO(
tint::transform::MultiplanarExternalTexture::NewBindingPoints); tint::transform::MultiplanarExternalTexture::NewBindingPoints);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
/// This struct stores symbols for new bindings created as a result of /// This struct stores symbols for new bindings created as a result of
@ -450,5 +449,4 @@ void MultiplanarExternalTexture::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -23,8 +23,7 @@
#include "src/tint/sem/builtin_type.h" #include "src/tint/sem/builtin_type.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// BindingPoint is an alias to sem::BindingPoint /// BindingPoint is an alias to sem::BindingPoint
using BindingPoint = sem::BindingPoint; using BindingPoint = sem::BindingPoint;
@ -96,7 +95,6 @@ class MultiplanarExternalTexture
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_MULTIPLANAR_EXTERNAL_TEXTURE_H_ #endif // SRC_TINT_TRANSFORM_MULTIPLANAR_EXTERNAL_TEXTURE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/transform/multiplanar_external_texture.h" #include "src/tint/transform/multiplanar_external_texture.h"
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using MultiplanarExternalTextureTest = TransformTest; using MultiplanarExternalTextureTest = TransformTest;
@ -1293,5 +1292,4 @@ type ET = texture_external;
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -27,8 +27,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::NumWorkgroupsFromUniform); TINT_INSTANTIATE_TYPEINFO(tint::transform::NumWorkgroupsFromUniform);
TINT_INSTANTIATE_TYPEINFO(tint::transform::NumWorkgroupsFromUniform::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::NumWorkgroupsFromUniform::Config);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
/// Accessor describes the identifiers used in a member accessor that is being /// Accessor describes the identifiers used in a member accessor that is being
/// used to retrieve the num_workgroups builtin from a parameter. /// used to retrieve the num_workgroups builtin from a parameter.
@ -166,5 +165,4 @@ NumWorkgroupsFromUniform::Config::Config(sem::BindingPoint ubo_bp)
NumWorkgroupsFromUniform::Config::Config(const Config&) = default; NumWorkgroupsFromUniform::Config::Config(const Config&) = default;
NumWorkgroupsFromUniform::Config::~Config() = default; NumWorkgroupsFromUniform::Config::~Config() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -18,12 +18,12 @@
#include "src/tint/sem/binding_point.h" #include "src/tint/sem/binding_point.h"
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class CloneContext; class CloneContext;
}
namespace transform { namespace tint::transform {
/// NumWorkgroupsFromUniform is a transform that implements the `num_workgroups` /// NumWorkgroupsFromUniform is a transform that implements the `num_workgroups`
/// builtin by loading it from a uniform buffer. /// builtin by loading it from a uniform buffer.
@ -84,7 +84,6 @@ class NumWorkgroupsFromUniform
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_NUM_WORKGROUPS_FROM_UNIFORM_H_ #endif // SRC_TINT_TRANSFORM_NUM_WORKGROUPS_FROM_UNIFORM_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using NumWorkgroupsFromUniformTest = TransformTest; using NumWorkgroupsFromUniformTest = TransformTest;
@ -452,5 +451,4 @@ fn main(tint_symbol : tint_symbol_1) {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using PromoteInitializersToConstVarTest = TransformTest; using PromoteInitializersToConstVarTest = TransformTest;
@ -623,5 +622,4 @@ let module_arr : array<f32, 4u> = array<f32, 4u>(0.0, 1.0, 2.0, 3.0);
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using PromoteSideEffectsToDeclTest = TransformTest; using PromoteSideEffectsToDeclTest = TransformTest;
@ -4008,5 +4007,4 @@ fn f() {
EXPECT_EQ(expect, str(got)); EXPECT_EQ(expect, str(got));
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -15,8 +15,7 @@
#include "src/tint/transform/remove_continue_in_switch.h" #include "src/tint/transform/remove_continue_in_switch.h"
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using RemoveContinueInSwitchTest = TransformTest; using RemoveContinueInSwitchTest = TransformTest;
@ -561,5 +560,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -30,8 +30,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::RemovePhonies); TINT_INSTANTIATE_TYPEINFO(tint::transform::RemovePhonies);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
struct SinkSignature { struct SinkSignature {
@ -152,5 +151,4 @@ void RemovePhonies::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// RemovePhonies is a Transform that removes all phony-assignment statements, /// RemovePhonies is a Transform that removes all phony-assignment statements,
/// while preserving function call expressions in the RHS of the assignment that /// while preserving function call expressions in the RHS of the assignment that
@ -52,7 +51,6 @@ class RemovePhonies : public Castable<RemovePhonies, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_REMOVE_PHONIES_H_ #endif // SRC_TINT_TRANSFORM_REMOVE_PHONIES_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using RemovePhoniesTest = TransformTest; using RemovePhoniesTest = TransformTest;
@ -427,5 +426,4 @@ struct S {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -30,8 +30,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::RemoveUnreachableStatements); TINT_INSTANTIATE_TYPEINFO(tint::transform::RemoveUnreachableStatements);
namespace tint { namespace tint::transform {
namespace transform {
RemoveUnreachableStatements::RemoveUnreachableStatements() = default; RemoveUnreachableStatements::RemoveUnreachableStatements() = default;
@ -63,5 +62,4 @@ void RemoveUnreachableStatements::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// RemoveUnreachableStatements is a Transform that removes all statements /// RemoveUnreachableStatements is a Transform that removes all statements
/// marked as unreachable. /// marked as unreachable.
@ -52,7 +51,6 @@ class RemoveUnreachableStatements
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_REMOVE_UNREACHABLE_STATEMENTS_H_ #endif // SRC_TINT_TRANSFORM_REMOVE_UNREACHABLE_STATEMENTS_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using RemoveUnreachableStatementsTest = TransformTest; using RemoveUnreachableStatementsTest = TransformTest;
@ -567,5 +566,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
constexpr const char kUnicodeIdentifier[] = // "𝖎𝖉𝖊𝖓𝖙𝖎𝖋𝖎𝖊𝖗123" constexpr const char kUnicodeIdentifier[] = // "𝖎𝖉𝖊𝖓𝖙𝖎𝖋𝖎𝖊𝖗123"
@ -1459,5 +1458,4 @@ INSTANTIATE_TEST_SUITE_P(
kUnicodeIdentifier)); kUnicodeIdentifier));
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::Robustness); TINT_INSTANTIATE_TYPEINFO(tint::transform::Robustness);
TINT_INSTANTIATE_TYPEINFO(tint::transform::Robustness::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::Robustness::Config);
namespace tint { namespace tint::transform {
namespace transform {
/// State holds the current transform state /// State holds the current transform state
struct Robustness::State { struct Robustness::State {
@ -316,5 +315,4 @@ void Robustness::Run(CloneContext& ctx, const DataMap& inputs, DataMap&) const {
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -20,15 +20,12 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
// Forward declarations // Forward declarations
namespace tint { namespace tint::ast {
namespace ast {
class IndexAccessorExpression; class IndexAccessorExpression;
class CallExpression; class CallExpression;
} // namespace ast } // namespace tint::ast
} // namespace tint
namespace tint { namespace tint::transform {
namespace transform {
/// This transform is responsible for clamping all array accesses to be within /// This transform is responsible for clamping all array accesses to be within
/// the bounds of the array. Any access before the start of the array will clamp /// the bounds of the array. Any access before the start of the array will clamp
@ -82,7 +79,6 @@ class Robustness : public Castable<Robustness, Transform> {
struct State; struct State;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_ROBUSTNESS_H_ #endif // SRC_TINT_TRANSFORM_ROBUSTNESS_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using RobustnessTest = TransformTest; using RobustnessTest = TransformTest;
@ -1741,5 +1740,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::SimplifyPointers); TINT_INSTANTIATE_TYPEINFO(tint::transform::SimplifyPointers);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
@ -235,5 +234,4 @@ void SimplifyPointers::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
State(ctx).Run(); State(ctx).Run();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// SimplifyPointers is a Transform that moves all usage of function-scope /// SimplifyPointers is a Transform that moves all usage of function-scope
/// `let` statements of a pointer type into their places of usage, while also /// `let` statements of a pointer type into their places of usage, while also
@ -54,7 +53,6 @@ class SimplifyPointers : public Castable<SimplifyPointers, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_SIMPLIFY_POINTERS_H_ #endif // SRC_TINT_TRANSFORM_SIMPLIFY_POINTERS_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/transform/unshadow.h" #include "src/tint/transform/unshadow.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using SimplifyPointersTest = TransformTest; using SimplifyPointersTest = TransformTest;
@ -366,5 +365,4 @@ fn main() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -24,8 +24,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::SingleEntryPoint); TINT_INSTANTIATE_TYPEINFO(tint::transform::SingleEntryPoint);
TINT_INSTANTIATE_TYPEINFO(tint::transform::SingleEntryPoint::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::SingleEntryPoint::Config);
namespace tint { namespace tint::transform {
namespace transform {
SingleEntryPoint::SingleEntryPoint() = default; SingleEntryPoint::SingleEntryPoint() = default;
@ -113,5 +112,4 @@ SingleEntryPoint::Config::~Config() = default;
SingleEntryPoint::Config& SingleEntryPoint::Config::operator=(const Config&) = SingleEntryPoint::Config& SingleEntryPoint::Config::operator=(const Config&) =
default; default;
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Strip all but one entry point a module. /// Strip all but one entry point a module.
/// ///
@ -66,7 +65,6 @@ class SingleEntryPoint : public Castable<SingleEntryPoint, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_SINGLE_ENTRY_POINT_H_ #endif // SRC_TINT_TRANSFORM_SINGLE_ENTRY_POINT_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using SingleEntryPointTest = TransformTest; using SingleEntryPointTest = TransformTest;
@ -513,5 +512,4 @@ fn comp_main1() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -25,8 +25,7 @@
#include "src/tint/transform/manager.h" #include "src/tint/transform/manager.h"
#include "src/tint/writer/wgsl/generator.h" #include "src/tint/writer/wgsl/generator.h"
namespace tint { namespace tint::transform {
namespace transform {
/// @param program the program to get an output WGSL string from /// @param program the program to get an output WGSL string from
/// @returns the output program as a WGSL string, or an error string if the /// @returns the output program as a WGSL string, or an error string if the
@ -148,7 +147,6 @@ using TransformTest = TransformTestBase<testing::Test>;
template <typename T> template <typename T>
using TransformTestWithParam = TransformTestBase<testing::TestWithParam<T>>; using TransformTestWithParam = TransformTestBase<testing::TestWithParam<T>>;
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_TEST_HELPER_H_ #endif // SRC_TINT_TRANSFORM_TEST_HELPER_H_

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::Transform); TINT_INSTANTIATE_TYPEINFO(tint::transform::Transform);
TINT_INSTANTIATE_TYPEINFO(tint::transform::Data); TINT_INSTANTIATE_TYPEINFO(tint::transform::Data);
namespace tint { namespace tint::transform {
namespace transform {
Data::Data() = default; Data::Data() = default;
Data::Data(const Data&) = default; Data::Data(const Data&) = default;
@ -156,5 +155,4 @@ const ast::Type* Transform::CreateASTTypeFor(CloneContext& ctx,
return nullptr; return nullptr;
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -22,8 +22,7 @@
#include "src/tint/castable.h" #include "src/tint/castable.h"
#include "src/tint/program.h" #include "src/tint/program.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Data is the base class for transforms that accept extra input or emit extra /// Data is the base class for transforms that accept extra input or emit extra
/// output information along with a Program. /// output information along with a Program.
@ -193,7 +192,6 @@ class Transform : public Castable<Transform> {
const sem::Type* ty); const sem::Type* ty);
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_TRANSFORM_H_ #endif // SRC_TINT_TRANSFORM_TRANSFORM_H_

View File

@ -18,8 +18,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
// Inherit from Transform so we have access to protected methods // Inherit from Transform so we have access to protected methods
@ -119,5 +118,4 @@ TEST_F(CreateASTTypeForTest, Struct) {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -26,8 +26,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::Unshadow); TINT_INSTANTIATE_TYPEINFO(tint::transform::Unshadow);
namespace tint { namespace tint::transform {
namespace transform {
/// The PIMPL state for the Unshadow transform /// The PIMPL state for the Unshadow transform
struct Unshadow::State { struct Unshadow::State {
@ -95,5 +94,4 @@ void Unshadow::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
State(ctx).Run(); State(ctx).Run();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// Unshadow is a Transform that renames any variables that shadow another /// Unshadow is a Transform that renames any variables that shadow another
/// variable. /// variable.
@ -44,7 +43,6 @@ class Unshadow : public Castable<Unshadow, Transform> {
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_UNSHADOW_H_ #endif // SRC_TINT_TRANSFORM_UNSHADOW_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using UnshadowTest = TransformTest; using UnshadowTest = TransformTest;
@ -605,5 +604,4 @@ type a = i32;
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/transform/promote_side_effects_to_decl.h" #include "src/tint/transform/promote_side_effects_to_decl.h"
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using UnwindDiscardFunctionsTest = TransformTest; using UnwindDiscardFunctionsTest = TransformTest;
@ -1417,5 +1416,4 @@ fn main(@builtin(position) coord_in : vec4<f32>) -> @location(0) vec4<f32> {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using VarForDynamicIndexTest = TransformTest; using VarForDynamicIndexTest = TransformTest;
@ -549,5 +548,4 @@ fn f() {
} }
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -23,8 +23,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::VectorizeScalarMatrixConstructors); TINT_INSTANTIATE_TYPEINFO(tint::transform::VectorizeScalarMatrixConstructors);
namespace tint { namespace tint::transform {
namespace transform {
VectorizeScalarMatrixConstructors::VectorizeScalarMatrixConstructors() = VectorizeScalarMatrixConstructors::VectorizeScalarMatrixConstructors() =
default; default;
@ -93,5 +92,4 @@ void VectorizeScalarMatrixConstructors::Run(CloneContext& ctx,
ctx.Clone(); ctx.Clone();
} }
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/transform/transform.h" #include "src/tint/transform/transform.h"
namespace tint { namespace tint::transform {
namespace transform {
/// A transform that converts scalar matrix constructors to the vector form. /// A transform that converts scalar matrix constructors to the vector form.
class VectorizeScalarMatrixConstructors class VectorizeScalarMatrixConstructors
@ -48,7 +47,6 @@ class VectorizeScalarMatrixConstructors
DataMap& outputs) const override; DataMap& outputs) const override;
}; };
} // namespace transform } // namespace tint::transform
} // namespace tint
#endif // SRC_TINT_TRANSFORM_VECTORIZE_SCALAR_MATRIX_CONSTRUCTORS_H_ #endif // SRC_TINT_TRANSFORM_VECTORIZE_SCALAR_MATRIX_CONSTRUCTORS_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/transform/test_helper.h" #include "src/tint/transform/test_helper.h"
#include "src/tint/utils/string.h" #include "src/tint/utils/string.h"
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
using VectorizeScalarMatrixConstructorsTest = using VectorizeScalarMatrixConstructorsTest =
@ -120,5 +119,4 @@ INSTANTIATE_TEST_SUITE_P(VectorizeScalarMatrixConstructorsTest,
std::make_pair(4, 4))); std::make_pair(4, 4)));
} // namespace } // namespace
} // namespace transform } // namespace tint::transform
} // namespace tint

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::transform::VertexPulling); TINT_INSTANTIATE_TYPEINFO(tint::transform::VertexPulling);
TINT_INSTANTIATE_TYPEINFO(tint::transform::VertexPulling::Config); TINT_INSTANTIATE_TYPEINFO(tint::transform::VertexPulling::Config);
namespace tint { namespace tint::transform {
namespace transform {
namespace { namespace {
@ -958,5 +957,4 @@ VertexBufferLayoutDescriptor& VertexBufferLayoutDescriptor::operator=(
VertexBufferLayoutDescriptor::~VertexBufferLayoutDescriptor() = default; VertexBufferLayoutDescriptor::~VertexBufferLayoutDescriptor() = default;
} // namespace transform } // namespace tint::transform
} // namespace tint

Some files were not shown because too many files have changed in this diff Show More