Remove the context object.

This CL strips the context object out of Tint.

Change-Id: Id0dcb9c557b217c03a8d9ac08fc9fe1c799f3fdc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34742
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
dan sinclair
2020-12-07 16:03:54 +00:00
committed by Commit Bot service account
parent bd018d254d
commit c35176eadf
67 changed files with 18 additions and 223 deletions

View File

@@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/case_statement.h"
#include <unordered_set>
#include "gtest/gtest.h"
#include "src/ast/case_statement.h"
#include "src/reader/wgsl/parser.h"
#include "src/writer/wgsl/generator.h"
@@ -107,8 +108,7 @@ fn main() -> void {
)");
// Parse the wgsl, create the src module
Context ctx;
reader::wgsl::Parser parser(&ctx, &file);
reader::wgsl::Parser parser(&file);
ASSERT_TRUE(parser.Parse()) << parser.error();
auto src = parser.module();

View File

@@ -92,12 +92,11 @@ TEST_F(StorageTextureTest, TypeName) {
}
TEST_F(StorageTextureTest, F32) {
Context ctx;
Module mod;
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
ast::AccessControl::kReadOnly,
ImageFormat::kRgba32Float);
TypeDeterminer td(&ctx, &mod);
TypeDeterminer td(&mod);
ASSERT_TRUE(td.Determine()) << td.error();
ASSERT_TRUE(s->Is<Texture>());
@@ -106,12 +105,11 @@ TEST_F(StorageTextureTest, F32) {
}
TEST_F(StorageTextureTest, U32) {
Context ctx;
Module mod;
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
ast::AccessControl::kReadOnly,
ImageFormat::kRg32Uint);
TypeDeterminer td(&ctx, &mod);
TypeDeterminer td(&mod);
ASSERT_TRUE(td.Determine()) << td.error();
ASSERT_TRUE(s->Is<Texture>());
@@ -120,12 +118,11 @@ TEST_F(StorageTextureTest, U32) {
}
TEST_F(StorageTextureTest, I32) {
Context ctx;
Module mod;
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
ast::AccessControl::kReadOnly,
ImageFormat::kRgba32Sint);
TypeDeterminer td(&ctx, &mod);
TypeDeterminer td(&mod);
ASSERT_TRUE(td.Determine()) << td.error();
ASSERT_TRUE(s->Is<Texture>());