Move atomic to type/

This CL moves atomic to type/ and updates the namespaces.

Bug: tint:1718
Change-Id: I3331bc0dfae2ccede52b5589b7d3cc443366096a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113424
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair
2022-12-08 22:21:24 +00:00
committed by Dan Sinclair
parent 0e780da882
commit d8a084585f
23 changed files with 78 additions and 74 deletions

View File

@@ -27,12 +27,12 @@
#include "src/tint/ast/unary_op.h"
#include "src/tint/program_builder.h"
#include "src/tint/sem/array.h"
#include "src/tint/sem/atomic.h"
#include "src/tint/sem/call.h"
#include "src/tint/sem/member_accessor_expression.h"
#include "src/tint/sem/statement.h"
#include "src/tint/sem/struct.h"
#include "src/tint/sem/variable.h"
#include "src/tint/type/atomic.h"
#include "src/tint/type/reference.h"
#include "src/tint/utils/block_allocator.h"
#include "src/tint/utils/hash.h"
@@ -994,7 +994,7 @@ Transform::ApplyResult DecomposeMemoryAccess::Apply(const Program* src,
auto* buf = access.var->Declaration();
auto* offset = access.offset->Build(ctx);
auto* buf_ty = access.var->Type()->UnwrapRef();
auto* el_ty = access.type->UnwrapRef()->As<sem::Atomic>()->Type();
auto* el_ty = access.type->UnwrapRef()->As<type::Atomic>()->Type();
Symbol func = state.AtomicFunc(buf_ty, el_ty, builtin,
access.var->As<sem::VariableUser>());

View File

@@ -18,10 +18,10 @@
#include <string>
#include "src/tint/program_builder.h"
#include "src/tint/sem/atomic.h"
#include "src/tint/sem/block_statement.h"
#include "src/tint/sem/for_loop_statement.h"
#include "src/tint/sem/variable.h"
#include "src/tint/type/atomic.h"
#include "src/tint/type/depth_multisampled_texture.h"
#include "src/tint/type/reference.h"
#include "src/tint/type/sampler.h"
@@ -142,7 +142,7 @@ const ast::Type* Transform::CreateASTTypeFor(CloneContext& ctx, const type::Type
if (auto* s = ty->As<type::Reference>()) {
return CreateASTTypeFor(ctx, s->StoreType());
}
if (auto* a = ty->As<sem::Atomic>()) {
if (auto* a = ty->As<type::Atomic>()) {
return ctx.dst->create<ast::Atomic>(CreateASTTypeFor(ctx, a->Type()));
}
if (auto* t = ty->As<type::DepthTexture>()) {

View File

@@ -22,9 +22,9 @@
#include "src/tint/ast/workgroup_attribute.h"
#include "src/tint/program_builder.h"
#include "src/tint/sem/atomic.h"
#include "src/tint/sem/function.h"
#include "src/tint/sem/variable.h"
#include "src/tint/type/atomic.h"
#include "src/tint/utils/map.h"
#include "src/tint/utils/unique_vector.h"
@@ -303,7 +303,7 @@ struct ZeroInitWorkgroupMemory::State {
return true;
}
if (auto* atomic = ty->As<sem::Atomic>()) {
if (auto* atomic = ty->As<type::Atomic>()) {
auto* zero_init = b.Construct(CreateASTTypeFor(ctx, atomic->Type()));
auto expr = get_expr(1u);
if (!expr) {
@@ -439,7 +439,7 @@ struct ZeroInitWorkgroupMemory::State {
/// sub-initializations.
/// @param ty the type to inspect
bool CanTriviallyZero(const type::Type* ty) {
if (ty->Is<sem::Atomic>()) {
if (ty->Is<type::Atomic>()) {
return false;
}
if (auto* str = ty->As<sem::Struct>()) {