Add Partial Tint Dual Source Blending Extension
Adds dual source blending extension string to Tint. Adds @index
attribute to ast and resolver. Includes basic ast and resolver tests.
Bug: dawn:1709
Change-Id: I6bf05b42978c3338e1f5f45d21bd2a3fb5fed08d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/137281
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/program_builder.h b/src/tint/program_builder.h
index 4f4788f..f8866ac 100644
--- a/src/tint/program_builder.h
+++ b/src/tint/program_builder.h
@@ -50,6 +50,7 @@
#include "src/tint/ast/if_statement.h"
#include "src/tint/ast/increment_decrement_statement.h"
#include "src/tint/ast/index_accessor_expression.h"
+#include "src/tint/ast/index_attribute.h"
#include "src/tint/ast/int_literal_expression.h"
#include "src/tint/ast/interpolate_attribute.h"
#include "src/tint/ast/invariant_attribute.h"
@@ -3264,6 +3265,23 @@
return create<ast::LocationAttribute>(source_, Expr(std::forward<EXPR>(location)));
}
+ /// Creates an ast::IndexAttribute
+ /// @param source the source information
+ /// @param index the index value expression
+ /// @returns the index attribute pointer
+ template <typename EXPR>
+ const ast::IndexAttribute* Index(const Source& source, EXPR&& index) {
+ return create<ast::IndexAttribute>(source, Expr(std::forward<EXPR>(index)));
+ }
+
+ /// Creates an ast::IndexAttribute
+ /// @param index the index value expression
+ /// @returns the index attribute pointer
+ template <typename EXPR>
+ const ast::IndexAttribute* Index(EXPR&& index) {
+ return create<ast::IndexAttribute>(source_, Expr(std::forward<EXPR>(index)));
+ }
+
/// Creates an ast::IdAttribute
/// @param source the source information
/// @param id the id value