mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Add tint::Program as a wrapper of tint::ast::Module.
`tint::Program` will become the new public API object for a parsed shader program. For now, have Program be a simple wrapper around ast::Module so we can migrate Dawn's use of the public tint API. Add new Program variants of public APIs for places that returned or took a Module. Remove Reset() methods from Generators, they aren't used, and make the migration harder. Change-Id: Ic5bee46ceb109ea591ba7fec33685220b244a1ae Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38540 Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
aee7acaaea
commit
d59cedb5a5
@@ -24,6 +24,7 @@
|
||||
#include "src/ast/statement.h"
|
||||
#include "src/diagnostic/diagnostic.h"
|
||||
#include "src/diagnostic/formatter.h"
|
||||
#include "src/program.h"
|
||||
|
||||
namespace tint {
|
||||
|
||||
@@ -39,6 +40,11 @@ class Validator {
|
||||
/// @returns true if the validation was successful
|
||||
bool Validate(const ast::Module* module);
|
||||
|
||||
/// Runs the validator
|
||||
/// @param program the program to validate
|
||||
/// @returns true if the validation was successful
|
||||
bool Validate(const Program* program) { return Validate(&program->module); }
|
||||
|
||||
/// @returns error messages from the validator
|
||||
std::string error() {
|
||||
diag::Formatter formatter{{false, false, false, false}};
|
||||
|
||||
Reference in New Issue
Block a user