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

@@ -470,7 +470,7 @@ class ProgramBuilder {
type = MaybeCreateTypename(type);
return {type.ast ? builder->create<ast::Matrix>(type, rows, columns)
: nullptr,
type.sem ? builder->create<sem::Matrix>(type, rows, columns)
type.sem ? builder->create<sem::Matrix>(vec(type, rows), columns)
: nullptr};
}
@@ -486,7 +486,7 @@ class ProgramBuilder {
return {type.ast
? builder->create<ast::Matrix>(source, type, rows, columns)
: nullptr,
type.sem ? builder->create<sem::Matrix>(type, rows, columns)
type.sem ? builder->create<sem::Matrix>(vec(type, rows), columns)
: nullptr};
}