Update some type methods to PascalCase.
Most of the code base has been converted over to PascalCase. A few of
the methods on types remained as camelCase. This causes confusion as to
which to use, so this CL starts converting the renaming camelCase
methods to PascalCase.
Change-Id: Id2c608c4a6e9e2b30a16718bbc6f5babd62aeba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/203854
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/lang/core/constant/eval.cc b/src/tint/lang/core/constant/eval.cc
index ded2d07..5ca0c4e 100644
--- a/src/tint/lang/core/constant/eval.cc
+++ b/src/tint/lang/core/constant/eval.cc
@@ -1201,7 +1201,7 @@
Eval::Result Eval::Dot(const Source& source, const Value* v1, const Value* v2) {
auto* vec_ty = v1->Type()->As<core::type::Vector>();
TINT_ASSERT(vec_ty);
- auto* elem_ty = vec_ty->type();
+ auto* elem_ty = vec_ty->Type();
switch (vec_ty->Width()) {
case 2:
return Dispatch_fia_fiu32_f16( //
@@ -1375,10 +1375,10 @@
auto* m = static_cast<const core::type::Matrix*>(ty);
Vector<const Value*, 4> els;
- for (uint32_t c = 0; c < m->columns(); c++) {
+ for (uint32_t c = 0; c < m->Columns(); c++) {
Vector<const Value*, 4> column;
- for (uint32_t r = 0; r < m->rows(); r++) {
- auto i = r + c * m->rows();
+ for (uint32_t r = 0; r < m->Rows(); r++) {
+ auto i = r + c * m->Rows();
column.Push(args[i]);
}
els.Push(mgr.Composite(m->ColumnType(), std::move(column)));
@@ -1645,11 +1645,11 @@
const Source& source) {
auto* mat_ty = args[0]->Type()->As<core::type::Matrix>();
auto* vec_ty = args[1]->Type()->As<core::type::Vector>();
- auto* elem_ty = vec_ty->type();
+ auto* elem_ty = vec_ty->Type();
auto dot = [&](const Value* m, size_t row, const Value* v) {
Eval::Result result;
- switch (mat_ty->columns()) {
+ switch (mat_ty->Columns()) {
case 2:
result = Dispatch_fa_f32_f16(Dot2Func(source, elem_ty), //
m->Index(0)->Index(row), //
@@ -1681,7 +1681,7 @@
};
Vector<const Value*, 4> result;
- for (size_t i = 0; i < mat_ty->rows(); ++i) {
+ for (size_t i = 0; i < mat_ty->Rows(); ++i) {
auto r = dot(args[0], i, args[1]); // matrix row i * vector
if (r != Success) {
return error;
@@ -1695,11 +1695,11 @@
const Source& source) {
auto* vec_ty = args[0]->Type()->As<core::type::Vector>();
auto* mat_ty = args[1]->Type()->As<core::type::Matrix>();
- auto* elem_ty = vec_ty->type();
+ auto* elem_ty = vec_ty->Type();
auto dot = [&](const Value* v, const Value* m, size_t col) {
Eval::Result result;
- switch (mat_ty->rows()) {
+ switch (mat_ty->Rows()) {
case 2:
result = Dispatch_fa_f32_f16(Dot2Func(source, elem_ty), //
m->Index(col)->Index(0), //
@@ -1731,7 +1731,7 @@
};
Vector<const Value*, 4> result;
- for (size_t i = 0; i < mat_ty->columns(); ++i) {
+ for (size_t i = 0; i < mat_ty->Columns(); ++i) {
auto r = dot(args[0], args[1], i); // vector * matrix col i
if (r != Success) {
return error;
@@ -1748,14 +1748,14 @@
auto* mat2 = args[1];
auto* mat1_ty = mat1->Type()->As<core::type::Matrix>();
auto* mat2_ty = mat2->Type()->As<core::type::Matrix>();
- auto* elem_ty = mat1_ty->type();
+ auto* elem_ty = mat1_ty->Type();
auto dot = [&](const Value* m1, size_t row, const Value* m2, size_t col) {
auto m1e = [&](size_t r, size_t c) { return m1->Index(c)->Index(r); };
auto m2e = [&](size_t r, size_t c) { return m2->Index(c)->Index(r); };
Eval::Result result;
- switch (mat1_ty->columns()) {
+ switch (mat1_ty->Columns()) {
case 2:
result = Dispatch_fa_f32_f16(Dot2Func(source, elem_ty), //
m1e(row, 0), //
@@ -1788,9 +1788,9 @@
};
Vector<const Value*, 4> result_mat;
- for (size_t c = 0; c < mat2_ty->columns(); ++c) {
+ for (size_t c = 0; c < mat2_ty->Columns(); ++c) {
Vector<const Value*, 4> col_vec;
- for (size_t r = 0; r < mat1_ty->rows(); ++r) {
+ for (size_t r = 0; r < mat1_ty->Rows(); ++r) {
auto v = dot(mat1, r, mat2, c); // mat1 row r * mat2 col c
if (v != Success) {
return error;
@@ -2402,7 +2402,7 @@
const Source& source) {
auto* u = args[0];
auto* v = args[1];
- auto* elem_ty = u->Type()->As<core::type::Vector>()->type();
+ auto* elem_ty = u->Type()->As<core::type::Vector>()->Type();
// cross product of a v3 is the determinant of the 3x3 matrix:
//
@@ -2472,7 +2472,7 @@
auto* m = args[0];
auto* mat_ty = m->Type()->As<core::type::Matrix>();
auto me = [&](size_t r, size_t c) { return m->Index(c)->Index(r); };
- switch (mat_ty->rows()) {
+ switch (mat_ty->Rows()) {
case 2:
return Dispatch_fa_f32_f16(Det2Func(source, ty), //
me(0, 0), me(1, 0), //
@@ -3408,7 +3408,7 @@
auto* e1 = args[0];
auto* e2 = args[1];
auto* vec_ty = ty->As<core::type::Vector>();
- auto* el_ty = vec_ty->type();
+ auto* el_ty = vec_ty->Type();
// dot(e2, e1)
auto dot_e2_e1 = Dot(source, e2, e1);
@@ -3446,7 +3446,7 @@
VectorRef<const Value*> args,
const Source& source) {
auto* vec_ty = ty->As<core::type::Vector>();
- auto* el_ty = vec_ty->type();
+ auto* el_ty = vec_ty->Type();
auto compute_k = [&](auto e3, auto dot_e2_e1) -> Eval::Result {
using NumberT = decltype(e3);
@@ -3812,9 +3812,9 @@
// Produce column vectors from each row
Vector<const Value*, 4> result_mat;
- for (size_t r = 0; r < mat_ty->rows(); ++r) {
+ for (size_t r = 0; r < mat_ty->Rows(); ++r) {
Vector<const Value*, 4> new_col_vec;
- for (size_t c = 0; c < mat_ty->columns(); ++c) {
+ for (size_t c = 0; c < mat_ty->Columns(); ++c) {
new_col_vec.Push(me(r, c));
}
result_mat.Push(mgr.Composite(result_mat_ty->ColumnType(), new_col_vec));
diff --git a/src/tint/lang/core/constant/eval_construction_test.cc b/src/tint/lang/core/constant/eval_construction_test.cc
index d554c6e..473b120 100644
--- a/src/tint/lang/core/constant/eval_construction_test.cc
+++ b/src/tint/lang/core/constant/eval_construction_test.cc
@@ -178,10 +178,10 @@
EXPECT_EQ(sem->ConstantValue()->Index(i)->ValueAs<f32>(), 0.0f);
}
} else if (auto* mat = sem->Type()->As<core::type::Matrix>()) {
- for (size_t i = 0; i < mat->columns(); ++i) {
+ for (size_t i = 0; i < mat->Columns(); ++i) {
EXPECT_TRUE(sem->ConstantValue()->Index(i)->AnyZero());
EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllZero());
- for (size_t j = 0; j < mat->rows(); ++j) {
+ for (size_t j = 0; j < mat->Rows(); ++j) {
EXPECT_TRUE(sem->ConstantValue()->Index(i)->Index(j)->AnyZero());
EXPECT_TRUE(sem->ConstantValue()->Index(i)->Index(j)->AllZero());
EXPECT_EQ(sem->ConstantValue()->Index(i)->Index(j)->ValueAs<f32>(), 0.0f);
@@ -231,7 +231,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -260,7 +260,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -289,7 +289,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -320,7 +320,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -349,7 +349,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -378,7 +378,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -407,7 +407,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -436,7 +436,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -467,7 +467,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -497,7 +497,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -527,7 +527,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::AbstractInt>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::AbstractInt>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -557,7 +557,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::AbstractFloat>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::AbstractFloat>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -586,7 +586,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -615,7 +615,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -644,7 +644,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -675,7 +675,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -704,7 +704,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -733,7 +733,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -762,7 +762,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -791,7 +791,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -820,7 +820,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -849,7 +849,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -878,7 +878,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -907,7 +907,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -938,7 +938,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -969,7 +969,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -1000,7 +1000,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -1031,7 +1031,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -1062,7 +1062,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -1091,7 +1091,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -1120,7 +1120,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -1149,7 +1149,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::Bool>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -1178,9 +1178,9 @@
ASSERT_NE(sem, nullptr);
auto* mat = sem->Type()->As<core::type::Matrix>();
ASSERT_NE(mat, nullptr);
- EXPECT_TRUE(mat->type()->Is<core::type::F32>());
- EXPECT_EQ(mat->columns(), 2u);
- EXPECT_EQ(mat->rows(), 3u);
+ EXPECT_TRUE(mat->Type()->Is<core::type::F32>());
+ EXPECT_EQ(mat->Columns(), 2u);
+ EXPECT_EQ(mat->Rows(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
EXPECT_TRUE(sem->ConstantValue()->AllZero());
@@ -1222,9 +1222,9 @@
EXPECT_NE(sem, nullptr);
auto* mat = sem->Type()->As<core::type::Matrix>();
ASSERT_NE(mat, nullptr);
- EXPECT_TRUE(mat->type()->Is<core::type::F16>());
- EXPECT_EQ(mat->columns(), 2u);
- EXPECT_EQ(mat->rows(), 3u);
+ EXPECT_TRUE(mat->Type()->Is<core::type::F16>());
+ EXPECT_EQ(mat->Columns(), 2u);
+ EXPECT_EQ(mat->Rows(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
EXPECT_TRUE(sem->ConstantValue()->AllZero());
@@ -1264,9 +1264,9 @@
ASSERT_NE(sem, nullptr);
auto* mat = sem->Type()->As<core::type::Matrix>();
ASSERT_NE(mat, nullptr);
- EXPECT_TRUE(mat->type()->Is<core::type::F32>());
- EXPECT_EQ(mat->columns(), 3u);
- EXPECT_EQ(mat->rows(), 2u);
+ EXPECT_TRUE(mat->Type()->Is<core::type::F32>());
+ EXPECT_EQ(mat->Columns(), 3u);
+ EXPECT_EQ(mat->Rows(), 2u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
EXPECT_FALSE(sem->ConstantValue()->AllZero());
@@ -1309,9 +1309,9 @@
ASSERT_NE(sem, nullptr);
auto* mat = sem->Type()->As<core::type::Matrix>();
ASSERT_NE(mat, nullptr);
- EXPECT_TRUE(mat->type()->Is<core::type::F32>());
- EXPECT_EQ(mat->columns(), 3u);
- EXPECT_EQ(mat->rows(), 2u);
+ EXPECT_TRUE(mat->Type()->Is<core::type::F32>());
+ EXPECT_EQ(mat->Columns(), 3u);
+ EXPECT_EQ(mat->Rows(), 2u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
EXPECT_FALSE(sem->ConstantValue()->AllZero());
@@ -2030,7 +2030,7 @@
->Index(0)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs<f32>(), 0._f);
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs<f32>(), 0._f);
@@ -2043,7 +2043,7 @@
->Index(1)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs<f32>(), 0._f);
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs<f32>(), 0._f);
@@ -2056,7 +2056,7 @@
->Index(2)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(0)->ValueAs<f32>(), 0._f);
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(1)->ValueAs<f32>(), 0._f);
@@ -2095,7 +2095,7 @@
->Index(0)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::I32>());
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs<i32>(), 0_i);
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs<i32>(), 0_i);
@@ -2107,7 +2107,7 @@
->Index(1)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::U32>());
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs<u32>(), 0_u);
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs<u32>(), 0_u);
@@ -2120,7 +2120,7 @@
->Index(2)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(0)->ValueAs<f32>(), 0._f);
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(1)->ValueAs<f32>(), 0._f);
@@ -2134,7 +2134,7 @@
->Index(3)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F16>());
EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(0)->ValueAs<f16>(), 0._h);
EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(1)->ValueAs<f16>(), 0._h);
@@ -2147,7 +2147,7 @@
->Index(4)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::Bool>());
EXPECT_EQ(sem->ConstantValue()->Index(4)->Index(0)->ValueAs<bool>(), false);
EXPECT_EQ(sem->ConstantValue()->Index(4)->Index(1)->ValueAs<bool>(), false);
@@ -2278,7 +2278,7 @@
->Index(0)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::I32>());
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs<i32>(), 1_i);
EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs<i32>(), 1_i);
@@ -2290,7 +2290,7 @@
->Index(1)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::U32>());
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs<u32>(), 2_u);
EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs<u32>(), 2_u);
@@ -2303,7 +2303,7 @@
->Index(2)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(0)->ValueAs<f32>(), 3._f);
EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(1)->ValueAs<f32>(), 3._f);
@@ -2317,7 +2317,7 @@
->Index(3)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F16>());
EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(0)->ValueAs<f16>(), 4._h);
EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(1)->ValueAs<f16>(), 4._h);
@@ -2330,7 +2330,7 @@
->Index(4)
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::Bool>());
EXPECT_EQ(sem->ConstantValue()->Index(4)->Index(0)->ValueAs<bool>(), false);
EXPECT_EQ(sem->ConstantValue()->Index(4)->Index(1)->ValueAs<bool>(), false);
diff --git a/src/tint/lang/core/constant/eval_conversion_test.cc b/src/tint/lang/core/constant/eval_conversion_test.cc
index f1762a8..480da29 100644
--- a/src/tint/lang/core/constant/eval_conversion_test.cc
+++ b/src/tint/lang/core/constant/eval_conversion_test.cc
@@ -259,7 +259,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -288,7 +288,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -319,7 +319,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -350,7 +350,7 @@
EXPECT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -379,7 +379,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_FALSE(sem->ConstantValue()->AnyZero());
@@ -408,7 +408,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
@@ -453,7 +453,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F16>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F16>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
EXPECT_TRUE(sem->ConstantValue()->AnyZero());
diff --git a/src/tint/lang/core/constant/eval_indexing_test.cc b/src/tint/lang/core/constant/eval_indexing_test.cc
index f764e24..8583390 100644
--- a/src/tint/lang/core/constant/eval_indexing_test.cc
+++ b/src/tint/lang/core/constant/eval_indexing_test.cc
@@ -270,7 +270,7 @@
ASSERT_NE(sem, nullptr);
auto* vec = sem->Type()->As<core::type::Vector>();
ASSERT_NE(vec, nullptr);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type());
@@ -339,8 +339,8 @@
auto* ty = mat->Type()->As<core::type::Matrix>();
ASSERT_NE(mat->Type(), nullptr);
EXPECT_TRUE(ty->ColumnType()->Is<core::type::Vector>());
- EXPECT_EQ(ty->columns(), 2u);
- EXPECT_EQ(ty->rows(), 3u);
+ EXPECT_EQ(ty->Columns(), 2u);
+ EXPECT_EQ(ty->Rows(), 3u);
EXPECT_EQ(mat->ConstantValue()->Type(), mat->Type());
EXPECT_TRUE(mat->ConstantValue()->AnyZero());
EXPECT_FALSE(mat->ConstantValue()->AllZero());
@@ -374,7 +374,7 @@
EXPECT_NE(vec, nullptr);
auto* ty = vec->Type()->As<core::type::Vector>();
ASSERT_NE(vec->Type(), nullptr);
- EXPECT_TRUE(ty->type()->Is<core::type::F32>());
+ EXPECT_TRUE(ty->Type()->Is<core::type::F32>());
EXPECT_EQ(ty->Width(), 3u);
EXPECT_EQ(vec->ConstantValue()->Type(), vec->Type());
EXPECT_TRUE(vec->ConstantValue()->AnyZero());
diff --git a/src/tint/lang/core/constant/manager.cc b/src/tint/lang/core/constant/manager.cc
index d87bfe3..5da3c44 100644
--- a/src/tint/lang/core/constant/manager.cc
+++ b/src/tint/lang/core/constant/manager.cc
@@ -133,7 +133,7 @@
return Switch(
type, //
[&](const core::type::Vector* v) -> const Value* {
- auto* zero_el = Zero(v->type());
+ auto* zero_el = Zero(v->Type());
return Splat(type, zero_el);
},
[&](const core::type::Matrix* m) -> const Value* {
diff --git a/src/tint/lang/core/constant/value.cc b/src/tint/lang/core/constant/value.cc
index 97a64f1..195ee82 100644
--- a/src/tint/lang/core/constant/value.cc
+++ b/src/tint/lang/core/constant/value.cc
@@ -99,7 +99,7 @@
return Switch(
Type(), //
[&](const core::type::Vector* vec) { return elements_equal(vec->Width()); },
- [&](const core::type::Matrix* mat) { return elements_equal(mat->columns()); },
+ [&](const core::type::Matrix* mat) { return elements_equal(mat->Columns()); },
[&](const core::type::Struct* str) { return elements_equal(str->Members().Length()); },
[&](const core::type::Array* arr) {
if (auto n = arr->ConstantCount()) {
diff --git a/src/tint/lang/core/intrinsic/type_matchers.h b/src/tint/lang/core/intrinsic/type_matchers.h
index a7373fe..a17043a1 100644
--- a/src/tint/lang/core/intrinsic/type_matchers.h
+++ b/src/tint/lang/core/intrinsic/type_matchers.h
@@ -129,7 +129,7 @@
if (auto* v = ty->As<type::Vector>()) {
N = v->Width();
- T = v->type();
+ T = v->Type();
return true;
}
return false;
@@ -144,7 +144,7 @@
if (auto* v = ty->As<type::Vector>()) {
if (v->Width() == N) {
- T = v->type();
+ T = v->Type();
return true;
}
}
@@ -181,7 +181,7 @@
if (auto* v = ty->As<type::Vector>()) {
if (v->Packed()) {
- T = v->type();
+ T = v->Type();
return true;
}
}
@@ -206,9 +206,9 @@
return true;
}
if (auto* m = ty->As<type::Matrix>()) {
- M = m->columns();
+ M = m->Columns();
N = m->ColumnType()->Width();
- T = m->type();
+ T = m->Type();
return true;
}
return false;
@@ -221,8 +221,8 @@
return true;
}
if (auto* m = ty->As<type::Matrix>()) {
- if (m->columns() == C && m->rows() == R) {
- T = m->type();
+ if (m->Columns() == C && m->Rows() == R) {
+ T = m->Type();
return true;
}
}
@@ -408,7 +408,7 @@
if (ty->Is<intrinsic::Any>()) {
return true;
}
- return ty->Is([](const type::Sampler* s) { return s->kind() == type::SamplerKind::kSampler; });
+ return ty->Is([](const type::Sampler* s) { return s->Kind() == type::SamplerKind::kSampler; });
}
inline const type::Sampler* BuildSampler(intrinsic::MatchState& state, const type::Type*) {
@@ -420,7 +420,7 @@
return true;
}
return ty->Is(
- [](const type::Sampler* s) { return s->kind() == type::SamplerKind::kComparisonSampler; });
+ [](const type::Sampler* s) { return s->Kind() == type::SamplerKind::kComparisonSampler; });
}
inline const type::Sampler* BuildSamplerComparison(intrinsic::MatchState& state,
@@ -437,8 +437,8 @@
return true;
}
if (auto* v = ty->As<type::SampledTexture>()) {
- if (v->dim() == dim) {
- T = v->type();
+ if (v->Dim() == dim) {
+ T = v->Type();
return true;
}
}
@@ -474,8 +474,8 @@
return true;
}
if (auto* v = ty->As<type::MultisampledTexture>()) {
- if (v->dim() == dim) {
- T = v->type();
+ if (v->Dim() == dim) {
+ T = v->Type();
return true;
}
}
@@ -501,7 +501,7 @@
if (ty->Is<intrinsic::Any>()) {
return true;
}
- return ty->Is([&](const type::DepthTexture* t) { return t->dim() == dim; });
+ return ty->Is([&](const type::DepthTexture* t) { return t->Dim() == dim; });
}
#define DECLARE_DEPTH_TEXTURE(suffix, dim) \
@@ -525,7 +525,7 @@
return true;
}
return ty->Is([&](const type::DepthMultisampledTexture* t) {
- return t->dim() == type::TextureDimension::k2d;
+ return t->Dim() == type::TextureDimension::k2d;
});
}
@@ -545,9 +545,9 @@
return true;
}
if (auto* v = ty->As<type::StorageTexture>()) {
- if (v->dim() == dim) {
- F = intrinsic::Number(static_cast<uint32_t>(v->texel_format()));
- A = intrinsic::Number(static_cast<uint32_t>(v->access()));
+ if (v->Dim() == dim) {
+ F = intrinsic::Number(static_cast<uint32_t>(v->TexelFormat()));
+ A = intrinsic::Number(static_cast<uint32_t>(v->Access()));
return true;
}
}
@@ -592,7 +592,7 @@
return true;
}
if (auto* v = ty->As<type::InputAttachment>()) {
- T = v->type();
+ T = v->Type();
return true;
}
return false;
diff --git a/src/tint/lang/core/ir/binary/encode.cc b/src/tint/lang/core/ir/binary/encode.cc
index 7703b0c..03f88f7 100644
--- a/src/tint/lang/core/ir/binary/encode.cc
+++ b/src/tint/lang/core/ir/binary/encode.cc
@@ -406,13 +406,13 @@
void TypeVector(pb::TypeVector& vector_out, const core::type::Vector* vector_in) {
vector_out.set_width(vector_in->Width());
- vector_out.set_element_type(Type(vector_in->type()));
+ vector_out.set_element_type(Type(vector_in->Type()));
}
void TypeMatrix(pb::TypeMatrix& matrix_out, const core::type::Matrix* matrix_in) {
- matrix_out.set_num_columns(matrix_in->columns());
- matrix_out.set_num_rows(matrix_in->rows());
- matrix_out.set_element_type(Type(matrix_in->type()));
+ matrix_out.set_num_columns(matrix_in->Columns());
+ matrix_out.set_num_rows(matrix_in->Rows());
+ matrix_out.set_element_type(Type(matrix_in->Type()));
}
void TypePointer(pb::TypePointer& pointer_out, const core::type::Pointer* pointer_in) {
@@ -469,41 +469,41 @@
void TypeDepthTexture(pb::TypeDepthTexture& texture_out,
const core::type::DepthTexture* texture_in) {
- texture_out.set_dimension(TextureDimension(texture_in->dim()));
+ texture_out.set_dimension(TextureDimension(texture_in->Dim()));
}
void TypeSampledTexture(pb::TypeSampledTexture& texture_out,
const core::type::SampledTexture* texture_in) {
- texture_out.set_dimension(TextureDimension(texture_in->dim()));
- texture_out.set_sub_type(Type(texture_in->type()));
+ texture_out.set_dimension(TextureDimension(texture_in->Dim()));
+ texture_out.set_sub_type(Type(texture_in->Type()));
}
void TypeMultisampledTexture(pb::TypeMultisampledTexture& texture_out,
const core::type::MultisampledTexture* texture_in) {
- texture_out.set_dimension(TextureDimension(texture_in->dim()));
- texture_out.set_sub_type(Type(texture_in->type()));
+ texture_out.set_dimension(TextureDimension(texture_in->Dim()));
+ texture_out.set_sub_type(Type(texture_in->Type()));
}
void TypeDepthMultisampledTexture(pb::TypeDepthMultisampledTexture& texture_out,
const core::type::DepthMultisampledTexture* texture_in) {
- texture_out.set_dimension(TextureDimension(texture_in->dim()));
+ texture_out.set_dimension(TextureDimension(texture_in->Dim()));
}
void TypeStorageTexture(pb::TypeStorageTexture& texture_out,
const core::type::StorageTexture* texture_in) {
- texture_out.set_dimension(TextureDimension(texture_in->dim()));
- texture_out.set_texel_format(TexelFormat(texture_in->texel_format()));
- texture_out.set_access(AccessControl(texture_in->access()));
+ texture_out.set_dimension(TextureDimension(texture_in->Dim()));
+ texture_out.set_texel_format(TexelFormat(texture_in->TexelFormat()));
+ texture_out.set_access(AccessControl(texture_in->Access()));
}
void TypeExternalTexture(pb::TypeExternalTexture&, const core::type::ExternalTexture*) {}
void TypeInputAttachment(pb::TypeInputAttachment& input_attachment_out,
const core::type::InputAttachment* input_attachment_in) {
- input_attachment_out.set_sub_type(Type(input_attachment_in->type()));
+ input_attachment_out.set_sub_type(Type(input_attachment_in->Type()));
}
void TypeSampler(pb::TypeSampler& sampler_out, const core::type::Sampler* sampler_in) {
- sampler_out.set_kind(SamplerKind(sampler_in->kind()));
+ sampler_out.set_kind(SamplerKind(sampler_in->Kind()));
}
////////////////////////////////////////////////////////////////////////////
diff --git a/src/tint/lang/core/ir/builder.cc b/src/tint/lang/core/ir/builder.cc
index 5cad9c1..cb220b9 100644
--- a/src/tint/lang/core/ir/builder.cc
+++ b/src/tint/lang/core/ir/builder.cc
@@ -150,7 +150,7 @@
auto* vec_ty = vec_ptr_ty->StoreType()->As<core::type::Vector>();
TINT_ASSERT(vec_ty);
if (TINT_LIKELY(vec_ty)) {
- return vec_ty->type();
+ return vec_ty->Type();
}
}
return ir.Types().i32();
diff --git a/src/tint/lang/core/ir/transform/bgra8unorm_polyfill.cc b/src/tint/lang/core/ir/transform/bgra8unorm_polyfill.cc
index 9e6002f..8d1fd84 100644
--- a/src/tint/lang/core/ir/transform/bgra8unorm_polyfill.cc
+++ b/src/tint/lang/core/ir/transform/bgra8unorm_polyfill.cc
@@ -69,7 +69,7 @@
}
auto* storage_texture = ptr->StoreType()->As<core::type::StorageTexture>();
if (storage_texture &&
- storage_texture->texel_format() == core::TexelFormat::kBgra8Unorm) {
+ storage_texture->TexelFormat() == core::TexelFormat::kBgra8Unorm) {
ReplaceVar(var, storage_texture);
to_remove.Push(var);
}
@@ -85,7 +85,7 @@
auto* param = func->Params()[index];
auto* storage_texture = param->Type()->As<core::type::StorageTexture>();
if (storage_texture &&
- storage_texture->texel_format() == core::TexelFormat::kBgra8Unorm) {
+ storage_texture->TexelFormat() == core::TexelFormat::kBgra8Unorm) {
ReplaceParameter(func, param, index, storage_texture);
}
}
@@ -98,7 +98,7 @@
void ReplaceVar(Var* old_var, const core::type::StorageTexture* bgra8) {
// Redeclare the variable with a rgba8unorm texel format.
auto* rgba8 = ty.Get<core::type::StorageTexture>(
- bgra8->dim(), core::TexelFormat::kRgba8Unorm, bgra8->access(), bgra8->type());
+ bgra8->Dim(), core::TexelFormat::kRgba8Unorm, bgra8->Access(), bgra8->Type());
auto* new_var = b.Var(ty.ptr(handle, rgba8));
auto bp = old_var->BindingPoint();
new_var->SetBindingPoint(bp->group, bp->binding);
@@ -122,7 +122,7 @@
const core::type::StorageTexture* bgra8) {
// Redeclare the parameter with a rgba8unorm texel format.
auto* rgba8 = ty.Get<core::type::StorageTexture>(
- bgra8->dim(), core::TexelFormat::kRgba8Unorm, bgra8->access(), bgra8->type());
+ bgra8->Dim(), core::TexelFormat::kRgba8Unorm, bgra8->Access(), bgra8->Type());
auto* new_param = b.FunctionParam(rgba8);
if (auto name = ir.NameOf(old_param)) {
ir.SetName(new_param, name.NameView());
@@ -156,7 +156,7 @@
if (call->Func() == core::BuiltinFn::kTextureStore) {
// Swizzle the value argument of a `textureStore()` builtin.
auto* tex = old_value->Type()->As<core::type::StorageTexture>();
- auto index = core::type::IsTextureArray(tex->dim()) ? 3u : 2u;
+ auto index = core::type::IsTextureArray(tex->Dim()) ? 3u : 2u;
auto* value = call->Args()[index];
auto* swizzle = b.Swizzle(value->Type(), value, Vector{2u, 1u, 0u, 3u});
swizzle->InsertBefore(call);
diff --git a/src/tint/lang/core/ir/transform/binary_polyfill.cc b/src/tint/lang/core/ir/transform/binary_polyfill.cc
index db8fa5f..43c46b2 100644
--- a/src/tint/lang/core/ir/transform/binary_polyfill.cc
+++ b/src/tint/lang/core/ir/transform/binary_polyfill.cc
@@ -118,7 +118,7 @@
StringStream name;
name << "tint_" << (is_div ? "div_" : "mod_");
if (auto* vec = result_ty->As<type::Vector>()) {
- name << "v" << vec->Width() << vec->type()->FriendlyName();
+ name << "v" << vec->Width() << vec->Type()->FriendlyName();
} else {
name << result_ty->FriendlyName();
}
diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill.cc b/src/tint/lang/core/ir/transform/builtin_polyfill.cc
index 97433c0..b40447d 100644
--- a/src/tint/lang/core/ir/transform/builtin_polyfill.cc
+++ b/src/tint/lang/core/ir/transform/builtin_polyfill.cc
@@ -124,8 +124,8 @@
if (config.texture_sample_base_clamp_to_edge_2d_f32) {
auto* tex =
builtin->Args()[0]->Type()->As<core::type::SampledTexture>();
- if (tex && tex->dim() == core::type::TextureDimension::k2d &&
- tex->type()->Is<core::type::F32>()) {
+ if (tex && tex->Dim() == core::type::TextureDimension::k2d &&
+ tex->Type()->Is<core::type::F32>()) {
worklist.Push(builtin);
}
}
diff --git a/src/tint/lang/core/ir/transform/conversion_polyfill.cc b/src/tint/lang/core/ir/transform/conversion_polyfill.cc
index 5c3e80d..87b3cfb 100644
--- a/src/tint/lang/core/ir/transform/conversion_polyfill.cc
+++ b/src/tint/lang/core/ir/transform/conversion_polyfill.cc
@@ -100,13 +100,13 @@
StringStream name;
name << "tint_";
if (auto* src_vec = src_ty->As<type::Vector>()) {
- name << "v" << src_vec->Width() << src_vec->type()->FriendlyName();
+ name << "v" << src_vec->Width() << src_vec->Type()->FriendlyName();
} else {
name << src_ty->FriendlyName();
}
name << "_to_";
if (auto* res_vec = res_ty->As<type::Vector>()) {
- name << "v" << res_vec->Width() << res_vec->type()->FriendlyName();
+ name << "v" << res_vec->Width() << res_vec->Type()->FriendlyName();
} else {
name << res_ty->FriendlyName();
}
diff --git a/src/tint/lang/core/ir/transform/preserve_padding.cc b/src/tint/lang/core/ir/transform/preserve_padding.cc
index 550d67d..8ec3a4e 100644
--- a/src/tint/lang/core/ir/transform/preserve_padding.cc
+++ b/src/tint/lang/core/ir/transform/preserve_padding.cc
@@ -143,7 +143,7 @@
});
},
[&](const type::Matrix* mat) {
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
auto* col_ptr =
b.Access(ty.ptr(storage, mat->ColumnType()), target, u32(i));
auto* col_value = b.Access(mat->ColumnType(), value_param, u32(i));
diff --git a/src/tint/lang/core/ir/transform/rename_conflicts.cc b/src/tint/lang/core/ir/transform/rename_conflicts.cc
index 17733e7..597a1fe 100644
--- a/src/tint/lang/core/ir/transform/rename_conflicts.cc
+++ b/src/tint/lang/core/ir/transform/rename_conflicts.cc
@@ -1,3 +1,4 @@
+
// Copyright 2023 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
@@ -222,13 +223,13 @@
},
[&](const core::type::Vector* v) {
EnsureResolvesTo("vec" + tint::ToString(v->Width()), nullptr);
- return v->type();
+ return v->Type();
},
[&](const core::type::Matrix* m) {
EnsureResolvesTo(
- "mat" + tint::ToString(m->columns()) + "x" + tint::ToString(m->rows()),
+ "mat" + tint::ToString(m->Columns()) + "x" + tint::ToString(m->Rows()),
nullptr);
- return m->type();
+ return m->Type();
},
[&](const core::type::Pointer* p) {
EnsureResolvesTo(tint::ToString(p->Access()), nullptr);
diff --git a/src/tint/lang/core/ir/transform/robustness.cc b/src/tint/lang/core/ir/transform/robustness.cc
index c7292e6..e6aaf32 100644
--- a/src/tint/lang/core/ir/transform/robustness.cc
+++ b/src/tint/lang/core/ir/transform/robustness.cc
@@ -219,7 +219,7 @@
return b.Constant(u32(vec->Width() - 1u));
},
[&](const type::Matrix* mat) -> ir::Value* {
- return b.Constant(u32(mat->columns() - 1u));
+ return b.Constant(u32(mat->Columns() - 1u));
},
[&](const type::Array* arr) -> ir::Value* {
if (arr->ConstantCount()) {
@@ -311,7 +311,7 @@
case core::BuiltinFn::kTextureLoad: {
clamp_coords(1u);
uint32_t next_arg = 2u;
- if (type::IsTextureArray(texture->dim())) {
+ if (type::IsTextureArray(texture->Dim())) {
clamp_array_index(next_arg++);
}
if (texture->IsAnyOf<type::SampledTexture, type::DepthTexture>()) {
@@ -321,7 +321,7 @@
}
case core::BuiltinFn::kTextureStore: {
clamp_coords(1u);
- if (type::IsTextureArray(texture->dim())) {
+ if (type::IsTextureArray(texture->Dim())) {
clamp_array_index(2u);
}
break;
diff --git a/src/tint/lang/core/ir/transform/std140.cc b/src/tint/lang/core/ir/transform/std140.cc
index 67aeb3d..53d34fd 100644
--- a/src/tint/lang/core/ir/transform/std140.cc
+++ b/src/tint/lang/core/ir/transform/std140.cc
@@ -159,7 +159,7 @@
member_index_map.Add(member, member_index);
auto* col = mat->ColumnType();
uint32_t offset = member->Offset();
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
StringStream ss;
ss << member->Name().Name() << "_col" << std::to_string(i);
new_members.Push(ty.Get<core::type::StructMember>(
@@ -202,13 +202,13 @@
return mat;
}
StringStream name;
- name << "mat" << mat->columns() << "x" << mat->rows() << "_"
- << mat->ColumnType()->type()->FriendlyName() << "_std140";
+ name << "mat" << mat->Columns() << "x" << mat->Rows() << "_"
+ << mat->ColumnType()->Type()->FriendlyName() << "_std140";
Vector<core::type::StructMember*, 4> members;
// Decompose these matrices into a separate member for each column.
auto* col = mat->ColumnType();
uint32_t offset = 0;
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
StringStream ss;
ss << "col" << std::to_string(i);
members.Push(ty.Get<core::type::StructMember>(
@@ -220,8 +220,8 @@
// Create a new struct with the rewritten members.
return ty.Get<core::type::Struct>(
sym.New(name.str()), std::move(members), col->Align(),
- col->Align() * mat->columns(),
- (col->Align() * (mat->columns() - 1)) + col->Size());
+ col->Align() * mat->Columns(),
+ (col->Align() * (mat->Columns() - 1)) + col->Size());
},
[&](Default) {
// This type cannot contain a matrix, so no changes needed.
@@ -241,7 +241,7 @@
auto first_column = indices.Back()->As<Constant>()->Value()->ValueAs<uint32_t>();
Vector<Value*, 4> column_indices(std::move(indices));
Vector<Value*, 4> args;
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
column_indices.Back() = b.Constant(u32(first_column + i));
if (is_ptr) {
auto* access = b.Access(ty.ptr(uniform, mat->ColumnType()), root, column_indices);
@@ -279,7 +279,7 @@
if (auto* mat = NeedsDecomposing(member->Type())) {
args.Push(
RebuildMatrix(mat, input, Vector{b.Constant(u32(index))}));
- index += mat->columns();
+ index += mat->Columns();
} else {
// Extract and convert the member.
auto* type = input_str->Element(index);
diff --git a/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors.cc b/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors.cc
index 86f454a..6f24300 100644
--- a/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors.cc
+++ b/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors.cc
@@ -77,7 +77,7 @@
// Collect consecutive scalars into column vectors.
Vector<Value*, 4> columns;
- for (uint32_t c = 0; c < mat->columns(); c++) {
+ for (uint32_t c = 0; c < mat->Columns(); c++) {
Vector<Value*, 4> values;
for (uint32_t r = 0; r < col->Width(); r++) {
values.Push(scalars[c * col->Width() + r]);
diff --git a/src/tint/lang/core/ir/validator.cc b/src/tint/lang/core/ir/validator.cc
index f7b5af1..2afd202 100644
--- a/src/tint/lang/core/ir/validator.cc
+++ b/src/tint/lang/core/ir/validator.cc
@@ -2179,7 +2179,7 @@
if (TINT_LIKELY(memory_view_ty)) {
auto* vec_ty = memory_view_ty->StoreType()->As<core::type::Vector>();
if (TINT_LIKELY(vec_ty)) {
- return vec_ty->type();
+ return vec_ty->Type();
}
}
diff --git a/src/tint/lang/core/type/builtin_structs.cc b/src/tint/lang/core/type/builtin_structs.cc
index 31af873..b77aee1 100644
--- a/src/tint/lang/core/type/builtin_structs.cc
+++ b/src/tint/lang/core/type/builtin_structs.cc
@@ -92,7 +92,7 @@
[&](const Vector* vec) {
auto width = vec->Width();
return Switch(
- vec->type(), //
+ vec->Type(), //
[&](const F32*) { return build(kModfVecF32Names[width - 2], vec); },
[&](const F16*) { return build(kModfVecF16Names[width - 2], vec); },
[&](const AbstractFloat*) {
@@ -153,7 +153,7 @@
[&](const Vector* vec) {
auto width = vec->Width();
return Switch(
- vec->type(), //
+ vec->Type(), //
[&](const F32*) {
return build(kFrexpVecF32Names[width - 2], ty, types.vec(types.i32(), width));
},
diff --git a/src/tint/lang/core/type/depth_multisampled_texture.cc b/src/tint/lang/core/type/depth_multisampled_texture.cc
index 81bf7de..faa5250 100644
--- a/src/tint/lang/core/type/depth_multisampled_texture.cc
+++ b/src/tint/lang/core/type/depth_multisampled_texture.cc
@@ -47,19 +47,19 @@
bool DepthMultisampledTexture::Equals(const UniqueNode& other) const {
if (auto* o = other.As<DepthMultisampledTexture>()) {
- return o->dim() == dim();
+ return o->Dim() == Dim();
}
return false;
}
std::string DepthMultisampledTexture::FriendlyName() const {
StringStream out;
- out << "texture_depth_multisampled_" << dim();
+ out << "texture_depth_multisampled_" << Dim();
return out.str();
}
DepthMultisampledTexture* DepthMultisampledTexture::Clone(CloneContext& ctx) const {
- return ctx.dst.mgr->Get<DepthMultisampledTexture>(dim());
+ return ctx.dst.mgr->Get<DepthMultisampledTexture>(Dim());
}
bool DepthMultisampledTexture::IsValidDimension(TextureDimension dim) {
diff --git a/src/tint/lang/core/type/depth_multisampled_texture_test.cc b/src/tint/lang/core/type/depth_multisampled_texture_test.cc
index b2c5648..c6200a5 100644
--- a/src/tint/lang/core/type/depth_multisampled_texture_test.cc
+++ b/src/tint/lang/core/type/depth_multisampled_texture_test.cc
@@ -63,7 +63,7 @@
TEST_F(DepthMultisampledTextureTest, Dim) {
DepthMultisampledTexture d(TextureDimension::k2d);
- EXPECT_EQ(d.dim(), TextureDimension::k2d);
+ EXPECT_EQ(d.Dim(), TextureDimension::k2d);
}
TEST_F(DepthMultisampledTextureTest, FriendlyName) {
@@ -78,7 +78,7 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* dt = a->Clone(ctx);
- EXPECT_EQ(dt->dim(), TextureDimension::k2d);
+ EXPECT_EQ(dt->Dim(), TextureDimension::k2d);
}
} // namespace
diff --git a/src/tint/lang/core/type/depth_texture.cc b/src/tint/lang/core/type/depth_texture.cc
index b6a2e2b..0df9bc8 100644
--- a/src/tint/lang/core/type/depth_texture.cc
+++ b/src/tint/lang/core/type/depth_texture.cc
@@ -47,19 +47,19 @@
bool DepthTexture::Equals(const UniqueNode& other) const {
if (auto* o = other.As<DepthTexture>()) {
- return o->dim() == dim();
+ return o->Dim() == Dim();
}
return false;
}
std::string DepthTexture::FriendlyName() const {
StringStream out;
- out << "texture_depth_" << dim();
+ out << "texture_depth_" << Dim();
return out.str();
}
DepthTexture* DepthTexture::Clone(CloneContext& ctx) const {
- return ctx.dst.mgr->Get<DepthTexture>(dim());
+ return ctx.dst.mgr->Get<DepthTexture>(Dim());
}
bool DepthTexture::IsValidDimension(TextureDimension dim) {
diff --git a/src/tint/lang/core/type/depth_texture_test.cc b/src/tint/lang/core/type/depth_texture_test.cc
index 771d8f7..11e9309 100644
--- a/src/tint/lang/core/type/depth_texture_test.cc
+++ b/src/tint/lang/core/type/depth_texture_test.cc
@@ -77,7 +77,7 @@
TEST_F(DepthTextureTest, Dim) {
DepthTexture d(TextureDimension::kCube);
- EXPECT_EQ(d.dim(), TextureDimension::kCube);
+ EXPECT_EQ(d.Dim(), TextureDimension::kCube);
}
TEST_F(DepthTextureTest, FriendlyName) {
@@ -92,7 +92,7 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* dt = a->Clone(ctx);
- EXPECT_EQ(dt->dim(), TextureDimension::k2d);
+ EXPECT_EQ(dt->Dim(), TextureDimension::k2d);
}
} // namespace
diff --git a/src/tint/lang/core/type/external_texture_test.cc b/src/tint/lang/core/type/external_texture_test.cc
index d856dd1..1e107c1 100644
--- a/src/tint/lang/core/type/external_texture_test.cc
+++ b/src/tint/lang/core/type/external_texture_test.cc
@@ -74,7 +74,7 @@
TEST_F(ExternalTextureTest, Dim) {
F32 f32;
ExternalTexture s;
- EXPECT_EQ(s.dim(), TextureDimension::k2d);
+ EXPECT_EQ(s.Dim(), TextureDimension::k2d);
}
TEST_F(ExternalTextureTest, FriendlyName) {
diff --git a/src/tint/lang/core/type/input_attachment.cc b/src/tint/lang/core/type/input_attachment.cc
index 11c96be..65e05e8 100644
--- a/src/tint/lang/core/type/input_attachment.cc
+++ b/src/tint/lang/core/type/input_attachment.cc
@@ -38,7 +38,7 @@
namespace tint::core::type {
-InputAttachment::InputAttachment(const Type* type)
+InputAttachment::InputAttachment(const type::Type* type)
: Base(Hash(TypeCode::Of<InputAttachment>().bits, type), TextureDimension::k2d), type_(type) {
TINT_ASSERT(type_);
}
diff --git a/src/tint/lang/core/type/input_attachment.h b/src/tint/lang/core/type/input_attachment.h
index 7feae62..d364876 100644
--- a/src/tint/lang/core/type/input_attachment.h
+++ b/src/tint/lang/core/type/input_attachment.h
@@ -39,7 +39,7 @@
public:
/// Constructor
/// @param type the data type of the input attachment
- explicit InputAttachment(const Type* type);
+ explicit InputAttachment(const type::Type* type);
/// Destructor
~InputAttachment() override;
@@ -48,7 +48,7 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the subtype of the input attachment
- Type* type() const { return const_cast<Type*>(type_); }
+ const type::Type* Type() const { return type_; }
/// @returns the name for this type that closely resembles how it would be
/// declared in WGSL.
@@ -59,7 +59,7 @@
InputAttachment* Clone(CloneContext& ctx) const override;
private:
- const Type* const type_;
+ const type::Type* type_;
};
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/input_attachment_test.cc b/src/tint/lang/core/type/input_attachment_test.cc
index 2a0584c..418484c 100644
--- a/src/tint/lang/core/type/input_attachment_test.cc
+++ b/src/tint/lang/core/type/input_attachment_test.cc
@@ -81,7 +81,7 @@
TEST_F(InputAttachmentTest, Dim) {
F32 f32;
InputAttachment s(&f32);
- EXPECT_EQ(s.dim(), TextureDimension::k2d);
+ EXPECT_EQ(s.Dim(), TextureDimension::k2d);
}
TEST_F(InputAttachmentTest, FriendlyName) {
@@ -99,11 +99,11 @@
auto* c = a->Clone(ctx);
ASSERT_TRUE(c->Is<InputAttachment>());
- EXPECT_TRUE(c->type()->Is<F32>());
+ EXPECT_TRUE(c->Type()->Is<F32>());
auto* d = b->Clone(ctx);
ASSERT_TRUE(d->Is<InputAttachment>());
- EXPECT_TRUE(d->type()->Is<I32>());
+ EXPECT_TRUE(d->Type()->Is<I32>());
}
} // namespace
diff --git a/src/tint/lang/core/type/matrix.cc b/src/tint/lang/core/type/matrix.cc
index f6d1c16..a811a8f 100644
--- a/src/tint/lang/core/type/matrix.cc
+++ b/src/tint/lang/core/type/matrix.cc
@@ -45,7 +45,7 @@
Flag::kCreationFixedFootprint,
Flag::kFixedFootprint,
}),
- subtype_(column_type->type()),
+ subtype_(column_type->Type()),
column_type_(column_type),
rows_(column_type->Width()),
columns_(columns) {
@@ -71,7 +71,7 @@
}
uint32_t Matrix::Size() const {
- return column_type_->Align() * columns();
+ return column_type_->Align() * Columns();
}
uint32_t Matrix::Align() const {
@@ -82,7 +82,7 @@
return column_type_->Align();
}
-TypeAndCount Matrix::Elements(const Type* /* type_if_invalid = nullptr */,
+TypeAndCount Matrix::Elements(const type::Type* /* type_if_invalid = nullptr */,
uint32_t /* count_if_invalid = 0 */) const {
return {column_type_, columns_};
}
diff --git a/src/tint/lang/core/type/matrix.h b/src/tint/lang/core/type/matrix.h
index 052944e..329490b 100644
--- a/src/tint/lang/core/type/matrix.h
+++ b/src/tint/lang/core/type/matrix.h
@@ -55,11 +55,11 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the type of the matrix
- const Type* type() const { return subtype_; }
+ const type::Type* Type() const { return subtype_; }
/// @returns the number of rows in the matrix
- uint32_t rows() const { return rows_; }
+ uint32_t Rows() const { return rows_; }
/// @returns the number of columns in the matrix
- uint32_t columns() const { return columns_; }
+ uint32_t Columns() const { return columns_; }
/// @returns the column-vector type of the matrix
const Vector* ColumnType() const { return column_type_; }
@@ -79,7 +79,7 @@
uint32_t ColumnStride() const;
/// @copydoc Type::Elements
- TypeAndCount Elements(const Type* type_if_invalid = nullptr,
+ TypeAndCount Elements(const type::Type* type_if_invalid = nullptr,
uint32_t count_if_invalid = 0) const override;
/// @copydoc Type::Element
@@ -90,7 +90,7 @@
Matrix* Clone(CloneContext& ctx) const override;
private:
- const Type* const subtype_;
+ const type::Type* const subtype_;
const Vector* const column_type_;
const uint32_t rows_;
const uint32_t columns_;
diff --git a/src/tint/lang/core/type/matrix_test.cc b/src/tint/lang/core/type/matrix_test.cc
index 2cbf0c1..e5a7946 100644
--- a/src/tint/lang/core/type/matrix_test.cc
+++ b/src/tint/lang/core/type/matrix_test.cc
@@ -40,9 +40,9 @@
auto* d = create<Matrix>(create<Vector>(create<I32>(), 2u), 4u);
auto* e = create<Matrix>(create<Vector>(create<I32>(), 3u), 2u);
- EXPECT_EQ(a->type(), create<I32>());
- EXPECT_EQ(a->rows(), 3u);
- EXPECT_EQ(a->columns(), 4u);
+ EXPECT_EQ(a->Type(), create<I32>());
+ EXPECT_EQ(a->Rows(), 3u);
+ EXPECT_EQ(a->Columns(), 4u);
EXPECT_EQ(a, b);
EXPECT_NE(a, c);
@@ -85,9 +85,9 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* mat = a->Clone(ctx);
- EXPECT_TRUE(mat->type()->Is<I32>());
- EXPECT_EQ(mat->rows(), 3u);
- EXPECT_EQ(mat->columns(), 4u);
+ EXPECT_TRUE(mat->Type()->Is<I32>());
+ EXPECT_EQ(mat->Rows(), 3u);
+ EXPECT_EQ(mat->Columns(), 4u);
}
} // namespace
diff --git a/src/tint/lang/core/type/multisampled_texture.cc b/src/tint/lang/core/type/multisampled_texture.cc
index 3094042..50e41bc 100644
--- a/src/tint/lang/core/type/multisampled_texture.cc
+++ b/src/tint/lang/core/type/multisampled_texture.cc
@@ -38,7 +38,7 @@
namespace tint::core::type {
-MultisampledTexture::MultisampledTexture(TextureDimension dim, const Type* type)
+MultisampledTexture::MultisampledTexture(TextureDimension dim, const type::Type* type)
: Base(Hash(tint::TypeCode::Of<MultisampledTexture>().bits, dim, type), dim), type_(type) {
TINT_ASSERT(type_);
}
@@ -47,20 +47,20 @@
bool MultisampledTexture::Equals(const UniqueNode& other) const {
if (auto* o = other.As<MultisampledTexture>()) {
- return o->dim() == dim() && o->type_ == type_;
+ return o->Dim() == Dim() && o->type_ == type_;
}
return false;
}
std::string MultisampledTexture::FriendlyName() const {
StringStream out;
- out << "texture_multisampled_" << dim() << "<" << type_->FriendlyName() << ">";
+ out << "texture_multisampled_" << Dim() << "<" << type_->FriendlyName() << ">";
return out.str();
}
MultisampledTexture* MultisampledTexture::Clone(CloneContext& ctx) const {
auto* ty = type_->Clone(ctx);
- return ctx.dst.mgr->Get<MultisampledTexture>(dim(), ty);
+ return ctx.dst.mgr->Get<MultisampledTexture>(Dim(), ty);
}
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/multisampled_texture.h b/src/tint/lang/core/type/multisampled_texture.h
index a1edfcc..190bdaf 100644
--- a/src/tint/lang/core/type/multisampled_texture.h
+++ b/src/tint/lang/core/type/multisampled_texture.h
@@ -41,7 +41,7 @@
/// Constructor
/// @param dim the dimensionality of the texture
/// @param type the data type of the multisampled texture
- MultisampledTexture(TextureDimension dim, const Type* type);
+ MultisampledTexture(TextureDimension dim, const type::Type* type);
/// Destructor
~MultisampledTexture() override;
@@ -51,7 +51,7 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the subtype of the sampled texture
- const Type* type() const { return type_; }
+ const type::Type* Type() const { return type_; }
/// @returns the name for this type that closely resembles how it would be
/// declared in WGSL.
@@ -62,7 +62,7 @@
MultisampledTexture* Clone(CloneContext& ctx) const override;
private:
- const Type* const type_;
+ const type::Type* const type_;
};
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/multisampled_texture_test.cc b/src/tint/lang/core/type/multisampled_texture_test.cc
index 1368c00..580eb9d 100644
--- a/src/tint/lang/core/type/multisampled_texture_test.cc
+++ b/src/tint/lang/core/type/multisampled_texture_test.cc
@@ -82,13 +82,13 @@
TEST_F(MultisampledTextureTest, Dim) {
F32 f32;
MultisampledTexture s(TextureDimension::k3d, &f32);
- EXPECT_EQ(s.dim(), TextureDimension::k3d);
+ EXPECT_EQ(s.Dim(), TextureDimension::k3d);
}
TEST_F(MultisampledTextureTest, Type) {
F32 f32;
MultisampledTexture s(TextureDimension::k3d, &f32);
- EXPECT_EQ(s.type(), &f32);
+ EXPECT_EQ(s.Type(), &f32);
}
TEST_F(MultisampledTextureTest, FriendlyName) {
@@ -104,8 +104,8 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* mt = a->Clone(ctx);
- EXPECT_EQ(mt->dim(), TextureDimension::k2d);
- EXPECT_TRUE(mt->type()->Is<F32>());
+ EXPECT_EQ(mt->Dim(), TextureDimension::k2d);
+ EXPECT_TRUE(mt->Type()->Is<F32>());
}
} // namespace
diff --git a/src/tint/lang/core/type/sampled_texture.cc b/src/tint/lang/core/type/sampled_texture.cc
index d8e6308..efea9ad 100644
--- a/src/tint/lang/core/type/sampled_texture.cc
+++ b/src/tint/lang/core/type/sampled_texture.cc
@@ -38,7 +38,7 @@
namespace tint::core::type {
-SampledTexture::SampledTexture(TextureDimension dim, const Type* type)
+SampledTexture::SampledTexture(TextureDimension dim, const type::Type* type)
: Base(Hash(TypeCode::Of<SampledTexture>().bits, dim, type), dim), type_(type) {
TINT_ASSERT(type_);
}
@@ -47,20 +47,20 @@
bool SampledTexture::Equals(const UniqueNode& other) const {
if (auto* o = other.As<SampledTexture>()) {
- return o->dim() == dim() && o->type_ == type_;
+ return o->Dim() == Dim() && o->type_ == type_;
}
return false;
}
std::string SampledTexture::FriendlyName() const {
StringStream out;
- out << "texture_" << dim() << "<" << type_->FriendlyName() << ">";
+ out << "texture_" << Dim() << "<" << type_->FriendlyName() << ">";
return out.str();
}
SampledTexture* SampledTexture::Clone(CloneContext& ctx) const {
auto* ty = type_->Clone(ctx);
- return ctx.dst.mgr->Get<SampledTexture>(dim(), ty);
+ return ctx.dst.mgr->Get<SampledTexture>(Dim(), ty);
}
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/sampled_texture.h b/src/tint/lang/core/type/sampled_texture.h
index c3ef693..27d5586 100644
--- a/src/tint/lang/core/type/sampled_texture.h
+++ b/src/tint/lang/core/type/sampled_texture.h
@@ -41,7 +41,7 @@
/// Constructor
/// @param dim the dimensionality of the texture
/// @param type the data type of the sampled texture
- SampledTexture(TextureDimension dim, const Type* type);
+ SampledTexture(TextureDimension dim, const type::Type* type);
/// Destructor
~SampledTexture() override;
@@ -51,7 +51,7 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the subtype of the sampled texture
- Type* type() const { return const_cast<Type*>(type_); }
+ const type::Type* Type() const { return type_; }
/// @returns the name for this type that closely resembles how it would be
/// declared in WGSL.
@@ -62,7 +62,7 @@
SampledTexture* Clone(CloneContext& ctx) const override;
private:
- const Type* const type_;
+ const type::Type* type_;
};
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/sampled_texture_test.cc b/src/tint/lang/core/type/sampled_texture_test.cc
index 0c67600..598b7ce 100644
--- a/src/tint/lang/core/type/sampled_texture_test.cc
+++ b/src/tint/lang/core/type/sampled_texture_test.cc
@@ -45,8 +45,8 @@
auto* c = create<SampledTexture>(TextureDimension::k2d, create<F32>());
auto* d = create<SampledTexture>(TextureDimension::kCube, create<I32>());
- EXPECT_TRUE(a->type()->Is<F32>());
- EXPECT_EQ(a->dim(), TextureDimension::kCube);
+ EXPECT_TRUE(a->Type()->Is<F32>());
+ EXPECT_EQ(a->Dim(), TextureDimension::kCube);
EXPECT_EQ(a, b);
EXPECT_NE(a, c);
@@ -86,13 +86,13 @@
TEST_F(SampledTextureTest, Dim) {
F32 f32;
SampledTexture s(TextureDimension::k3d, &f32);
- EXPECT_EQ(s.dim(), TextureDimension::k3d);
+ EXPECT_EQ(s.Dim(), TextureDimension::k3d);
}
TEST_F(SampledTextureTest, Type) {
F32 f32;
SampledTexture s(TextureDimension::k3d, &f32);
- EXPECT_EQ(s.type(), &f32);
+ EXPECT_EQ(s.Type(), &f32);
}
TEST_F(SampledTextureTest, FriendlyName) {
@@ -108,8 +108,8 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* mt = a->Clone(ctx);
- EXPECT_EQ(mt->dim(), TextureDimension::kCube);
- EXPECT_TRUE(mt->type()->Is<F32>());
+ EXPECT_EQ(mt->Dim(), TextureDimension::kCube);
+ EXPECT_TRUE(mt->Type()->Is<F32>());
}
} // namespace
diff --git a/src/tint/lang/core/type/sampler.h b/src/tint/lang/core/type/sampler.h
index ae768da..d0cd006 100644
--- a/src/tint/lang/core/type/sampler.h
+++ b/src/tint/lang/core/type/sampler.h
@@ -50,7 +50,7 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the sampler type
- SamplerKind kind() const { return kind_; }
+ SamplerKind Kind() const { return kind_; }
/// @returns true if this is a comparison sampler
bool IsComparison() const { return kind_ == SamplerKind::kComparisonSampler; }
diff --git a/src/tint/lang/core/type/sampler_test.cc b/src/tint/lang/core/type/sampler_test.cc
index 7ad875d..1b6176b 100644
--- a/src/tint/lang/core/type/sampler_test.cc
+++ b/src/tint/lang/core/type/sampler_test.cc
@@ -39,8 +39,8 @@
auto* b = create<Sampler>(SamplerKind::kSampler);
auto* c = create<Sampler>(SamplerKind::kComparisonSampler);
- EXPECT_EQ(a->kind(), SamplerKind::kSampler);
- EXPECT_EQ(c->kind(), SamplerKind::kComparisonSampler);
+ EXPECT_EQ(a->Kind(), SamplerKind::kSampler);
+ EXPECT_EQ(c->Kind(), SamplerKind::kComparisonSampler);
EXPECT_FALSE(a->IsComparison());
EXPECT_TRUE(c->IsComparison());
@@ -83,7 +83,7 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* mt = a->Clone(ctx);
- EXPECT_EQ(mt->kind(), SamplerKind::kSampler);
+ EXPECT_EQ(mt->Kind(), SamplerKind::kSampler);
}
} // namespace
diff --git a/src/tint/lang/core/type/storage_texture.cc b/src/tint/lang/core/type/storage_texture.cc
index ea7c9ca..1130544 100644
--- a/src/tint/lang/core/type/storage_texture.cc
+++ b/src/tint/lang/core/type/storage_texture.cc
@@ -41,7 +41,7 @@
StorageTexture::StorageTexture(TextureDimension dim,
core::TexelFormat format,
core::Access access,
- const Type* subtype)
+ const type::Type* subtype)
: Base(Hash(tint::TypeCode::Of<StorageTexture>().bits, dim, format, access), dim),
texel_format_(format),
access_(access),
@@ -51,14 +51,14 @@
bool StorageTexture::Equals(const UniqueNode& other) const {
if (auto* o = other.As<StorageTexture>()) {
- return o->dim() == dim() && o->texel_format_ == texel_format_ && o->access_ == access_;
+ return o->Dim() == Dim() && o->texel_format_ == texel_format_ && o->access_ == access_;
}
return false;
}
std::string StorageTexture::FriendlyName() const {
StringStream out;
- out << "texture_storage_" << dim() << "<" << texel_format_ << ", " << access_ << ">";
+ out << "texture_storage_" << Dim() << "<" << texel_format_ << ", " << access_ << ">";
return out.str();
}
@@ -100,7 +100,7 @@
StorageTexture* StorageTexture::Clone(CloneContext& ctx) const {
auto* ty = subtype_->Clone(ctx);
- return ctx.dst.mgr->Get<StorageTexture>(dim(), texel_format_, access_, ty);
+ return ctx.dst.mgr->Get<StorageTexture>(Dim(), texel_format_, access_, ty);
}
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/storage_texture.h b/src/tint/lang/core/type/storage_texture.h
index d78f4a7..f3266ab 100644
--- a/src/tint/lang/core/type/storage_texture.h
+++ b/src/tint/lang/core/type/storage_texture.h
@@ -63,13 +63,13 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the storage subtype
- const Type* type() const { return subtype_; }
+ const type::Type* Type() const { return subtype_; }
/// @returns the texel format
- core::TexelFormat texel_format() const { return texel_format_; }
+ core::TexelFormat TexelFormat() const { return texel_format_; }
/// @returns the access control
- core::Access access() const { return access_; }
+ core::Access Access() const { return access_; }
/// @returns the name for this type that closely resembles how it would be
/// declared in WGSL.
@@ -78,7 +78,7 @@
/// @param format the storage texture image format
/// @param type_mgr the Manager used to build the returned type
/// @returns the storage texture subtype for the given TexelFormat
- static Type* SubtypeFor(core::TexelFormat format, Manager& type_mgr);
+ static type::Type* SubtypeFor(core::TexelFormat format, Manager& type_mgr);
/// @param ctx the clone context
/// @returns a clone of this type
@@ -87,7 +87,7 @@
private:
core::TexelFormat const texel_format_;
core::Access const access_;
- const Type* const subtype_;
+ const type::Type* const subtype_;
};
} // namespace tint::core::type
diff --git a/src/tint/lang/core/type/storage_texture_test.cc b/src/tint/lang/core/type/storage_texture_test.cc
index 7225456..0047828 100644
--- a/src/tint/lang/core/type/storage_texture_test.cc
+++ b/src/tint/lang/core/type/storage_texture_test.cc
@@ -54,8 +54,8 @@
Create(TextureDimension::kCube, core::TexelFormat::kR32Float, core::Access::kReadWrite);
auto* e = Create(TextureDimension::kCube, core::TexelFormat::kRgba32Float, core::Access::kRead);
- EXPECT_TRUE(a->type()->Is<F32>());
- EXPECT_EQ(a->dim(), TextureDimension::kCube);
+ EXPECT_TRUE(a->Type()->Is<F32>());
+ EXPECT_EQ(a->Dim(), TextureDimension::kCube);
EXPECT_EQ(a, b);
EXPECT_NE(a, c);
@@ -93,13 +93,13 @@
TEST_F(StorageTextureTest, Dim) {
auto* s = Create(TextureDimension::k2dArray, core::TexelFormat::kRgba32Float,
core::Access::kReadWrite);
- EXPECT_EQ(s->dim(), TextureDimension::k2dArray);
+ EXPECT_EQ(s->Dim(), TextureDimension::k2dArray);
}
TEST_F(StorageTextureTest, Format) {
auto* s = Create(TextureDimension::k2dArray, core::TexelFormat::kRgba32Float,
core::Access::kReadWrite);
- EXPECT_EQ(s->texel_format(), core::TexelFormat::kRgba32Float);
+ EXPECT_EQ(s->TexelFormat(), core::TexelFormat::kRgba32Float);
}
TEST_F(StorageTextureTest, FriendlyName) {
@@ -117,7 +117,7 @@
ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
- EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<F32>());
+ EXPECT_TRUE(s->As<StorageTexture>()->Type()->Is<F32>());
}
TEST_F(StorageTextureTest, U32) {
@@ -130,7 +130,7 @@
ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
- EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<U32>());
+ EXPECT_TRUE(s->As<StorageTexture>()->Type()->Is<U32>());
}
TEST_F(StorageTextureTest, I32) {
@@ -143,7 +143,7 @@
ASSERT_TRUE(program.IsValid()) << program.Diagnostics();
ASSERT_TRUE(s->Is<Texture>());
ASSERT_TRUE(s->Is<StorageTexture>());
- EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<I32>());
+ EXPECT_TRUE(s->As<StorageTexture>()->Type()->Is<I32>());
}
TEST_F(StorageTextureTest, Clone) {
@@ -154,9 +154,9 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* mt = a->Clone(ctx);
- EXPECT_EQ(mt->dim(), TextureDimension::kCube);
- EXPECT_EQ(mt->texel_format(), core::TexelFormat::kRgba32Float);
- EXPECT_TRUE(mt->type()->Is<F32>());
+ EXPECT_EQ(mt->Dim(), TextureDimension::kCube);
+ EXPECT_EQ(mt->TexelFormat(), core::TexelFormat::kRgba32Float);
+ EXPECT_TRUE(mt->Type()->Is<F32>());
}
} // namespace
diff --git a/src/tint/lang/core/type/texture.h b/src/tint/lang/core/type/texture.h
index b3db55f..cbcf2a4 100644
--- a/src/tint/lang/core/type/texture.h
+++ b/src/tint/lang/core/type/texture.h
@@ -44,7 +44,7 @@
~Texture() override;
/// @returns the texture dimension
- TextureDimension dim() const { return dim_; }
+ TextureDimension Dim() const { return dim_; }
private:
TextureDimension const dim_;
diff --git a/src/tint/lang/core/type/texture_test.cc b/src/tint/lang/core/type/texture_test.cc
index 3e0ce86..cfeb06c 100644
--- a/src/tint/lang/core/type/texture_test.cc
+++ b/src/tint/lang/core/type/texture_test.cc
@@ -41,7 +41,7 @@
// TextureType is an abstract class, so use concrete class
// SampledTexture in its stead.
SampledTexture st(GetParam(), &f32);
- EXPECT_EQ(st.dim(), GetParam());
+ EXPECT_EQ(st.Dim(), GetParam());
}
INSTANTIATE_TEST_SUITE_P(Dimensions,
diff --git a/src/tint/lang/core/type/type.cc b/src/tint/lang/core/type/type.cc
index 8be0c71..128f270 100644
--- a/src/tint/lang/core/type/type.cc
+++ b/src/tint/lang/core/type/type.cc
@@ -93,16 +93,16 @@
}
bool Type::is_float_matrix() const {
- return Is([](const Matrix* m) { return m->type()->is_float_scalar(); });
+ return Is([](const Matrix* m) { return m->Type()->is_float_scalar(); });
}
bool Type::is_square_float_matrix() const {
return Is(
- [](const Matrix* m) { return m->type()->is_float_scalar() && m->rows() == m->columns(); });
+ [](const Matrix* m) { return m->Type()->is_float_scalar() && m->Rows() == m->Columns(); });
}
bool Type::is_float_vector() const {
- return Is([](const Vector* v) { return v->type()->is_float_scalar(); });
+ return Is([](const Vector* v) { return v->Type()->is_float_scalar(); });
}
bool Type::is_float_scalar_or_vector() const {
@@ -126,11 +126,11 @@
}
bool Type::is_signed_integer_vector() const {
- return Is([](const Vector* v) { return v->type()->IsAnyOf<I32, AbstractInt>(); });
+ return Is([](const Vector* v) { return v->Type()->IsAnyOf<I32, AbstractInt>(); });
}
bool Type::is_unsigned_integer_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<U32>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<U32>(); });
}
bool Type::is_unsigned_integer_scalar_or_vector() const {
@@ -146,11 +146,11 @@
}
bool Type::is_abstract_integer_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<AbstractInt>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<AbstractInt>(); });
}
bool Type::is_abstract_float_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<AbstractFloat>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<AbstractFloat>(); });
}
bool Type::is_abstract_integer_scalar_or_vector() const {
@@ -162,7 +162,7 @@
}
bool Type::is_bool_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<Bool>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<Bool>(); });
}
bool Type::is_bool_scalar_or_vector() const {
@@ -170,11 +170,11 @@
}
bool Type::is_numeric_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<core::type::NumericScalar>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<core::type::NumericScalar>(); });
}
bool Type::is_scalar_vector() const {
- return Is([](const Vector* v) { return v->type()->Is<core::type::Scalar>(); });
+ return Is([](const Vector* v) { return v->Type()->Is<core::type::Scalar>(); });
}
bool Type::is_numeric_scalar_or_vector() const {
@@ -189,8 +189,8 @@
return Switch(
this, //
[&](const AbstractNumeric*) { return true; },
- [&](const Vector* v) { return v->type()->HoldsAbstract(); },
- [&](const Matrix* m) { return m->type()->HoldsAbstract(); },
+ [&](const Vector* v) { return v->Type()->HoldsAbstract(); },
+ [&](const Matrix* m) { return m->Type()->HoldsAbstract(); },
[&](const Array* a) { return a->ElemType()->HoldsAbstract(); },
[&](const Struct* s) {
for (auto* m : s->Members()) {
@@ -228,16 +228,16 @@
[&](const Vector* from_vec) {
if (auto* to_vec = to->As<Vector>()) {
if (from_vec->Width() == to_vec->Width()) {
- return ConversionRank(from_vec->type(), to_vec->type());
+ return ConversionRank(from_vec->Type(), to_vec->Type());
}
}
return kNoConversion;
},
[&](const Matrix* from_mat) {
if (auto* to_mat = to->As<Matrix>()) {
- if (from_mat->columns() == to_mat->columns() &&
- from_mat->rows() == to_mat->rows()) {
- return ConversionRank(from_mat->type(), to_mat->type());
+ if (from_mat->Columns() == to_mat->Columns() &&
+ from_mat->Rows() == to_mat->Rows()) {
+ return ConversionRank(from_mat->Type(), to_mat->Type());
}
}
return kNoConversion;
diff --git a/src/tint/lang/core/type/vector.cc b/src/tint/lang/core/type/vector.cc
index 38acaed..a837c83 100644
--- a/src/tint/lang/core/type/vector.cc
+++ b/src/tint/lang/core/type/vector.cc
@@ -37,7 +37,7 @@
namespace tint::core::type {
-Vector::Vector(Type const* subtype, uint32_t width, bool packed /* = false */)
+Vector::Vector(type::Type const* subtype, uint32_t width, bool packed /* = false */)
: Base(Hash(tint::TypeCode::Of<Vector>().bits, width, subtype, packed),
core::type::Flags{
Flag::kConstructable,
@@ -90,7 +90,7 @@
return ctx.dst.mgr->Get<Vector>(subtype, width_, packed_);
}
-TypeAndCount Vector::Elements(const Type* /* type_if_invalid = nullptr */,
+TypeAndCount Vector::Elements(const type::Type* /* type_if_invalid = nullptr */,
uint32_t /* count_if_invalid = 0 */) const {
return {subtype_, width_};
}
diff --git a/src/tint/lang/core/type/vector.h b/src/tint/lang/core/type/vector.h
index a389eb0..e84109c 100644
--- a/src/tint/lang/core/type/vector.h
+++ b/src/tint/lang/core/type/vector.h
@@ -35,7 +35,7 @@
namespace tint::core::type {
/// A vector type.
-class Vector : public Castable<Vector, Type> {
+class Vector : public Castable<Vector, type::Type> {
public:
/// Constructor
/// @param subtype the vector element type
@@ -51,7 +51,7 @@
bool Equals(const UniqueNode& other) const override;
/// @returns the type of the vector elements
- const Type* type() const { return subtype_; }
+ const type::Type* Type() const { return subtype_; }
/// @returns the name for this type that closely resembles how it would be
/// declared in WGSL.
@@ -78,18 +78,18 @@
static uint32_t AlignOf(uint32_t width);
/// @copydoc Type::Elements
- TypeAndCount Elements(const Type* type_if_invalid = nullptr,
+ TypeAndCount Elements(const type::Type* type_if_invalid = nullptr,
uint32_t count_if_invalid = 0) const override;
/// @copydoc Type::Element
- const Type* Element(uint32_t index) const override;
+ const type::Type* Element(uint32_t index) const override;
/// @param ctx the clone context
/// @returns a clone of this type
Vector* Clone(CloneContext& ctx) const override;
private:
- Type const* const subtype_;
+ type::Type const* const subtype_;
const uint32_t width_;
const bool packed_;
};
diff --git a/src/tint/lang/core/type/vector_test.cc b/src/tint/lang/core/type/vector_test.cc
index 7d59a9c..2750e71 100644
--- a/src/tint/lang/core/type/vector_test.cc
+++ b/src/tint/lang/core/type/vector_test.cc
@@ -39,7 +39,7 @@
auto* c = create<Vector>(create<F32>(), 2u);
auto* d = create<Vector>(create<F32>(), 3u);
- EXPECT_EQ(a->type(), create<I32>());
+ EXPECT_EQ(a->Type(), create<I32>());
EXPECT_EQ(a->Width(), 2u);
EXPECT_EQ(a, b);
@@ -54,7 +54,7 @@
EXPECT_FALSE(v->Packed());
- EXPECT_EQ(p1->type(), create<F32>());
+ EXPECT_EQ(p1->Type(), create<F32>());
EXPECT_EQ(p1->Width(), 3u);
EXPECT_TRUE(p1->Packed());
@@ -100,7 +100,7 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* vec = a->Clone(ctx);
- EXPECT_TRUE(vec->type()->Is<I32>());
+ EXPECT_TRUE(vec->Type()->Is<I32>());
EXPECT_EQ(vec->Width(), 2u);
EXPECT_FALSE(vec->Packed());
}
@@ -112,7 +112,7 @@
core::type::CloneContext ctx{{nullptr}, {nullptr, &mgr}};
auto* vec = a->Clone(ctx);
- EXPECT_TRUE(vec->type()->Is<I32>());
+ EXPECT_TRUE(vec->Type()->Is<I32>());
EXPECT_EQ(vec->Width(), 3u);
EXPECT_TRUE(vec->Packed());
}
diff --git a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
index 1552e36..f54ecd1 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -1171,7 +1171,7 @@
const sem::BuiltinFn* builtin) {
auto* vec_ty = builtin->Parameters()[0]->Type()->As<core::type::Vector>();
std::string fn = "dot";
- if (vec_ty->type()->is_integer_scalar()) {
+ if (vec_ty->Type()->is_integer_scalar()) {
// GLSL does not have a builtin for dot() with integer vector types.
// Generate the helper function if it hasn't been created already
fn = tint::GetOrAdd(int_dot_funcs_, vec_ty, [&]() -> std::string {
@@ -1183,13 +1183,13 @@
std::string v;
{
StringStream s;
- EmitType(s, vec_ty->type(), core::AddressSpace::kUndefined, core::Access::kRead,
+ EmitType(s, vec_ty->Type(), core::AddressSpace::kUndefined, core::Access::kRead,
"");
v = s.str();
}
{ // (u)int tint_int_dot([i|u]vecN a, [i|u]vecN b) {
auto l = Line(&b);
- EmitType(l, vec_ty->type(), core::AddressSpace::kUndefined, core::Access::kRead,
+ EmitType(l, vec_ty->Type(), core::AddressSpace::kUndefined, core::Access::kRead,
"");
l << " " << fn_name << "(";
EmitType(l, vec_ty, core::AddressSpace::kUndefined, core::Access::kRead, "");
@@ -1424,8 +1424,8 @@
out << ")";
// textureSize() on array samplers returns the array size in the
// final component, so strip it out.
- if (texture_type->dim() == core::type::TextureDimension::k2dArray ||
- texture_type->dim() == core::type::TextureDimension::kCubeArray) {
+ if (texture_type->Dim() == core::type::TextureDimension::k2dArray ||
+ texture_type->Dim() == core::type::TextureDimension::kCubeArray) {
out << ".xy";
}
return;
@@ -1556,7 +1556,7 @@
// GLSL requires Dref to be appended to the coordinates, *unless* it's
// samplerCubeArrayShadow, in which case it will be handled as a separate
// parameter.
- if (texture_type->dim() == core::type::TextureDimension::kCubeArray) {
+ if (texture_type->Dim() == core::type::TextureDimension::kCubeArray) {
append_depth_ref_to_coords = false;
}
@@ -1984,7 +1984,7 @@
if (auto* storage = type->As<core::type::StorageTexture>()) {
auto bp = *sem->Attributes().binding_point;
out << "layout(binding = " << bp.binding << ", ";
- switch (storage->texel_format()) {
+ switch (storage->TexelFormat()) {
case core::TexelFormat::kBgra8Unorm:
TINT_ICE() << "bgra8unorm should have been polyfilled to rgba8unorm";
case core::TexelFormat::kR32Uint:
@@ -2275,7 +2275,7 @@
ScopedParen sp(out);
- for (size_t column_idx = 0; column_idx < m->columns(); column_idx++) {
+ for (size_t column_idx = 0; column_idx < m->Columns(); column_idx++) {
if (column_idx > 0) {
out << ", ";
}
@@ -2363,16 +2363,16 @@
if (i != 0) {
out << ", ";
}
- EmitZeroValue(out, vec->type());
+ EmitZeroValue(out, vec->Type());
}
} else if (auto* mat = type->As<core::type::Matrix>()) {
EmitType(out, type, core::AddressSpace::kUndefined, core::Access::kReadWrite, "");
ScopedParen sp(out);
- for (uint32_t i = 0; i < (mat->rows() * mat->columns()); i++) {
+ for (uint32_t i = 0; i < (mat->Rows() * mat->Columns()); i++) {
if (i != 0) {
out << ", ";
}
- EmitZeroValue(out, mat->type());
+ EmitZeroValue(out, mat->Type());
}
} else if (auto* str = type->As<core::type::Struct>()) {
EmitType(out, type, core::AddressSpace::kUndefined, core::Access::kUndefined, "");
@@ -2710,13 +2710,13 @@
} else if (type->Is<core::type::I32>()) {
out << "int";
} else if (auto* mat = type->As<core::type::Matrix>()) {
- TINT_ASSERT((mat->type()->IsAnyOf<core::type::F32, core::type::F16>()));
- if (mat->type()->Is<core::type::F16>()) {
+ TINT_ASSERT((mat->Type()->IsAnyOf<core::type::F32, core::type::F16>()));
+ if (mat->Type()->Is<core::type::F16>()) {
out << "f16";
}
- out << "mat" << mat->columns();
- if (mat->rows() != mat->columns()) {
- out << "x" << mat->rows();
+ out << "mat" << mat->Columns();
+ if (mat->Rows() != mat->Columns()) {
+ out << "x" << mat->Rows();
}
} else if (TINT_UNLIKELY(type->Is<core::type::Pointer>())) {
TINT_ICE() << "Attempting to emit pointer type. These should have been removed with the "
@@ -2737,7 +2737,7 @@
out << "highp ";
if (storage) {
- switch (storage->access()) {
+ switch (storage->Access()) {
case core::Access::kRead:
out << "readonly ";
break;
@@ -2749,7 +2749,7 @@
// Except for image variables qualified with the format qualifiers r32f, r32i,
// and r32ui, image variables must specify either memory qualifier readonly or
// the memory qualifier writeonly.
- switch (storage->texel_format()) {
+ switch (storage->TexelFormat()) {
case core::TexelFormat::kR32Float:
case core::TexelFormat::kR32Sint:
case core::TexelFormat::kR32Uint:
@@ -2763,12 +2763,12 @@
}
} break;
default:
- TINT_UNREACHABLE() << "unexpected storage texture access " << storage->access();
+ TINT_UNREACHABLE() << "unexpected storage texture access " << storage->Access();
}
}
- auto* subtype = sampled ? sampled->type()
- : storage ? storage->type()
- : ms ? ms->type()
+ auto* subtype = sampled ? sampled->Type()
+ : storage ? storage->Type()
+ : ms ? ms->Type()
: nullptr;
if (!subtype || subtype->Is<core::type::F32>()) {
} else if (subtype->Is<core::type::I32>()) {
@@ -2781,7 +2781,7 @@
out << (storage ? "image" : "sampler");
- switch (tex->dim()) {
+ switch (tex->Dim()) {
case core::type::TextureDimension::k1d:
out << "1D";
break;
@@ -2801,7 +2801,7 @@
out << "CubeArray";
break;
default:
- TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->dim();
+ TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->Dim();
}
if (tex->Is<core::type::DepthTexture>()) {
out << "Shadow";
@@ -2810,19 +2810,19 @@
out << "uint";
} else if (auto* vec = type->As<core::type::Vector>()) {
auto width = vec->Width();
- if (vec->type()->Is<core::type::F32>() && width >= 1 && width <= 4) {
+ if (vec->Type()->Is<core::type::F32>() && width >= 1 && width <= 4) {
out << "vec" << width;
- } else if (vec->type()->Is<core::type::F16>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::F16>() && width >= 1 && width <= 4) {
out << "f16vec" << width;
- } else if (vec->type()->Is<core::type::I32>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::I32>() && width >= 1 && width <= 4) {
out << "ivec" << width;
- } else if (vec->type()->Is<core::type::U32>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::U32>() && width >= 1 && width <= 4) {
out << "uvec" << width;
- } else if (vec->type()->Is<core::type::Bool>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::Bool>() && width >= 1 && width <= 4) {
out << "bvec" << width;
} else {
out << "vector<";
- EmitType(out, vec->type(), address_space, access, "");
+ EmitType(out, vec->Type(), address_space, access, "");
out << ", " << width << ">";
}
} else if (auto* atomic = type->As<core::type::Atomic>()) {
diff --git a/src/tint/lang/glsl/writer/ast_raise/combine_samplers.cc b/src/tint/lang/glsl/writer/ast_raise/combine_samplers.cc
index 583b4b5..16d0a38 100644
--- a/src/tint/lang/glsl/writer/ast_raise/combine_samplers.cc
+++ b/src/tint/lang/glsl/writer/ast_raise/combine_samplers.cc
@@ -154,7 +154,7 @@
const core::type::Type* texture_type = texture->Type()->UnwrapRef();
const core::type::DepthTexture* depth = texture_type->As<core::type::DepthTexture>();
if (depth && !sampler) {
- return ctx.dst->ty.sampled_texture(depth->dim(), ctx.dst->ty.f32());
+ return ctx.dst->ty.sampled_texture(depth->Dim(), ctx.dst->ty.f32());
}
return CreateASTTypeFor(ctx, texture_type);
@@ -321,7 +321,7 @@
[new_pair];
args.Push(ctx.dst->Expr(var->name->symbol));
} else if (auto* sampler_type = type->As<core::type::Sampler>()) {
- core::type::SamplerKind kind = sampler_type->kind();
+ core::type::SamplerKind kind = sampler_type->Kind();
int index = (kind == core::type::SamplerKind::kSampler) ? 0 : 1;
const ast::Variable*& p = placeholder_samplers_[index];
if (!p) {
diff --git a/src/tint/lang/glsl/writer/ast_raise/texture_1d_to_2d.cc b/src/tint/lang/glsl/writer/ast_raise/texture_1d_to_2d.cc
index df5452a..8808210 100644
--- a/src/tint/lang/glsl/writer/ast_raise/texture_1d_to_2d.cc
+++ b/src/tint/lang/glsl/writer/ast_raise/texture_1d_to_2d.cc
@@ -54,7 +54,7 @@
auto texture = signature.Parameter(core::ParameterUsage::kTexture);
if (texture) {
auto* tex = texture->Type()->As<core::type::Texture>();
- if (tex->dim() == core::type::TextureDimension::k1d) {
+ if (tex->Dim() == core::type::TextureDimension::k1d) {
return true;
}
}
@@ -65,10 +65,10 @@
if (Switch(
program.Sem().Get(var)->Type()->UnwrapRef(),
[&](const core::type::SampledTexture* tex) {
- return tex->dim() == core::type::TextureDimension::k1d;
+ return tex->Dim() == core::type::TextureDimension::k1d;
},
[&](const core::type::StorageTexture* storage_tex) {
- return storage_tex->dim() == core::type::TextureDimension::k1d;
+ return storage_tex->Dim() == core::type::TextureDimension::k1d;
})) {
return true;
}
@@ -112,19 +112,19 @@
const ast::Variable* r = Switch(
sem.Get(v)->Type()->UnwrapRef(),
[&](const core::type::SampledTexture* tex) -> const ast::Variable* {
- if (tex->dim() == core::type::TextureDimension::k1d) {
+ if (tex->Dim() == core::type::TextureDimension::k1d) {
auto type = ctx.dst->ty.sampled_texture(core::type::TextureDimension::k2d,
- CreateASTTypeFor(ctx, tex->type()));
+ CreateASTTypeFor(ctx, tex->Type()));
return create_var(v, type);
} else {
return nullptr;
}
},
[&](const core::type::StorageTexture* storage_tex) -> const ast::Variable* {
- if (storage_tex->dim() == core::type::TextureDimension::k1d) {
+ if (storage_tex->Dim() == core::type::TextureDimension::k1d) {
auto type = ctx.dst->ty.storage_texture(core::type::TextureDimension::k2d,
- storage_tex->texel_format(),
- storage_tex->access());
+ storage_tex->TexelFormat(),
+ storage_tex->Access());
return create_var(v, type);
} else {
return nullptr;
@@ -149,7 +149,7 @@
return nullptr;
}
auto* tex = texture->Type()->As<core::type::Texture>();
- if (tex->dim() != core::type::TextureDimension::k1d) {
+ if (tex->Dim() != core::type::TextureDimension::k1d) {
return nullptr;
}
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 e2b3b59..adaf489 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -481,7 +481,7 @@
return "";
}
out << ", int idx, ";
- if (!EmitTypeAndName(out, vec->type(), core::AddressSpace::kUndefined,
+ if (!EmitTypeAndName(out, vec->Type(), core::AddressSpace::kUndefined,
core::Access::kUndefined, "val")) {
return "";
}
@@ -556,7 +556,7 @@
Line(&helpers_) << "switch (col) {";
{
ScopedIndent si2(&helpers_);
- for (uint32_t i = 0; i < mat->columns(); ++i) {
+ for (uint32_t i = 0; i < mat->Columns(); ++i) {
Line(&helpers_) << "case " << i << ": mat[" << i << "] = val; break;";
}
}
@@ -606,7 +606,7 @@
return "";
}
out << ", int col, int row, ";
- if (!EmitTypeAndName(out, mat->type(), core::AddressSpace::kUndefined,
+ if (!EmitTypeAndName(out, mat->Type(), core::AddressSpace::kUndefined,
core::Access::kUndefined, "val")) {
return "";
}
@@ -617,14 +617,14 @@
Line(&helpers_) << "switch (col) {";
{
ScopedIndent si2(&helpers_);
- for (uint32_t i = 0; i < mat->columns(); ++i) {
+ for (uint32_t i = 0; i < mat->Columns(); ++i) {
Line(&helpers_) << "case " << i << ":";
{
auto vec_name = "mat[" + std::to_string(i) + "]";
ScopedIndent si3(&helpers_);
{
auto out = Line(&helpers_);
- switch (mat->rows()) {
+ switch (mat->Rows()) {
case 2:
out << vec_name
<< " = (row.xx == int2(0, 1)) ? val.xx : " << vec_name
@@ -2693,7 +2693,7 @@
switch (builtin->Fn()) {
case wgsl::BuiltinFn::kTextureDimensions:
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
case core::type::TextureDimension::kNone:
TINT_ICE() << "texture dimension is kNone";
case core::type::TextureDimension::k1d:
@@ -2720,7 +2720,7 @@
}
break;
case wgsl::BuiltinFn::kTextureNumLayers:
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
default:
TINT_ICE() << "texture dimension is not arrayed";
case core::type::TextureDimension::k2dArray:
@@ -2734,7 +2734,7 @@
}
break;
case wgsl::BuiltinFn::kTextureNumLevels:
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
default:
TINT_ICE() << "texture dimension does not support mips";
case core::type::TextureDimension::k1d:
@@ -2755,7 +2755,7 @@
}
break;
case wgsl::BuiltinFn::kTextureNumSamples:
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
default:
TINT_ICE() << "texture dimension does not support multisampling";
case core::type::TextureDimension::k2d:
@@ -2886,7 +2886,7 @@
break;
}
if (auto* storage_texture_type = texture_type->As<core::type::StorageTexture>()) {
- if (storage_texture_type->access() == core::Access::kReadWrite) {
+ if (storage_texture_type->Access() == core::Access::kReadWrite) {
break;
}
}
@@ -3522,10 +3522,10 @@
TINT_ICE() << "Rasterizer Ordered View type isn't storage texture";
}
out << "RasterizerOrderedTexture2D";
- auto* component = ImageFormatToRWtextureType(storage->texel_format());
+ auto* component = ImageFormatToRWtextureType(storage->TexelFormat());
if (TINT_UNLIKELY(!component)) {
TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
- << static_cast<int>(storage->texel_format());
+ << static_cast<int>(storage->TexelFormat());
}
out << "<" << component << "> " << name;
} else if (!EmitTypeAndName(out, type, sem->AddressSpace(), sem->Access(), name)) {
@@ -3537,7 +3537,7 @@
if (unwrapped_type->Is<core::type::Texture>()) {
register_space = "t";
if (auto* st = unwrapped_type->As<core::type::StorageTexture>();
- st && st->access() != core::Access::kRead) {
+ st && st->Access() != core::Access::kRead) {
register_space = "u";
}
} else if (unwrapped_type->Is<core::type::Sampler>()) {
@@ -3815,7 +3815,7 @@
ScopedParen sp(out);
- for (size_t i = 0; i < m->columns(); i++) {
+ for (size_t i = 0; i < m->Columns(); i++) {
if (i > 0) {
out << ", ";
}
@@ -3975,7 +3975,7 @@
if (i != 0) {
out << ", ";
}
- if (!EmitValue(out, vec->type(), value)) {
+ if (!EmitValue(out, vec->Type(), value)) {
return false;
}
}
@@ -3987,11 +3987,11 @@
return false;
}
ScopedParen sp(out);
- for (uint32_t i = 0; i < (mat->rows() * mat->columns()); i++) {
+ for (uint32_t i = 0; i < (mat->Rows() * mat->Columns()); i++) {
if (i != 0) {
out << ", ";
}
- if (!EmitValue(out, mat->type(), value)) {
+ if (!EmitValue(out, mat->Type(), value)) {
return false;
}
}
@@ -4440,16 +4440,16 @@
return true;
},
[&](const core::type::Matrix* mat) {
- if (mat->type()->Is<core::type::F16>()) {
+ if (mat->Type()->Is<core::type::F16>()) {
// Use matrix<type, N, M> for f16 matrix
out << "matrix<";
- if (!EmitType(out, mat->type(), address_space, access, "")) {
+ if (!EmitType(out, mat->Type(), address_space, access, "")) {
return false;
}
- out << ", " << mat->columns() << ", " << mat->rows() << ">";
+ out << ", " << mat->Columns() << ", " << mat->Rows() << ">";
return true;
}
- if (!EmitType(out, mat->type(), address_space, access, "")) {
+ if (!EmitType(out, mat->Type(), address_space, access, "")) {
return false;
}
// Note: HLSL's matrices are declared as <type>NxM, where N is the
@@ -4459,7 +4459,7 @@
// on column vectors. To simplify everything we use the transpose of the
// matrices. See:
// https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math#matrix-ordering
- out << mat->columns() << "x" << mat->rows();
+ out << mat->Columns() << "x" << mat->Rows();
return true;
},
[&](const core::type::Pointer*) -> bool {
@@ -4488,12 +4488,12 @@
auto* depth_ms = tex->As<core::type::DepthMultisampledTexture>();
auto* sampled = tex->As<core::type::SampledTexture>();
- if (storage && storage->access() != core::Access::kRead) {
+ if (storage && storage->Access() != core::Access::kRead) {
out << "RW";
}
out << "Texture";
- switch (tex->dim()) {
+ switch (tex->Dim()) {
case core::type::TextureDimension::k1d:
out << "1D";
break;
@@ -4513,20 +4513,20 @@
out << "CubeArray";
break;
default:
- TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->dim();
+ TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->Dim();
}
if (storage) {
- auto* component = ImageFormatToRWtextureType(storage->texel_format());
+ auto* component = ImageFormatToRWtextureType(storage->TexelFormat());
if (TINT_UNLIKELY(!component)) {
TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
- << static_cast<int>(storage->texel_format());
+ << static_cast<int>(storage->TexelFormat());
}
out << "<" << component << ">";
} else if (depth_ms) {
out << "<float4>";
} else if (sampled || ms) {
- auto* subtype = sampled ? sampled->type() : ms->type();
+ auto* subtype = sampled ? sampled->Type() : ms->Type();
out << "<";
if (subtype->Is<core::type::F32>()) {
out << "float4";
@@ -4547,18 +4547,18 @@
},
[&](const core::type::Vector* vec) {
auto width = vec->Width();
- if (vec->type()->Is<core::type::F32>() && width >= 1 && width <= 4) {
+ if (vec->Type()->Is<core::type::F32>() && width >= 1 && width <= 4) {
out << "float" << width;
- } else if (vec->type()->Is<core::type::I32>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::I32>() && width >= 1 && width <= 4) {
out << "int" << width;
- } else if (vec->type()->Is<core::type::U32>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::U32>() && width >= 1 && width <= 4) {
out << "uint" << width;
- } else if (vec->type()->Is<core::type::Bool>() && width >= 1 && width <= 4) {
+ } else if (vec->Type()->Is<core::type::Bool>() && width >= 1 && width <= 4) {
out << "bool" << width;
} else {
// For example, use "vector<float16_t, N>" for f16 vector.
out << "vector<";
- if (!EmitType(out, vec->type(), address_space, access, "")) {
+ if (!EmitType(out, vec->Type(), address_space, access, "")) {
return false;
}
out << ", " << width << ">";
diff --git a/src/tint/lang/hlsl/writer/ast_raise/decompose_memory_access.cc b/src/tint/lang/hlsl/writer/ast_raise/decompose_memory_access.cc
index bacc9a0..48b28d9 100644
--- a/src/tint/lang/hlsl/writer/ast_raise/decompose_memory_access.cc
+++ b/src/tint/lang/hlsl/writer/ast_raise/decompose_memory_access.cc
@@ -175,55 +175,55 @@
if (auto* vec = ty->As<core::type::Vector>()) {
switch (vec->Width()) {
case 2:
- if (vec->type()->Is<core::type::I32>()) {
+ if (vec->Type()->Is<core::type::I32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec2I32;
return true;
}
- if (vec->type()->Is<core::type::U32>()) {
+ if (vec->Type()->Is<core::type::U32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec2U32;
return true;
}
- if (vec->type()->Is<core::type::F32>()) {
+ if (vec->Type()->Is<core::type::F32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec2F32;
return true;
}
- if (vec->type()->Is<core::type::F16>()) {
+ if (vec->Type()->Is<core::type::F16>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec2F16;
return true;
}
break;
case 3:
- if (vec->type()->Is<core::type::I32>()) {
+ if (vec->Type()->Is<core::type::I32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec3I32;
return true;
}
- if (vec->type()->Is<core::type::U32>()) {
+ if (vec->Type()->Is<core::type::U32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec3U32;
return true;
}
- if (vec->type()->Is<core::type::F32>()) {
+ if (vec->Type()->Is<core::type::F32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec3F32;
return true;
}
- if (vec->type()->Is<core::type::F16>()) {
+ if (vec->Type()->Is<core::type::F16>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec3F16;
return true;
}
break;
case 4:
- if (vec->type()->Is<core::type::I32>()) {
+ if (vec->Type()->Is<core::type::I32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec4I32;
return true;
}
- if (vec->type()->Is<core::type::U32>()) {
+ if (vec->Type()->Is<core::type::U32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec4U32;
return true;
}
- if (vec->type()->Is<core::type::F32>()) {
+ if (vec->Type()->Is<core::type::F32>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec4F32;
return true;
}
- if (vec->type()->Is<core::type::F16>()) {
+ if (vec->Type()->Is<core::type::F16>()) {
out = DecomposeMemoryAccess::Intrinsic::DataType::kVec4F16;
return true;
}
@@ -533,7 +533,7 @@
if (auto* mat_ty = el_ty->As<core::type::Matrix>()) {
auto* vec_ty = mat_ty->ColumnType();
Symbol load = LoadFunc(vec_ty, address_space, buffer);
- for (uint32_t i = 0; i < mat_ty->columns(); i++) {
+ for (uint32_t i = 0; i < mat_ty->Columns(); i++) {
auto* offset = b.Add("offset", u32(i * mat_ty->ColumnStride()));
values.Push(b.Call(load, offset));
}
@@ -612,7 +612,7 @@
auto* vec_ty = mat_ty->ColumnType();
Symbol store = StoreFunc(vec_ty, buffer);
Vector<const ast::Statement*, 4> stmts;
- for (uint32_t i = 0; i < mat_ty->columns(); i++) {
+ for (uint32_t i = 0; i < mat_ty->Columns(); i++) {
auto* offset = b.Add("offset", u32(i * mat_ty->ColumnStride()));
auto* element = b.IndexAccessor("value", u32(i));
auto* call = b.Call(store, offset, element);
@@ -853,11 +853,11 @@
if (swizzle->Indices().Length() == 1) {
if (auto access = state.TakeAccess(accessor->object)) {
auto* vec_ty = access.type->As<core::type::Vector>();
- auto* offset = state.Mul(vec_ty->type()->Size(), swizzle->Indices()[0u]);
+ auto* offset = state.Mul(vec_ty->Type()->Size(), swizzle->Indices()[0u]);
state.AddAccess(accessor, {
access.var,
state.Add(access.offset, offset),
- vec_ty->type(),
+ vec_ty->Type(),
});
}
}
@@ -889,11 +889,11 @@
continue;
}
if (auto* vec_ty = access.type->As<core::type::Vector>()) {
- auto* offset = state.Mul(vec_ty->type()->Size(), accessor->index);
+ auto* offset = state.Mul(vec_ty->Type()->Size(), accessor->index);
state.AddAccess(accessor, {
access.var,
state.Add(access.offset, offset),
- vec_ty->type(),
+ vec_ty->Type(),
});
continue;
}
diff --git a/src/tint/lang/hlsl/writer/printer/printer.cc b/src/tint/lang/hlsl/writer/printer/printer.cc
index 5e42810..ee93a6d 100644
--- a/src/tint/lang/hlsl/writer/printer/printer.cc
+++ b/src/tint/lang/hlsl/writer/printer/printer.cc
@@ -566,7 +566,7 @@
register_space = 't';
auto* st = ptr->StoreType()->As<core::type::StorageTexture>();
- if (st && st->access() != core::Access::kRead) {
+ if (st && st->Access() != core::Access::kRead) {
register_space = 'u';
}
} else if (ptr->StoreType()->Is<core::type::Sampler>()) {
@@ -1232,7 +1232,7 @@
EmitType(out, m);
const ScopedParen sp(out);
- for (size_t i = 0; i < m->columns(); i++) {
+ for (size_t i = 0; i < m->Columns(); i++) {
if (i > 0) {
out << ", ";
}
@@ -1346,32 +1346,32 @@
void EmitVectorType(StringStream& out, const core::type::Vector* vec) {
auto width = vec->Width();
- if (vec->type()->Is<core::type::F32>()) {
+ if (vec->Type()->Is<core::type::F32>()) {
out << "float" << width;
- } else if (vec->type()->Is<core::type::I32>()) {
+ } else if (vec->Type()->Is<core::type::I32>()) {
out << "int" << width;
- } else if (vec->type()->Is<core::type::U32>()) {
+ } else if (vec->Type()->Is<core::type::U32>()) {
out << "uint" << width;
- } else if (vec->type()->Is<core::type::Bool>()) {
+ } else if (vec->Type()->Is<core::type::Bool>()) {
out << "bool" << width;
} else {
// For example, use "vector<float16_t, N>" for f16 vector.
out << "vector<";
- EmitType(out, vec->type());
+ EmitType(out, vec->Type());
out << ", " << width << ">";
}
}
void EmitMatrixType(StringStream& out, const core::type::Matrix* mat) {
- if (mat->type()->Is<core::type::F16>()) {
+ if (mat->Type()->Is<core::type::F16>()) {
// Use matrix<type, N, M> for f16 matrix
out << "matrix<";
- EmitType(out, mat->type());
- out << ", " << mat->columns() << ", " << mat->rows() << ">";
+ EmitType(out, mat->Type());
+ out << ", " << mat->Columns() << ", " << mat->Rows() << ">";
return;
}
- EmitType(out, mat->type());
+ EmitType(out, mat->Type());
// Note: HLSL's matrices are declared as <type>NxM, where N is the
// number of rows and M is the number of columns. Despite HLSL's
@@ -1380,7 +1380,7 @@
// on column vectors. To simplify everything we use the transpose of the
// matrices. See:
// https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math#matrix-ordering
- out << mat->columns() << "x" << mat->rows();
+ out << mat->Columns() << "x" << mat->Rows();
}
void EmitTextureType(StringStream& out, const core::type::Texture* tex) {
@@ -1393,12 +1393,12 @@
auto* depth_ms = tex->As<core::type::DepthMultisampledTexture>();
auto* sampled = tex->As<core::type::SampledTexture>();
- if (storage && storage->access() != core::Access::kRead) {
+ if (storage && storage->Access() != core::Access::kRead) {
out << "RW";
}
out << "Texture";
- switch (tex->dim()) {
+ switch (tex->Dim()) {
case core::type::TextureDimension::k1d:
out << "1D";
break;
@@ -1418,20 +1418,20 @@
out << "CubeArray";
break;
default:
- TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->dim();
+ TINT_UNREACHABLE() << "unexpected TextureDimension " << tex->Dim();
}
if (storage) {
- auto* component = ImageFormatToRWtextureType(storage->texel_format());
+ auto* component = ImageFormatToRWtextureType(storage->TexelFormat());
if (TINT_UNLIKELY(!component)) {
TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
- << static_cast<int>(storage->texel_format());
+ << static_cast<int>(storage->TexelFormat());
}
out << "<" << component << ">";
} else if (depth_ms) {
out << "<float4>";
} else if (sampled || ms) {
- auto* subtype = sampled ? sampled->type() : ms->type();
+ auto* subtype = sampled ? sampled->Type() : ms->Type();
out << "<";
if (subtype->Is<core::type::F32>()) {
out << "float4";
diff --git a/src/tint/lang/hlsl/writer/raise/builtin_polyfill.cc b/src/tint/lang/hlsl/writer/raise/builtin_polyfill.cc
index b21f1af..188efa7 100644
--- a/src/tint/lang/hlsl/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/hlsl/writer/raise/builtin_polyfill.cc
@@ -766,8 +766,8 @@
auto* tex = call->Args()[0];
auto* tex_type = tex->Type()->As<core::type::Texture>();
- TINT_ASSERT(tex_type->dim() == core::type::TextureDimension::k2dArray ||
- tex_type->dim() == core::type::TextureDimension::kCubeArray);
+ TINT_ASSERT(tex_type->Dim() == core::type::TextureDimension::k2dArray ||
+ tex_type->Dim() == core::type::TextureDimension::kCubeArray);
const core::type::Type* query_ty = ty.vec(ty.u32(), 3);
b.InsertBefore(call, [&] {
@@ -792,7 +792,7 @@
Vector<uint32_t, 2> swizzle{};
uint32_t query_size = 0;
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::kNone:
TINT_ICE() << "texture dimension is kNone";
case core::type::TextureDimension::k1d:
@@ -842,7 +842,7 @@
Vector<uint32_t, 2> swizzle{};
uint32_t query_size = 0;
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::kNone:
TINT_ICE() << "texture dimension is kNone";
case core::type::TextureDimension::k1d:
@@ -921,7 +921,7 @@
auto* tex = call->Args()[0];
auto* tex_type = tex->Type()->As<core::type::Texture>();
- TINT_ASSERT(tex_type->dim() == core::type::TextureDimension::k2d);
+ TINT_ASSERT(tex_type->Dim() == core::type::TextureDimension::k2d);
TINT_ASSERT((tex_type->IsAnyOf<core::type::DepthMultisampledTexture,
core::type::MultisampledTexture>()));
@@ -950,9 +950,9 @@
Vector<uint32_t, 2> swizzle;
const core::type::Type* ret_ty = tint::Switch(
tex_type, //
- [&](const core::type::SampledTexture* sampled) { return sampled->type(); },
- [&](const core::type::StorageTexture* storage) { return storage->type(); },
- [&](const core::type::MultisampledTexture* ms) { return ms->type(); },
+ [&](const core::type::SampledTexture* sampled) { return sampled->Type(); },
+ [&](const core::type::StorageTexture* storage) { return storage->Type(); },
+ [&](const core::type::MultisampledTexture* ms) { return ms->Type(); },
[&](const core::type::DepthTexture*) {
swizzle.Push(0u);
return ty.f32();
@@ -968,7 +968,7 @@
bool is_storage = tex_type->Is<core::type::StorageTexture>();
b.InsertBefore(call, [&] {
Vector<core::ir::Value*, 2> call_args;
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k1d: {
auto* coord = b.Convert(ty.i32(), args[1]);
core::ir::Value* lvl = nullptr;
@@ -1049,15 +1049,15 @@
new_args.Push(tex);
b.InsertBefore(call, [&] {
- if (tex_type->dim() == core::type::TextureDimension::k2dArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray) {
auto* coords = args[1];
auto* array_idx = args[2];
auto* coords_ty = coords->Type()->As<core::type::Vector>();
TINT_ASSERT(coords_ty);
- auto* new_coords = b.Construct(ty.vec3(coords_ty->type()), coords,
- b.Convert(coords_ty->type(), array_idx));
+ auto* new_coords = b.Construct(ty.vec3(coords_ty->Type()), coords,
+ b.Convert(coords_ty->Type(), array_idx));
new_args.Push(new_coords->Result(0));
new_args.Push(args[3]);
@@ -1117,7 +1117,7 @@
uint32_t offset_idx = 0;
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
offset_idx = is_depth ? 3 : 4;
@@ -1160,7 +1160,7 @@
auto* tex_type = tex->Type()->As<core::type::Texture>();
TINT_ASSERT(tex_type);
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
params.Push(args[3]);
@@ -1209,7 +1209,7 @@
params.Push(args[1]); // sampler
core::ir::Value* coords = args[2];
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k1d:
case core::type::TextureDimension::k2d:
params.Push(coords);
@@ -1259,7 +1259,7 @@
params.Push(args[1]); // sampler
core::ir::Value* coords = args[2];
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
params.Push(args[3]); // bias
@@ -1318,7 +1318,7 @@
params.Push(args[1]); // sampler
core::ir::Value* coords = args[2];
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
params.Push(args[3]); // depth ref
@@ -1372,7 +1372,7 @@
params.Push(args[1]); // sampler
core::ir::Value* coords = args[2];
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
params.Push(args[3]); // ddx
@@ -1431,7 +1431,7 @@
params.Push(args[1]); // sampler
core::ir::Value* coords = args[2];
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
params.Push(coords);
params.Push(b.Convert<f32>(args[3])->Result(0)); // Level
diff --git a/src/tint/lang/hlsl/writer/raise/decompose_storage_access.cc b/src/tint/lang/hlsl/writer/raise/decompose_storage_access.cc
index be0d2a7..eec363e 100644
--- a/src/tint/lang/hlsl/writer/raise/decompose_storage_access.cc
+++ b/src/tint/lang/hlsl/writer/raise/decompose_storage_access.cc
@@ -591,7 +591,7 @@
b.Append(fn->Block(), [&] {
Vector<core::ir::Value*, 4> values;
- for (size_t i = 0; i < mat->columns(); ++i) {
+ for (size_t i = 0; i < mat->Columns(); ++i) {
auto* add = b.Add<u32>(p, u32(i * mat->ColumnStride()));
auto* load = MakeLoad(inst, var, mat->ColumnType(), add->Result(0));
values.Push(load->Result(0));
@@ -615,7 +615,7 @@
b.Append(fn->Block(), [&] {
Vector<core::ir::Value*, 4> values;
- for (size_t i = 0; i < mat->columns(); ++i) {
+ for (size_t i = 0; i < mat->Columns(); ++i) {
auto* from = b.Access(mat->ColumnType(), obj, u32(i));
MakeStore(inst, var, from->Result(0),
b.Add<u32>(p, u32(i * mat->ColumnStride()))->Result(0));
@@ -714,8 +714,8 @@
obj, //
[&](const core::type::Vector* v) {
b.InsertBefore(
- a, [&] { UpdateOffsetData(idx_value, v->type()->Size(), &offset); });
- obj = v->type();
+ a, [&] { UpdateOffsetData(idx_value, v->Type()->Size(), &offset); });
+ obj = v->Type();
},
[&](const core::type::Matrix* m) {
b.InsertBefore(
diff --git a/src/tint/lang/hlsl/writer/raise/decompose_uniform_access.cc b/src/tint/lang/hlsl/writer/raise/decompose_uniform_access.cc
index fdbe18c..9710785 100644
--- a/src/tint/lang/hlsl/writer/raise/decompose_uniform_access.cc
+++ b/src/tint/lang/hlsl/writer/raise/decompose_uniform_access.cc
@@ -200,8 +200,8 @@
tint::Switch(
obj_ty,
[&](const core::type::Vector* v) {
- update_offset(idx_value, v->type()->Size());
- obj_ty = v->type();
+ update_offset(idx_value, v->Type()->Size());
+ obj_ty = v->Type();
},
[&](const core::type::Matrix* m) {
update_offset(idx_value, m->ColumnStride());
@@ -430,7 +430,7 @@
// A vec3 will be stored as a vec4, so we can bitcast as if we're a vec4 and swizzle out the
// last element
if (result_ty->Width() == 3) {
- auto* bc = b.Bitcast(ty.vec4(result_ty->type()), b.Load(access));
+ auto* bc = b.Bitcast(ty.vec4(result_ty->Type()), b.Load(access));
return b.Swizzle(result_ty, bc, {0, 1, 2});
}
@@ -489,7 +489,7 @@
b.Append(fn->Block(), [&] {
Vector<core::ir::Value*, 4> values;
- for (size_t i = 0; i < mat->columns(); ++i) {
+ for (size_t i = 0; i < mat->Columns(); ++i) {
uint32_t stride = static_cast<uint32_t>(i * mat->ColumnStride());
OffsetData od{stride, {start_byte_offset}};
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
index 39aa061..8315980 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
@@ -124,7 +124,7 @@
// If we need to promote from scalar to vector, bitcast the scalar to the
// vector element type.
if (curr_type->Is<core::type::Scalar>() && target_vec_type) {
- target_type = target_vec_type->type();
+ target_type = target_vec_type->Type();
}
// Bit cast
@@ -1265,12 +1265,12 @@
};
// MSL requires that `lod` is a constant 0 for 1D textures.
- bool level_is_constant_zero = texture_type->dim() == core::type::TextureDimension::k1d;
+ bool level_is_constant_zero = texture_type->Dim() == core::type::TextureDimension::k1d;
switch (builtin->Fn()) {
case wgsl::BuiltinFn::kTextureDimensions: {
std::vector<const char*> dims;
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
case core::type::TextureDimension::kNone:
diagnostics_.AddError(Source{}) << "texture dimension is kNone";
return false;
@@ -1401,7 +1401,7 @@
bool inside_params = false;
if (usage == Usage::kCoords && e->Type()->UnwrapRef()->is_integer_scalar_or_vector()) {
inside_params = true;
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
case core::type::TextureDimension::k1d:
out << "uint(";
break;
@@ -1463,7 +1463,7 @@
out << "level(0)";
}
if (auto* ddx = arg(Usage::kDdx)) {
- auto dim = texture_type->dim();
+ auto dim = texture_type->Dim();
switch (dim) {
case core::type::TextureDimension::k2d:
case core::type::TextureDimension::k2dArray:
@@ -1508,7 +1508,7 @@
maybe_write_comma();
if (!has_offset) {
// offset argument may need to be provided if we have a component.
- switch (texture_type->dim()) {
+ switch (texture_type->Dim()) {
case core::type::TextureDimension::k2d:
case core::type::TextureDimension::k2dArray:
out << "int2(0), ";
@@ -1542,7 +1542,7 @@
// written values are visible to subsequent reads from the same thread.
if (auto* storage = texture_type->As<core::type::StorageTexture>();
builtin->Fn() == wgsl::BuiltinFn::kTextureStore &&
- storage->access() == core::Access::kReadWrite) {
+ storage->Access() == core::Access::kReadWrite) {
out << "; ";
texture_expr();
out << ".fence()";
@@ -1556,7 +1556,7 @@
const sem::BuiltinFn* builtin) {
auto* vec_ty = builtin->Parameters()[0]->Type()->As<core::type::Vector>();
std::string fn = "dot";
- if (vec_ty->type()->is_integer_scalar()) {
+ if (vec_ty->Type()->is_integer_scalar()) {
// MSL does not have a builtin for dot() with integer vector types.
// Generate the helper function if it hasn't been created already
fn = tint::GetOrAdd(int_dot_funcs_, vec_ty->Width(), [&]() -> std::string {
@@ -1920,14 +1920,14 @@
return true;
},
[&](const core::type::Vector* vec) { //
- return EmitZeroValue(out, vec->type());
+ return EmitZeroValue(out, vec->Type());
},
[&](const core::type::Matrix* mat) {
if (!EmitType(out, mat)) {
return false;
}
ScopedParen sp(out);
- return EmitZeroValue(out, mat->type());
+ return EmitZeroValue(out, mat->Type());
},
[&](const core::type::Array*) {
out << "{}";
@@ -1994,7 +1994,7 @@
ScopedParen sp(out);
- for (size_t i = 0; i < m->columns(); i++) {
+ for (size_t i = 0; i < m->Columns(); i++) {
if (i > 0) {
out << ", ";
}
@@ -2767,10 +2767,10 @@
return true;
},
[&](const core::type::Matrix* mat) {
- if (!EmitType(out, mat->type())) {
+ if (!EmitType(out, mat->Type())) {
return false;
}
- out << mat->columns() << "x" << mat->rows();
+ out << mat->Columns() << "x" << mat->Rows();
return true;
},
[&](const core::type::Pointer* ptr) {
@@ -2815,7 +2815,7 @@
out << "texture";
}
- switch (tex->dim()) {
+ switch (tex->Dim()) {
case core::type::TextureDimension::k1d:
out << "1d";
break;
@@ -2856,16 +2856,16 @@
return true;
},
[&](const core::type::StorageTexture* storage) {
- if (!EmitType(out, storage->type())) {
+ if (!EmitType(out, storage->Type())) {
return false;
}
std::string access_str;
- if (storage->access() == core::Access::kRead) {
+ if (storage->Access() == core::Access::kRead) {
out << ", access::read";
- } else if (storage->access() == core::Access::kReadWrite) {
+ } else if (storage->Access() == core::Access::kReadWrite) {
out << ", access::read_write";
- } else if (storage->access() == core::Access::kWrite) {
+ } else if (storage->Access() == core::Access::kWrite) {
out << ", access::write";
} else {
diagnostics_.AddError(Source{})
@@ -2875,14 +2875,14 @@
return true;
},
[&](const core::type::MultisampledTexture* ms) {
- if (!EmitType(out, ms->type())) {
+ if (!EmitType(out, ms->Type())) {
return false;
}
out << ", access::read";
return true;
},
[&](const core::type::SampledTexture* sampled) {
- if (!EmitType(out, sampled->type())) {
+ if (!EmitType(out, sampled->Type())) {
return false;
}
out << ", access::sample";
@@ -2898,7 +2898,7 @@
if (vec->Packed()) {
out << "packed_";
}
- if (!EmitType(out, vec->type())) {
+ if (!EmitType(out, vec->Type())) {
return false;
}
out << vec->Width();
diff --git a/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc b/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
index 941b42d..8a41cdc 100644
--- a/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
+++ b/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
@@ -118,7 +118,7 @@
ast::Type MakePackedVec3(const core::type::Type* ty) {
auto* vec = ty->As<core::type::Vector>();
TINT_ASSERT(vec != nullptr && vec->Width() == 3);
- return b.ty(core::BuiltinType::kPackedVec3, CreateASTTypeFor(ctx, vec->type()));
+ return b.ty(core::BuiltinType::kPackedVec3, CreateASTTypeFor(ctx, vec->Type()));
}
/// Recursively rewrite a type using `__packed_vec3`, if needed.
@@ -141,7 +141,7 @@
// type, to avoid changing the array element stride.
return b.ty(packed_vec3_wrapper_struct_names.GetOrAdd(vec, [&] {
auto name = b.Symbols().New(
- "tint_packed_vec3_" + vec->type()->FriendlyName() +
+ "tint_packed_vec3_" + vec->Type()->FriendlyName() +
(array_element ? "_array_element" : "_struct_member"));
auto* member =
b.Member(kStructMemberName, MakePackedVec3(vec),
@@ -159,7 +159,7 @@
// Rewrite the matrix as an array of columns that use the aligned wrapper struct.
auto new_col_type = RewriteType(mat->ColumnType(), /* array_element */ true);
if (new_col_type) {
- return b.ty.array(new_col_type, u32(mat->columns()));
+ return b.ty.array(new_col_type, u32(mat->Columns()));
}
return {};
},
@@ -284,7 +284,7 @@
copy_array_elements(arr->ConstantCount().value(), arr->ElemType());
},
[&](const core::type::Matrix* mat) {
- copy_array_elements(mat->columns(), mat->ColumnType());
+ copy_array_elements(mat->Columns(), mat->ColumnType());
},
[&](const core::type::Struct* str) {
statements.Push(b.Decl(b.Var("result", out_type())));
diff --git a/src/tint/lang/msl/writer/common/printer_support.cc b/src/tint/lang/msl/writer/common/printer_support.cc
index ce92042..9f563c8 100644
--- a/src/tint/lang/msl/writer/common/printer_support.cc
+++ b/src/tint/lang/msl/writer/common/printer_support.cc
@@ -144,7 +144,7 @@
[&](const core::type::Vector* vec) {
auto num_els = vec->Width();
- auto* el_ty = vec->type();
+ auto* el_ty = vec->Type();
SizeAndAlign el_size_align = MslPackedTypeSizeAndAlign(el_ty);
if (el_ty->IsAnyOf<core::type::U32, core::type::I32, core::type::F32,
core::type::F16>()) {
@@ -166,9 +166,9 @@
[&](const core::type::Matrix* mat) {
// https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf
// 2.3 Matrix Data Types
- auto cols = mat->columns();
- auto rows = mat->rows();
- auto* el_ty = mat->type();
+ auto cols = mat->Columns();
+ auto rows = mat->Rows();
+ auto* el_ty = mat->Type();
// Metal only support half and float matrix.
if (el_ty->IsAnyOf<core::type::F32, core::type::F16>()) {
static constexpr SizeAndAlign table_f32[] = {
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index 4d72b79..1b93146 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -1299,7 +1299,7 @@
if (vec->Packed()) {
out << "packed_";
}
- EmitType(out, vec->type());
+ EmitType(out, vec->Type());
out << vec->Width();
}
@@ -1307,8 +1307,8 @@
/// @param out the output stream
/// @param mat the matrix to emit
void EmitMatrixType(StringStream& out, const core::type::Matrix* mat) {
- EmitType(out, mat->type());
- out << mat->columns() << "x" << mat->rows();
+ EmitType(out, mat->Type());
+ out << mat->Columns() << "x" << mat->Rows();
}
/// Handles generating a texture declaration
@@ -1325,7 +1325,7 @@
out << "texture";
}
- switch (tex->dim()) {
+ switch (tex->Dim()) {
case core::type::TextureDimension::k1d:
out << "1d";
break;
@@ -1358,26 +1358,26 @@
[&](const core::type::DepthTexture*) { out << "float, access::sample"; },
[&](const core::type::DepthMultisampledTexture*) { out << "float, access::read"; },
[&](const core::type::StorageTexture* storage) {
- EmitType(out, storage->type());
+ EmitType(out, storage->Type());
out << ", ";
std::string access_str;
- if (storage->access() == core::Access::kRead) {
+ if (storage->Access() == core::Access::kRead) {
out << "access::read";
- } else if (storage->access() == core::Access::kReadWrite) {
+ } else if (storage->Access() == core::Access::kReadWrite) {
out << "access::read_write";
- } else if (storage->access() == core::Access::kWrite) {
+ } else if (storage->Access() == core::Access::kWrite) {
out << "access::write";
} else {
TINT_IR_ICE(ir_) << "invalid access control for storage texture";
}
},
[&](const core::type::MultisampledTexture* ms) {
- EmitType(out, ms->type());
+ EmitType(out, ms->Type());
out << ", access::read";
},
[&](const core::type::SampledTexture* sampled) {
- EmitType(out, sampled->type());
+ EmitType(out, sampled->Type());
out << ", access::sample";
}, //
TINT_ICE_ON_NO_MATCH);
@@ -1607,7 +1607,7 @@
[&](const core::type::Matrix* m) {
EmitType(out, m);
ScopedParen sp(out);
- emit_values(m->columns());
+ emit_values(m->Columns());
},
[&](const core::type::Array* a) {
EmitType(out, a);
@@ -1655,12 +1655,12 @@
[&](const core::type::F32*) { out << "0.0f"; }, //
[&](const core::type::I32*) { out << "0"; }, //
[&](const core::type::U32*) { out << "0u"; }, //
- [&](const core::type::Vector* vec) { EmitZeroValue(out, vec->type()); }, //
+ [&](const core::type::Vector* vec) { EmitZeroValue(out, vec->Type()); }, //
[&](const core::type::Matrix* mat) {
EmitType(out, mat);
ScopedParen sp(out);
- EmitZeroValue(out, mat->type());
+ EmitZeroValue(out, mat->Type());
},
[&](const core::type::Array*) { out << "{}"; }, //
[&](const core::type::Struct*) { out << "{}"; }, //
diff --git a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
index 5c0cafe..92fdf47 100644
--- a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
@@ -348,7 +348,7 @@
auto* arg0 = builtin->Args()[0];
auto* arg1 = builtin->Args()[1];
auto* vec = arg0->Type()->As<core::type::Vector>();
- if (vec->type()->is_integer_scalar()) {
+ if (vec->Type()->is_integer_scalar()) {
// Calls to `dot` with a integer arguments are replaced with helper functions, as
// MSL's `dot` builtin only supports floating point arguments.
auto* polyfill = integer_dot_polyfills.GetOrAdd(vec, [&] {
@@ -357,7 +357,7 @@
// let mul = lhs * rhs;
// return mul[0] + mul[1] + mul[2] + mul[3];
// }
- auto* el_ty = vec->type();
+ auto* el_ty = vec->Type();
auto* lhs = b.FunctionParam("lhs", vec);
auto* rhs = b.FunctionParam("rhs", vec);
auto* func = b.Function("tint_dot", el_ty);
@@ -552,7 +552,7 @@
void TextureDimensions(core::ir::CoreBuiltinCall* builtin) {
auto* tex = builtin->Args()[0];
auto* type = tex->Type()->As<core::type::Texture>();
- bool needs_lod_arg = type->dim() != core::type::TextureDimension::k1d &&
+ bool needs_lod_arg = type->Dim() != core::type::TextureDimension::k1d &&
!type->Is<core::type::MultisampledTexture>() &&
!type->Is<core::type::DepthMultisampledTexture>();
@@ -580,9 +580,9 @@
values.Push(call->Result(0));
};
get_dim(msl::BuiltinFn::kGetWidth);
- if (type->dim() != core::type::TextureDimension::k1d) {
+ if (type->Dim() != core::type::TextureDimension::k1d) {
get_dim(msl::BuiltinFn::kGetHeight);
- if (type->dim() == core::type::TextureDimension::k3d) {
+ if (type->Dim() == core::type::TextureDimension::k3d) {
get_dim(msl::BuiltinFn::kGetDepth);
}
}
@@ -612,8 +612,8 @@
// Add an offset argument if it was not provided.
const bool has_offset = args.Back()->Type()->is_signed_integer_vector();
- const bool needs_offset = tex_type->dim() == core::type::TextureDimension::k2d ||
- tex_type->dim() == core::type::TextureDimension::k2dArray;
+ const bool needs_offset = tex_type->Dim() == core::type::TextureDimension::k2d ||
+ tex_type->Dim() == core::type::TextureDimension::k2dArray;
if (needs_offset && !has_offset) {
args.Push(b.Zero<vec2<i32>>());
}
@@ -658,10 +658,10 @@
auto* coords = builtin->Args()[next_arg++];
core::ir::Value* index = nullptr;
core::ir::Value* lod_or_sample = nullptr;
- if (tex_type->dim() == core::type::TextureDimension::k2dArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray) {
index = builtin->Args()[next_arg++];
}
- if (tex_type->dim() != core::type::TextureDimension::k1d &&
+ if (tex_type->Dim() != core::type::TextureDimension::k1d &&
!tex_type->Is<core::type::StorageTexture>()) {
lod_or_sample = builtin->Args()[next_arg++];
}
@@ -706,7 +706,7 @@
b.InsertBefore(builtin, [&] {
auto* tex = builtin->Object();
auto* tex_type = tex->Type()->As<core::type::Texture>();
- if (IsTextureArray(tex_type->dim())) {
+ if (IsTextureArray(tex_type->Dim())) {
const uint32_t kArrayIndex = 2;
auto* index_arg = builtin->Args()[kArrayIndex];
if (index_arg->Type()->is_signed_integer_scalar()) {
@@ -759,8 +759,8 @@
b.InsertBefore(builtin, [&] {
// Wrap the bias argument in a constructor for the MSL `bias` builtin type.
uint32_t bias_idx = 2;
- if (tex_type->dim() == core::type::TextureDimension::k2dArray ||
- tex_type->dim() == core::type::TextureDimension::kCubeArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray ||
+ tex_type->Dim() == core::type::TextureDimension::kCubeArray) {
bias_idx = 3;
}
args[bias_idx] = b.Construct(ty.Get<msl::type::Bias>(), args[bias_idx])->Result(0);
@@ -825,8 +825,8 @@
b.InsertBefore(builtin, [&] {
// Find the ddx and ddy arguments.
uint32_t grad_idx = 2;
- if (tex_type->dim() == core::type::TextureDimension::k2dArray ||
- tex_type->dim() == core::type::TextureDimension::kCubeArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray ||
+ tex_type->Dim() == core::type::TextureDimension::kCubeArray) {
grad_idx = 3;
}
auto* ddx = args[grad_idx];
@@ -834,7 +834,7 @@
// Wrap the ddx and ddy arguments in a constructor for the MSL `gradient` builtin type.
enum type::Gradient::Dim dim;
- switch (tex_type->dim()) {
+ switch (tex_type->Dim()) {
case core::type::TextureDimension::k2d:
case core::type::TextureDimension::k2dArray:
dim = type::Gradient::Dim::k2d;
@@ -879,8 +879,8 @@
b.InsertBefore(builtin, [&] {
// Wrap the LOD argument in a constructor for the MSL `level` builtin type.
uint32_t lod_idx = 2;
- if (tex_type->dim() == core::type::TextureDimension::k2dArray ||
- tex_type->dim() == core::type::TextureDimension::kCubeArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray ||
+ tex_type->Dim() == core::type::TextureDimension::kCubeArray) {
lod_idx = 3;
}
args[lod_idx] = b.Construct(ty.Get<msl::type::Level>(), args[lod_idx])->Result(0);
@@ -902,7 +902,7 @@
auto* coords = builtin->Args()[1];
core::ir::Value* value = nullptr;
core::ir::Value* index = nullptr;
- if (tex_type->dim() == core::type::TextureDimension::k2dArray) {
+ if (tex_type->Dim() == core::type::TextureDimension::k2dArray) {
index = builtin->Args()[2];
value = builtin->Args()[3];
} else {
@@ -927,7 +927,7 @@
// If we are writing to a read-write texture, add a fence to ensure that the written
// values are visible to subsequent reads from the same thread.
- if (tex_type->access() == core::Access::kReadWrite) {
+ if (tex_type->Access() == core::Access::kReadWrite) {
b.MemberCall<msl::ir::MemberBuiltinCall>(ty.void_(), msl::BuiltinFn::kFence, tex);
}
});
diff --git a/src/tint/lang/spirv/reader/ast_lower/decompose_strided_matrix.cc b/src/tint/lang/spirv/reader/ast_lower/decompose_strided_matrix.cc
index e28ff41..9f98364 100644
--- a/src/tint/lang/spirv/reader/ast_lower/decompose_strided_matrix.cc
+++ b/src/tint/lang/spirv/reader/ast_lower/decompose_strided_matrix.cc
@@ -57,7 +57,7 @@
/// @returns the identifier of an array that holds an vector column for each row of the matrix.
ast::Type array(ast::Builder* b) const {
- return b->ty.array(b->ty.vec<f32>(matrix->rows()), u32(matrix->columns()),
+ return b->ty.array(b->ty.vec<f32>(matrix->Rows()), u32(matrix->Columns()),
Vector{
b->Stride(stride),
});
@@ -153,8 +153,8 @@
if (auto info = decomposed.Get(access->Member())) {
auto fn = tint::GetOrAdd(mat_to_arr, *info, [&] {
auto name =
- b.Symbols().New("mat" + std::to_string(info->matrix->columns()) + "x" +
- std::to_string(info->matrix->rows()) + "_stride_" +
+ b.Symbols().New("mat" + std::to_string(info->matrix->Columns()) + "x" +
+ std::to_string(info->matrix->Rows()) + "_stride_" +
std::to_string(info->stride) + "_to_arr");
auto matrix = [&] { return CreateASTTypeFor(ctx, info->matrix); };
@@ -162,7 +162,7 @@
auto mat = b.Sym("m");
Vector<const ast::Expression*, 4> columns;
- for (uint32_t i = 0; i < static_cast<uint32_t>(info->matrix->columns()); i++) {
+ for (uint32_t i = 0; i < static_cast<uint32_t>(info->matrix->Columns()); i++) {
columns.Push(b.IndexAccessor(mat, u32(i)));
}
b.Func(name,
@@ -192,8 +192,8 @@
if (auto info = decomposed.Get(access->Member())) {
auto fn = tint::GetOrAdd(arr_to_mat, *info, [&] {
auto name =
- b.Symbols().New("arr_to_mat" + std::to_string(info->matrix->columns()) +
- "x" + std::to_string(info->matrix->rows()) + "_stride_" +
+ b.Symbols().New("arr_to_mat" + std::to_string(info->matrix->Columns()) +
+ "x" + std::to_string(info->matrix->Rows()) + "_stride_" +
std::to_string(info->stride));
auto matrix = [&] { return CreateASTTypeFor(ctx, info->matrix); };
@@ -201,7 +201,7 @@
auto arr = b.Sym("arr");
Vector<const ast::Expression*, 4> columns;
- for (uint32_t i = 0; i < static_cast<uint32_t>(info->matrix->columns()); i++) {
+ for (uint32_t i = 0; i < static_cast<uint32_t>(info->matrix->Columns()); i++) {
columns.Push(b.IndexAccessor(arr, u32(i)));
}
b.Func(name,
diff --git a/src/tint/lang/spirv/writer/printer/printer.cc b/src/tint/lang/spirv/writer/printer/printer.cc
index 721d72c..3960266 100644
--- a/src/tint/lang/spirv/writer/printer/printer.cc
+++ b/src/tint/lang/spirv/writer/printer/printer.cc
@@ -149,14 +149,14 @@
// Depth textures are always declared as sampled textures.
[&](const core::type::DepthTexture* depth) {
- return types.Get<core::type::SampledTexture>(depth->dim(), types.f32());
+ return types.Get<core::type::SampledTexture>(depth->Dim(), types.f32());
},
[&](const core::type::DepthMultisampledTexture* depth) {
- return types.Get<core::type::MultisampledTexture>(depth->dim(), types.f32());
+ return types.Get<core::type::MultisampledTexture>(depth->Dim(), types.f32());
},
[&](const core::type::StorageTexture* st) -> const core::type::Type* {
- return types.Get<core::type::StorageTexture>(st->dim(), st->texel_format(),
- core::Access::kRead, st->type());
+ return types.Get<core::type::StorageTexture>(st->Dim(), st->TexelFormat(),
+ core::Access::kRead, st->Type());
},
// Both sampler types are the same in SPIR-V.
@@ -443,7 +443,7 @@
},
[&](const core::type::Matrix* mat) {
OperandList operands = {Type(ty), id};
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
operands.push_back(Constant(constant->Index(i)));
}
module_.PushType(spv::Op::OpConstantComposite, operands);
@@ -517,11 +517,11 @@
module_.PushType(spv::Op::OpTypeFloat, {id, 16u});
},
[&](const core::type::Vector* vec) {
- module_.PushType(spv::Op::OpTypeVector, {id, Type(vec->type()), vec->Width()});
+ module_.PushType(spv::Op::OpTypeVector, {id, Type(vec->Type()), vec->Width()});
},
[&](const core::type::Matrix* mat) {
module_.PushType(spv::Op::OpTypeMatrix,
- {id, Type(mat->ColumnType()), mat->columns()});
+ {id, Type(mat->ColumnType()), mat->Columns()});
},
[&](const core::type::Array* arr) {
if (arr->ConstantCount()) {
@@ -599,12 +599,12 @@
// Emit matrix layout decorations if necessary.
if (auto* matrix_type = get_nested_matrix_type(member->Type())) {
- const uint32_t effective_row_count = (matrix_type->rows() == 2) ? 2 : 4;
+ const uint32_t effective_row_count = (matrix_type->Rows() == 2) ? 2 : 4;
module_.PushAnnot(spv::Op::OpMemberDecorate,
{id, member->Index(), U32Operand(SpvDecorationColMajor)});
module_.PushAnnot(spv::Op::OpMemberDecorate,
{id, member->Index(), U32Operand(SpvDecorationMatrixStride),
- Operand(effective_row_count * matrix_type->type()->Size())});
+ Operand(effective_row_count * matrix_type->Type()->Size())});
}
if (member->Name().IsValid()) {
@@ -630,15 +630,15 @@
void EmitTextureType(uint32_t id, const core::type::Texture* texture) {
uint32_t sampled_type = Switch(
texture, //
- [&](const core::type::SampledTexture* t) { return Type(t->type()); },
- [&](const core::type::MultisampledTexture* t) { return Type(t->type()); },
- [&](const core::type::StorageTexture* t) { return Type(t->type()); },
- [&](const core::type::InputAttachment* t) { return Type(t->type()); }, //
+ [&](const core::type::SampledTexture* t) { return Type(t->Type()); },
+ [&](const core::type::MultisampledTexture* t) { return Type(t->Type()); },
+ [&](const core::type::StorageTexture* t) { return Type(t->Type()); },
+ [&](const core::type::InputAttachment* t) { return Type(t->Type()); }, //
TINT_ICE_ON_NO_MATCH);
uint32_t dim = SpvDimMax;
uint32_t array = 0u;
- switch (texture->dim()) {
+ switch (texture->Dim()) {
case core::type::TextureDimension::kNone: {
break;
}
@@ -700,7 +700,7 @@
uint32_t format = SpvImageFormat_::SpvImageFormatUnknown;
if (auto* st = texture->As<core::type::StorageTexture>()) {
- format = TexelFormat(st->texel_format());
+ format = TexelFormat(st->TexelFormat());
}
module_.PushType(spv::Op::OpTypeImage,
@@ -2293,7 +2293,7 @@
// Add NonReadable and NonWritable decorations to storage textures and buffers.
auto* st = store_ty->As<core::type::StorageTexture>();
- auto access = st ? st->access() : ptr->Access();
+ auto access = st ? st->Access() : ptr->Access();
if (st || ptr->AddressSpace() != core::AddressSpace::kHandle) {
if (access == core::Access::kRead) {
module_.PushAnnot(spv::Op::OpDecorate,
diff --git a/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc b/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
index d23eb16..5c778c0 100644
--- a/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
@@ -337,7 +337,7 @@
auto* v1 = builtin->Args()[0];
auto* v2 = builtin->Args()[1];
auto* vec = v1->Type()->As<core::type::Vector>();
- auto* elty = vec->type();
+ auto* elty = vec->Type();
for (uint32_t i = 0; i < vec->Width(); i++) {
b.InsertBefore(builtin, [&] {
auto* e1 = b.Access(elty, v1, u32(i));
@@ -481,7 +481,7 @@
core::ir::Value* array_idx,
core::ir::Instruction* insertion_point) {
auto* vec = coords->Type()->As<core::type::Vector>();
- auto* element_ty = vec->type();
+ auto* element_ty = vec->Type();
// Convert the index to match the coordinate type if needed.
if (array_idx->Type() != element_ty) {
@@ -519,7 +519,7 @@
sampled_image->InsertBefore(builtin);
// Append the array index to the coordinates if provided.
- auto* array_idx = IsTextureArray(texture_ty->dim()) ? next_arg() : nullptr;
+ auto* array_idx = IsTextureArray(texture_ty->Dim()) ? next_arg() : nullptr;
if (array_idx) {
coords = AppendArrayIndex(coords, array_idx, builtin);
}
@@ -624,7 +624,7 @@
sampled_image->InsertBefore(builtin);
// Append the array index to the coordinates if provided.
- auto* array_idx = IsTextureArray(texture_ty->dim()) ? next_arg() : nullptr;
+ auto* array_idx = IsTextureArray(texture_ty->Dim()) ? next_arg() : nullptr;
if (array_idx) {
coords = AppendArrayIndex(coords, array_idx, builtin);
}
@@ -683,7 +683,7 @@
auto* texture_ty = texture->Type()->As<core::type::Texture>();
// Append the array index to the coordinates if provided.
- auto* array_idx = IsTextureArray(texture_ty->dim()) ? next_arg() : nullptr;
+ auto* array_idx = IsTextureArray(texture_ty->Dim()) ? next_arg() : nullptr;
if (array_idx) {
coords = AppendArrayIndex(coords, array_idx, builtin);
}
@@ -741,7 +741,7 @@
auto* texture_ty = texture->Type()->As<core::type::Texture>();
// Append the array index to the coordinates if provided.
- auto* array_idx = IsTextureArray(texture_ty->dim()) ? next_arg() : nullptr;
+ auto* array_idx = IsTextureArray(texture_ty->Dim()) ? next_arg() : nullptr;
if (array_idx) {
coords = AppendArrayIndex(coords, array_idx, builtin);
}
@@ -798,9 +798,9 @@
// Add an extra component to the result vector for arrayed textures.
auto* result_ty = builtin->Result(0)->Type();
- if (core::type::IsTextureArray(texture_ty->dim())) {
+ if (core::type::IsTextureArray(texture_ty->Dim())) {
auto* vec = result_ty->As<core::type::Vector>();
- result_ty = ty.vec(vec->type(), vec->Width() + 1);
+ result_ty = ty.vec(vec->Type(), vec->Width() + 1);
}
// Call the function.
@@ -809,7 +809,7 @@
result->InsertBefore(builtin);
// Swizzle the first two components from the result for arrayed textures.
- if (core::type::IsTextureArray(texture_ty->dim())) {
+ if (core::type::IsTextureArray(texture_ty->Dim())) {
result = b.Swizzle(builtin->Result(0)->Type(), result, {0, 1});
result->InsertBefore(builtin);
}
diff --git a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
index 3091c09..cf7f106 100644
--- a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
+++ b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
@@ -82,7 +82,7 @@
auto column_wise = [&](auto op) {
auto* mat = ty->As<core::type::Matrix>();
Vector<core::ir::Value*, 4> args;
- for (uint32_t col = 0; col < mat->columns(); col++) {
+ for (uint32_t col = 0; col < mat->Columns(); col++) {
auto* lhs_col = b.Access(mat->ColumnType(), lhs, u32(col));
auto* rhs_col = b.Access(mat->ColumnType(), rhs, u32(col));
auto* add = b.Binary(op, mat->ColumnType(), lhs_col, rhs_col);
@@ -146,7 +146,7 @@
b.InsertBefore(convert, [&] {
// Extract and convert each column separately.
Vector<core::ir::Value*, 4> args;
- for (uint32_t c = 0; c < out_mat->columns(); c++) {
+ for (uint32_t c = 0; c < out_mat->Columns(); c++) {
auto* col = b.Access(in_mat->ColumnType(), arg, u32(c));
auto* new_col = b.Convert(out_mat->ColumnType(), col);
args.Push(new_col->Result(0));
diff --git a/src/tint/lang/wgsl/ast/transform/builtin_polyfill.cc b/src/tint/lang/wgsl/ast/transform/builtin_polyfill.cc
index b9438d9..18b9347 100644
--- a/src/tint/lang/wgsl/ast/transform/builtin_polyfill.cc
+++ b/src/tint/lang/wgsl/ast/transform/builtin_polyfill.cc
@@ -123,11 +123,11 @@
if (cfg.builtins.bgra8unorm) {
if (auto* ty_expr = src.Sem().Get<sem::TypeExpression>(expr)) {
if (auto* tex = ty_expr->Type()->As<core::type::StorageTexture>()) {
- if (tex->texel_format() == core::TexelFormat::kBgra8Unorm) {
+ if (tex->TexelFormat() == core::TexelFormat::kBgra8Unorm) {
ctx.Replace(expr, [this, tex] {
return ctx.dst->Expr(ctx.dst->ty.storage_texture(
- tex->dim(), core::TexelFormat::kRgba8Unorm,
- tex->access()));
+ tex->Dim(), core::TexelFormat::kRgba8Unorm,
+ tex->Access()));
});
made_changes = true;
}
@@ -1393,7 +1393,7 @@
if (cfg.builtins.reflect_vec2_f32) {
auto& sig = builtin->Signature();
auto* vec = sig.return_type->As<core::type::Vector>();
- if (vec && vec->Width() == 2 && vec->type()->Is<core::type::F32>()) {
+ if (vec && vec->Width() == 2 && vec->Type()->Is<core::type::F32>()) {
return builtin_polyfills.GetOrAdd(
builtin, [&] { return reflect(builtin->ReturnType()); });
}
@@ -1422,7 +1422,7 @@
auto& sig = builtin->Signature();
auto* tex = sig.Parameter(core::ParameterUsage::kTexture);
if (auto* stex = tex->Type()->As<core::type::StorageTexture>()) {
- if (stex->texel_format() == core::TexelFormat::kBgra8Unorm) {
+ if (stex->TexelFormat() == core::TexelFormat::kBgra8Unorm) {
ctx.Replace(expr, [this, expr] {
return ctx.dst->MemberAccessor(
ctx.CloneWithoutTransform(expr), "bgra");
@@ -1438,7 +1438,7 @@
auto& sig = builtin->Signature();
auto* tex = sig.Parameter(core::ParameterUsage::kTexture);
if (auto* stex = tex->Type()->As<core::type::SampledTexture>()) {
- if (stex->type()->Is<core::type::F32>()) {
+ if (stex->Type()->Is<core::type::F32>()) {
return builtin_polyfills.GetOrAdd(builtin, [&] {
return textureSampleBaseClampToEdge_2d_f32();
});
@@ -1452,7 +1452,7 @@
auto& sig = builtin->Signature();
auto* tex = sig.Parameter(core::ParameterUsage::kTexture);
if (auto* stex = tex->Type()->As<core::type::StorageTexture>()) {
- if (stex->texel_format() == core::TexelFormat::kBgra8Unorm) {
+ if (stex->TexelFormat() == core::TexelFormat::kBgra8Unorm) {
size_t value_idx = static_cast<size_t>(
sig.IndexOf(core::ParameterUsage::kValue));
ctx.Replace(expr, [this, expr, value_idx] {
diff --git a/src/tint/lang/wgsl/ast/transform/preserve_padding.cc b/src/tint/lang/wgsl/ast/transform/preserve_padding.cc
index 5e28fed..195c67f 100644
--- a/src/tint/lang/wgsl/ast/transform/preserve_padding.cc
+++ b/src/tint/lang/wgsl/ast/transform/preserve_padding.cc
@@ -156,7 +156,7 @@
// Call a helper function that assigns each column separately.
return call_helper([&] {
tint::Vector<const Statement*, 4> body;
- for (uint32_t i = 0; i < mat->columns(); i++) {
+ for (uint32_t i = 0; i < mat->Columns(); i++) {
body.Push(MakeAssignment(mat->ColumnType(),
b.IndexAccessor(b.Deref(kDestParamName), u32(i)),
b.IndexAccessor(kValueParamName, u32(i))));
diff --git a/src/tint/lang/wgsl/ast/transform/robustness.cc b/src/tint/lang/wgsl/ast/transform/robustness.cc
index cea2d77..89f5b0a 100644
--- a/src/tint/lang/wgsl/ast/transform/robustness.cc
+++ b/src/tint/lang/wgsl/ast/transform/robustness.cc
@@ -252,7 +252,7 @@
// Validation will have rejected any OOB accesses.
return nullptr;
}
- return b.Expr(u32(mat->columns() - 1u));
+ return b.Expr(u32(mat->Columns() - 1u));
},
[&](const core::type::Array* arr) -> const Expression* {
if (arr->Count()->Is<core::type::RuntimeArrayCount>()) {
diff --git a/src/tint/lang/wgsl/ast/transform/std140.cc b/src/tint/lang/wgsl/ast/transform/std140.cc
index 7307b6d..ea7f5fe 100644
--- a/src/tint/lang/wgsl/ast/transform/std140.cc
+++ b/src/tint/lang/wgsl/ast/transform/std140.cc
@@ -290,7 +290,7 @@
fork_std140 = true;
// Replace the member with column vectors.
const auto name_prefix = PrefixForUniqueNames(
- str->Declaration(), member->Name(), mat->columns());
+ str->Declaration(), member->Name(), mat->Columns());
// Build a struct member for each column of the matrix
auto column_members = DecomposedMatrixStructMembers(
@@ -407,9 +407,9 @@
[&](const core::type::Matrix* mat) {
if (MatrixNeedsDecomposing(mat)) {
auto std140_mat = std140_mats.GetOrAdd(mat, [&] {
- auto name = b.Symbols().New("mat" + std::to_string(mat->columns()) + "x" +
- std::to_string(mat->rows()) + "_" +
- mat->type()->FriendlyName());
+ auto name = b.Symbols().New("mat" + std::to_string(mat->Columns()) + "x" +
+ std::to_string(mat->Rows()) + "_" +
+ mat->Type()->FriendlyName());
auto members =
DecomposedMatrixStructMembers(mat, "col", mat->Align(), mat->Size());
b.Structure(name, members);
@@ -454,7 +454,7 @@
uint32_t align,
uint32_t size) {
// Replace the member with column vectors.
- const auto num_columns = mat->columns();
+ const auto num_columns = mat->Columns();
const auto column_size = mat->ColumnType()->Size();
const auto column_stride = mat->ColumnStride();
// Build a struct member for each column of the matrix
@@ -636,8 +636,8 @@
return "arr" + std::to_string(count.value()) + "_" + ConvertSuffix(arr->ElemType());
},
[&](const core::type::Matrix* mat) {
- return "mat" + std::to_string(mat->columns()) + "x" + std::to_string(mat->rows()) +
- "_" + ConvertSuffix(mat->type());
+ return "mat" + std::to_string(mat->Columns()) + "x" + std::to_string(mat->Rows()) +
+ "_" + ConvertSuffix(mat->Type());
},
[&](const core::type::F32*) { return "f32"; }, //
[&](const core::type::F16*) { return "f16"; }, //
@@ -879,7 +879,7 @@
const core::type::Type* ret_ty = nullptr;
// Build switch() cases for each column of the matrix
- auto num_columns = chain.std140_mat_ty->columns();
+ auto num_columns = chain.std140_mat_ty->Columns();
for (uint32_t column_idx = 0; column_idx < num_columns; column_idx++) {
const Expression* expr = nullptr;
const core::type::Type* ty = nullptr;
@@ -1082,7 +1082,7 @@
[&](const core::type::Vector* vec) -> ExprTypeName {
auto* idx = dynamic_index(dyn_idx->slot);
auto* expr = b.IndexAccessor(lhs, idx);
- return {expr, vec->type(), name};
+ return {expr, vec->Type(), name};
}, //
TINT_ICE_ON_NO_MATCH);
}
@@ -1097,7 +1097,7 @@
rhs += xyzw[el];
}
auto swizzle_ty = src.Types().Find<core::type::Vector>(
- vec->type(), static_cast<uint32_t>(swizzle->Length()));
+ vec->Type(), static_cast<uint32_t>(swizzle->Length()));
auto* expr = b.MemberAccessor(lhs, rhs);
return {expr, swizzle_ty, rhs};
}, //
@@ -1124,7 +1124,7 @@
}, //
[&](const core::type::Vector* vec) -> ExprTypeName {
auto* expr = b.IndexAccessor(lhs, idx);
- return {expr, vec->type(), std::to_string(idx)};
+ return {expr, vec->Type(), std::to_string(idx)};
}, //
TINT_ICE_ON_NO_MATCH);
}
diff --git a/src/tint/lang/wgsl/ast/transform/transform.cc b/src/tint/lang/wgsl/ast/transform/transform.cc
index 33a45c9..1e0bf1e 100644
--- a/src/tint/lang/wgsl/ast/transform/transform.cc
+++ b/src/tint/lang/wgsl/ast/transform/transform.cc
@@ -101,11 +101,11 @@
return ctx.dst->ty.bool_();
}
if (auto* m = ty->As<core::type::Matrix>()) {
- auto el = CreateASTTypeFor(ctx, m->type());
- return ctx.dst->ty.mat(el, m->columns(), m->rows());
+ auto el = CreateASTTypeFor(ctx, m->Type());
+ return ctx.dst->ty.mat(el, m->Columns(), m->Rows());
}
if (auto* v = ty->As<core::type::Vector>()) {
- auto el = CreateASTTypeFor(ctx, v->type());
+ auto el = CreateASTTypeFor(ctx, v->Type());
if (v->Packed()) {
TINT_ASSERT(v->Width() == 3u);
return ctx.dst->ty(core::BuiltinType::kPackedVec3, el);
@@ -159,25 +159,25 @@
return ctx.dst->ty.atomic(CreateASTTypeFor(ctx, a->Type()));
}
if (auto* t = ty->As<core::type::DepthTexture>()) {
- return ctx.dst->ty.depth_texture(t->dim());
+ return ctx.dst->ty.depth_texture(t->Dim());
}
if (auto* t = ty->As<core::type::DepthMultisampledTexture>()) {
- return ctx.dst->ty.depth_multisampled_texture(t->dim());
+ return ctx.dst->ty.depth_multisampled_texture(t->Dim());
}
if (ty->Is<core::type::ExternalTexture>()) {
return ctx.dst->ty.external_texture();
}
if (auto* t = ty->As<core::type::MultisampledTexture>()) {
- return ctx.dst->ty.multisampled_texture(t->dim(), CreateASTTypeFor(ctx, t->type()));
+ return ctx.dst->ty.multisampled_texture(t->Dim(), CreateASTTypeFor(ctx, t->Type()));
}
if (auto* t = ty->As<core::type::SampledTexture>()) {
- return ctx.dst->ty.sampled_texture(t->dim(), CreateASTTypeFor(ctx, t->type()));
+ return ctx.dst->ty.sampled_texture(t->Dim(), CreateASTTypeFor(ctx, t->Type()));
}
if (auto* t = ty->As<core::type::StorageTexture>()) {
- return ctx.dst->ty.storage_texture(t->dim(), t->texel_format(), t->access());
+ return ctx.dst->ty.storage_texture(t->Dim(), t->TexelFormat(), t->Access());
}
if (auto* s = ty->As<core::type::Sampler>()) {
- return ctx.dst->ty.sampler(s->kind());
+ return ctx.dst->ty.sampler(s->Kind());
}
if (auto* p = ty->As<core::type::Pointer>()) {
// Note: core::type::Pointer always has an inferred access, but WGSL only allows an explicit
@@ -188,7 +188,7 @@
return ctx.dst->ty.ptr(address_space, CreateASTTypeFor(ctx, p->StoreType()), access);
}
if (auto* i = ty->As<core::type::InputAttachment>()) {
- return ctx.dst->ty.input_attachment(CreateASTTypeFor(ctx, i->type()));
+ return ctx.dst->ty.input_attachment(CreateASTTypeFor(ctx, i->Type()));
}
TINT_UNREACHABLE() << "Unhandled type: " << ty->TypeInfo().name;
}
diff --git a/src/tint/lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.cc b/src/tint/lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.cc
index bef4c62..f1b5a19 100644
--- a/src/tint/lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.cc
+++ b/src/tint/lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.cc
@@ -108,14 +108,14 @@
// 'element(uint32_t c, uint32_t r)' callback.
auto build_mat = [&](auto&& element) {
tint::Vector<const Expression*, 4> columns;
- for (uint32_t c = 0; c < mat_type->columns(); c++) {
+ for (uint32_t c = 0; c < mat_type->Columns(); c++) {
tint::Vector<const Expression*, 4> row_values;
- for (uint32_t r = 0; r < mat_type->rows(); r++) {
+ for (uint32_t r = 0; r < mat_type->Rows(); r++) {
row_values.Push(element(c, r));
}
// Construct the column vector.
- columns.Push(b.vec(CreateASTTypeFor(ctx, mat_type->type()), mat_type->rows(),
+ columns.Push(b.vec(CreateASTTypeFor(ctx, mat_type->Type()), mat_type->Rows(),
std::move(row_values)));
}
return b.Call(CreateASTTypeFor(ctx, mat_type), columns);
@@ -126,12 +126,12 @@
// This is done to ensure that the single argument value is only evaluated once, and
// with the correct expression evaluation order.
auto fn = tint::GetOrAdd(scalar_inits, mat_type, [&] {
- auto name = b.Symbols().New("build_mat" + std::to_string(mat_type->columns()) +
- "x" + std::to_string(mat_type->rows()));
+ auto name = b.Symbols().New("build_mat" + std::to_string(mat_type->Columns()) +
+ "x" + std::to_string(mat_type->Rows()));
b.Func(name,
tint::Vector{
// Single scalar parameter
- b.Param("value", CreateASTTypeFor(ctx, mat_type->type())),
+ b.Param("value", CreateASTTypeFor(ctx, mat_type->Type())),
},
CreateASTTypeFor(ctx, mat_type),
tint::Vector{
@@ -144,9 +144,9 @@
return b.Call(fn, ctx.Clone(args[0]->Declaration()));
}
- if (TINT_LIKELY(args.Length() == mat_type->columns() * mat_type->rows())) {
+ if (TINT_LIKELY(args.Length() == mat_type->Columns() * mat_type->Rows())) {
return build_mat([&](uint32_t c, uint32_t r) {
- return ctx.Clone(args[c * mat_type->rows() + r]->Declaration());
+ return ctx.Clone(args[c * mat_type->Rows() + r]->Declaration());
});
}
diff --git a/src/tint/lang/wgsl/ast/transform/vertex_pulling.cc b/src/tint/lang/wgsl/ast/transform/vertex_pulling.cc
index 9962ea4..aca164d 100644
--- a/src/tint/lang/wgsl/ast/transform/vertex_pulling.cc
+++ b/src/tint/lang/wgsl/ast/transform/vertex_pulling.cc
@@ -187,7 +187,7 @@
return {BaseWGSLType::kF16, 1};
},
[](const core::type::Vector* vec) -> AttributeWGSLType {
- return {WGSLTypeOf(vec->type()).base_type, vec->Width()};
+ return {WGSLTypeOf(vec->Type()).base_type, vec->Width()};
},
[](Default) -> AttributeWGSLType {
return {BaseWGSLType::kInvalid, 0};
diff --git a/src/tint/lang/wgsl/helpers/append_vector.cc b/src/tint/lang/wgsl/helpers/append_vector.cc
index 8ea2ebd..405d8f7 100644
--- a/src/tint/lang/wgsl/helpers/append_vector.cc
+++ b/src/tint/lang/wgsl/helpers/append_vector.cc
@@ -92,7 +92,7 @@
auto* vector_ty = vector_sem->Type()->UnwrapRef();
if (auto* vec = vector_ty->As<core::type::Vector>()) {
packed_size = vec->Width() + 1;
- packed_el_sem_ty = vec->type();
+ packed_el_sem_ty = vec->Type();
} else {
packed_size = 2;
packed_el_sem_ty = vector_ty;
diff --git a/src/tint/lang/wgsl/helpers/append_vector_test.cc b/src/tint/lang/wgsl/helpers/append_vector_test.cc
index 26ebba4..797b1e4 100644
--- a/src/tint/lang/wgsl/helpers/append_vector_test.cc
+++ b/src/tint/lang/wgsl/helpers/append_vector_test.cc
@@ -73,7 +73,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 3u);
@@ -119,7 +119,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 3u);
@@ -171,7 +171,7 @@
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 2u);
@@ -215,7 +215,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 3u);
@@ -259,7 +259,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 4u);
@@ -298,7 +298,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 2u);
@@ -339,7 +339,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 3u);
@@ -378,7 +378,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 2u);
@@ -420,7 +420,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 2u);
@@ -458,7 +458,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 2u);
@@ -500,7 +500,7 @@
ASSERT_NE(ctor, nullptr);
ASSERT_TRUE(ctor->ReturnType()->Is<core::type::Vector>());
EXPECT_EQ(ctor->ReturnType()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(ctor->ReturnType()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(ctor->ReturnType(), call->Type());
ASSERT_EQ(ctor->Parameters().Length(), 4u);
diff --git a/src/tint/lang/wgsl/inspector/inspector.cc b/src/tint/lang/wgsl/inspector/inspector.cc
index 3929fcd..1af4333 100644
--- a/src/tint/lang/wgsl/inspector/inspector.cc
+++ b/src/tint/lang/wgsl/inspector/inspector.cc
@@ -479,7 +479,7 @@
entry.variable_name = var->Declaration()->name->symbol.Name();
auto* tex = var->Type()->UnwrapRef()->As<core::type::Texture>();
- entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(tex->dim());
+ entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(tex->Dim());
result.push_back(entry);
}
@@ -532,13 +532,13 @@
entry.input_attachmnt_index = sem_var->Attributes().input_attachment_index.value();
auto* input_attachment_type = var->Type()->UnwrapRef()->As<core::type::InputAttachment>();
- auto* base_type = input_attachment_type->type();
+ auto* base_type = input_attachment_type->Type();
entry.sampled_kind = BaseTypeToSampledKind(base_type);
entry.variable_name = var->Declaration()->name->symbol.Name();
entry.dim =
- TypeTextureDimensionToResourceBindingTextureDimension(input_attachment_type->dim());
+ TypeTextureDimensionToResourceBindingTextureDimension(input_attachment_type->Dim());
result.push_back(entry);
}
@@ -755,13 +755,13 @@
entry.variable_name = var->Declaration()->name->symbol.Name();
auto* texture_type = var->Type()->UnwrapRef()->As<core::type::Texture>();
- entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(texture_type->dim());
+ entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(texture_type->Dim());
const core::type::Type* base_type = nullptr;
if (multisampled_only) {
- base_type = texture_type->As<core::type::MultisampledTexture>()->type();
+ base_type = texture_type->As<core::type::MultisampledTexture>()->Type();
} else {
- base_type = texture_type->As<core::type::SampledTexture>()->type();
+ base_type = texture_type->As<core::type::SampledTexture>()->Type();
}
entry.sampled_kind = BaseTypeToSampledKind(base_type);
@@ -788,7 +788,7 @@
auto* texture_type = var->Type()->UnwrapRef()->As<core::type::StorageTexture>();
ResourceBinding entry;
- switch (texture_type->access()) {
+ switch (texture_type->Access()) {
case core::Access::kWrite:
entry.resource_type = ResourceBinding::ResourceType::kWriteOnlyStorageTexture;
break;
@@ -805,12 +805,12 @@
entry.binding = binding_info.binding;
entry.variable_name = var->Declaration()->name->symbol.Name();
- entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(texture_type->dim());
+ entry.dim = TypeTextureDimensionToResourceBindingTextureDimension(texture_type->Dim());
- auto* base_type = texture_type->type();
+ auto* base_type = texture_type->Type();
entry.sampled_kind = BaseTypeToSampledKind(base_type);
entry.image_format =
- TypeTexelFormatToResourceBindingTexelFormat(texture_type->texel_format());
+ TypeTexelFormatToResourceBindingTexelFormat(texture_type->TexelFormat());
result.push_back(entry);
}
diff --git a/src/tint/lang/wgsl/inspector/resource_binding.cc b/src/tint/lang/wgsl/inspector/resource_binding.cc
index 0cf21bb..7606a14 100644
--- a/src/tint/lang/wgsl/inspector/resource_binding.cc
+++ b/src/tint/lang/wgsl/inspector/resource_binding.cc
@@ -67,9 +67,9 @@
if (auto* at = base_type->As<core::type::Array>()) {
base_type = at->ElemType();
} else if (auto* mt = base_type->As<core::type::Matrix>()) {
- base_type = mt->type();
+ base_type = mt->Type();
} else if (auto* vt = base_type->As<core::type::Vector>()) {
- base_type = vt->type();
+ base_type = vt->Type();
}
if (base_type->Is<core::type::F32>()) {
diff --git a/src/tint/lang/wgsl/resolver/builtin_test.cc b/src/tint/lang/wgsl/resolver/builtin_test.cc
index 9bb6a4a..e5dd078 100644
--- a/src/tint/lang/wgsl/resolver/builtin_test.cc
+++ b/src/tint/lang/wgsl/resolver/builtin_test.cc
@@ -153,7 +153,7 @@
ASSERT_NE(TypeOf(expr), nullptr);
EXPECT_TRUE(TypeOf(expr)->Is<core::type::Vector>());
EXPECT_EQ(TypeOf(expr)->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinTest, Select_Error_NoParams) {
@@ -369,8 +369,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -414,8 +414,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -460,8 +460,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -507,8 +507,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -565,8 +565,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -614,8 +614,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -664,8 +664,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -715,8 +715,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -792,7 +792,7 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinFloatTest, Cross_f16) {
@@ -806,7 +806,7 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
}
TEST_F(ResolverBuiltinFloatTest, Cross_Error_NoArgs) {
@@ -1059,7 +1059,7 @@
auto* fract = ty->Members()[0];
ASSERT_TRUE(fract->Type()->Is<core::type::Vector>());
EXPECT_EQ(fract->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 12u);
EXPECT_EQ(fract->Align(), 16u);
@@ -1068,7 +1068,7 @@
auto* exp = ty->Members()[1];
ASSERT_TRUE(exp->Type()->Is<core::type::Vector>());
EXPECT_EQ(exp->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(exp->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(exp->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(exp->Offset(), 16u);
EXPECT_EQ(exp->Size(), 12u);
EXPECT_EQ(exp->Align(), 16u);
@@ -1094,7 +1094,7 @@
auto* fract = ty->Members()[0];
ASSERT_TRUE(fract->Type()->Is<core::type::Vector>());
EXPECT_EQ(fract->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 6u);
EXPECT_EQ(fract->Align(), 8u);
@@ -1103,7 +1103,7 @@
auto* exp = ty->Members()[1];
ASSERT_TRUE(exp->Type()->Is<core::type::Vector>());
EXPECT_EQ(exp->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(exp->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(exp->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(exp->Offset(), 16u);
EXPECT_EQ(exp->Size(), 12u);
EXPECT_EQ(exp->Align(), 16u);
@@ -1220,8 +1220,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinFloatTest, Mix_VectorScalar_f16) {
@@ -1235,8 +1235,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
}
// modf: (f32) -> __modf_result, (vecN<f32>) -> __modf_result_vecN, (f16) -> __modf_result_f16,
@@ -1315,7 +1315,7 @@
auto* fract = ty->Members()[0];
ASSERT_TRUE(fract->Type()->Is<core::type::Vector>());
EXPECT_EQ(fract->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 12u);
EXPECT_EQ(fract->Align(), 16u);
@@ -1324,7 +1324,7 @@
auto* whole = ty->Members()[1];
ASSERT_TRUE(whole->Type()->Is<core::type::Vector>());
EXPECT_EQ(whole->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(whole->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(whole->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(whole->Offset(), 16u);
EXPECT_EQ(whole->Size(), 12u);
EXPECT_EQ(whole->Align(), 16u);
@@ -1350,7 +1350,7 @@
auto* fract = ty->Members()[0];
ASSERT_TRUE(fract->Type()->Is<core::type::Vector>());
EXPECT_EQ(fract->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(fract->Type()->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 6u);
EXPECT_EQ(fract->Align(), 8u);
@@ -1359,7 +1359,7 @@
auto* whole = ty->Members()[1];
ASSERT_TRUE(whole->Type()->Is<core::type::Vector>());
EXPECT_EQ(whole->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(whole->Type()->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(whole->Type()->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(whole->Offset(), 8u);
EXPECT_EQ(whole->Size(), 6u);
EXPECT_EQ(whole->Align(), 8u);
@@ -1452,7 +1452,7 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinFloatTest, Normalize_Vector_f16) {
@@ -1466,7 +1466,7 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_float_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
}
TEST_F(ResolverBuiltinFloatTest, Normalize_Error_NoParams) {
@@ -1551,8 +1551,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_signed_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1596,8 +1596,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_unsigned_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1641,8 +1641,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_signed_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1686,8 +1686,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_unsigned_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1732,8 +1732,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_signed_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1779,8 +1779,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_unsigned_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1826,8 +1826,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_signed_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -1873,8 +1873,8 @@
ASSERT_NE(TypeOf(call), nullptr);
EXPECT_TRUE(TypeOf(call)->is_unsigned_integer_vector());
EXPECT_EQ(TypeOf(call)->As<core::type::Vector>()->Width(), 3u);
- ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->type(), nullptr);
- EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ ASSERT_NE(TypeOf(call)->As<core::type::Vector>()->Type(), nullptr);
+ EXPECT_TRUE(TypeOf(call)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
} else {
// Invalid parameter count.
EXPECT_FALSE(r()->Resolve());
@@ -2121,7 +2121,7 @@
ASSERT_NE(TypeOf(expr), nullptr);
ASSERT_TRUE(TypeOf(expr)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(expr)->As<core::type::Vector>()->Width(), 4u);
}
@@ -2260,11 +2260,11 @@
ASSERT_NE(TypeOf(expr), nullptr);
ASSERT_TRUE(TypeOf(expr)->Is<core::type::Vector>());
if (type == Texture::kF32) {
- EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
} else if (type == Texture::kI32) {
- EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
- EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(expr)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
}
EXPECT_EQ(TypeOf(expr)->As<core::type::Vector>()->Width(), 4u);
}
@@ -2560,14 +2560,14 @@
auto* vec = As<core::type::Vector>(TypeOf(call));
ASSERT_NE(vec, nullptr);
EXPECT_EQ(vec->Width(), 2u);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
break;
}
case core::type::TextureDimension::k3d: {
auto* vec = As<core::type::Vector>(TypeOf(call));
ASSERT_NE(vec, nullptr);
EXPECT_EQ(vec->Width(), 3u);
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
break;
}
}
@@ -2585,20 +2585,20 @@
EXPECT_EQ(vec->Width(), 4u);
switch (param.texture_data_type) {
case ast::test::TextureDataType::kF32:
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
break;
case ast::test::TextureDataType::kU32:
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
break;
case ast::test::TextureDataType::kI32:
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
break;
}
} else if (std::string(param.function) == "textureGatherCompare") {
auto* vec = As<core::type::Vector>(TypeOf(call));
ASSERT_NE(vec, nullptr);
EXPECT_EQ(vec->Width(), 4u);
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
} else {
switch (param.texture_kind) {
case ast::test::TextureKind::kRegular:
@@ -2608,13 +2608,13 @@
ASSERT_NE(vec, nullptr);
switch (param.texture_data_type) {
case ast::test::TextureDataType::kF32:
- EXPECT_TRUE(vec->type()->Is<core::type::F32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::F32>());
break;
case ast::test::TextureDataType::kU32:
- EXPECT_TRUE(vec->type()->Is<core::type::U32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::U32>());
break;
case ast::test::TextureDataType::kI32:
- EXPECT_TRUE(vec->type()->Is<core::type::I32>());
+ EXPECT_TRUE(vec->Type()->Is<core::type::I32>());
break;
}
break;
diff --git a/src/tint/lang/wgsl/resolver/builtins_validation_test.cc b/src/tint/lang/wgsl/resolver/builtins_validation_test.cc
index 7552048..a04c046 100644
--- a/src/tint/lang/wgsl/resolver/builtins_validation_test.cc
+++ b/src/tint/lang/wgsl/resolver/builtins_validation_test.cc
@@ -939,9 +939,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 2u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 2u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
}
TEST_F(ResolverBuiltinsValidationTest, Frexp_Vec3) {
@@ -956,9 +956,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
}
TEST_F(ResolverBuiltinsValidationTest, Frexp_Vec4) {
@@ -973,9 +973,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
}
TEST_F(ResolverBuiltinsValidationTest, Modf_Scalar) {
@@ -1003,9 +1003,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 2u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 2u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinsValidationTest, Modf_Vec3) {
@@ -1020,9 +1020,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 3u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinsValidationTest, Modf_Vec4) {
@@ -1037,9 +1037,9 @@
ASSERT_TRUE(members[0]->Type()->Is<core::type::Vector>());
ASSERT_TRUE(members[1]->Type()->Is<core::type::Vector>());
EXPECT_EQ(members[0]->Type()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(members[1]->Type()->As<core::type::Vector>()->Width(), 4u);
- EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(members[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverBuiltinsValidationTest, Cross_Float_Vec3) {
diff --git a/src/tint/lang/wgsl/resolver/materialize_test.cc b/src/tint/lang/wgsl/resolver/materialize_test.cc
index d156bda..b14df1a 100644
--- a/src/tint/lang/wgsl/resolver/materialize_test.cc
+++ b/src/tint/lang/wgsl/resolver/materialize_test.cc
@@ -114,19 +114,19 @@
for (uint32_t i = 0; i < v->Width(); i++) {
auto* el = value->Index(i);
ASSERT_NE(el, nullptr);
- EXPECT_TYPE(el->Type(), v->type());
+ EXPECT_TYPE(el->Type(), v->Type());
EXPECT_EQ(el->ValueAs<T>(), expected_value);
}
},
[&](const core::type::Matrix* m) {
- for (uint32_t c = 0; c < m->columns(); c++) {
+ for (uint32_t c = 0; c < m->Columns(); c++) {
auto* column = value->Index(c);
ASSERT_NE(column, nullptr);
EXPECT_TYPE(column->Type(), m->ColumnType());
- for (uint32_t r = 0; r < m->rows(); r++) {
+ for (uint32_t r = 0; r < m->Rows(); r++) {
auto* el = column->Index(r);
ASSERT_NE(el, nullptr);
- EXPECT_TYPE(el->Type(), m->type());
+ EXPECT_TYPE(el->Type(), m->Type());
EXPECT_EQ(el->ValueAs<T>(), expected_value);
}
}
@@ -1302,7 +1302,7 @@
ASSERT_TRUE(concrete_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
ASSERT_TRUE(materialize->Expr()->Type()->Is<core::type::Struct>());
auto* abstract_str = materialize->Expr()->Type()->As<core::type::Struct>();
@@ -1310,7 +1310,7 @@
ASSERT_TRUE(abstract_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractFloat>());
}
@@ -1349,7 +1349,7 @@
ASSERT_TRUE(concrete_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F16>());
ASSERT_TRUE(materialize->Expr()->Type()->Is<core::type::Struct>());
auto* abstract_str = materialize->Expr()->Type()->As<core::type::Struct>();
@@ -1357,7 +1357,7 @@
ASSERT_TRUE(abstract_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractFloat>());
}
@@ -1394,12 +1394,12 @@
ASSERT_TRUE(concrete_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F32>());
ASSERT_TRUE(concrete_str->Members()[1]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::I32>());
ASSERT_TRUE(materialize->Expr()->Type()->Is<core::type::Struct>());
auto* abstract_str = materialize->Expr()->Type()->As<core::type::Struct>();
@@ -1407,12 +1407,12 @@
ASSERT_TRUE(abstract_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractFloat>());
ASSERT_TRUE(abstract_str->Members()[1]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractInt>());
}
@@ -1454,12 +1454,12 @@
ASSERT_TRUE(concrete_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::F16>());
ASSERT_TRUE(concrete_str->Members()[1]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::I32>());
ASSERT_TRUE(materialize->Expr()->Type()->Is<core::type::Struct>());
auto* abstract_str = materialize->Expr()->Type()->As<core::type::Struct>();
@@ -1467,12 +1467,12 @@
ASSERT_TRUE(abstract_str->Members()[0]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractFloat>());
ASSERT_TRUE(abstract_str->Members()[1]
->Type()
->As<core::type::Vector>()
- ->type()
+ ->Type()
->Is<core::type::AbstractInt>());
}
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index c44661f..5d5d73d 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -1820,7 +1820,7 @@
[&](const core::type::AbstractFloat*) { return target_ty ? target_ty : f32(); },
[&](const core::type::Vector* v) {
return Switch(
- v->type(), //
+ v->Type(), //
[&](const core::type::AbstractInt*) {
return target_ty ? target_ty : i32v(v->Width());
},
@@ -1829,9 +1829,9 @@
});
},
[&](const core::type::Matrix* m) {
- return Switch(m->type(), //
+ return Switch(m->Type(), //
[&](const core::type::AbstractFloat*) {
- return target_ty ? target_ty : f32m(m->columns(), m->rows());
+ return target_ty ? target_ty : f32m(m->Columns(), m->Rows());
});
},
[&](const sem::Array* a) -> const core::type::Type* {
@@ -2021,9 +2021,9 @@
auto* ty = Switch(
storage_ty, //
[&](const sem::Array* arr) { return arr->ElemType(); },
- [&](const core::type::Vector* vec) { return vec->type(); },
+ [&](const core::type::Vector* vec) { return vec->Type(); },
[&](const core::type::Matrix* mat) {
- return b.create<core::type::Vector>(mat->type(), mat->rows());
+ return b.create<core::type::Vector>(mat->Type(), mat->Rows());
},
[&](Default) {
AddError(expr->source) << "cannot index type '" << sem_.TypeNameOf(storage_ty) << "'";
@@ -2209,13 +2209,13 @@
[&](const core::type::Vector* v) {
if (v->Packed()) {
TINT_ASSERT(v->Width() == 3u);
- return ctor_or_conv(CtorConvIntrinsic::kPackedVec3, Vector{v->type()});
+ return ctor_or_conv(CtorConvIntrinsic::kPackedVec3, Vector{v->Type()});
}
- return ctor_or_conv(wgsl::intrinsic::VectorCtorConv(v->Width()), Vector{v->type()});
+ return ctor_or_conv(wgsl::intrinsic::VectorCtorConv(v->Width()), Vector{v->Type()});
},
[&](const core::type::Matrix* m) {
- return ctor_or_conv(wgsl::intrinsic::MatrixCtorConv(m->columns(), m->rows()),
- Vector{m->type()});
+ return ctor_or_conv(wgsl::intrinsic::MatrixCtorConv(m->Columns(), m->Rows()),
+ Vector{m->Type()});
},
[&](const sem::Array* arr) -> sem::Call* {
auto* call_target = array_ctors_.GetOrAdd(
@@ -3584,7 +3584,7 @@
const sem::ValueExpression* obj_expr = object;
if (size == 1) {
// A single element swizzle is just the type of the vector.
- ty = vec->type();
+ ty = vec->Type();
// If we're extracting from a memory view, we return a reference.
if (memory_view) {
ty = b.create<core::type::Reference>(memory_view->AddressSpace(), ty,
@@ -3593,7 +3593,7 @@
} else {
// The vector will have a number of components equal to the length of
// the swizzle.
- ty = b.create<core::type::Vector>(vec->type(), static_cast<uint32_t>(size));
+ ty = b.create<core::type::Vector>(vec->Type(), static_cast<uint32_t>(size));
if (obj_expr->Type()->Is<core::type::Pointer>()) {
// If the LHS is a pointer, the load rule is invoked. We special case this
diff --git a/src/tint/lang/wgsl/resolver/resolver_test.cc b/src/tint/lang/wgsl/resolver/resolver_test.cc
index 1c4b861..bbf3a58 100644
--- a/src/tint/lang/wgsl/resolver/resolver_test.cc
+++ b/src/tint/lang/wgsl/resolver/resolver_test.cc
@@ -667,7 +667,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
}
@@ -679,7 +679,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
}
@@ -691,7 +691,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1300,7 +1300,7 @@
ASSERT_NE(TypeOf(mem), nullptr);
ASSERT_TRUE(TypeOf(mem)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(mem)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(mem)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(mem)->As<core::type::Vector>()->Width(), 4u);
auto* sma = Sem().Get(mem)->As<sem::Swizzle>();
ASSERT_NE(sma, nullptr);
@@ -1352,7 +1352,7 @@
ASSERT_NE(TypeOf(mem), nullptr);
ASSERT_TRUE(TypeOf(mem)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(mem)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(mem)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(mem)->As<core::type::Vector>()->Width(), 2u);
ASSERT_TRUE(Sem().Get(mem)->Is<sem::Swizzle>());
}
@@ -1864,11 +1864,11 @@
ASSERT_NE(TypeOf(der), nullptr);
ASSERT_TRUE(TypeOf(der)->Is<core::type::Vector>());
if (op == core::UnaryOp::kNot) {
- EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
} else if (op == core::UnaryOp::kNegation || op == core::UnaryOp::kComplement) {
- EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
} else {
- EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(der)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
EXPECT_EQ(TypeOf(der)->As<core::type::Vector>()->Width(), 4u);
}
diff --git a/src/tint/lang/wgsl/resolver/uniformity.cc b/src/tint/lang/wgsl/resolver/uniformity.cc
index aecfb1f..c790b2c 100644
--- a/src/tint/lang/wgsl/resolver/uniformity.cc
+++ b/src/tint/lang/wgsl/resolver/uniformity.cc
@@ -1636,7 +1636,7 @@
// Loading from a read-write storage texture may produce a non-uniform value.
auto* storage =
builtin->Parameters()[0]->Type()->As<core::type::StorageTexture>();
- if (storage && storage->access() == core::Access::kReadWrite) {
+ if (storage && storage->Access() == core::Access::kReadWrite) {
callsite_tag = {CallSiteTag::CallSiteNoRestriction};
function_tag = ReturnValueMayBeNonUniform;
}
diff --git a/src/tint/lang/wgsl/resolver/validator.cc b/src/tint/lang/wgsl/resolver/validator.cc
index 16c4692..28bd6a3 100644
--- a/src/tint/lang/wgsl/resolver/validator.cc
+++ b/src/tint/lang/wgsl/resolver/validator.cc
@@ -256,8 +256,8 @@
}
return Switch(
type, //
- [&](const core::type::Vector* vec) { return IsHostShareable(vec->type()); },
- [&](const core::type::Matrix* mat) { return IsHostShareable(mat->type()); },
+ [&](const core::type::Vector* vec) { return IsHostShareable(vec->Type()); },
+ [&](const core::type::Matrix* mat) { return IsHostShareable(mat->Type()); },
[&](const sem::Array* arr) { return IsHostShareable(arr->ElemType()); },
[&](const core::type::Struct* str) {
for (auto* member : str->Members()) {
@@ -404,7 +404,7 @@
}
bool Validator::StorageTexture(const core::type::StorageTexture* t, const Source& source) const {
- switch (t->access()) {
+ switch (t->Access()) {
case core::Access::kRead:
if (!allowed_features_.features.count(
wgsl::LanguageFeature::kReadonlyAndReadwriteStorageTextures)) {
@@ -430,27 +430,27 @@
return false;
}
- if (TINT_UNLIKELY(t->texel_format() == core::TexelFormat::kR8Unorm &&
+ if (TINT_UNLIKELY(t->TexelFormat() == core::TexelFormat::kR8Unorm &&
!enabled_extensions_.Contains(wgsl::Extension::kChromiumInternalGraphite))) {
AddError(source) << style::Enum(core::TexelFormat::kR8Unorm) << " requires the "
<< style::Code(wgsl::Extension::kChromiumInternalGraphite) << " extension";
return false;
}
- if (!IsValidStorageTextureDimension(t->dim())) {
+ if (!IsValidStorageTextureDimension(t->Dim())) {
AddError(source) << "cube dimensions for storage textures are not supported";
return false;
}
- if (!IsValidStorageTextureTexelFormat(t->texel_format())) {
+ if (!IsValidStorageTextureTexelFormat(t->TexelFormat())) {
AddError(source) << "image format must be one of the texel formats specified for storage "
"textures in https://gpuweb.github.io/gpuweb/wgsl/#texel-formats";
return false;
}
if (mode_ == wgsl::ValidationMode::kCompat &&
- IsInvalidStorageTextureTexelFormatInCompatibilityMode(t->texel_format())) {
- AddError(source) << "format " << t->texel_format()
+ IsInvalidStorageTextureTexelFormatInCompatibilityMode(t->TexelFormat())) {
+ AddError(source) << "format " << t->TexelFormat()
<< " is not supported as a storage texture in compatibility mode";
return false;
}
@@ -459,7 +459,7 @@
}
bool Validator::SampledTexture(const core::type::SampledTexture* t, const Source& source) const {
- if (!t->type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
+ if (!t->Type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
AddError(source) << "texture_2d<type>: type must be f32, i32 or u32";
return false;
}
@@ -469,12 +469,12 @@
bool Validator::MultisampledTexture(const core::type::MultisampledTexture* t,
const Source& source) const {
- if (t->dim() != core::type::TextureDimension::k2d) {
+ if (t->Dim() != core::type::TextureDimension::k2d) {
AddError(source) << "only 2d multisampled textures are supported";
return false;
}
- if (!t->type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
+ if (!t->Type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
AddError(source) << "texture_multisampled_2d<type>: type must be f32, i32 or u32";
return false;
}
@@ -489,7 +489,7 @@
<< style::Code("chromium_internal_input_attachments");
return false;
}
- if (!t->type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
+ if (!t->Type()->UnwrapRef()->IsAnyOf<core::type::F32, core::type::I32, core::type::U32>()) {
AddError(source) << "input_attachment<type>: type must be f32, i32 or u32";
return false;
}
@@ -686,7 +686,7 @@
if (arr->ElemType()->Is<core::type::Scalar>()) {
hint << "Consider using a vector or struct as the element type instead.";
} else if (auto* vec = arr->ElemType()->As<core::type::Vector>();
- vec && vec->type()->Size() == 4) {
+ vec && vec->Type()->Size() == 4) {
hint << "Consider using a vec4 instead.";
} else if (arr->ElemType()->Is<sem::Struct>()) {
hint << "Consider using the " << style::Attribute("@size")
@@ -1004,7 +1004,7 @@
is_stage_mismatch = true;
}
auto* vec = type->As<core::type::Vector>();
- if (!(vec && vec->Width() == 4 && vec->type()->Is<core::type::F32>())) {
+ if (!(vec && vec->Width() == 4 && vec->Type()->Is<core::type::F32>())) {
err_builtin_type("vec4<f32>");
return false;
}
@@ -2348,8 +2348,8 @@
}
auto* storage = var->Type()->UnwrapRef()->As<core::type::StorageTexture>();
if (stage == ast::PipelineStage::kVertex && storage &&
- storage->access() != core::Access::kRead) {
- AddError(source) << "storage texture with " << style::Enum(storage->access())
+ storage->Access() != core::Access::kRead) {
+ AddError(source) << "storage texture with " << style::Enum(storage->Access())
<< " access mode cannot be used by " << stage << " pipeline stage";
var_decl_note(var);
return false;
diff --git a/src/tint/lang/wgsl/resolver/value_constructor_validation_test.cc b/src/tint/lang/wgsl/resolver/value_constructor_validation_test.cc
index 0fb486e..36fb57e 100644
--- a/src/tint/lang/wgsl/resolver/value_constructor_validation_test.cc
+++ b/src/tint/lang/wgsl/resolver/value_constructor_validation_test.cc
@@ -643,10 +643,10 @@
ASSERT_EQ(ctor->Parameters().Length(), 2u);
ASSERT_TRUE(ctor->Parameters()[0]->Type()->Is<core::type::Vector>());
EXPECT_TRUE(
- ctor->Parameters()[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ctor->Parameters()[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
ASSERT_TRUE(ctor->Parameters()[1]->Type()->Is<core::type::Vector>());
EXPECT_TRUE(
- ctor->Parameters()[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ ctor->Parameters()[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::I32>());
}
TEST_F(ResolverValueConstructorValidationTest, InferredArrayU32_VecAI_VecF32) {
@@ -667,10 +667,10 @@
ASSERT_EQ(ctor->Parameters().Length(), 2u);
ASSERT_TRUE(ctor->Parameters()[0]->Type()->Is<core::type::Vector>());
EXPECT_TRUE(
- ctor->Parameters()[0]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ctor->Parameters()[0]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
ASSERT_TRUE(ctor->Parameters()[1]->Type()->Is<core::type::Vector>());
EXPECT_TRUE(
- ctor->Parameters()[1]->Type()->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ ctor->Parameters()[1]->Type()->As<core::type::Vector>()->Type()->Is<core::type::F32>());
}
TEST_F(ResolverValueConstructorValidationTest, ArrayArgumentTypeMismatch_U32F32) {
@@ -1157,7 +1157,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1176,7 +1176,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1199,7 +1199,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1220,7 +1220,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1241,7 +1241,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1262,7 +1262,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1283,7 +1283,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1303,7 +1303,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 2u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1433,7 +1433,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1452,7 +1452,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1476,7 +1476,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1498,7 +1498,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1520,7 +1520,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1542,7 +1542,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1564,7 +1564,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1585,7 +1585,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1606,7 +1606,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1626,7 +1626,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 3u);
auto* call = Sem().Get<sem::Call>(tc);
@@ -1799,7 +1799,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1811,7 +1811,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1825,7 +1825,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1837,7 +1837,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1849,7 +1849,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1861,7 +1861,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1873,7 +1873,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1885,7 +1885,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1897,7 +1897,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1909,7 +1909,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1921,7 +1921,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1933,7 +1933,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1945,7 +1945,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1957,7 +1957,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -1979,7 +1979,7 @@
ASSERT_NE(TypeOf(tc), nullptr);
ASSERT_TRUE(TypeOf(tc)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(tc)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
EXPECT_EQ(TypeOf(tc)->As<core::type::Vector>()->Width(), 4u);
}
@@ -2069,11 +2069,11 @@
ASSERT_TRUE(TypeOf(vec2_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec2_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec2_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec2_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec2_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec2_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec2_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec2_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec2_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec2_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec2_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec2_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec2_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec2_bool)->As<core::type::Vector>()->Width(), 2u);
EXPECT_EQ(TypeOf(vec2_i32)->As<core::type::Vector>()->Width(), 2u);
EXPECT_EQ(TypeOf(vec2_u32)->As<core::type::Vector>()->Width(), 2u);
@@ -2098,11 +2098,11 @@
ASSERT_TRUE(TypeOf(vec2_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec2_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec2_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec2_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec2_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec2_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec2_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec2_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec2_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec2_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec2_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec2_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec2_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec2_bool)->As<core::type::Vector>()->Width(), 2u);
EXPECT_EQ(TypeOf(vec2_i32)->As<core::type::Vector>()->Width(), 2u);
EXPECT_EQ(TypeOf(vec2_u32)->As<core::type::Vector>()->Width(), 2u);
@@ -2127,11 +2127,11 @@
ASSERT_TRUE(TypeOf(vec3_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec3_bool)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_i32)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_u32)->As<core::type::Vector>()->Width(), 3u);
@@ -2156,11 +2156,11 @@
ASSERT_TRUE(TypeOf(vec3_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec3_bool)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_i32)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_u32)->As<core::type::Vector>()->Width(), 3u);
@@ -2185,11 +2185,11 @@
ASSERT_TRUE(TypeOf(vec3_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec3_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec3_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec3_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec3_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec3_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec3_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec3_bool)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_i32)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(vec3_u32)->As<core::type::Vector>()->Width(), 3u);
@@ -2214,11 +2214,11 @@
ASSERT_TRUE(TypeOf(vec4_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec4_bool)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_i32)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_u32)->As<core::type::Vector>()->Width(), 4u);
@@ -2243,11 +2243,11 @@
ASSERT_TRUE(TypeOf(vec4_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec4_bool)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_i32)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_u32)->As<core::type::Vector>()->Width(), 4u);
@@ -2272,11 +2272,11 @@
ASSERT_TRUE(TypeOf(vec4_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec4_bool)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_i32)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_u32)->As<core::type::Vector>()->Width(), 4u);
@@ -2302,11 +2302,11 @@
ASSERT_TRUE(TypeOf(vec4_u32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f32)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(vec4_f16)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->type()->Is<core::type::Bool>());
- EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->type()->Is<core::type::I32>());
- EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->type()->Is<core::type::U32>());
- EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->type()->Is<core::type::F32>());
- EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->type()->Is<core::type::F16>());
+ EXPECT_TRUE(TypeOf(vec4_bool)->As<core::type::Vector>()->Type()->Is<core::type::Bool>());
+ EXPECT_TRUE(TypeOf(vec4_i32)->As<core::type::Vector>()->Type()->Is<core::type::I32>());
+ EXPECT_TRUE(TypeOf(vec4_u32)->As<core::type::Vector>()->Type()->Is<core::type::U32>());
+ EXPECT_TRUE(TypeOf(vec4_f32)->As<core::type::Vector>()->Type()->Is<core::type::F32>());
+ EXPECT_TRUE(TypeOf(vec4_f16)->As<core::type::Vector>()->Type()->Is<core::type::F16>());
EXPECT_EQ(TypeOf(vec4_bool)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_i32)->As<core::type::Vector>()->Width(), 4u);
EXPECT_EQ(TypeOf(vec4_u32)->As<core::type::Vector>()->Width(), 4u);
@@ -2328,9 +2328,9 @@
ASSERT_TRUE(TypeOf(v2)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(v3)->Is<core::type::Vector>());
ASSERT_TRUE(TypeOf(v4)->Is<core::type::Vector>());
- EXPECT_TRUE(TypeOf(v2)->As<core::type::Vector>()->type()->Is<core::type::AbstractInt>());
- EXPECT_TRUE(TypeOf(v3)->As<core::type::Vector>()->type()->Is<core::type::AbstractInt>());
- EXPECT_TRUE(TypeOf(v4)->As<core::type::Vector>()->type()->Is<core::type::AbstractInt>());
+ EXPECT_TRUE(TypeOf(v2)->As<core::type::Vector>()->Type()->Is<core::type::AbstractInt>());
+ EXPECT_TRUE(TypeOf(v3)->As<core::type::Vector>()->Type()->Is<core::type::AbstractInt>());
+ EXPECT_TRUE(TypeOf(v4)->As<core::type::Vector>()->Type()->Is<core::type::AbstractInt>());
EXPECT_EQ(TypeOf(v2)->As<core::type::Vector>()->Width(), 2u);
EXPECT_EQ(TypeOf(v3)->As<core::type::Vector>()->Width(), 3u);
EXPECT_EQ(TypeOf(v4)->As<core::type::Vector>()->Width(), 4u);
diff --git a/src/tint/lang/wgsl/sem/function.cc b/src/tint/lang/wgsl/sem/function.cc
index 311c903..e7ad174 100644
--- a/src/tint/lang/wgsl/sem/function.cc
+++ b/src/tint/lang/wgsl/sem/function.cc
@@ -164,7 +164,7 @@
for (auto* global : TransitivelyReferencedGlobals()) {
auto* unwrapped_type = global->Type()->UnwrapRef();
auto* sampler = unwrapped_type->As<core::type::Sampler>();
- if (sampler == nullptr || sampler->kind() != kind) {
+ if (sampler == nullptr || sampler->Kind() != kind) {
continue;
}
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
index 0b520bc..a10c5f5 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
+++ b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
@@ -736,7 +736,7 @@
tint::Switch(
obj_ty,
[&](const core::type::Vector* vec) {
- TINT_DEFER(obj_ty = vec->type());
+ TINT_DEFER(obj_ty = vec->Type());
expr = VectorMemberAccess(expr, index);
},
[&](const core::type::Matrix* mat) {
@@ -965,10 +965,10 @@
[&](const core::type::F32*) { return b.ty.f32(); }, //
[&](const core::type::Bool*) { return b.ty.bool_(); },
[&](const core::type::Matrix* m) {
- return b.ty.mat(Type(m->type()), m->columns(), m->rows());
+ return b.ty.mat(Type(m->Type()), m->Columns(), m->Rows());
},
[&](const core::type::Vector* v) {
- auto el = Type(v->type());
+ auto el = Type(v->Type());
if (v->Packed()) {
TINT_ASSERT(v->Width() == 3u);
return b.ty(core::BuiltinType::kPackedVec3, el);
@@ -998,27 +998,27 @@
},
[&](const core::type::Struct* s) { return Struct(s); },
[&](const core::type::Atomic* a) { return b.ty.atomic(Type(a->Type())); },
- [&](const core::type::DepthTexture* t) { return b.ty.depth_texture(t->dim()); },
+ [&](const core::type::DepthTexture* t) { return b.ty.depth_texture(t->Dim()); },
[&](const core::type::DepthMultisampledTexture* t) {
- return b.ty.depth_multisampled_texture(t->dim());
+ return b.ty.depth_multisampled_texture(t->Dim());
},
[&](const core::type::ExternalTexture*) { return b.ty.external_texture(); },
[&](const core::type::MultisampledTexture* t) {
- auto el = Type(t->type());
- return b.ty.multisampled_texture(t->dim(), el);
+ auto el = Type(t->Type());
+ return b.ty.multisampled_texture(t->Dim(), el);
},
[&](const core::type::SampledTexture* t) {
- auto el = Type(t->type());
- return b.ty.sampled_texture(t->dim(), el);
+ auto el = Type(t->Type());
+ return b.ty.sampled_texture(t->Dim(), el);
},
[&](const core::type::StorageTexture* t) {
if (RequiresChromiumInternalGraphite(t)) {
Enable(wgsl::Extension::kChromiumInternalGraphite);
}
- return b.ty.storage_texture(t->dim(), t->texel_format(), t->access());
+ return b.ty.storage_texture(t->Dim(), t->TexelFormat(), t->Access());
},
- [&](const core::type::Sampler* s) { return b.ty.sampler(s->kind()); },
+ [&](const core::type::Sampler* s) { return b.ty.sampler(s->Kind()); },
[&](const core::type::Pointer* p) {
// Note: type::Pointer always has an inferred access, but WGSL only allows an
// explicit access in the 'storage' address space.
@@ -1034,7 +1034,7 @@
},
[&](const core::type::InputAttachment* i) {
Enable(wgsl::Extension::kChromiumInternalInputAttachments);
- auto el = Type(i->type());
+ auto el = Type(i->Type());
return b.ty.input_attachment(el);
}, //
TINT_ICE_ON_NO_MATCH);
@@ -1263,7 +1263,7 @@
/// @returns true if the storage texture type requires the kChromiumInternalGraphite extension
/// to be enabled.
bool RequiresChromiumInternalGraphite(const core::type::StorageTexture* tex) {
- return tex->texel_format() == core::TexelFormat::kR8Unorm;
+ return tex->TexelFormat() == core::TexelFormat::kR8Unorm;
}
};