[wgsl-writer] Omit the storage class for handle types

These types have an implicit storage class of UniformConstant.

Bug: tint:332
Change-Id: I78c5b2a085e543ebba7d5e92b8f11550d0cd4d49
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/40400
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-02-04 18:35:40 +00:00
committed by Commit Bot service account
parent 0ff5e0bfb8
commit 1f2d38c826
5 changed files with 40 additions and 3 deletions

View File

@@ -127,5 +127,9 @@ bool Type::is_bool_scalar_or_vector() const {
return Is<Bool>() || is_bool_vector();
}
bool Type::is_handle() const {
return Is<type::Sampler>() || Is<type::Texture>();
}
} // namespace type
} // namespace tint

View File

@@ -99,6 +99,8 @@ class Type : public Castable<Type> {
bool is_bool_vector() const;
/// @returns true if this type is boolean scalar or vector
bool is_bool_scalar_or_vector() const;
/// @returns true if this type is a handle type
bool is_handle() const;
protected:
Type();