mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
resolver: Validate uniform buffer types
Fixed: tint:210 Change-Id: I7763ca23a5dce09755a1ca71d35f24897a875ac0 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48604 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
8db818840e
commit
42708348b7
@@ -985,13 +985,42 @@ class ProgramBuilder {
|
||||
decorations);
|
||||
}
|
||||
|
||||
/// @param args the arguments to pass to Var()
|
||||
/// @returns a `ast::Variable` constructed by calling Var() with the arguments
|
||||
/// of `args`, which is automatically registered as a global variable with the
|
||||
/// ast::Module.
|
||||
template <typename... ARGS>
|
||||
ast::Variable* Global(ARGS&&... args) {
|
||||
auto* var = Var(std::forward<ARGS>(args)...);
|
||||
/// @param name the variable name
|
||||
/// @param type the variable type
|
||||
/// @param storage the variable storage class
|
||||
/// @param constructor constructor expression
|
||||
/// @param decorations variable decorations
|
||||
/// @returns a new `ast::Variable`, which is automatically registered as a
|
||||
/// global variable with the ast::Module.
|
||||
template <typename NAME>
|
||||
ast::Variable* Global(NAME&& name,
|
||||
sem::Type* type,
|
||||
ast::StorageClass storage,
|
||||
ast::Expression* constructor = nullptr,
|
||||
ast::DecorationList decorations = {}) {
|
||||
auto* var =
|
||||
Var(std::forward<NAME>(name), type, storage, constructor, decorations);
|
||||
AST().AddGlobalVariable(var);
|
||||
return var;
|
||||
}
|
||||
|
||||
/// @param source the variable source
|
||||
/// @param name the variable name
|
||||
/// @param type the variable type
|
||||
/// @param storage the variable storage class
|
||||
/// @param constructor constructor expression
|
||||
/// @param decorations variable decorations
|
||||
/// @returns a new `ast::Variable`, which is automatically registered as a
|
||||
/// global variable with the ast::Module.
|
||||
template <typename NAME>
|
||||
ast::Variable* Global(const Source& source,
|
||||
NAME&& name,
|
||||
sem::Type* type,
|
||||
ast::StorageClass storage,
|
||||
ast::Expression* constructor = nullptr,
|
||||
ast::DecorationList decorations = {}) {
|
||||
auto* var = Var(source, std::forward<NAME>(name), type, storage,
|
||||
constructor, decorations);
|
||||
AST().AddGlobalVariable(var);
|
||||
return var;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user