From 15f80a706c6ab03e1d28deb3ce0094b577d53ac5 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 1 Dec 2020 19:27:29 +0000 Subject: [PATCH] [parser] Remove assert about input validity This assert is only enforcing that the input is valid, not that it is safe. This should be deferred until validation. Bug: dawn:578 Change-Id: I083a62292ff7ca0fc35080d8c66dabf3188c7bca Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34480 Commit-Queue: Ryan Harrison Auto-Submit: Ryan Harrison Reviewed-by: dan sinclair --- src/ast/type/storage_texture_type.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/ast/type/storage_texture_type.cc b/src/ast/type/storage_texture_type.cc index 87c4657d3f..af6c7d5dd9 100644 --- a/src/ast/type/storage_texture_type.cc +++ b/src/ast/type/storage_texture_type.cc @@ -23,19 +23,6 @@ namespace tint { namespace ast { namespace type { -namespace { - -#ifndef NDEBUG - -bool IsValidStorageDimension(TextureDimension dim) { - return dim == TextureDimension::k1d || dim == TextureDimension::k1dArray || - dim == TextureDimension::k2d || dim == TextureDimension::k2dArray || - dim == TextureDimension::k3d; -} - -#endif // NDEBUG - -} // namespace // Note, these names match the names in the WGSL spec. This behaviour is used // in the WGSL writer to emit the texture format names. @@ -156,9 +143,7 @@ std::ostream& operator<<(std::ostream& out, ImageFormat format) { StorageTexture::StorageTexture(TextureDimension dim, ast::AccessControl access, ImageFormat format) - : Base(dim), access_(access), image_format_(format) { - assert(IsValidStorageDimension(dim)); -} + : Base(dim), access_(access), image_format_(format) {} void StorageTexture::set_type(Type* const type) { type_ = type;