diff --git a/src/tint/sem/vector.cc b/src/tint/sem/vector.cc index 6b4e15d5b6..2df7cf0a33 100644 --- a/src/tint/sem/vector.cc +++ b/src/tint/sem/vector.cc @@ -52,33 +52,17 @@ bool Vector::IsConstructible() const { } uint32_t Vector::Size() const { - return SizeOf(width_); + return subtype_->Size() * width_; } uint32_t Vector::Align() const { - return AlignOf(width_); -} - -uint32_t Vector::SizeOf(uint32_t width) { - switch (width) { + switch (width_) { case 2: - return 8; + return subtype_->Size() * 2; case 3: - return 12; + return subtype_->Size() * 4; case 4: - return 16; - } - return 0; // Unreachable -} - -uint32_t Vector::AlignOf(uint32_t width) { - switch (width) { - case 2: - return 8; - case 3: - return 16; - case 4: - return 16; + return subtype_->Size() * 4; } return 0; // Unreachable }