sem::Matrix: Pass the column type to the constructor

It's common to want this when indexing matrices.

Change-Id: Ic60a3a8d05873119d78a3cb0860d129e33ac3525
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49880
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton
2021-05-05 16:48:32 +00:00
committed by Commit Bot service account
parent b432f232b5
commit 6c1cf6569e
8 changed files with 53 additions and 30 deletions

View File

@@ -58,7 +58,8 @@ TEST_F(CreateASTTypeForTest, Basic) {
TEST_F(CreateASTTypeForTest, Matrix) {
auto* mat = create([](ProgramBuilder& b) {
return b.create<sem::Matrix>(b.create<sem::F32>(), 2, 3);
auto* column_type = b.create<sem::Vector>(b.create<sem::F32>(), 2u);
return b.create<sem::Matrix>(column_type, 3u);
});
ASSERT_TRUE(mat->Is<ast::Matrix>());
ASSERT_TRUE(mat->As<ast::Matrix>()->type()->Is<ast::F32>());