mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 13:14:56 +00:00
Context object owns a TypeManager
Add a Context::Reset method to clear state. Hide the member behind an accessor. Change-Id: Iafb7c39249f66f70c5a99a8ed1c69f2c0238834f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17742 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
@@ -252,10 +252,7 @@ int main(int argc, const char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
tint::TypeManager type_manager;
|
||||
|
||||
tint::Context ctx;
|
||||
ctx.type_mgr = &type_manager;
|
||||
|
||||
std::unique_ptr<tint::reader::Reader> reader;
|
||||
#if TINT_BUILD_WGSL_READER
|
||||
@@ -267,7 +264,7 @@ int main(int argc, const char** argv) {
|
||||
return 1;
|
||||
}
|
||||
reader = std::make_unique<tint::reader::wgsl::Parser>(
|
||||
ctx, std::string(data.begin(), data.end()));
|
||||
&ctx, std::string(data.begin(), data.end()));
|
||||
}
|
||||
#endif // TINT_BUILD_WGSL_READER
|
||||
|
||||
@@ -279,7 +276,7 @@ int main(int argc, const char** argv) {
|
||||
if (!ReadFile<uint32_t>(options.input_filename, &data)) {
|
||||
return 1;
|
||||
}
|
||||
reader = std::make_unique<tint::reader::spirv::Parser>(ctx, data);
|
||||
reader = std::make_unique<tint::reader::spirv::Parser>(&ctx, data);
|
||||
}
|
||||
#endif // TINT_BUILD_SPV_READER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user