Import Tint changes from Dawn
Changes:
- eef812825f92d62ea7f12b218f0c990e6f52510d [ir] Move spirv binding remapper into the raise method. by dan sinclair <dsinclair@chromium.org>
- 650cb61f708baace9689864b1599c5bf56b6938e [ir][spirv-writer] Implement DP4A builtins by James Price <jrprice@google.com>
- 8cd1f0a6eccdc15b5ddbe6e6d8b349b7f83ca3b2 [fuzzers] Add more builtins to dictionary.txt by James Price <jrprice@google.com>
- a1de3cc53ee4049ca5e2aa9e536e67532d6b8541 [tint][ir] Add DirectVariableAccess IR transform by Ben Clayton <bclayton@google.com>
- f319cdf324b17b378fb6b03c4965026195ab1faf [tint][intrinsic] Add 'Table' and 'Dialect' types by Ben Clayton <bclayton@google.com>
- 7309db432187a9402219a79bf6159b27a6de9929 [ir] Add builtin polyfill for integer clamp by James Price <jrprice@google.com>
- 48309b615681450c383f09bbb37db567eb6942f3 [ir] Add polyfill for clamping insertBits args by James Price <jrprice@google.com>
- 064766e8c2c31a095f6f6768625a180136c8c570 [tint][cmake] Use '-fstandalone-debug' clang flag by Ben Clayton <bclayton@google.com>
- ce8faa76951d7909e76fba564935a925939786e8 [tint][ir] Call wgsl Lower() and Raise() where needed by Ben Clayton <bclayton@google.com>
- d88aa223e8234c4e875ffc56cc5b375780b7a62c [tint][resolver] Use WGSL intrinsic tables by Ben Clayton <bclayton@google.com>
- 15215507e4ac98299c7551e1d421ebba475c4e72 Remove allow_collisions from binding remapper options. by dan sinclair <dsinclair@chromium.org>
- 9860d3dbde279331f0a83cd634baa0a8941c5fd5 [tint][ir] Add Traverse() helper by Ben Clayton <bclayton@google.com>
- 23a6cff2dc16d57a4dfc28f27be06da289b9eaf2 [tint][ir] Add Sequenced flag to lang::*::ir::BuiltinCall by Ben Clayton <bclayton@google.com>
- e1f65a7000e2718767b084aead6e181a0b741908 [tint][ir] Fixes for instruction cloning. by Ben Clayton <bclayton@google.com>
- fc75496ce3ce559f5e3af71a580c867bf2748abe [tint][ir-to-program] Enable full-ptr-param extension whe... by Ben Clayton <bclayton@google.com>
- 3cbffe57334008083341337ef96c91293d7bfbfb [tint] Add Vector::EraseIf() by Ben Clayton <bclayton@google.com>
- 4d517633ce488ff9a50f07095e3e8d60b38a8442 [tint] Remove incorrectly namespaced forward declarations by Ben Clayton <bclayton@google.com>
- 51d3141eebf23374af26b87e62905ce7f0c08d34 [ir] Add polyfill for clamping extractBits args by James Price <jrprice@google.com>
GitOrigin-RevId: eef812825f92d62ea7f12b218f0c990e6f52510d
Change-Id: Ic00d05603fc5470f641a7c68a17a71a6bd727b15
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/153641
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt
index 8741ed9..2f3e893 100644
--- a/src/tint/CMakeLists.txt
+++ b/src/tint/CMakeLists.txt
@@ -81,6 +81,11 @@
)
if(COMPILER_IS_CLANG)
+ if(IS_DEBUG_BUILD)
+ target_compile_options(${TARGET} PRIVATE
+ -fstandalone-debug
+ )
+ endif()
target_compile_options(${TARGET} PRIVATE
${COMMON_CLANG_OPTIONS}
)
diff --git a/src/tint/api/options/binding_remapper.h b/src/tint/api/options/binding_remapper.h
index 07ecafa..3a15317 100644
--- a/src/tint/api/options/binding_remapper.h
+++ b/src/tint/api/options/binding_remapper.h
@@ -30,12 +30,8 @@
/// A map of old binding point to new binding point
BindingPoints binding_points;
- /// If true, then validation will be disabled for binding point collisions
- /// generated by this transform
- bool allow_collisions = false;
-
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
- TINT_REFLECT(binding_points, allow_collisions);
+ TINT_REFLECT(binding_points);
};
} // namespace tint
diff --git a/src/tint/fuzzers/dictionary.txt b/src/tint/fuzzers/dictionary.txt
index 005735f..59742d7 100644
--- a/src/tint/fuzzers/dictionary.txt
+++ b/src/tint/fuzzers/dictionary.txt
@@ -108,6 +108,8 @@
"discard"
"distance"
"dot"
+"dot4I8Packed"
+"dot4U8Packed"
"dpdx"
"dpdxCoarse"
"dpdxFine"
@@ -285,6 +287,7 @@
"while"
"workgroup"
"workgroupBarrier"
+"workgroupUniformLoad"
"workgroup_id"
"@workgroup_size"
"write"
diff --git a/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc b/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
index 58cd879..0f1cc86 100644
--- a/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
+++ b/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
@@ -17,9 +17,11 @@
#include <unordered_set>
#include "src/tint/fuzzers/apply_substitute_overrides.h"
+#include "src/tint/lang/wgsl/reader/lower/lower.h"
#include "src/tint/lang/wgsl/reader/parser/parser.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
+#include "src/tint/lang/wgsl/writer/raise/raise.h"
#include "src/tint/lang/wgsl/writer/writer.h"
[[noreturn]] void TintInternalCompilerErrorReporter(const tint::InternalCompilerError& err) {
@@ -77,6 +79,16 @@
__builtin_trap();
}
+ if (auto res = tint::wgsl::reader::Lower(ir.Get()); !res) {
+ std::cerr << res.Failure() << std::endl;
+ __builtin_trap();
+ }
+
+ if (auto res = tint::wgsl::writer::Raise(ir.Get()); !res) {
+ std::cerr << res.Failure() << std::endl;
+ __builtin_trap();
+ }
+
auto dst = tint::wgsl::writer::IRToProgram(ir.Get());
if (!dst.IsValid()) {
#if TINT_BUILD_WGSL_WRITER
diff --git a/src/tint/lang/core/constant/BUILD.bazel b/src/tint/lang/core/constant/BUILD.bazel
index 6b5ca7b..6904781 100644
--- a/src/tint/lang/core/constant/BUILD.bazel
+++ b/src/tint/lang/core/constant/BUILD.bazel
@@ -94,6 +94,7 @@
"//src/tint/lang/core/type:test",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/reader",
"//src/tint/lang/wgsl/resolver",
diff --git a/src/tint/lang/core/constant/BUILD.cmake b/src/tint/lang/core/constant/BUILD.cmake
index 5e1666d..d77761f 100644
--- a/src/tint/lang/core/constant/BUILD.cmake
+++ b/src/tint/lang/core/constant/BUILD.cmake
@@ -93,6 +93,7 @@
tint_lang_core_type_test
tint_lang_wgsl
tint_lang_wgsl_ast
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_program
tint_lang_wgsl_reader
tint_lang_wgsl_resolver
diff --git a/src/tint/lang/core/constant/BUILD.gn b/src/tint/lang/core/constant/BUILD.gn
index 4d5ccd8..2f15285 100644
--- a/src/tint/lang/core/constant/BUILD.gn
+++ b/src/tint/lang/core/constant/BUILD.gn
@@ -96,6 +96,7 @@
"${tint_src_dir}/lang/core/type:unittests",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/reader",
"${tint_src_dir}/lang/wgsl/resolver",
diff --git a/src/tint/lang/core/intrinsic/BUILD.bazel b/src/tint/lang/core/intrinsic/BUILD.bazel
index 2ef3c24..5dfde8d 100644
--- a/src/tint/lang/core/intrinsic/BUILD.bazel
+++ b/src/tint/lang/core/intrinsic/BUILD.bazel
@@ -27,12 +27,15 @@
name = "intrinsic",
srcs = [
"ctor_conv.cc",
+ "data.cc",
"table.cc",
],
hdrs = [
"ctor_conv.h",
+ "dialect.h",
"table.h",
"table_data.h",
+ "type_matchers.h",
],
deps = [
"//src/tint/lang/core",
@@ -65,11 +68,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/type",
"//src/tint/lang/core/type:test",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/resolver",
"//src/tint/lang/wgsl/resolver:test",
diff --git a/src/tint/lang/core/intrinsic/BUILD.cmake b/src/tint/lang/core/intrinsic/BUILD.cmake
index 713c8eb..399d71d 100644
--- a/src/tint/lang/core/intrinsic/BUILD.cmake
+++ b/src/tint/lang/core/intrinsic/BUILD.cmake
@@ -21,8 +21,6 @@
# Do not modify this file directly
################################################################################
-include(lang/core/intrinsic/data/BUILD.cmake)
-
################################################################################
# Target: tint_lang_core_intrinsic
# Kind: lib
@@ -30,9 +28,12 @@
tint_add_target(tint_lang_core_intrinsic lib
lang/core/intrinsic/ctor_conv.cc
lang/core/intrinsic/ctor_conv.h
+ lang/core/intrinsic/data.cc
+ lang/core/intrinsic/dialect.h
lang/core/intrinsic/table.cc
lang/core/intrinsic/table.h
lang/core/intrinsic/table_data.h
+ lang/core/intrinsic/type_matchers.h
)
tint_target_add_dependencies(tint_lang_core_intrinsic lib
@@ -66,11 +67,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_type
tint_lang_core_type_test
tint_lang_wgsl
tint_lang_wgsl_ast
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_program
tint_lang_wgsl_resolver
tint_lang_wgsl_resolver_test
diff --git a/src/tint/lang/core/intrinsic/BUILD.gn b/src/tint/lang/core/intrinsic/BUILD.gn
index f66d3fe..2ee3356 100644
--- a/src/tint/lang/core/intrinsic/BUILD.gn
+++ b/src/tint/lang/core/intrinsic/BUILD.gn
@@ -33,9 +33,12 @@
sources = [
"ctor_conv.cc",
"ctor_conv.h",
+ "data.cc",
+ "dialect.h",
"table.cc",
"table.h",
"table_data.h",
+ "type_matchers.h",
]
deps = [
"${tint_src_dir}/lang/core",
@@ -65,11 +68,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/core/type:unittests",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/resolver",
"${tint_src_dir}/lang/wgsl/resolver:unittests",
diff --git a/src/tint/lang/core/intrinsic/ctor_conv.cc.tmpl b/src/tint/lang/core/intrinsic/ctor_conv.cc.tmpl
index 960214c..99f8712 100644
--- a/src/tint/lang/core/intrinsic/ctor_conv.cc.tmpl
+++ b/src/tint/lang/core/intrinsic/ctor_conv.cc.tmpl
@@ -29,4 +29,4 @@
return "<unknown>";
}
-} // namespace tint::resolver
+} // namespace tint::core::intrinsic
diff --git a/src/tint/lang/core/intrinsic/ctor_conv.h b/src/tint/lang/core/intrinsic/ctor_conv.h
index fa68e8d..30ede3b 100644
--- a/src/tint/lang/core/intrinsic/ctor_conv.h
+++ b/src/tint/lang/core/intrinsic/ctor_conv.h
@@ -26,6 +26,8 @@
#include <cstdint>
+#include "src/tint/utils/traits/traits.h"
+
namespace tint::core::intrinsic {
/// CtorConv is an enumerator of types that have a constructor or converter overload
@@ -52,9 +54,19 @@
kNone,
};
-/// @returns the name of the type.
+/// @returns the name of the enumerator
+/// @param i the CtorConv enumerator
const char* str(CtorConv i);
+/// Prints the CtorConv @p c to @p o
+/// @param o the stream to write to
+/// @param c the CtorConv
+/// @return the stream so calls can be chained
+template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
+auto& operator<<(STREAM& o, CtorConv c) {
+ return o << str(c);
+}
+
/// @param n the width of the vector
/// @return the CtorConv for a vector of width `n`
inline CtorConv VectorCtorConv(uint32_t n) {
diff --git a/src/tint/lang/core/intrinsic/ctor_conv.h.tmpl b/src/tint/lang/core/intrinsic/ctor_conv.h.tmpl
index bf99e91..08df482 100644
--- a/src/tint/lang/core/intrinsic/ctor_conv.h.tmpl
+++ b/src/tint/lang/core/intrinsic/ctor_conv.h.tmpl
@@ -18,6 +18,8 @@
#include <cstdint>
+#include "src/tint/utils/traits/traits.h"
+
namespace tint::core::intrinsic {
/// CtorConv is an enumerator of types that have a constructor or converter overload
@@ -29,9 +31,19 @@
kNone,
};
-/// @returns the name of the type.
+/// @returns the name of the enumerator
+/// @param i the CtorConv enumerator
const char* str(CtorConv i);
+/// Prints the CtorConv @p c to @p o
+/// @param o the stream to write to
+/// @param c the CtorConv
+/// @return the stream so calls can be chained
+template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
+auto& operator<<(STREAM& o, CtorConv c) {
+ return o << str(c);
+}
+
/// @param n the width of the vector
/// @return the CtorConv for a vector of width `n`
inline CtorConv VectorCtorConv(uint32_t n) {
@@ -73,6 +85,6 @@
return CtorConv::kNone;
}
-} // namespace tint::resolver
+} // namespace tint::core::intrinsic
#endif // SRC_TINT_LANG_CORE_INTRINSIC_CTOR_CONV_H_
diff --git a/src/tint/lang/core/intrinsic/data/data.cc b/src/tint/lang/core/intrinsic/data.cc
similarity index 99%
copy from src/tint/lang/core/intrinsic/data/data.cc
copy to src/tint/lang/core/intrinsic/data.cc
index 94f9779..804e52f 100644
--- a/src/tint/lang/core/intrinsic/data/data.cc
+++ b/src/tint/lang/core/intrinsic/data.cc
@@ -14,7 +14,7 @@
////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
-// src/tint/lang/core/intrinsic/data/data.cc.tmpl
+// src/tint/lang/core/intrinsic/data.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
@@ -24,11 +24,11 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/data.h"
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
+#include "src/tint/lang/core/intrinsic/dialect.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::core::intrinsic::data {
+namespace tint::core::intrinsic {
namespace {
@@ -12233,7 +12233,7 @@
} // anonymous namespace
-const core::intrinsic::TableData kData{
+const core::intrinsic::TableData Dialect::kData{
/* template_types */ kTemplateTypes,
/* template_numbers */ kTemplateNumbers,
/* type_matcher_indices */ kTypeMatcherIndices,
@@ -12268,4 +12268,4 @@
/* unary '-' */ kUnaryOperators[kUnaryOperatorMinus],
};
-} // namespace tint::core::intrinsic::data
+} // namespace tint::core::intrinsic
diff --git a/src/tint/lang/core/intrinsic/data/data.cc.tmpl b/src/tint/lang/core/intrinsic/data.cc.tmpl
similarity index 77%
rename from src/tint/lang/core/intrinsic/data/data.cc.tmpl
rename to src/tint/lang/core/intrinsic/data.cc.tmpl
index 0879608..6e29145 100644
--- a/src/tint/lang/core/intrinsic/data/data.cc.tmpl
+++ b/src/tint/lang/core/intrinsic/data.cc.tmpl
@@ -19,14 +19,14 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/data.h"
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
+#include "src/tint/lang/core/intrinsic/dialect.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::core::intrinsic::data {
+namespace tint::core::intrinsic {
{{ Eval "Data"
"Intrinsics" $I
- "Name" "kData" -}}
+ "Name" "Dialect::kData" -}}
-} // namespace tint::core::intrinsic::data
+} // namespace tint::core::intrinsic
diff --git a/src/tint/lang/core/intrinsic/data/BUILD.bazel b/src/tint/lang/core/intrinsic/data/BUILD.bazel
deleted file mode 100644
index 7359e8e..0000000
--- a/src/tint/lang/core/intrinsic/data/BUILD.bazel
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.bazel.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-load("//src/tint:flags.bzl", "COPTS")
-load("@bazel_skylib//lib:selects.bzl", "selects")
-cc_library(
- name = "data",
- srcs = [
- "data.cc",
- ],
- hdrs = [
- "data.h",
- "type_matchers.h",
- ],
- deps = [
- "//src/tint/lang/core",
- "//src/tint/lang/core/constant",
- "//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/type",
- "//src/tint/utils/containers",
- "//src/tint/utils/diagnostic",
- "//src/tint/utils/ice",
- "//src/tint/utils/id",
- "//src/tint/utils/macros",
- "//src/tint/utils/math",
- "//src/tint/utils/memory",
- "//src/tint/utils/result",
- "//src/tint/utils/rtti",
- "//src/tint/utils/symbol",
- "//src/tint/utils/text",
- "//src/tint/utils/traits",
- ],
- copts = COPTS,
- visibility = ["//visibility:public"],
-)
-
diff --git a/src/tint/lang/core/intrinsic/data/BUILD.cmake b/src/tint/lang/core/intrinsic/data/BUILD.cmake
deleted file mode 100644
index dc4cb63..0000000
--- a/src/tint/lang/core/intrinsic/data/BUILD.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.cmake.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-################################################################################
-# Target: tint_lang_core_intrinsic_data
-# Kind: lib
-################################################################################
-tint_add_target(tint_lang_core_intrinsic_data lib
- lang/core/intrinsic/data/data.cc
- lang/core/intrinsic/data/data.h
- lang/core/intrinsic/data/type_matchers.h
-)
-
-tint_target_add_dependencies(tint_lang_core_intrinsic_data lib
- tint_lang_core
- tint_lang_core_constant
- tint_lang_core_intrinsic
- tint_lang_core_type
- tint_utils_containers
- tint_utils_diagnostic
- tint_utils_ice
- tint_utils_id
- tint_utils_macros
- tint_utils_math
- tint_utils_memory
- tint_utils_result
- tint_utils_rtti
- tint_utils_symbol
- tint_utils_text
- tint_utils_traits
-)
diff --git a/src/tint/lang/core/intrinsic/data/BUILD.gn b/src/tint/lang/core/intrinsic/data/BUILD.gn
deleted file mode 100644
index 289deb7..0000000
--- a/src/tint/lang/core/intrinsic/data/BUILD.gn
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.gn.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-import("../../../../../../scripts/tint_overrides_with_defaults.gni")
-
-import("${tint_src_dir}/tint.gni")
-
-libtint_source_set("data") {
- sources = [
- "data.cc",
- "data.h",
- "type_matchers.h",
- ]
- deps = [
- "${tint_src_dir}/lang/core",
- "${tint_src_dir}/lang/core/constant",
- "${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/type",
- "${tint_src_dir}/utils/containers",
- "${tint_src_dir}/utils/diagnostic",
- "${tint_src_dir}/utils/ice",
- "${tint_src_dir}/utils/id",
- "${tint_src_dir}/utils/macros",
- "${tint_src_dir}/utils/math",
- "${tint_src_dir}/utils/memory",
- "${tint_src_dir}/utils/result",
- "${tint_src_dir}/utils/rtti",
- "${tint_src_dir}/utils/symbol",
- "${tint_src_dir}/utils/text",
- "${tint_src_dir}/utils/traits",
- ]
-}
diff --git a/src/tint/lang/core/intrinsic/data/data.h b/src/tint/lang/core/intrinsic/data/data.h
deleted file mode 100644
index 8325e74..0000000
--- a/src/tint/lang/core/intrinsic/data/data.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2023 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SRC_TINT_LANG_CORE_INTRINSIC_DATA_DATA_H_
-#define SRC_TINT_LANG_CORE_INTRINSIC_DATA_DATA_H_
-
-#include "src/tint/lang/core/intrinsic/table_data.h"
-
-namespace tint::core::intrinsic::data {
-
-extern const TableData kData;
-
-} // namespace tint::core::intrinsic::data
-
-#endif // SRC_TINT_LANG_CORE_INTRINSIC_DATA_DATA_H_
diff --git a/src/tint/lang/core/intrinsic/dialect.h b/src/tint/lang/core/intrinsic/dialect.h
new file mode 100644
index 0000000..53621d7
--- /dev/null
+++ b/src/tint/lang/core/intrinsic/dialect.h
@@ -0,0 +1,46 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_TINT_LANG_CORE_INTRINSIC_DIALECT_H_
+#define SRC_TINT_LANG_CORE_INTRINSIC_DIALECT_H_
+
+#include "src/tint/lang/core/builtin_fn.h"
+#include "src/tint/lang/core/intrinsic/ctor_conv.h"
+#include "src/tint/lang/core/intrinsic/table_data.h"
+
+namespace tint::core::intrinsic {
+
+/// Dialect holds the intrinsic table data and types for the core dialect
+struct Dialect {
+ /// The dialect's intrinsic table data
+ static const TableData kData;
+
+ /// The dialect's builtin function enumerator
+ using BuiltinFn = core::BuiltinFn;
+
+ /// The dialect's type constructor / convertor enumerator
+ using CtorConv = core::intrinsic::CtorConv;
+
+ /// @returns the name of the builtin function @p fn
+ /// @param fn the builtin function
+ static std::string_view ToString(BuiltinFn fn) { return str(fn); }
+
+ /// @returns the name of the type constructor / convertor @p ty
+ /// @param ty the type constructor / convertor
+ static std::string_view ToString(CtorConv ty) { return str(ty); }
+};
+
+} // namespace tint::core::intrinsic
+
+#endif // SRC_TINT_LANG_CORE_INTRINSIC_DIALECT_H_
diff --git a/src/tint/lang/core/intrinsic/table.cc b/src/tint/lang/core/intrinsic/table.cc
index 1e057a7..b01a447 100644
--- a/src/tint/lang/core/intrinsic/table.cc
+++ b/src/tint/lang/core/intrinsic/table.cc
@@ -98,7 +98,7 @@
/// @returns the matched intrinsic
Result<Overload> MatchIntrinsic(Context& context,
const IntrinsicInfo& intrinsic,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage,
TemplateState templates,
@@ -131,7 +131,7 @@
/// @returns the resolved Candidate.
Candidate ResolveCandidate(Context& context,
Candidates&& candidates,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
TemplateState templates);
@@ -152,24 +152,24 @@
void PrintOverload(StringStream& ss,
Context& context,
const OverloadInfo& overload,
- const char* intrinsic_name);
+ std::string_view intrinsic_name);
// Prints the list of candidates for emitting diagnostics
void PrintCandidates(StringStream& ss,
Context& context,
VectorRef<Candidate> candidates,
- const char* intrinsic_name);
+ std::string_view intrinsic_name);
/// Raises an error when no overload is a clear winner of overload resolution
void ErrAmbiguousOverload(Context& context,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
TemplateState templates,
VectorRef<Candidate> candidates);
/// @return a string representing a call to a builtin with the given argument
/// types.
-std::string CallSignature(const char* intrinsic_name,
+std::string CallSignature(std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
const core::type::Type* template_arg = nullptr) {
StringStream ss;
@@ -195,7 +195,7 @@
Result<Overload> MatchIntrinsic(Context& context,
const IntrinsicInfo& intrinsic,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage,
TemplateState templates,
@@ -377,7 +377,7 @@
Candidate ResolveCandidate(Context& context,
Candidates&& candidates,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
TemplateState templates) {
Vector<uint32_t, kNumFixedParams> best_ranks;
@@ -455,7 +455,7 @@
void PrintOverload(StringStream& ss,
Context& context,
const OverloadInfo& overload,
- const char* intrinsic_name) {
+ std::string_view intrinsic_name) {
TemplateState templates;
// TODO(crbug.com/tint/1730): Use input evaluation stage to output only relevant overloads.
@@ -536,7 +536,7 @@
void PrintCandidates(StringStream& ss,
Context& context,
VectorRef<Candidate> candidates,
- const char* intrinsic_name) {
+ std::string_view intrinsic_name) {
for (auto& candidate : candidates) {
ss << " ";
PrintOverload(ss, context, *candidate.overload, intrinsic_name);
@@ -545,7 +545,7 @@
}
void ErrAmbiguousOverload(Context& context,
- const char* intrinsic_name,
+ std::string_view intrinsic_name,
VectorRef<const core::type::Type*> args,
TemplateState templates,
VectorRef<Candidate> candidates) {
@@ -583,12 +583,12 @@
} // namespace
-Result<Overload> Lookup(Context& context,
- const char* intrinsic_name,
- size_t function_id,
- VectorRef<const core::type::Type*> args,
- EvaluationStage earliest_eval_stage,
- const Source& source) {
+Result<Overload> LookupFn(Context& context,
+ std::string_view intrinsic_name,
+ size_t function_id,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
// Generates an error when no overloads match the provided arguments
auto on_no_match = [&](VectorRef<Candidate> candidates) {
StringStream ss;
@@ -607,13 +607,13 @@
earliest_eval_stage, TemplateState{}, on_no_match);
}
-Result<Overload> Lookup(Context& context,
- core::UnaryOp op,
- const core::type::Type* arg,
- EvaluationStage earliest_eval_stage,
- const Source& source) {
+Result<Overload> LookupUnary(Context& context,
+ core::UnaryOp op,
+ const core::type::Type* arg,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
const IntrinsicInfo* intrinsic_info = nullptr;
- const char* intrinsic_name = nullptr;
+ std::string_view intrinsic_name;
switch (op) {
case core::UnaryOp::kComplement:
intrinsic_info = &context.data.unary_complement;
@@ -652,15 +652,15 @@
TemplateState{}, on_no_match);
}
-Result<Overload> Lookup(Context& context,
- core::BinaryOp op,
- const core::type::Type* lhs,
- const core::type::Type* rhs,
- EvaluationStage earliest_eval_stage,
- const Source& source,
- bool is_compound) {
+Result<Overload> LookupBinary(Context& context,
+ core::BinaryOp op,
+ const core::type::Type* lhs,
+ const core::type::Type* rhs,
+ EvaluationStage earliest_eval_stage,
+ const Source& source,
+ bool is_compound) {
const IntrinsicInfo* intrinsic_info = nullptr;
- const char* intrinsic_name = nullptr;
+ std::string_view intrinsic_name;
switch (op) {
case core::BinaryOp::kAnd:
intrinsic_info = &context.data.binary_and;
@@ -756,18 +756,17 @@
TemplateState{}, on_no_match);
}
-Result<Overload> Lookup(Context& context,
- CtorConv type,
- const core::type::Type* template_arg,
- VectorRef<const core::type::Type*> args,
- EvaluationStage earliest_eval_stage,
- const Source& source) {
- auto name = str(type);
-
+Result<Overload> LookupCtorConv(Context& context,
+ std::string_view type_name,
+ size_t type_id,
+ const core::type::Type* template_arg,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
// Generates an error when no overloads match the provided arguments
auto on_no_match = [&](VectorRef<Candidate> candidates) {
StringStream ss;
- ss << "no matching constructor for " << CallSignature(name, args, template_arg)
+ ss << "no matching constructor for " << CallSignature(type_name, args, template_arg)
<< std::endl;
Candidates ctor, conv;
for (auto candidate : candidates) {
@@ -781,13 +780,13 @@
ss << std::endl
<< ctor.Length() << " candidate constructor" << (ctor.Length() > 1 ? "s:" : ":")
<< std::endl;
- PrintCandidates(ss, context, ctor, name);
+ PrintCandidates(ss, context, ctor, type_name);
}
if (!conv.IsEmpty()) {
ss << std::endl
<< conv.Length() << " candidate conversion" << (conv.Length() > 1 ? "s:" : ":")
<< std::endl;
- PrintCandidates(ss, context, conv, name);
+ PrintCandidates(ss, context, conv, type_name);
}
context.diags.add_error(diag::System::Intrinsics, ss.str(), source);
};
@@ -799,7 +798,7 @@
}
// Resolve the intrinsic overload
- return MatchIntrinsic(context, context.data.ctor_conv[static_cast<size_t>(type)], name, args,
+ return MatchIntrinsic(context, context.data.ctor_conv[type_id], type_name, args,
earliest_eval_stage, templates, on_no_match);
}
diff --git a/src/tint/lang/core/intrinsic/table.h b/src/tint/lang/core/intrinsic/table.h
index 6b13e4e..6b90c15 100644
--- a/src/tint/lang/core/intrinsic/table.h
+++ b/src/tint/lang/core/intrinsic/table.h
@@ -32,9 +32,6 @@
namespace tint::diag {
class List;
} // namespace tint::diag
-namespace tint::type {
-class Manager;
-} // namespace tint::type
namespace tint::core::intrinsic {
@@ -101,7 +98,7 @@
/// Lookup looks for the builtin overload with the given signature, raising an error diagnostic
/// if the builtin was not found.
/// @param context the intrinsic context
-/// @param intrinsic_name the name of the intrinsi
+/// @param function_name the name of the function
/// @param function_id the function identifier
/// @param args the argument types passed to the builtin function
/// @param earliest_eval_stage the the earliest evaluation stage that a call to
@@ -112,37 +109,12 @@
/// (EvaluationStage::kConstant).
/// @param source the source of the builtin call
/// @return the resolved builtin function overload
-Result<Overload> Lookup(Context& context,
- const char* intrinsic_name,
- size_t function_id,
- VectorRef<const core::type::Type*> args,
- EvaluationStage earliest_eval_stage,
- const Source& source);
-
-/// Lookup looks for the builtin overload with the given signature, raising an error diagnostic
-/// if the builtin was not found.
-/// @param context the intrinsic context
-/// @param builtin_fn the builtin function
-/// @param args the argument types passed to the builtin function
-/// @param earliest_eval_stage the the earliest evaluation stage that a call to
-/// the builtin can be made. This can alter the overloads considered.
-/// For example, if the earliest evaluation stage is `EvaluationStage::kRuntime`, then
-/// only overloads with concrete argument types will be considered, as all
-/// abstract-numerics will have been materialized after shader creation time
-/// (EvaluationStage::kConstant).
-/// @param source the source of the builtin call
-/// @return the resolved builtin function overload
-template <typename BUILTIN_FN>
-Result<Overload> Lookup(Context& context,
- BUILTIN_FN builtin_fn,
- VectorRef<const core::type::Type*> args,
- EvaluationStage earliest_eval_stage,
- const Source& source) {
- static_assert(std::is_enum_v<BUILTIN_FN>);
- std::string name = tint::ToString(builtin_fn); // TODO(bclayton): Avoid this heap allocation
- size_t id = static_cast<size_t>(builtin_fn);
- return Lookup(context, name.c_str(), id, std::move(args), earliest_eval_stage, source);
-}
+Result<Overload> LookupFn(Context& context,
+ std::string_view function_name,
+ size_t function_id,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source);
/// Lookup looks for the unary op overload with the given signature, raising an error
/// diagnostic if the operator was not found.
@@ -157,11 +129,11 @@
/// after shader creation time (EvaluationStage::kConstant).
/// @param source the source of the operator call
/// @return the resolved unary operator overload
-Result<Overload> Lookup(Context& context,
- core::UnaryOp op,
- const core::type::Type* arg,
- EvaluationStage earliest_eval_stage,
- const Source& source);
+Result<Overload> LookupUnary(Context& context,
+ core::UnaryOp op,
+ const core::type::Type* arg,
+ EvaluationStage earliest_eval_stage,
+ const Source& source);
/// Lookup looks for the binary op overload with the given signature, raising an error
/// diagnostic if the operator was not found.
@@ -178,17 +150,18 @@
/// after shader creation time (EvaluationStage::kConstant).
/// @param is_compound true if the binary operator is being used as a compound assignment
/// @return the resolved binary operator overload
-Result<Overload> Lookup(Context& context,
- core::BinaryOp op,
- const core::type::Type* lhs,
- const core::type::Type* rhs,
- EvaluationStage earliest_eval_stage,
- const Source& source,
- bool is_compound);
+Result<Overload> LookupBinary(Context& context,
+ core::BinaryOp op,
+ const core::type::Type* lhs,
+ const core::type::Type* rhs,
+ EvaluationStage earliest_eval_stage,
+ const Source& source,
+ bool is_compound);
/// Lookup looks for the value constructor or conversion overload for the given CtorConv.
/// @param context the intrinsic context
-/// @param type the type being constructed or converted
+/// @param type_name the name of the type being constructed or converted
+/// @param type_id the type identifier
/// @param template_arg the optional template argument
/// @param args the argument types passed to the constructor / conversion call
/// @param earliest_eval_stage the the earliest evaluation stage that a call to
@@ -199,12 +172,121 @@
/// after shader creation time (EvaluationStage::kConstant).
/// @param source the source of the call
/// @return the resolved type constructor or conversion function overload
-Result<Overload> Lookup(Context& context,
- CtorConv type,
- const core::type::Type* template_arg,
- VectorRef<const core::type::Type*> args,
- EvaluationStage earliest_eval_stage,
- const Source& source);
+Result<Overload> LookupCtorConv(Context& context,
+ std::string_view type_name,
+ size_t type_id,
+ const core::type::Type* template_arg,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source);
+
+/// Table is a wrapper around a dialect to provide type-safe interface to the intrinsic table.
+template <typename DIALECT>
+struct Table {
+ /// Alias to DIALECT::BuiltinFn
+ using BuiltinFn = typename DIALECT::BuiltinFn;
+
+ /// Alias to DIALECT::CtorConv
+ using CtorConv = typename DIALECT::CtorConv;
+
+ static_assert(std::is_enum_v<BuiltinFn>);
+ static_assert(std::is_enum_v<CtorConv>);
+
+ /// @param types The type manager
+ /// @param symbols The symbol table
+ /// @param diags The diagnostics
+ Table(core::type::Manager& types, SymbolTable& symbols, diag::List& diags)
+ : context{DIALECT::kData, types, symbols, diags} {}
+
+ /// Lookup looks for the builtin overload with the given signature, raising an error diagnostic
+ /// if the builtin was not found.
+ /// @param builtin_fn the builtin function
+ /// @param args the argument types passed to the builtin function
+ /// @param earliest_eval_stage the the earliest evaluation stage that a call to
+ /// the builtin can be made. This can alter the overloads considered.
+ /// For example, if the earliest evaluation stage is `EvaluationStage::kRuntime`, then
+ /// only overloads with concrete argument types will be considered, as all
+ /// abstract-numerics will have been materialized after shader creation time
+ /// (EvaluationStage::kConstant).
+ /// @param source the source of the builtin call
+ /// @return the resolved builtin function overload
+ Result<Overload> Lookup(BuiltinFn builtin_fn,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
+ std::string_view name = DIALECT::ToString(builtin_fn);
+ size_t id = static_cast<size_t>(builtin_fn);
+ return LookupFn(context, name, id, std::move(args), earliest_eval_stage, source);
+ }
+
+ /// Lookup looks for the unary op overload with the given signature, raising an error
+ /// diagnostic if the operator was not found.
+ /// @param op the unary operator
+ /// @param arg the type of the expression passed to the operator
+ /// @param earliest_eval_stage the the earliest evaluation stage that a call to
+ /// the unary operator can be made. This can alter the overloads considered.
+ /// For example, if the earliest evaluation stage is
+ /// `EvaluationStage::kRuntime`, then only overloads with concrete argument types
+ /// will be considered, as all abstract-numerics will have been materialized
+ /// after shader creation time (EvaluationStage::kConstant).
+ /// @param source the source of the operator call
+ /// @return the resolved unary operator overload
+ Result<Overload> Lookup(core::UnaryOp op,
+ const core::type::Type* arg,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
+ return LookupUnary(context, op, arg, earliest_eval_stage, source);
+ }
+
+ /// Lookup looks for the binary op overload with the given signature, raising an error
+ /// diagnostic if the operator was not found.
+ /// @param op the binary operator
+ /// @param lhs the LHS value type passed to the operator
+ /// @param rhs the RHS value type passed to the operator
+ /// @param source the source of the operator call
+ /// @param earliest_eval_stage the the earliest evaluation stage that a call to
+ /// the binary operator can be made. This can alter the overloads considered.
+ /// For example, if the earliest evaluation stage is
+ /// `EvaluationStage::kRuntime`, then only overloads with concrete argument types
+ /// will be considered, as all abstract-numerics will have been materialized
+ /// after shader creation time (EvaluationStage::kConstant).
+ /// @param is_compound true if the binary operator is being used as a compound assignment
+ /// @return the resolved binary operator overload
+ Result<Overload> Lookup(core::BinaryOp op,
+ const core::type::Type* lhs,
+ const core::type::Type* rhs,
+ EvaluationStage earliest_eval_stage,
+ const Source& source,
+ bool is_compound) {
+ return LookupBinary(context, op, lhs, rhs, earliest_eval_stage, source, is_compound);
+ }
+
+ /// Lookup looks for the value constructor or conversion overload for the given CtorConv.
+ /// @param type the type being constructed or converted
+ /// @param template_arg the optional template argument
+ /// @param args the argument types passed to the constructor / conversion call
+ /// @param earliest_eval_stage the the earliest evaluation stage that a call to
+ /// the constructor or conversion can be made. This can alter the overloads considered.
+ /// For example, if the earliest evaluation stage is
+ /// `EvaluationStage::kRuntime`, then only overloads with concrete argument types
+ /// will be considered, as all abstract-numerics will have been materialized
+ /// after shader creation time (EvaluationStage::kConstant).
+ /// @param source the source of the call
+ /// @return the resolved type constructor or conversion function overload
+ Result<Overload> Lookup(CtorConv type,
+ const core::type::Type* template_arg,
+ VectorRef<const core::type::Type*> args,
+ EvaluationStage earliest_eval_stage,
+ const Source& source) {
+ std::string_view name = DIALECT::ToString(type);
+ size_t id = static_cast<size_t>(type);
+ return LookupCtorConv(context, name, id, template_arg, std::move(args), earliest_eval_stage,
+ source);
+ }
+
+ /// The intrinsic context
+ Context context;
+};
} // namespace tint::core::intrinsic
diff --git a/src/tint/lang/core/intrinsic/table_data.h b/src/tint/lang/core/intrinsic/table_data.h
index 5d540aa..8b6a687 100644
--- a/src/tint/lang/core/intrinsic/table_data.h
+++ b/src/tint/lang/core/intrinsic/table_data.h
@@ -26,9 +26,6 @@
#include "src/tint/utils/containers/slice.h"
/// Forward declaration
-namespace tint::type {
-class Manager;
-} // namespace tint::type
namespace tint::core::intrinsic {
struct TableData;
} // namespace tint::core::intrinsic
diff --git a/src/tint/lang/core/intrinsic/table_test.cc b/src/tint/lang/core/intrinsic/table_test.cc
index 88d36f3..914fe66 100644
--- a/src/tint/lang/core/intrinsic/table_test.cc
+++ b/src/tint/lang/core/intrinsic/table_test.cc
@@ -17,7 +17,7 @@
#include <utility>
#include "gmock/gmock.h"
-#include "src/tint/lang/core/intrinsic/data/data.h"
+#include "src/tint/lang/core/intrinsic/dialect.h"
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/type/atomic.h"
#include "src/tint/lang/core/type/depth_multisampled_texture.h"
@@ -50,13 +50,13 @@
class IntrinsicTableTest : public testing::Test, public ProgramBuilder {
public:
- Context context{core::intrinsic::data::kData, Types(), Symbols(), Diagnostics()};
+ Table<Dialect> table{Types(), Symbols(), Diagnostics()};
};
TEST_F(IntrinsicTableTest, MatchF32) {
auto* f32 = create<core::type::F32>();
auto result =
- Lookup(context, core::BuiltinFn::kCos, Vector{f32}, EvaluationStage::kConstant, Source{});
+ table.Lookup(core::BuiltinFn::kCos, Vector{f32}, EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -67,7 +67,7 @@
TEST_F(IntrinsicTableTest, MismatchF32) {
auto* i32 = create<core::type::I32>();
auto result =
- Lookup(context, core::BuiltinFn::kCos, Vector{i32}, EvaluationStage::kConstant, Source{});
+ table.Lookup(core::BuiltinFn::kCos, Vector{i32}, EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -76,8 +76,8 @@
auto* f32 = create<core::type::F32>();
auto* u32 = create<core::type::U32>();
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
- auto result = Lookup(context, core::BuiltinFn::kUnpack2X16Float, Vector{u32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kUnpack2X16Float, Vector{u32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec2_f32);
@@ -87,8 +87,8 @@
TEST_F(IntrinsicTableTest, MismatchU32) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kUnpack2X16Float, Vector{f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kUnpack2X16Float, Vector{f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -98,8 +98,8 @@
auto* i32 = create<core::type::I32>();
auto* vec4_f32 = create<core::type::Vector>(f32, 4u);
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k1d, f32);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
@@ -115,16 +115,16 @@
TEST_F(IntrinsicTableTest, MismatchI32) {
auto* f32 = create<core::type::F32>();
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k1d, f32);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
TEST_F(IntrinsicTableTest, MatchIU32AsI32) {
auto* i32 = create<core::type::I32>();
- auto result = Lookup(context, core::BuiltinFn::kCountOneBits, Vector{i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kCountOneBits, Vector{i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
@@ -134,8 +134,8 @@
TEST_F(IntrinsicTableTest, MatchIU32AsU32) {
auto* u32 = create<core::type::U32>();
- auto result = Lookup(context, core::BuiltinFn::kCountOneBits, Vector{u32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kCountOneBits, Vector{u32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, u32);
@@ -145,16 +145,16 @@
TEST_F(IntrinsicTableTest, MismatchIU32) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kCountOneBits, Vector{f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kCountOneBits, Vector{f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
TEST_F(IntrinsicTableTest, MatchFIU32AsI32) {
auto* i32 = create<core::type::I32>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{i32, i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{i32, i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
@@ -166,8 +166,8 @@
TEST_F(IntrinsicTableTest, MatchFIU32AsU32) {
auto* u32 = create<core::type::U32>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{u32, u32, u32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{u32, u32, u32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, u32);
@@ -179,8 +179,8 @@
TEST_F(IntrinsicTableTest, MatchFIU32AsF32) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{f32, f32, f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{f32, f32, f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -192,8 +192,8 @@
TEST_F(IntrinsicTableTest, MismatchFIU32) {
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{bool_, bool_, bool_},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{bool_, bool_, bool_},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -201,8 +201,8 @@
TEST_F(IntrinsicTableTest, MatchBool) {
auto* f32 = create<core::type::F32>();
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{f32, f32, bool_},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kSelect, Vector{f32, f32, bool_},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -214,8 +214,8 @@
TEST_F(IntrinsicTableTest, MismatchBool) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{f32, f32, f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kSelect, Vector{f32, f32, f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -225,8 +225,8 @@
auto* atomicI32 = create<core::type::Atomic>(i32);
auto* ptr = create<core::type::Pointer>(core::AddressSpace::kWorkgroup, atomicI32,
core::Access::kReadWrite);
- auto result = Lookup(context, core::BuiltinFn::kAtomicLoad, Vector{ptr},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kAtomicLoad, Vector{ptr},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, i32);
@@ -237,8 +237,8 @@
TEST_F(IntrinsicTableTest, MismatchPointer) {
auto* i32 = create<core::type::I32>();
auto* atomicI32 = create<core::type::Atomic>(i32);
- auto result = Lookup(context, core::BuiltinFn::kAtomicLoad, Vector{atomicI32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kAtomicLoad, Vector{atomicI32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -248,8 +248,8 @@
create<core::type::RuntimeArrayCount>(), 4u, 4u, 4u, 4u);
auto* arr_ptr =
create<core::type::Pointer>(core::AddressSpace::kStorage, arr, core::Access::kReadWrite);
- auto result = Lookup(context, core::BuiltinFn::kArrayLength, Vector{arr_ptr},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kArrayLength, Vector{arr_ptr},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_TRUE(result->return_type->Is<core::type::U32>());
@@ -261,8 +261,8 @@
TEST_F(IntrinsicTableTest, MismatchArray) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kArrayLength, Vector{f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kArrayLength, Vector{f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -273,8 +273,8 @@
auto* vec4_f32 = create<core::type::Vector>(f32, 4u);
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k2d, f32);
auto* sampler = create<core::type::Sampler>(core::type::SamplerKind::kSampler);
- auto result = Lookup(context, core::BuiltinFn::kTextureSample, Vector{tex, sampler, vec2_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureSample, Vector{tex, sampler, vec2_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
@@ -291,8 +291,8 @@
auto* f32 = create<core::type::F32>();
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k2d, f32);
- auto result = Lookup(context, core::BuiltinFn::kTextureSample, Vector{tex, f32, vec2_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureSample, Vector{tex, f32, vec2_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -303,8 +303,8 @@
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
auto* vec4_f32 = create<core::type::Vector>(f32, 4u);
auto* tex = create<core::type::SampledTexture>(core::type::TextureDimension::k2d, f32);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
@@ -323,8 +323,8 @@
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
auto* vec4_f32 = create<core::type::Vector>(f32, 4u);
auto* tex = create<core::type::MultisampledTexture>(core::type::TextureDimension::k2d, f32);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
@@ -342,8 +342,8 @@
auto* i32 = create<core::type::I32>();
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
auto* tex = create<core::type::DepthTexture>(core::type::TextureDimension::k2d);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -361,8 +361,8 @@
auto* i32 = create<core::type::I32>();
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
auto* tex = create<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32, i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -381,8 +381,8 @@
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
auto* vec4_f32 = create<core::type::Vector>(f32, 4u);
auto* tex = create<core::type::ExternalTexture>();
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{tex, vec2_i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec4_f32);
@@ -403,8 +403,8 @@
core::TexelFormat::kR32Float,
core::Access::kWrite, subtype);
- auto result = Lookup(context, core::BuiltinFn::kTextureStore, Vector{tex, vec2_i32, vec4_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureStore, Vector{tex, vec2_i32, vec4_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_TRUE(result->return_type->Is<type::Void>());
@@ -421,20 +421,20 @@
auto* f32 = create<core::type::F32>();
auto* i32 = create<core::type::I32>();
auto* vec2_i32 = create<core::type::Vector>(i32, 2u);
- auto result = Lookup(context, core::BuiltinFn::kTextureLoad, Vector{f32, vec2_i32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureLoad, Vector{f32, vec2_i32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
TEST_F(IntrinsicTableTest, ImplicitLoadOnReference) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kCos,
- Vector{
- create<core::type::Reference>(core::AddressSpace::kFunction, f32,
- core::Access::kReadWrite),
- },
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kCos,
+ Vector{
+ create<core::type::Reference>(core::AddressSpace::kFunction, f32,
+ core::Access::kReadWrite),
+ },
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -444,8 +444,8 @@
TEST_F(IntrinsicTableTest, MatchTemplateType) {
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{f32, f32, f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{f32, f32, f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -457,8 +457,8 @@
TEST_F(IntrinsicTableTest, MismatchTemplateType) {
auto* f32 = create<core::type::F32>();
auto* u32 = create<core::type::U32>();
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{f32, u32, f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{f32, u32, f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -466,8 +466,8 @@
TEST_F(IntrinsicTableTest, MatchOpenSizeVector) {
auto* f32 = create<core::type::F32>();
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{vec2_f32, vec2_f32, vec2_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{vec2_f32, vec2_f32, vec2_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, vec2_f32);
@@ -481,8 +481,8 @@
auto* f32 = create<core::type::F32>();
auto* u32 = create<core::type::U32>();
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
- auto result = Lookup(context, core::BuiltinFn::kClamp, Vector{vec2_f32, u32, vec2_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kClamp, Vector{vec2_f32, u32, vec2_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -491,8 +491,8 @@
auto* f32 = create<core::type::F32>();
auto* vec3_f32 = create<core::type::Vector>(f32, 3u);
auto* mat3_f32 = create<core::type::Matrix>(vec3_f32, 3u);
- auto result = Lookup(context, core::BuiltinFn::kDeterminant, Vector{mat3_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kDeterminant, Vector{mat3_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_EQ(result->return_type, f32);
@@ -504,8 +504,8 @@
auto* f32 = create<core::type::F32>();
auto* vec2_f32 = create<core::type::Vector>(f32, 2u);
auto* mat3x2_f32 = create<core::type::Matrix>(vec2_f32, 3u);
- auto result = Lookup(context, core::BuiltinFn::kDeterminant, Vector{mat3x2_f32},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kDeterminant, Vector{mat3x2_f32},
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -513,8 +513,8 @@
TEST_F(IntrinsicTableTest, MatchDifferentArgsElementType_Builtin_ConstantEval) {
auto* af = create<core::type::AbstractFloat>();
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{af, af, bool_},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kSelect, Vector{af, af, bool_},
+ EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_NE(result->const_eval_fn, nullptr);
@@ -529,8 +529,8 @@
auto* af = create<core::type::AbstractFloat>();
auto* bool_ref = create<core::type::Reference>(
core::AddressSpace::kFunction, create<core::type::Bool>(), core::Access::kReadWrite);
- auto result = Lookup(context, core::BuiltinFn::kSelect, Vector{af, af, bool_ref},
- EvaluationStage::kRuntime, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kSelect, Vector{af, af, bool_ref},
+ EvaluationStage::kRuntime, Source{});
ASSERT_TRUE(result) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
EXPECT_NE(result->const_eval_fn, nullptr);
@@ -544,8 +544,8 @@
TEST_F(IntrinsicTableTest, MatchDifferentArgsElementType_Binary_ConstantEval) {
auto* ai = create<core::type::AbstractInt>();
auto* u32 = create<core::type::U32>();
- auto result = Lookup(context, core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kConstant,
- Source{}, false);
+ auto result = table.Lookup(core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kConstant,
+ Source{}, false);
ASSERT_TRUE(result) << Diagnostics();
ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
@@ -557,8 +557,8 @@
TEST_F(IntrinsicTableTest, MatchDifferentArgsElementType_Binary_RuntimeEval) {
auto* ai = create<core::type::AbstractInt>();
auto* u32 = create<core::type::U32>();
- auto result = Lookup(context, core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kRuntime,
- Source{}, false);
+ auto result = table.Lookup(core::BinaryOp::kShiftLeft, ai, u32, EvaluationStage::kRuntime,
+ Source{}, false);
ASSERT_TRUE(result) << Diagnostics();
ASSERT_NE(result->const_eval_fn, nullptr) << Diagnostics();
ASSERT_EQ(Diagnostics().str(), "");
@@ -571,8 +571,8 @@
// None of the arguments match, so expect the overloads with 2 parameters to
// come first
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BuiltinFn::kTextureDimensions, Vector{bool_, bool_},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureDimensions, Vector{bool_, bool_},
+ EvaluationStage::kConstant, Source{});
EXPECT_FALSE(result);
ASSERT_EQ(Diagnostics().str(),
R"(error: no matching call to textureDimensions(bool, bool)
@@ -611,8 +611,8 @@
TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) {
auto* tex = create<core::type::DepthTexture>(core::type::TextureDimension::k2d);
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BuiltinFn::kTextureDimensions, Vector{tex, bool_},
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kTextureDimensions, Vector{tex, bool_},
+ EvaluationStage::kConstant, Source{});
EXPECT_FALSE(result);
ASSERT_EQ(Diagnostics().str(),
R"(error: no matching call to textureDimensions(texture_depth_2d, bool)
@@ -651,16 +651,16 @@
TEST_F(IntrinsicTableTest, MatchUnaryOp) {
auto* i32 = create<core::type::I32>();
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
- auto result = Lookup(context, core::UnaryOp::kNegation, vec3_i32, EvaluationStage::kConstant,
- Source{{12, 34}});
+ auto result = table.Lookup(core::UnaryOp::kNegation, vec3_i32, EvaluationStage::kConstant,
+ Source{{12, 34}});
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_EQ(Diagnostics().str(), "");
}
TEST_F(IntrinsicTableTest, MismatchUnaryOp) {
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::UnaryOp::kNegation, bool_, EvaluationStage::kConstant,
- Source{{12, 34}});
+ auto result =
+ table.Lookup(core::UnaryOp::kNegation, bool_, EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator - (bool)
@@ -673,7 +673,7 @@
TEST_F(IntrinsicTableTest, MatchUnaryOp_Constant) {
auto* ai = create<core::type::AbstractInt>();
auto result =
- Lookup(context, core::UnaryOp::kNegation, ai, EvaluationStage::kConstant, Source{{12, 34}});
+ table.Lookup(core::UnaryOp::kNegation, ai, EvaluationStage::kConstant, Source{{12, 34}});
EXPECT_EQ(result->return_type, ai);
EXPECT_EQ(Diagnostics().str(), "");
}
@@ -681,7 +681,7 @@
TEST_F(IntrinsicTableTest, MatchUnaryOp_Runtime) {
auto* ai = create<core::type::AbstractInt>();
auto result =
- Lookup(context, core::UnaryOp::kNegation, ai, EvaluationStage::kRuntime, Source{{12, 34}});
+ table.Lookup(core::UnaryOp::kNegation, ai, EvaluationStage::kRuntime, Source{{12, 34}});
EXPECT_NE(result->return_type, ai);
EXPECT_TRUE(result->return_type->Is<core::type::I32>());
EXPECT_EQ(Diagnostics().str(), "");
@@ -690,9 +690,9 @@
TEST_F(IntrinsicTableTest, MatchBinaryOp) {
auto* i32 = create<core::type::I32>();
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
- auto result = Lookup(context, core::BinaryOp::kMultiply, i32, vec3_i32,
- EvaluationStage::kConstant, Source{{12, 34}},
- /* is_compound */ false);
+ auto result = table.Lookup(core::BinaryOp::kMultiply, i32, vec3_i32, EvaluationStage::kConstant,
+ Source{{12, 34}},
+ /* is_compound */ false);
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_EQ(result->parameters[0].type, i32);
EXPECT_EQ(result->parameters[1].type, vec3_i32);
@@ -702,9 +702,9 @@
TEST_F(IntrinsicTableTest, MismatchBinaryOp) {
auto* f32 = create<core::type::F32>();
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BinaryOp::kMultiply, f32, bool_, EvaluationStage::kConstant,
- Source{{12, 34}},
- /* is_compound */ false);
+ auto result = table.Lookup(core::BinaryOp::kMultiply, f32, bool_, EvaluationStage::kConstant,
+ Source{{12, 34}},
+ /* is_compound */ false);
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator * (f32, bool)
@@ -724,9 +724,9 @@
TEST_F(IntrinsicTableTest, MatchCompoundOp) {
auto* i32 = create<core::type::I32>();
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
- auto result = Lookup(context, core::BinaryOp::kMultiply, i32, vec3_i32,
- EvaluationStage::kConstant, Source{{12, 34}},
- /* is_compound */ true);
+ auto result = table.Lookup(core::BinaryOp::kMultiply, i32, vec3_i32, EvaluationStage::kConstant,
+ Source{{12, 34}},
+ /* is_compound */ true);
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_EQ(result->parameters[0].type, i32);
EXPECT_EQ(result->parameters[1].type, vec3_i32);
@@ -736,9 +736,9 @@
TEST_F(IntrinsicTableTest, MismatchCompoundOp) {
auto* f32 = create<core::type::F32>();
auto* bool_ = create<core::type::Bool>();
- auto result = Lookup(context, core::BinaryOp::kMultiply, f32, bool_, EvaluationStage::kConstant,
- Source{{12, 34}},
- /* is_compound */ true);
+ auto result = table.Lookup(core::BinaryOp::kMultiply, f32, bool_, EvaluationStage::kConstant,
+ Source{{12, 34}},
+ /* is_compound */ true);
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(), R"(12:34 error: no matching overload for operator *= (f32, bool)
@@ -758,8 +758,8 @@
TEST_F(IntrinsicTableTest, MatchTypeInitializerImplicit) {
auto* i32 = create<core::type::I32>();
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
- auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{i32, i32, i32},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, nullptr, Vector{i32, i32, i32},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -773,8 +773,8 @@
TEST_F(IntrinsicTableTest, MatchTypeInitializerExplicit) {
auto* i32 = create<core::type::I32>();
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
- auto result = Lookup(context, CtorConv::kVec3, i32, Vector{i32, i32, i32},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, i32, Vector{i32, i32, i32},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -788,8 +788,8 @@
TEST_F(IntrinsicTableTest, MismatchTypeInitializerImplicit) {
auto* i32 = create<core::type::I32>();
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{i32, f32, i32},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, nullptr, Vector{i32, f32, i32},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(),
R"(12:34 error: no matching constructor for vec3(i32, f32, i32)
@@ -815,8 +815,8 @@
TEST_F(IntrinsicTableTest, MismatchTypeInitializerExplicit) {
auto* i32 = create<core::type::I32>();
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, CtorConv::kVec3, i32, Vector{i32, f32, i32},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, i32, Vector{i32, f32, i32},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(),
R"(12:34 error: no matching constructor for vec3<i32>(i32, f32, i32)
@@ -842,8 +842,8 @@
TEST_F(IntrinsicTableTest, MatchTypeInitializerImplicitVecFromVecAbstract) {
auto* ai = create<core::type::AbstractInt>();
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
- auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{vec3_ai},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, nullptr, Vector{vec3_ai},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_ai);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -857,8 +857,8 @@
auto* vec2_ai = create<core::type::Vector>(create<core::type::AbstractInt>(), 2u);
auto* vec2_af = create<core::type::Vector>(af, 2u);
auto* mat2x2_af = create<core::type::Matrix>(vec2_af, 2u);
- auto result = Lookup(context, CtorConv::kMat2x2, nullptr, Vector{vec2_ai, vec2_ai},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kMat2x2, nullptr, Vector{vec2_ai, vec2_ai},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_TYPE(result->return_type, mat2x2_af);
EXPECT_TRUE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -871,8 +871,8 @@
TEST_F(IntrinsicTableTest, MatchTypeInitializer_ConstantEval) {
auto* ai = create<core::type::AbstractInt>();
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
- auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{ai, ai, ai},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, nullptr, Vector{ai, ai, ai},
+ EvaluationStage::kConstant, Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, vec3_ai);
@@ -886,8 +886,8 @@
TEST_F(IntrinsicTableTest, MatchTypeInitializer_RuntimeEval) {
auto* ai = create<core::type::AbstractInt>();
- auto result = Lookup(context, CtorConv::kVec3, nullptr, Vector{ai, ai, ai},
- EvaluationStage::kRuntime, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, nullptr, Vector{ai, ai, ai},
+ EvaluationStage::kRuntime, Source{{12, 34}});
auto* i32 = create<type::I32>();
auto* vec3_i32 = create<type::Vector>(i32, 3u);
ASSERT_TRUE(result) << Diagnostics();
@@ -906,8 +906,8 @@
auto* vec3_i32 = create<core::type::Vector>(i32, 3u);
auto* f32 = create<core::type::F32>();
auto* vec3_f32 = create<core::type::Vector>(f32, 3u);
- auto result = Lookup(context, CtorConv::kVec3, i32, Vector{vec3_f32},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, i32, Vector{vec3_f32}, EvaluationStage::kConstant,
+ Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, vec3_i32);
EXPECT_FALSE(result->info->flags.Contains(OverloadFlag::kIsConstructor));
@@ -919,8 +919,8 @@
auto* arr = create<core::type::Array>(create<core::type::U32>(),
create<core::type::RuntimeArrayCount>(), 4u, 4u, 4u, 4u);
auto* f32 = create<core::type::F32>();
- auto result = Lookup(context, CtorConv::kVec3, f32, Vector{arr}, EvaluationStage::kConstant,
- Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, f32, Vector{arr}, EvaluationStage::kConstant,
+ Source{{12, 34}});
ASSERT_FALSE(result);
EXPECT_EQ(Diagnostics().str(),
R"(12:34 error: no matching constructor for vec3<f32>(array<u32>)
@@ -949,8 +949,8 @@
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
auto* f32 = create<core::type::F32>();
auto* vec3_f32 = create<core::type::Vector>(f32, 3u);
- auto result = Lookup(context, CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kConstant,
- Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kConstant,
+ Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
// NOTE: Conversions are explicit, so there's no way to have it return abstracts
@@ -966,8 +966,8 @@
auto* vec3_ai = create<core::type::Vector>(ai, 3u);
auto* vec3_f32 = create<core::type::Vector>(create<core::type::F32>(), 3u);
auto* vec3_i32 = create<core::type::Vector>(create<core::type::I32>(), 3u);
- auto result = Lookup(context, CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kRuntime,
- Source{{12, 34}});
+ auto result = table.Lookup(CtorConv::kVec3, af, Vector{vec3_ai}, EvaluationStage::kRuntime,
+ Source{{12, 34}});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_NE(result->const_eval_fn, nullptr);
EXPECT_EQ(result->return_type, vec3_f32);
@@ -980,8 +980,8 @@
auto* f32 = create<core::type::F32>();
Vector<const core::type::Type*, 0> arg_tys;
arg_tys.Resize(257, f32);
- auto result = Lookup(context, core::BuiltinFn::kAbs, std::move(arg_tys),
- EvaluationStage::kConstant, Source{});
+ auto result = table.Lookup(core::BuiltinFn::kAbs, std::move(arg_tys),
+ EvaluationStage::kConstant, Source{});
ASSERT_FALSE(result);
ASSERT_THAT(Diagnostics().str(), HasSubstr("no matching call"));
}
@@ -994,7 +994,7 @@
auto* ai = create<core::type::AbstractInt>();
auto* i32 = create<core::type::I32>();
auto result =
- Lookup(context, CtorConv::kI32, nullptr, Vector{ai}, EvaluationStage::kConstant, Source{});
+ table.Lookup(CtorConv::kI32, nullptr, Vector{ai}, EvaluationStage::kConstant, Source{});
ASSERT_TRUE(result) << Diagnostics();
EXPECT_EQ(result->return_type, i32);
EXPECT_EQ(result->parameters.Length(), 1u);
@@ -1030,15 +1030,15 @@
};
struct IntrinsicTableAbstractBinaryTest : public resolver::ResolverTestWithParam<Case> {
- Context context{core::intrinsic::data::kData, Types(), Symbols(), Diagnostics()};
+ Table<Dialect> table{Types(), Symbols(), Diagnostics()};
};
TEST_P(IntrinsicTableAbstractBinaryTest, MatchAdd) {
auto* arg_lhs = GetParam().arg_lhs(*this);
auto* arg_rhs = GetParam().arg_rhs(*this);
- auto result = Lookup(context, core::BinaryOp::kAdd, arg_lhs, arg_rhs,
- EvaluationStage::kConstant, Source{{12, 34}},
- /* is_compound */ false);
+ auto result = table.Lookup(core::BinaryOp::kAdd, arg_lhs, arg_rhs, EvaluationStage::kConstant,
+ Source{{12, 34}},
+ /* is_compound */ false);
bool matched = result;
bool expected_match = GetParam().expected_match;
@@ -1214,15 +1214,15 @@
};
struct IntrinsicTableAbstractTernaryTest : public resolver::ResolverTestWithParam<Case> {
- Context context{core::intrinsic::data::kData, Types(), Symbols(), Diagnostics()};
+ Table<Dialect> table{Types(), Symbols(), Diagnostics()};
};
TEST_P(IntrinsicTableAbstractTernaryTest, MatchClamp) {
auto* arg_a = GetParam().arg_a(*this);
auto* arg_b = GetParam().arg_b(*this);
auto* arg_c = GetParam().arg_c(*this);
- auto builtin = Lookup(context, core::BuiltinFn::kClamp, Vector{arg_a, arg_b, arg_c},
- EvaluationStage::kConstant, Source{{12, 34}});
+ auto builtin = table.Lookup(core::BuiltinFn::kClamp, Vector{arg_a, arg_b, arg_c},
+ EvaluationStage::kConstant, Source{{12, 34}});
bool expected_match = GetParam().expected_match;
EXPECT_EQ(builtin == true, expected_match) << Diagnostics();
diff --git a/src/tint/lang/core/intrinsic/data/type_matchers.h b/src/tint/lang/core/intrinsic/type_matchers.h
similarity index 98%
rename from src/tint/lang/core/intrinsic/data/type_matchers.h
rename to src/tint/lang/core/intrinsic/type_matchers.h
index 1dbd965..37735c2 100644
--- a/src/tint/lang/core/intrinsic/data/type_matchers.h
+++ b/src/tint/lang/core/intrinsic/type_matchers.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_LANG_CORE_INTRINSIC_DATA_TYPE_MATCHERS_H_
-#define SRC_TINT_LANG_CORE_INTRINSIC_DATA_TYPE_MATCHERS_H_
+#ifndef SRC_TINT_LANG_CORE_INTRINSIC_TYPE_MATCHERS_H_
+#define SRC_TINT_LANG_CORE_INTRINSIC_TYPE_MATCHERS_H_
#include "src/tint/lang/core/evaluation_stage.h"
#include "src/tint/lang/core/intrinsic/table_data.h"
@@ -40,7 +40,9 @@
#include "src/tint/lang/core/type/u32.h"
#include "src/tint/lang/core/type/vector.h"
-namespace tint::core::intrinsic::data {
+//! @cond Doxygen_Suppress
+
+namespace tint::core::intrinsic {
inline bool MatchBool(intrinsic::MatchState&, const type::Type* ty) {
return ty->IsAnyOf<intrinsic::Any, type::Bool>();
@@ -588,6 +590,8 @@
return type::CreateAtomicCompareExchangeResult(state.types, state.symbols, ty);
}
-} // namespace tint::core::intrinsic::data
+} // namespace tint::core::intrinsic
-#endif // SRC_TINT_LANG_CORE_INTRINSIC_DATA_TYPE_MATCHERS_H_
+//! @endcond
+
+#endif // SRC_TINT_LANG_CORE_INTRINSIC_TYPE_MATCHERS_H_
diff --git a/src/tint/lang/core/ir/BUILD.bazel b/src/tint/lang/core/ir/BUILD.bazel
index 2b94ce3..dd00a54 100644
--- a/src/tint/lang/core/ir/BUILD.bazel
+++ b/src/tint/lang/core/ir/BUILD.bazel
@@ -119,6 +119,7 @@
"swizzle.h",
"terminate_invocation.h",
"terminator.h",
+ "traverse.h",
"unary.h",
"unreachable.h",
"user_call.h",
@@ -131,7 +132,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/type",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
@@ -189,6 +189,7 @@
"switch_test.cc",
"swizzle_test.cc",
"terminate_invocation_test.cc",
+ "traverse_test.cc",
"unary_test.cc",
"unreachable_test.cc",
"user_call_test.cc",
@@ -201,7 +202,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/utils/containers",
diff --git a/src/tint/lang/core/ir/BUILD.cmake b/src/tint/lang/core/ir/BUILD.cmake
index ccd8312..795ca8f 100644
--- a/src/tint/lang/core/ir/BUILD.cmake
+++ b/src/tint/lang/core/ir/BUILD.cmake
@@ -113,6 +113,7 @@
lang/core/ir/terminate_invocation.h
lang/core/ir/terminator.cc
lang/core/ir/terminator.h
+ lang/core/ir/traverse.h
lang/core/ir/unary.cc
lang/core/ir/unary.h
lang/core/ir/unreachable.cc
@@ -132,7 +133,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_type
tint_utils_containers
tint_utils_diagnostic
@@ -189,6 +189,7 @@
lang/core/ir/switch_test.cc
lang/core/ir/swizzle_test.cc
lang/core/ir/terminate_invocation_test.cc
+ lang/core/ir/traverse_test.cc
lang/core/ir/unary_test.cc
lang/core/ir/unreachable_test.cc
lang/core/ir/user_call_test.cc
@@ -202,7 +203,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_utils_containers
diff --git a/src/tint/lang/core/ir/BUILD.gn b/src/tint/lang/core/ir/BUILD.gn
index a2a54cc..ff12f1e 100644
--- a/src/tint/lang/core/ir/BUILD.gn
+++ b/src/tint/lang/core/ir/BUILD.gn
@@ -116,6 +116,7 @@
"terminate_invocation.h",
"terminator.cc",
"terminator.h",
+ "traverse.h",
"unary.cc",
"unary.h",
"unreachable.cc",
@@ -134,7 +135,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
@@ -190,6 +190,7 @@
"switch_test.cc",
"swizzle_test.cc",
"terminate_invocation_test.cc",
+ "traverse_test.cc",
"unary_test.cc",
"unreachable_test.cc",
"user_call_test.cc",
@@ -203,7 +204,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/utils/containers",
diff --git a/src/tint/lang/core/ir/access.cc b/src/tint/lang/core/ir/access.cc
index 73682b9..fd58dda 100644
--- a/src/tint/lang/core/ir/access.cc
+++ b/src/tint/lang/core/ir/access.cc
@@ -34,9 +34,9 @@
Access* Access::Clone(CloneContext& ctx) {
auto new_result = ctx.Clone(Result());
- auto new_obj = ctx.Clone(Object());
- auto new_indices = ctx.Clone<Access::kDefaultNumOperands>(Indices());
- return ctx.ir.instructions.Create<Access>(new_result, new_obj, new_indices);
+ auto obj = ctx.Remap(Object());
+ auto indices = ctx.Remap<Access::kDefaultNumOperands>(Indices());
+ return ctx.ir.instructions.Create<Access>(new_result, obj, indices);
}
//! @endcond
diff --git a/src/tint/lang/core/ir/access_test.cc b/src/tint/lang/core/ir/access_test.cc
index 7d9c4d6..2e87009 100644
--- a/src/tint/lang/core/ir/access_test.cc
+++ b/src/tint/lang/core/ir/access_test.cc
@@ -76,7 +76,7 @@
EXPECT_EQ(type, new_a->Result()->Type());
EXPECT_NE(nullptr, new_a->Object());
- EXPECT_NE(a->Object(), new_a->Object());
+ EXPECT_EQ(a->Object(), new_a->Object());
auto indices = new_a->Indices();
EXPECT_EQ(2u, indices.Length());
diff --git a/src/tint/lang/core/ir/binary.cc b/src/tint/lang/core/ir/binary.cc
index 251d587..ce5ab7e 100644
--- a/src/tint/lang/core/ir/binary.cc
+++ b/src/tint/lang/core/ir/binary.cc
@@ -31,9 +31,9 @@
Binary* Binary::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_lhs = ctx.Clone(LHS());
- auto* new_rhs = ctx.Clone(RHS());
- return ctx.ir.instructions.Create<Binary>(new_result, kind_, new_lhs, new_rhs);
+ auto* lhs = ctx.Remap(LHS());
+ auto* rhs = ctx.Remap(RHS());
+ return ctx.ir.instructions.Create<Binary>(new_result, kind_, lhs, rhs);
}
std::string_view ToString(enum Binary::Kind kind) {
diff --git a/src/tint/lang/core/ir/bitcast.cc b/src/tint/lang/core/ir/bitcast.cc
index f1fc737..41cb231 100644
--- a/src/tint/lang/core/ir/bitcast.cc
+++ b/src/tint/lang/core/ir/bitcast.cc
@@ -29,9 +29,9 @@
Bitcast::~Bitcast() = default;
Bitcast* Bitcast::Clone(CloneContext& ctx) {
- auto* new_res = ctx.Clone(Result());
- auto* new_val = ctx.Clone(Val());
- return ctx.ir.instructions.Create<Bitcast>(new_res, new_val);
+ auto* new_result = ctx.Clone(Result());
+ auto* val = ctx.Remap(Val());
+ return ctx.ir.instructions.Create<Bitcast>(new_result, val);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/break_if.cc b/src/tint/lang/core/ir/break_if.cc
index bf4a6c3..b0dcde8 100644
--- a/src/tint/lang/core/ir/break_if.cc
+++ b/src/tint/lang/core/ir/break_if.cc
@@ -41,10 +41,10 @@
BreakIf::~BreakIf() = default;
BreakIf* BreakIf::Clone(CloneContext& ctx) {
- auto* new_loop = ctx.Clone(loop_);
- auto* new_cond = ctx.Clone(Condition());
- auto new_args = ctx.Clone<BreakIf::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<BreakIf>(new_cond, new_loop, new_args);
+ auto* loop = ctx.Remap(loop_);
+ auto* cond = ctx.Remap(Condition());
+ auto args = ctx.Remap<BreakIf::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<BreakIf>(cond, loop, args);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/builder.h b/src/tint/lang/core/ir/builder.h
index 028eee2..64448cf 100644
--- a/src/tint/lang/core/ir/builder.h
+++ b/src/tint/lang/core/ir/builder.h
@@ -796,6 +796,8 @@
ir::Var* Var(std::string_view name, const core::type::Pointer* type);
/// Creates a new `var` declaration with a name and initializer value
+ /// @tparam SPACE the var's address space
+ /// @tparam ACCESS the var's access mode
/// @param name the var name
/// @param init the var initializer
/// @returns the instruction
@@ -814,6 +816,27 @@
return var;
}
+ /// Creates a new `var` declaration
+ /// @tparam SPACE the var's address space
+ /// @tparam T the storage pointer's element type
+ /// @tparam ACCESS the var's access mode
+ /// @returns the instruction
+ template <core::AddressSpace SPACE, typename T, core::Access ACCESS = core::Access::kReadWrite>
+ ir::Var* Var() {
+ return Var(ir.Types().ptr<SPACE, T, ACCESS>());
+ }
+
+ /// Creates a new `var` declaration with a name
+ /// @tparam SPACE the var's address space
+ /// @tparam T the storage pointer's element type
+ /// @tparam ACCESS the var's access mode
+ /// @param name the var name
+ /// @returns the instruction
+ template <core::AddressSpace SPACE, typename T, core::Access ACCESS = core::Access::kReadWrite>
+ ir::Var* Var(std::string_view name) {
+ return Var(name, ir.Types().ptr<SPACE, T, ACCESS>());
+ }
+
/// Creates a new `let` declaration
/// @param name the let name
/// @param value the let value
diff --git a/src/tint/lang/core/ir/clone_context.h b/src/tint/lang/core/ir/clone_context.h
index b5c375b..e9184ba 100644
--- a/src/tint/lang/core/ir/clone_context.h
+++ b/src/tint/lang/core/ir/clone_context.h
@@ -43,11 +43,9 @@
template <typename T>
T* Clone(T* what) {
if (auto replacement = replacements_.Get(what)) {
- auto* cast = As<T>((*replacement)());
- TINT_ASSERT(cast);
- return cast;
+ return (*replacement)->template As<T>();
}
- auto* result = what->Clone(*this)->template As<T>();
+ T* result = what->Clone(*this);
Replace(what, result);
return result;
}
@@ -76,34 +74,55 @@
return Transform(what, [&](T* p) { return Clone(p); });
}
+ /// Obtains the (potentially) remapped pointer to @p what
+ /// @param what the item
+ /// @return the cloned item for @p what, or the original pointer if @p what has not been cloned.
+ template <typename T>
+ T* Remap(T* what) {
+ if (auto replacement = replacements_.Get(what)) {
+ return (*replacement)->template As<T>();
+ }
+ return what;
+ }
+
+ /// Obtains the (potentially) remapped pointer of all the elements in @p what.
+ /// @param what the item
+ /// @return the remapped elements
+ template <size_t N, typename T>
+ Vector<T*, N> Remap(Slice<T* const> what) {
+ return Transform<N>(what, [&](T* const p) { return Remap(p); });
+ }
+
+ /// Obtains the (potentially) remapped pointer of all the elements in @p what.
+ /// @param what the item
+ /// @return the remapped elements
+ template <size_t N, typename T>
+ Vector<T*, N> Remap(Slice<T*> what) {
+ return Transform<N>(what, [&](T* p) { return Remap(p); });
+ }
+
+ /// Obtains the (potentially) remapped pointer of all the elements in @p what.
+ /// @param what the item
+ /// @return the remapped elements
+ template <size_t N, typename T>
+ Vector<T*, N> Remap(Vector<T*, N> what) {
+ return Transform(what, [&](T* p) { return Remap(p); });
+ }
+
/// Registers the replacement of `what` with `with`
/// @param what the value or instruction to replace
- /// @param with either a pointer to a replacement instruction, or a function with the signature
- /// `T*(T*)` used to build the replacement
+ /// @param with a pointer to a replacement value or instruction
template <typename WHAT, typename WITH>
- void Replace(WHAT* what, WITH&& with) {
- using T = std::decay_t<WHAT>;
- using F = std::decay_t<WITH>;
-
- constexpr bool T_is_value = traits::IsTypeOrDerived<T, Value>;
- constexpr bool T_is_instruction = traits::IsTypeOrDerived<T, Instruction>;
- static_assert(T_is_value || T_is_instruction);
-
- constexpr bool F_is_pointer = std::is_pointer_v<F>;
- constexpr bool F_is_function = std::is_function_v<F>;
- static_assert(F_is_pointer || F_is_function);
-
- if constexpr (F_is_pointer) {
- replacements_.Add(what, [with]() { return with; });
- } else if constexpr (F_is_function) {
- static_assert(std::is_same_v<traits::ParameterType<F, 0>, T*>);
- static_assert(std::is_same_v<traits::ReturnType<F>, T*>);
- replacements_.Add(what, [what, with]() { return with(what); });
- }
+ void Replace(WHAT* what, WITH* with) {
+ static_assert(traits::IsTypeOrDerived<WHAT, ir::Instruction> ||
+ traits::IsTypeOrDerived<WHAT, ir::Value>);
+ static_assert(traits::IsTypeOrDerived<WITH, WHAT>);
+ TINT_ASSERT(with);
+ replacements_.Add(what, with);
}
private:
- Hashmap<CastableBase*, std::function<CastableBase*()>, 8> replacements_;
+ Hashmap<CastableBase*, CastableBase*, 8> replacements_;
};
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/construct.cc b/src/tint/lang/core/ir/construct.cc
index f9ae628..d8035e2 100644
--- a/src/tint/lang/core/ir/construct.cc
+++ b/src/tint/lang/core/ir/construct.cc
@@ -32,8 +32,8 @@
Construct* Construct::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto new_args = ctx.Clone<Construct::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<Construct>(new_result, new_args);
+ auto args = ctx.Remap<Construct::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<Construct>(new_result, args);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/continue.cc b/src/tint/lang/core/ir/continue.cc
index 7ddb1a3..c361164 100644
--- a/src/tint/lang/core/ir/continue.cc
+++ b/src/tint/lang/core/ir/continue.cc
@@ -40,10 +40,10 @@
Continue::~Continue() = default;
Continue* Continue::Clone(CloneContext& ctx) {
- auto* new_loop = ctx.Clone(Loop());
- auto new_args = ctx.Clone<Continue::kDefaultNumOperands>(Args());
+ auto* loop = ctx.Remap(Loop());
+ auto args = ctx.Remap<Continue::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<Continue>(new_loop, new_args);
+ return ctx.ir.instructions.Create<Continue>(loop, args);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/convert.cc b/src/tint/lang/core/ir/convert.cc
index c9a5696..cbaeb0c 100644
--- a/src/tint/lang/core/ir/convert.cc
+++ b/src/tint/lang/core/ir/convert.cc
@@ -32,8 +32,8 @@
Convert* Convert::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_val = ctx.Clone(Args()[0]);
- return ctx.ir.instructions.Create<Convert>(new_result, new_val);
+ auto* val = ctx.Remap(Args()[0]);
+ return ctx.ir.instructions.Create<Convert>(new_result, val);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/core_builtin_call.cc b/src/tint/lang/core/ir/core_builtin_call.cc
index 86325ac..4358656 100644
--- a/src/tint/lang/core/ir/core_builtin_call.cc
+++ b/src/tint/lang/core/ir/core_builtin_call.cc
@@ -36,8 +36,8 @@
CoreBuiltinCall* CoreBuiltinCall::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto new_args = ctx.Clone<CoreBuiltinCall::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<CoreBuiltinCall>(new_result, func_, new_args);
+ auto args = ctx.Remap<CoreBuiltinCall::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<CoreBuiltinCall>(new_result, func_, args);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/core_builtin_call.h b/src/tint/lang/core/ir/core_builtin_call.h
index 9228678..ced02de 100644
--- a/src/tint/lang/core/ir/core_builtin_call.h
+++ b/src/tint/lang/core/ir/core_builtin_call.h
@@ -18,7 +18,7 @@
#include <string>
#include "src/tint/lang/core/builtin_fn.h"
-#include "src/tint/lang/core/intrinsic/data/data.h"
+#include "src/tint/lang/core/intrinsic/dialect.h"
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/ir/builtin_call.h"
#include "src/tint/utils/rtti/castable.h"
@@ -50,7 +50,9 @@
std::string FriendlyName() override { return core::str(func_); }
/// @returns the table data to validate this builtin
- const core::intrinsic::TableData& TableData() override { return core::intrinsic::data::kData; }
+ const core::intrinsic::TableData& TableData() override {
+ return core::intrinsic::Dialect::kData;
+ }
private:
core::BuiltinFn func_;
diff --git a/src/tint/lang/core/ir/exit_if.cc b/src/tint/lang/core/ir/exit_if.cc
index 8bb6539..2d6e77b 100644
--- a/src/tint/lang/core/ir/exit_if.cc
+++ b/src/tint/lang/core/ir/exit_if.cc
@@ -33,9 +33,9 @@
ExitIf::~ExitIf() = default;
ExitIf* ExitIf::Clone(CloneContext& ctx) {
- auto* new_if = ctx.Clone(If());
- auto new_args = ctx.Clone<ExitIf::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<ExitIf>(new_if, new_args);
+ auto* if_ = ctx.Remap(If());
+ auto args = ctx.Remap<ExitIf::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<ExitIf>(if_, args);
}
void ExitIf::SetIf(ir::If* i) {
diff --git a/src/tint/lang/core/ir/exit_loop.cc b/src/tint/lang/core/ir/exit_loop.cc
index 8e8d504..21347e1 100644
--- a/src/tint/lang/core/ir/exit_loop.cc
+++ b/src/tint/lang/core/ir/exit_loop.cc
@@ -34,9 +34,9 @@
ExitLoop::~ExitLoop() = default;
ExitLoop* ExitLoop::Clone(CloneContext& ctx) {
- auto* new_loop = ctx.Clone(Loop());
- auto new_args = ctx.Clone<ExitLoop::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<ExitLoop>(new_loop, new_args);
+ auto* loop = ctx.Remap(Loop());
+ auto args = ctx.Remap<ExitLoop::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<ExitLoop>(loop, args);
}
void ExitLoop::SetLoop(ir::Loop* l) {
diff --git a/src/tint/lang/core/ir/exit_switch.cc b/src/tint/lang/core/ir/exit_switch.cc
index 2216c8f..ba3b141 100644
--- a/src/tint/lang/core/ir/exit_switch.cc
+++ b/src/tint/lang/core/ir/exit_switch.cc
@@ -33,9 +33,9 @@
ExitSwitch::~ExitSwitch() = default;
ExitSwitch* ExitSwitch::Clone(CloneContext& ctx) {
- auto* new_switch = ctx.Clone(Switch());
- auto new_args = ctx.Clone<ExitSwitch::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<ExitSwitch>(new_switch, new_args);
+ auto* switch_ = ctx.Remap(Switch());
+ auto args = ctx.Remap<ExitSwitch::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<ExitSwitch>(switch_, args);
}
void ExitSwitch::SetSwitch(ir::Switch* s) {
diff --git a/src/tint/lang/core/ir/if.cc b/src/tint/lang/core/ir/if.cc
index 6368db2..e54d00f 100644
--- a/src/tint/lang/core/ir/if.cc
+++ b/src/tint/lang/core/ir/if.cc
@@ -49,11 +49,11 @@
}
If* If::Clone(CloneContext& ctx) {
- auto* new_cond = ctx.Clone(Condition());
+ auto* cond = ctx.Remap(Condition());
auto* new_true = ctx.ir.blocks.Create<ir::Block>();
auto* new_false = ctx.ir.blocks.Create<ir::Block>();
- auto* new_if = ctx.ir.instructions.Create<If>(new_cond, new_true, new_false);
+ auto* new_if = ctx.ir.instructions.Create<If>(cond, new_true, new_false);
ctx.Replace(this, new_if);
true_->CloneInto(ctx, new_true);
diff --git a/src/tint/lang/core/ir/let.cc b/src/tint/lang/core/ir/let.cc
index b843ee5..46fcc14 100644
--- a/src/tint/lang/core/ir/let.cc
+++ b/src/tint/lang/core/ir/let.cc
@@ -31,8 +31,8 @@
Let* Let::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_val = ctx.Clone(Value());
- auto* new_let = ctx.ir.instructions.Create<Let>(new_result, new_val);
+ auto* val = ctx.Remap(Value());
+ auto* new_let = ctx.ir.instructions.Create<Let>(new_result, val);
auto name = ctx.ir.NameOf(this);
ctx.ir.SetName(new_let, name.Name());
diff --git a/src/tint/lang/core/ir/load.cc b/src/tint/lang/core/ir/load.cc
index 361643b..895b74e 100644
--- a/src/tint/lang/core/ir/load.cc
+++ b/src/tint/lang/core/ir/load.cc
@@ -37,8 +37,8 @@
Load* Load::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_from = ctx.Clone(From());
- return ctx.ir.instructions.Create<Load>(new_result, new_from);
+ auto* from = ctx.Remap(From());
+ return ctx.ir.instructions.Create<Load>(new_result, from);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/load_vector_element.cc b/src/tint/lang/core/ir/load_vector_element.cc
index aebf4d5..fbc05b0 100644
--- a/src/tint/lang/core/ir/load_vector_element.cc
+++ b/src/tint/lang/core/ir/load_vector_element.cc
@@ -33,9 +33,9 @@
LoadVectorElement* LoadVectorElement::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_from = ctx.Clone(From());
- auto* new_index = ctx.Clone(Index());
- return ctx.ir.instructions.Create<LoadVectorElement>(new_result, new_from, new_index);
+ auto* from = ctx.Remap(From());
+ auto* index = ctx.Remap(Index());
+ return ctx.ir.instructions.Create<LoadVectorElement>(new_result, from, index);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/next_iteration.cc b/src/tint/lang/core/ir/next_iteration.cc
index 1c3fe65..b71ba34 100644
--- a/src/tint/lang/core/ir/next_iteration.cc
+++ b/src/tint/lang/core/ir/next_iteration.cc
@@ -41,8 +41,8 @@
NextIteration* NextIteration::Clone(CloneContext& ctx) {
auto* new_loop = ctx.Clone(loop_);
- auto new_args = ctx.Clone<NextIteration::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<NextIteration>(new_loop, new_args);
+ auto args = ctx.Remap<NextIteration::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<NextIteration>(new_loop, args);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/return.cc b/src/tint/lang/core/ir/return.cc
index 49b5939..da155f6 100644
--- a/src/tint/lang/core/ir/return.cc
+++ b/src/tint/lang/core/ir/return.cc
@@ -36,9 +36,11 @@
Return::~Return() = default;
Return* Return::Clone(CloneContext& ctx) {
- auto* new_func = ctx.Clone(Func());
- auto new_val = Value() ? ctx.Clone(Value()) : nullptr;
- return ctx.ir.instructions.Create<Return>(new_func, new_val);
+ auto* fn = ctx.Remap(Func());
+ if (auto* val = Value()) {
+ return ctx.ir.instructions.Create<Return>(fn, ctx.Remap(val));
+ }
+ return ctx.ir.instructions.Create<Return>(fn);
}
Function* Return::Func() const {
diff --git a/src/tint/lang/core/ir/store.cc b/src/tint/lang/core/ir/store.cc
index 8088087..493810b 100644
--- a/src/tint/lang/core/ir/store.cc
+++ b/src/tint/lang/core/ir/store.cc
@@ -31,9 +31,9 @@
Store::~Store() = default;
Store* Store::Clone(CloneContext& ctx) {
- auto* new_to = ctx.Clone(To());
- auto* new_from = ctx.Clone(From());
- return ctx.ir.instructions.Create<Store>(new_to, new_from);
+ auto* to = ctx.Remap(To());
+ auto* from = ctx.Remap(From());
+ return ctx.ir.instructions.Create<Store>(to, from);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/store_vector_element.cc b/src/tint/lang/core/ir/store_vector_element.cc
index 7d4a45d..bba671b 100644
--- a/src/tint/lang/core/ir/store_vector_element.cc
+++ b/src/tint/lang/core/ir/store_vector_element.cc
@@ -32,10 +32,10 @@
StoreVectorElement::~StoreVectorElement() = default;
StoreVectorElement* StoreVectorElement::Clone(CloneContext& ctx) {
- auto* new_to = ctx.Clone(To());
- auto* new_idx = ctx.Clone(Index());
- auto* new_val = ctx.Clone(Value());
- return ctx.ir.instructions.Create<StoreVectorElement>(new_to, new_idx, new_val);
+ auto* to = ctx.Remap(To());
+ auto* idx = ctx.Remap(Index());
+ auto* val = ctx.Remap(Value());
+ return ctx.ir.instructions.Create<StoreVectorElement>(to, idx, val);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/switch.cc b/src/tint/lang/core/ir/switch.cc
index d260921..cae733b 100644
--- a/src/tint/lang/core/ir/switch.cc
+++ b/src/tint/lang/core/ir/switch.cc
@@ -37,8 +37,8 @@
}
Switch* Switch::Clone(CloneContext& ctx) {
- auto* new_cond = ctx.Clone(Condition());
- auto* new_switch = ctx.ir.instructions.Create<Switch>(new_cond);
+ auto* cond = ctx.Remap(Condition());
+ auto* new_switch = ctx.ir.instructions.Create<Switch>(cond);
ctx.Replace(this, new_switch);
new_switch->cases_.Reserve(cases_.Length());
diff --git a/src/tint/lang/core/ir/swizzle.cc b/src/tint/lang/core/ir/swizzle.cc
index 0180d48..2c36714 100644
--- a/src/tint/lang/core/ir/swizzle.cc
+++ b/src/tint/lang/core/ir/swizzle.cc
@@ -41,8 +41,8 @@
Swizzle* Swizzle::Clone(CloneContext& ctx) {
auto* result = ctx.Clone(Result());
- auto* new_obj = ctx.Clone(Object());
- return ctx.ir.instructions.Create<Swizzle>(result, new_obj, indices_);
+ auto* obj = ctx.Remap(Object());
+ return ctx.ir.instructions.Create<Swizzle>(result, obj, indices_);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/transform/BUILD.bazel b/src/tint/lang/core/ir/transform/BUILD.bazel
index 4388198..e4c3240 100644
--- a/src/tint/lang/core/ir/transform/BUILD.bazel
+++ b/src/tint/lang/core/ir/transform/BUILD.bazel
@@ -33,6 +33,7 @@
"block_decorated_structs.cc",
"builtin_polyfill.cc",
"demote_to_helper.cc",
+ "direct_variable_access.cc",
"multiplanar_external_texture.cc",
"robustness.cc",
"shader_io.cc",
@@ -47,6 +48,7 @@
"block_decorated_structs.h",
"builtin_polyfill.h",
"demote_to_helper.h",
+ "direct_variable_access.h",
"multiplanar_external_texture.h",
"robustness.h",
"shader_io.h",
@@ -59,7 +61,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/utils/containers",
@@ -90,22 +91,35 @@
"block_decorated_structs_test.cc",
"builtin_polyfill_test.cc",
"demote_to_helper_test.cc",
+ "direct_variable_access_test.cc",
"helper_test.h",
"multiplanar_external_texture_test.cc",
"robustness_test.cc",
"std140_test.cc",
"zero_init_workgroup_memory_test.cc",
- ],
+ ] + select({
+ ":tint_build_wgsl_reader_and_tint_build_wgsl_writer": [
+ "direct_variable_access_wgsl_test.cc",
+ ],
+ "//conditions:default": [],
+ }),
deps = [
"//src/tint/api/common",
"//src/tint/api/options",
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir/transform",
"//src/tint/lang/core/type",
+ "//src/tint/lang/wgsl",
+ "//src/tint/lang/wgsl/ast",
+ "//src/tint/lang/wgsl/program",
+ "//src/tint/lang/wgsl/reader",
+ "//src/tint/lang/wgsl/reader/program_to_ir",
+ "//src/tint/lang/wgsl/sem",
+ "//src/tint/lang/wgsl/writer",
+ "//src/tint/lang/wgsl/writer/ir_to_program",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
"//src/tint/utils/ice",
@@ -125,3 +139,21 @@
visibility = ["//visibility:public"],
)
+alias(
+ name = "tint_build_wgsl_reader",
+ actual = "//src/tint:tint_build_wgsl_reader_true",
+)
+
+alias(
+ name = "tint_build_wgsl_writer",
+ actual = "//src/tint:tint_build_wgsl_writer_true",
+)
+
+selects.config_setting_group(
+ name = "tint_build_wgsl_reader_and_tint_build_wgsl_writer",
+ match_all = [
+ ":tint_build_wgsl_reader",
+ ":tint_build_wgsl_writer",
+ ],
+)
+
diff --git a/src/tint/lang/core/ir/transform/BUILD.cmake b/src/tint/lang/core/ir/transform/BUILD.cmake
index 5e772df..1164934 100644
--- a/src/tint/lang/core/ir/transform/BUILD.cmake
+++ b/src/tint/lang/core/ir/transform/BUILD.cmake
@@ -40,6 +40,8 @@
lang/core/ir/transform/builtin_polyfill.h
lang/core/ir/transform/demote_to_helper.cc
lang/core/ir/transform/demote_to_helper.h
+ lang/core/ir/transform/direct_variable_access.cc
+ lang/core/ir/transform/direct_variable_access.h
lang/core/ir/transform/multiplanar_external_texture.cc
lang/core/ir/transform/multiplanar_external_texture.h
lang/core/ir/transform/robustness.cc
@@ -58,7 +60,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_utils_containers
@@ -88,6 +89,7 @@
lang/core/ir/transform/block_decorated_structs_test.cc
lang/core/ir/transform/builtin_polyfill_test.cc
lang/core/ir/transform/demote_to_helper_test.cc
+ lang/core/ir/transform/direct_variable_access_test.cc
lang/core/ir/transform/helper_test.h
lang/core/ir/transform/multiplanar_external_texture_test.cc
lang/core/ir/transform/robustness_test.cc
@@ -101,10 +103,17 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_transform
tint_lang_core_type
+ tint_lang_wgsl
+ tint_lang_wgsl_ast
+ tint_lang_wgsl_program
+ tint_lang_wgsl_reader
+ tint_lang_wgsl_reader_program_to_ir
+ tint_lang_wgsl_sem
+ tint_lang_wgsl_writer
+ tint_lang_wgsl_writer_ir_to_program
tint_utils_containers
tint_utils_diagnostic
tint_utils_ice
@@ -123,3 +132,9 @@
tint_target_add_external_dependencies(tint_lang_core_ir_transform_test test
"gtest"
)
+
+if(TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
+ tint_target_add_sources(tint_lang_core_ir_transform_test test
+ "lang/core/ir/transform/direct_variable_access_wgsl_test.cc"
+ )
+endif(TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER)
diff --git a/src/tint/lang/core/ir/transform/BUILD.gn b/src/tint/lang/core/ir/transform/BUILD.gn
index cf99aba..9ee4ae0 100644
--- a/src/tint/lang/core/ir/transform/BUILD.gn
+++ b/src/tint/lang/core/ir/transform/BUILD.gn
@@ -45,6 +45,8 @@
"builtin_polyfill.h",
"demote_to_helper.cc",
"demote_to_helper.h",
+ "direct_variable_access.cc",
+ "direct_variable_access.h",
"multiplanar_external_texture.cc",
"multiplanar_external_texture.h",
"robustness.cc",
@@ -62,7 +64,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/utils/containers",
@@ -91,6 +92,7 @@
"block_decorated_structs_test.cc",
"builtin_polyfill_test.cc",
"demote_to_helper_test.cc",
+ "direct_variable_access_test.cc",
"helper_test.h",
"multiplanar_external_texture_test.cc",
"robustness_test.cc",
@@ -104,10 +106,17 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir/transform",
"${tint_src_dir}/lang/core/type",
+ "${tint_src_dir}/lang/wgsl",
+ "${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/program",
+ "${tint_src_dir}/lang/wgsl/reader",
+ "${tint_src_dir}/lang/wgsl/reader/program_to_ir",
+ "${tint_src_dir}/lang/wgsl/sem",
+ "${tint_src_dir}/lang/wgsl/writer",
+ "${tint_src_dir}/lang/wgsl/writer/ir_to_program",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
"${tint_src_dir}/utils/ice",
@@ -122,5 +131,9 @@
"${tint_src_dir}/utils/text",
"${tint_src_dir}/utils/traits",
]
+
+ if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
+ sources += [ "direct_variable_access_wgsl_test.cc" ]
+ }
}
}
diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill.cc b/src/tint/lang/core/ir/transform/builtin_polyfill.cc
index 992cf86..85df8d6 100644
--- a/src/tint/lang/core/ir/transform/builtin_polyfill.cc
+++ b/src/tint/lang/core/ir/transform/builtin_polyfill.cc
@@ -55,6 +55,12 @@
}
if (auto* builtin = inst->As<ir::CoreBuiltinCall>()) {
switch (builtin->Func()) {
+ case core::BuiltinFn::kClamp:
+ if (config.clamp_int &&
+ builtin->Result()->Type()->is_integer_scalar_or_vector()) {
+ worklist.Push(builtin);
+ }
+ break;
case core::BuiltinFn::kCountLeadingZeros:
if (config.count_leading_zeros) {
worklist.Push(builtin);
@@ -65,6 +71,11 @@
worklist.Push(builtin);
}
break;
+ case core::BuiltinFn::kExtractBits:
+ if (config.extract_bits != BuiltinPolyfillLevel::kNone) {
+ worklist.Push(builtin);
+ }
+ break;
case core::BuiltinFn::kFirstLeadingBit:
if (config.first_leading_bit) {
worklist.Push(builtin);
@@ -75,6 +86,11 @@
worklist.Push(builtin);
}
break;
+ case core::BuiltinFn::kInsertBits:
+ if (config.insert_bits != BuiltinPolyfillLevel::kNone) {
+ worklist.Push(builtin);
+ }
+ break;
case core::BuiltinFn::kSaturate:
if (config.saturate) {
worklist.Push(builtin);
@@ -100,18 +116,27 @@
for (auto* builtin : worklist) {
ir::Value* replacement = nullptr;
switch (builtin->Func()) {
+ case core::BuiltinFn::kClamp:
+ replacement = ClampInt(builtin);
+ break;
case core::BuiltinFn::kCountLeadingZeros:
replacement = CountLeadingZeros(builtin);
break;
case core::BuiltinFn::kCountTrailingZeros:
replacement = CountTrailingZeros(builtin);
break;
+ case core::BuiltinFn::kExtractBits:
+ replacement = ExtractBits(builtin);
+ break;
case core::BuiltinFn::kFirstLeadingBit:
replacement = FirstLeadingBit(builtin);
break;
case core::BuiltinFn::kFirstTrailingBit:
replacement = FirstTrailingBit(builtin);
break;
+ case core::BuiltinFn::kInsertBits:
+ replacement = InsertBits(builtin);
+ break;
case core::BuiltinFn::kSaturate:
replacement = Saturate(builtin);
break;
@@ -123,12 +148,14 @@
}
TINT_ASSERT_OR_RETURN(replacement);
- // Replace the old builtin call result with the new value.
- if (auto name = ir.NameOf(builtin->Result())) {
- ir.SetName(replacement, name);
+ if (replacement != builtin->Result()) {
+ // Replace the old builtin call result with the new value.
+ if (auto name = ir.NameOf(builtin->Result())) {
+ ir.SetName(replacement, name);
+ }
+ builtin->Result()->ReplaceAllUsesWith(replacement);
+ builtin->Destroy();
}
- builtin->Result()->ReplaceAllUsesWith(replacement);
- builtin->Destroy();
}
}
@@ -157,6 +184,24 @@
return element;
}
+ /// Polyfill a `clamp()` builtin call for integers.
+ /// @param call the builtin call instruction
+ /// @returns the replacement value
+ ir::Value* ClampInt(ir::CoreBuiltinCall* call) {
+ auto* type = call->Result()->Type();
+ auto* e = call->Args()[0];
+ auto* low = call->Args()[1];
+ auto* high = call->Args()[2];
+
+ Value* result = nullptr;
+ b.InsertBefore(call, [&] {
+ auto* max = b.Call(type, core::BuiltinFn::kMax, e, low);
+ auto* min = b.Call(type, core::BuiltinFn::kMin, max, high);
+ result = min->Result();
+ });
+ return result;
+ }
+
/// Polyfill a `countLeadingZeros()` builtin call.
/// @param call the builtin call instruction
/// @returns the replacement value
@@ -282,6 +327,36 @@
return result;
}
+ /// Polyfill an `extractBits()` builtin call.
+ /// @param call the builtin call instruction
+ /// @returns the replacement value
+ ir::Value* ExtractBits(ir::CoreBuiltinCall* call) {
+ auto* offset = call->Args()[1];
+ auto* count = call->Args()[2];
+
+ switch (config.extract_bits) {
+ case BuiltinPolyfillLevel::kClampOrRangeCheck: {
+ b.InsertBefore(call, [&] {
+ // Replace:
+ // extractBits(e, offset, count)
+ // With:
+ // let o = min(offset, 32);
+ // let c = min(count, w - o);
+ // extractBits(e, o, c);
+ auto* o = b.Call(ty.u32(), core::BuiltinFn::kMin, offset, 32_u);
+ auto* c = b.Call(ty.u32(), core::BuiltinFn::kMin, count,
+ b.Subtract(ty.u32(), 32_u, o));
+ call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 1, o->Result());
+ call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 2, c->Result());
+ });
+ return call->Result();
+ }
+ default:
+ TINT_UNIMPLEMENTED() << "extractBits polyfill level";
+ }
+ return nullptr;
+ }
+
/// Polyfill a `firstLeadingBit()` builtin call.
/// @param call the builtin call instruction
/// @returns the replacement value
@@ -406,6 +481,36 @@
return result;
}
+ /// Polyfill an `insertBits()` builtin call.
+ /// @param call the builtin call instruction
+ /// @returns the replacement value
+ ir::Value* InsertBits(ir::CoreBuiltinCall* call) {
+ auto* offset = call->Args()[2];
+ auto* count = call->Args()[3];
+
+ switch (config.insert_bits) {
+ case BuiltinPolyfillLevel::kClampOrRangeCheck: {
+ b.InsertBefore(call, [&] {
+ // Replace:
+ // insertBits(e, offset, count)
+ // With:
+ // let o = min(offset, 32);
+ // let c = min(count, w - o);
+ // insertBits(e, o, c);
+ auto* o = b.Call(ty.u32(), core::BuiltinFn::kMin, offset, 32_u);
+ auto* c = b.Call(ty.u32(), core::BuiltinFn::kMin, count,
+ b.Subtract(ty.u32(), 32_u, o));
+ call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 2, o->Result());
+ call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 3, c->Result());
+ });
+ return call->Result();
+ }
+ default:
+ TINT_UNIMPLEMENTED() << "insertBits polyfill level";
+ }
+ return nullptr;
+ }
+
/// Polyfill a `saturate()` builtin call.
/// @param call the builtin call instruction
/// @returns the replacement value
diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill.h b/src/tint/lang/core/ir/transform/builtin_polyfill.h
index da24f49..4115f62 100644
--- a/src/tint/lang/core/ir/transform/builtin_polyfill.h
+++ b/src/tint/lang/core/ir/transform/builtin_polyfill.h
@@ -26,16 +26,32 @@
namespace tint::core::ir::transform {
+/// Enumerator of polyfill levels.
+enum class BuiltinPolyfillLevel {
+ /// No polyfill needed, supported by the backend.
+ kNone,
+ /// Clamp or range check the parameters.
+ kClampOrRangeCheck,
+ /// Polyfill the entire function.
+ kFull,
+};
+
/// The set of polyfills that should be applied.
struct BuiltinPolyfillConfig {
+ /// Should `clamp()` be polyfilled for integer values?
+ bool clamp_int = false;
/// Should `countLeadingZeros()` be polyfilled?
bool count_leading_zeros = false;
/// Should `countTrailingZeros()` be polyfilled?
bool count_trailing_zeros = false;
+ /// How should `extractBits()` be polyfilled?
+ BuiltinPolyfillLevel extract_bits = BuiltinPolyfillLevel::kNone;
/// Should `firstLeadingBit()` be polyfilled?
bool first_leading_bit = false;
/// Should `firstTrailingBit()` be polyfilled?
bool first_trailing_bit = false;
+ /// How should `insertBits()` be polyfilled?
+ BuiltinPolyfillLevel insert_bits = BuiltinPolyfillLevel::kNone;
/// Should `saturate()` be polyfilled?
bool saturate = false;
/// Should `textureSampleBaseClampToEdge()` be polyfilled for texture_2d<f32> textures?
diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
index 869c89c..4e141ab 100644
--- a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
+++ b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
@@ -596,6 +596,148 @@
EXPECT_EQ(expect, str());
}
+TEST_F(IR_BuiltinPolyfillTest, ExtractBits_NoPolyfill) {
+ Build(core::BuiltinFn::kExtractBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %result:u32 = extractBits %arg, %arg_1, %arg_2
+ ret %result
+ }
+}
+)";
+ auto* expect = src;
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.extract_bits = BuiltinPolyfillLevel::kNone;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, ExtractBits_ClampArgs_U32) {
+ Build(core::BuiltinFn::kExtractBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %result:u32 = extractBits %arg, %arg_1, %arg_2
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %5:u32 = min %arg_1, 32u
+ %6:u32 = sub 32u, %5
+ %7:u32 = min %arg_2, %6
+ %result:u32 = extractBits %arg, %5, %7
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.extract_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, ExtractBits_ClampArgs_I32) {
+ Build(core::BuiltinFn::kExtractBits, ty.i32(), Vector{ty.i32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:i32, %arg_1:u32, %arg_2:u32):i32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %result:i32 = extractBits %arg, %arg_1, %arg_2
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:i32, %arg_1:u32, %arg_2:u32):i32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %5:u32 = min %arg_1, 32u
+ %6:u32 = sub 32u, %5
+ %7:u32 = min %arg_2, %6
+ %result:i32 = extractBits %arg, %5, %7
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.extract_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, ExtractBits_ClampArgs_Vec2U32) {
+ Build(core::BuiltinFn::kExtractBits, ty.vec2<u32>(),
+ Vector{ty.vec2<u32>(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:vec2<u32>, %arg_1:u32, %arg_2:u32):vec2<u32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %result:vec2<u32> = extractBits %arg, %arg_1, %arg_2
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:vec2<u32>, %arg_1:u32, %arg_2:u32):vec2<u32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %5:u32 = min %arg_1, 32u
+ %6:u32 = sub 32u, %5
+ %7:u32 = min %arg_2, %6
+ %result:vec2<u32> = extractBits %arg, %5, %7
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.extract_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, ExtractBits_ClampArgs_Vec4I32) {
+ Build(core::BuiltinFn::kExtractBits, ty.vec4<i32>(),
+ Vector{ty.vec4<i32>(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:vec4<i32>, %arg_1:u32, %arg_2:u32):vec4<i32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %result:vec4<i32> = extractBits %arg, %arg_1, %arg_2
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:vec4<i32>, %arg_1:u32, %arg_2:u32):vec4<i32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg'
+ %b1 = block {
+ %5:u32 = min %arg_1, 32u
+ %6:u32 = sub 32u, %5
+ %7:u32 = min %arg_2, %6
+ %result:vec4<i32> = extractBits %arg, %5, %7
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.extract_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
TEST_F(IR_BuiltinPolyfillTest, FirstLeadingBit_NoPolyfill) {
Build(core::BuiltinFn::kFirstLeadingBit, ty.u32(), Vector{ty.u32()});
auto* src = R"(
@@ -1058,6 +1200,148 @@
EXPECT_EQ(expect, str());
}
+TEST_F(IR_BuiltinPolyfillTest, InsertBits_NoPolyfill) {
+ Build(core::BuiltinFn::kInsertBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %result:u32 = insertBits %arg, %arg_1, %arg_2, %arg_3
+ ret %result
+ }
+}
+)";
+ auto* expect = src;
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.insert_bits = BuiltinPolyfillLevel::kNone;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, InsertBits_ClampArgs_U32) {
+ Build(core::BuiltinFn::kInsertBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %result:u32 = insertBits %arg, %arg_1, %arg_2, %arg_3
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %6:u32 = min %arg_2, 32u
+ %7:u32 = sub 32u, %6
+ %8:u32 = min %arg_3, %7
+ %result:u32 = insertBits %arg, %arg_1, %6, %8
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.insert_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, InsertBits_ClampArgs_I32) {
+ Build(core::BuiltinFn::kInsertBits, ty.i32(), Vector{ty.i32(), ty.i32(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %result:i32 = insertBits %arg, %arg_1, %arg_2, %arg_3
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %6:u32 = min %arg_2, 32u
+ %7:u32 = sub 32u, %6
+ %8:u32 = min %arg_3, %7
+ %result:i32 = insertBits %arg, %arg_1, %6, %8
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.insert_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, InsertBits_ClampArgs_Vec2U32) {
+ Build(core::BuiltinFn::kInsertBits, ty.vec2<u32>(),
+ Vector{ty.vec2<u32>(), ty.vec2<u32>(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:vec2<u32>, %arg_1:vec2<u32>, %arg_2:u32, %arg_3:u32):vec2<u32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %result:vec2<u32> = insertBits %arg, %arg_1, %arg_2, %arg_3
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:vec2<u32>, %arg_1:vec2<u32>, %arg_2:u32, %arg_3:u32):vec2<u32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %6:u32 = min %arg_2, 32u
+ %7:u32 = sub 32u, %6
+ %8:u32 = min %arg_3, %7
+ %result:vec2<u32> = insertBits %arg, %arg_1, %6, %8
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.insert_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_BuiltinPolyfillTest, InsertBits_ClampArgs_Vec4I32) {
+ Build(core::BuiltinFn::kInsertBits, ty.vec4<i32>(),
+ Vector{ty.vec4<i32>(), ty.vec4<i32>(), ty.u32(), ty.u32()});
+ auto* src = R"(
+%foo = func(%arg:vec4<i32>, %arg_1:vec4<i32>, %arg_2:u32, %arg_3:u32):vec4<i32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %result:vec4<i32> = insertBits %arg, %arg_1, %arg_2, %arg_3
+ ret %result
+ }
+}
+)";
+ auto* expect = R"(
+%foo = func(%arg:vec4<i32>, %arg_1:vec4<i32>, %arg_2:u32, %arg_3:u32):vec4<i32> -> %b1 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
+ %b1 = block {
+ %6:u32 = min %arg_2, 32u
+ %7:u32 = sub 32u, %6
+ %8:u32 = min %arg_3, %7
+ %result:vec4<i32> = insertBits %arg, %arg_1, %6, %8
+ ret %result
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ BuiltinPolyfillConfig config;
+ config.insert_bits = BuiltinPolyfillLevel::kClampOrRangeCheck;
+ Run(BuiltinPolyfill, config);
+ EXPECT_EQ(expect, str());
+}
+
TEST_F(IR_BuiltinPolyfillTest, TextureSampleBaseClampToEdge_2d_f32_NoPolyfill) {
auto* texture_ty =
ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32());
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access.cc b/src/tint/lang/core/ir/transform/direct_variable_access.cc
new file mode 100644
index 0000000..5939b82
--- /dev/null
+++ b/src/tint/lang/core/ir/transform/direct_variable_access.cc
@@ -0,0 +1,671 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "src/tint/lang/core/ir/transform/direct_variable_access.h"
+
+#include <string>
+#include <utility>
+
+#include "src/tint/lang/core/ir/builder.h"
+#include "src/tint/lang/core/ir/clone_context.h"
+#include "src/tint/lang/core/ir/module.h"
+#include "src/tint/lang/core/ir/traverse.h"
+#include "src/tint/lang/core/ir/user_call.h"
+#include "src/tint/lang/core/ir/validator.h"
+#include "src/tint/lang/core/ir/var.h"
+#include "src/tint/utils/containers/reverse.h"
+
+using namespace tint::core::fluent_types; // NOLINT
+using namespace tint::core::number_suffixes; // NOLINT
+
+namespace tint::core::ir::transform {
+namespace {
+
+/// An access root, originating from a module-scope var.
+/// These roots are not passed by parameter, but instead the callee references the module-scope var
+/// directly.
+struct RootModuleScopeVar {
+ /// The module-scope var
+ Var* var = nullptr;
+
+ /// @return a hash value for this object
+ uint64_t HashCode() const { return Hash(var); }
+
+ /// Inequality operator
+ bool operator!=(const RootModuleScopeVar& other) const { return var != other.var; }
+};
+
+/// An access root, originating from a pointer parameter or function-scope var.
+/// These roots are passed by pointer parameter.
+struct RootPtrParameter {
+ /// The parameter pointer type
+ const type::Pointer* type = nullptr;
+
+ /// @return a hash value for this object
+ uint64_t HashCode() const { return Hash(type); }
+
+ /// Inequality operator
+ bool operator!=(const RootPtrParameter& other) const { return type != other.type; }
+};
+
+/// An access root. Either a RootModuleScopeVar or RootPtrParameter.
+using AccessRoot = std::variant<RootModuleScopeVar, RootPtrParameter>;
+
+/// MemberAccess is an access operator to a struct member.
+struct MemberAccess {
+ /// The member being accessed
+ const type::StructMember* member;
+
+ /// @return a hash member for this object
+ uint64_t HashCode() const { return Hash(member); }
+
+ /// Inequality operator
+ bool operator!=(const MemberAccess& other) const { return member != other.member; }
+};
+
+/// IndexAccess is an access operator to an array element or matrix column.
+/// The ordered list of indices is passed by parameter.
+struct IndexAccess {
+ /// @return a hash value for this object
+ uint64_t HashCode() const { return 42; }
+
+ /// Inequality operator
+ bool operator!=(const IndexAccess&) const { return false; }
+};
+
+/// An access operation. Either a MemberAccess or IndexAccess.
+using AccessOp = std::variant<MemberAccess, IndexAccess>;
+
+/// A AccessShape describes the static "path" from a root variable to an element within the
+/// variable.
+///
+/// Functions that have pointer parameters which need transforming will be forked into one or more
+/// 'variants'. Each variant has different AccessShapes for the pointer parameters - the transform
+/// will only emit one variant when the shapes of the pointer parameter accesses match.
+///
+/// Array accessors index expressions are held externally to the AccessShape, so
+/// AccessShape will be considered equal even if the array or matrix index values differ.
+///
+/// For example, consider the following:
+///
+/// ```
+/// struct A {
+/// x : array<i32, 8>,
+/// y : u32,
+/// };
+/// struct B {
+/// x : i32,
+/// y : array<A, 4>
+/// };
+/// var<workgroup> C : B;
+/// ```
+///
+/// The following AccessShape would describe the following:
+///
+/// +====================================+===============+=================================+
+/// | AccessShape | Type | Expression |
+/// +====================================+===============+=================================+
+/// | [ Var 'C', MemberAccess 'x' ] | i32 | C.x |
+/// +------------------------------------+---------------+---------------------------------+
+/// | [ Var 'C', MemberAccess 'y' ] | array<A, 4> | C.y |
+/// +------------------------------------+---------------+---------------------------------+
+/// | [ Var 'C', MemberAccess 'y', | A | C.y[indices[0]] |
+/// | IndexAccess ] | | |
+/// +------------------------------------+---------------+---------------------------------+
+/// | [ Var 'C', MemberAccess 'y', | array<i32, 8> | C.y[indices[0]].x |
+/// | IndexAccess, MemberAccess 'x' ] | | |
+/// +------------------------------------+---------------+---------------------------------+
+/// | [ Var 'C', MemberAccess 'y', | i32 | C.y[indices[0]].x[indices[1]] |
+/// | IndexAccess, MemberAccess 'x', | | |
+/// | IndexAccess ] | | |
+/// +------------------------------------+---------------+---------------------------------+
+/// | [ Var 'C', MemberAccess 'y', | u32 | C.y[indices[0]].y |
+/// | IndexAccess, MemberAccess 'y' ] | | |
+/// +------------------------------------+---------------+---------------------------------+
+///
+/// Where: `indices` is the AccessChain::indices.
+struct AccessShape {
+ /// The access root.
+ AccessRoot root;
+ /// The access operations.
+ Vector<AccessOp, 8> ops;
+
+ /// @returns the number of IndexAccess operations in #ops.
+ uint32_t NumIndexAccesses() const {
+ uint32_t count = 0;
+ for (auto& op : ops) {
+ if (std::holds_alternative<IndexAccess>(op)) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ /// @return a hash value for this object
+ uint64_t HashCode() const { return Hash(root, ops); }
+
+ /// Inequality operator
+ bool operator!=(const AccessShape& other) const {
+ return root != other.root || ops != other.ops;
+ }
+};
+
+/// AccessChain describes a chain of access expressions originating from a variable.
+struct AccessChain {
+ /// The shape of the access chain
+ AccessShape shape;
+ /// The originating pointer
+ Value* root_ptr = nullptr;
+ /// The array of dynamic indices
+ Vector<Value*, 8> indices;
+};
+
+/// A variant signature describes the access shape of all the function's pointer parameters.
+/// This is a map of pointer parameter index to access shape.
+using VariantSignature = Hashmap<size_t, AccessShape, 4>;
+
+/// FnInfo describes a function that has pointer parameters which need replacing.
+/// This function will be replaced by zero, one or many variants. Each variant will have a unique
+/// access shape for the function's the pointer arguments.
+struct FnInfo {
+ /// A map of variant signature to the variant's unique IR function.
+ Hashmap<VariantSignature, Function*, 4> variants_by_sig;
+ /// The order to emit the variants in the final module.
+ Vector<Function*, 4> ordered_variants;
+};
+
+/// FnVariant describes a unique variant of a function that has pointer parameters that need
+/// replacing.
+struct FnVariant {
+ /// The signature of the variant.
+ VariantSignature signature;
+ /// The IR function for this variant.
+ Function* fn = nullptr;
+ /// The function information of the original function that this variant is based off.
+ FnInfo* info = nullptr;
+};
+
+/// PIMPL state for the transform.
+struct State {
+ /// The IR module.
+ Module& ir;
+
+ /// The transform options
+ const DirectVariableAccessOptions& options;
+
+ /// The IR builder.
+ Builder b{ir};
+
+ /// The type manager.
+ core::type::Manager& ty{ir.Types()};
+
+ /// The symbol table.
+ SymbolTable& sym{ir.symbols};
+
+ /// The functions that have pointer parameters that need transforming.
+ /// These functions will be replaced with zero, one or many forked variants.
+ Hashmap<ir::Function*, FnInfo*, 8> need_forking{};
+
+ /// Queue of variants that need building
+ Vector<FnVariant, 8> variants_to_build{};
+
+ /// Allocator for FnInfo
+ BlockAllocator<FnInfo> fn_info_allocator{};
+
+ /// Process the module.
+ void Process() {
+ // Make a copy of all the functions in the IR module.
+ auto input_fns = ir.functions;
+
+ // Populate #need_forking
+ GatherFnsThatNeedForking();
+
+ // Transform the functions that make calls to #need_forking, which aren't in #need_forking
+ // themselves.
+ BuildRootFns();
+
+ // Build variants of the functions in #need_forking.
+ BuildFnVariants();
+
+ // Rebuild ir.functions.
+ EmitFunctions(input_fns);
+ }
+
+ /// Populates #need_forking with all the functions that have pointer parameters which need
+ /// transforming. These functions will be replaced with variants based on the access shapes.
+ void GatherFnsThatNeedForking() {
+ for (auto* fn : ir.functions) {
+ for (auto* param : fn->Params()) {
+ if (ParamNeedsTransforming(param)) {
+ need_forking.Add(fn, fn_info_allocator.Create());
+ break;
+ }
+ }
+ }
+ }
+
+ /// Adjusts the calls of all the functions that make calls to #need_forking, which aren't in
+ /// #need_forking themselves. This populates #variants_to_build with the called functions.
+ void BuildRootFns() {
+ for (auto* fn : ir.functions) {
+ if (!need_forking.Contains(fn)) {
+ TransformCalls(fn);
+ }
+ }
+ }
+
+ /// Applies the necessary transformations to all the pointer arguments of calls made to
+ /// functions in #need_forking. Also populates #variants_to_build with the variants of the
+ /// callee functions.
+ /// @param fn the function to transform
+ void TransformCalls(Function* fn) {
+ // For all the function calls in the function...
+ Traverse(fn->Block(), [&](UserCall* call) {
+ auto* target = call->Target();
+ auto target_info = need_forking.Get(target);
+ if (!target_info) {
+ // Not a call to a function in #need_forking. Leave alone.
+ return;
+ }
+
+ // Found a call to a function in #need_forking.
+ // This call needs transforming to call the generated variant.
+
+ // New arguments to the call. This includes transformed and untransformed arguments.
+ Vector<Value*, 8> new_args;
+
+ // Pointer arguments that are being replaced.
+ Vector<Value*, 8> replaced_args;
+
+ // Signature of the callee variant
+ VariantSignature signature;
+
+ // For each argument / parameter...
+ for (size_t i = 0, n = call->Args().Length(); i < n; i++) {
+ auto* arg = call->Args()[i];
+ auto* param = target->Params()[i];
+ if (ParamNeedsTransforming(param)) {
+ // This argument needs replacing with:
+ // * Nothing: root is a module-scope var and the access chain has no indicies.
+ // * A single pointer argument to the root variable: The root is a pointer
+ // parameter or a function-scoped variable, and the access chain has no
+ // indicies.
+ // * A single indices array argument: The root is a module-scope var and the
+ // access chain has indices.
+ // * Both a pointer argument and indices array argument: The root is a pointer
+ // parameter or a function-scoped variable and the access chain has indices.
+ b.InsertBefore(call, [&] {
+ // Get the access chain for the pointer argument.
+ auto chain = AccessChainFor(arg);
+ // If the root is not a module-scope variable, then pass this root pointer
+ // as an argument.
+ if (std::holds_alternative<RootPtrParameter>(chain.shape.root)) {
+ new_args.Push(chain.root_ptr);
+ }
+ // If the chain access contains indices, then pass these as an array of u32.
+ if (size_t array_len = chain.indices.Length(); array_len > 0) {
+ auto* array = ty.array(ty.u32(), static_cast<uint32_t>(array_len));
+ auto* indices = b.Construct(array, std::move(chain.indices));
+ new_args.Push(indices->Result());
+ }
+ // Record the parameter shape for the variant's signature.
+ signature.Add(i, chain.shape);
+ });
+ // Record that this pointer argument has been replaced.
+ replaced_args.Push(arg);
+ } else {
+ // Argument does not need transformation.
+ // Push the existing argument to new_args.
+ new_args.Push(arg);
+ }
+ }
+
+ // Replace the call's arguments with new_args.
+ call->SetArgs(std::move(new_args));
+
+ // Clean up instructions that provided the now unused argument values.
+ for (auto* old_arg : replaced_args) {
+ DeleteDeadInstructions(old_arg);
+ }
+
+ // Look to see if this callee signature already has a variant created.
+ auto* new_target = (*target_info)->variants_by_sig.GetOrCreate(signature, [&] {
+ // New signature.
+
+ // Clone the original function to seed the new variant.
+ auto* variant_fn = CloneContext{ir}.Clone(target);
+ (*target_info)->ordered_variants.Push(variant_fn);
+
+ // Build a unique name for the variant.
+ if (auto fn_name = ir.NameOf(variant_fn); fn_name.IsValid()) {
+ StringStream variant_name;
+ variant_name << fn_name.NameView();
+ auto params = signature.Keys().Sort();
+ for (auto param_idx : params) {
+ variant_name << "_" << AccessShapeName(*signature.Get(param_idx));
+ }
+ ir.SetName(variant_fn, variant_name.str());
+ }
+
+ // Create an entry for the variant, and add it to the queue of variants that need to
+ // be built. We don't do this here to avoid unbounded stack usage.
+ variants_to_build.Push(FnVariant{/* signature */ signature,
+ /* fn */ variant_fn,
+ /* info */ *target_info});
+ return variant_fn;
+ });
+
+ // Repoint the target of the call to the variant.
+ call->SetTarget(new_target);
+ });
+ }
+
+ /// Builds all the variants in #variants_to_build by:
+ /// * Replacing the pointer parameters with zero, one or two parameters (root pointer, indices).
+ /// * Transforming any calls made by that variant to other functions found in #need_forking.
+ /// Note: The transformation of calls can add more variants to #variants_to_build.
+ /// BuildFnVariants() will continue to build variants until #variants_to_build is empty.
+ void BuildFnVariants() {
+ while (!variants_to_build.IsEmpty()) {
+ auto variant = variants_to_build.Pop();
+ BuildFnVariantParams(variant);
+ TransformCalls(variant.fn);
+ }
+ }
+
+ /// Walks the instructions that built #value to obtain the root variable and the pointer
+ /// accesses.
+ /// @param value the pointer value to get the access chain for
+ /// @return an AccessChain
+ AccessChain AccessChainFor(Value* value) {
+ AccessChain chain;
+ while (value) {
+ TINT_ASSERT(value->Alive());
+ value = tint::Switch(
+ value, //
+ [&](InstructionResult* res) {
+ // value was emitted by an instruction
+ auto* inst = res->Source();
+ return tint::Switch(
+ inst,
+ [&](Access* access) {
+ // The AccessOp of this access instruction
+ Vector<AccessOp, 8> ops;
+ // The ordered, non-member accesses performed by this access instruction
+ Vector<Value*, 8> indices;
+ // The pointee-type that each access is being performed on
+ auto* obj_ty = access->Object()->Type()->UnwrapPtr();
+
+ // For each access operation...
+ for (auto idx : access->Indices()) {
+ if (auto* str = obj_ty->As<type::Struct>()) {
+ // Struct type accesses must be constant, representing the index
+ // of the member being accessed.
+ TINT_ASSERT(idx->Is<Constant>());
+ auto i = idx->As<Constant>()->Value()->ValueAs<uint32_t>();
+ auto* member = str->Members()[i];
+ ops.Push(MemberAccess{member});
+ obj_ty = member->Type();
+ continue;
+ }
+
+ // Array or matrix access.
+ // Convert index to u32 if it isn't already.
+ if (!idx->Type()->Is<type::U32>()) {
+ idx = b.Convert(ty.u32(), idx)->Result();
+ }
+
+ ops.Push(IndexAccess{});
+ indices.Push(idx);
+ obj_ty = obj_ty->Elements().type;
+ }
+
+ // Push the ops and indices in reverse order to the chain. This is done
+ // so we can continue to walk the IR values and push accesses (without
+ // insertion) that bring us closer to the pointer root. These are
+ // reversed again once the root variable is found.
+ for (auto& op : Reverse(ops)) {
+ chain.shape.ops.Push(op);
+ }
+ for (auto& idx : Reverse(indices)) {
+ chain.indices.Push(idx);
+ }
+
+ TINT_ASSERT(obj_ty == access->Result()->Type()->UnwrapPtr());
+ return access->Object();
+ },
+ [&](Var* var) {
+ // A 'var' is a pointer root.
+ if (var->Block() == ir.root_block) {
+ // Root pointer is a module-scope 'var'
+ chain.shape.root = RootModuleScopeVar{var};
+ } else {
+ // Root pointer is a function-scope 'var'
+ chain.shape.root =
+ RootPtrParameter{var->Result()->Type()->As<type::Pointer>()};
+ }
+ chain.root_ptr = var->Result();
+ return nullptr;
+ },
+ [&](Let* let) { return let->Value(); },
+ [&](Default) {
+ TINT_ICE() << "unhandled instruction type: "
+ << (inst ? inst->TypeInfo().name : "<null>");
+ return nullptr;
+ });
+ },
+ [&](FunctionParam* param) {
+ // Root pointer is a parameter of the caller
+ chain.shape.root = RootPtrParameter{param->Type()->As<type::Pointer>()};
+ chain.root_ptr = param;
+ return nullptr;
+ },
+ [&](Default) {
+ TINT_ICE() << "unhandled value type: "
+ << (value ? value->TypeInfo().name : "<null>");
+ return nullptr;
+ });
+ }
+
+ // Reverse the chain's ops and indices. See above for why.
+ chain.shape.ops.Reverse();
+ chain.indices.Reverse();
+
+ return chain;
+ }
+
+ /// Replaces the pointer parameters that need transforming of the variant function @p variant.
+ /// Instructions are inserted at the top of the @p variant function block to reconstruct the
+ /// pointer parameters from the access chain using the root pointer and access ops.
+ /// @param variant the variant function to transform
+ void BuildFnVariantParams(const FnVariant& variant) {
+ // Insert new instructions at the top of the function block...
+ b.InsertBefore(variant.fn->Block()->Front(), [&] {
+ // The replacement parameters for the variant function
+ Vector<ir::FunctionParam*, 8> new_params;
+ const auto& old_params = variant.fn->Params();
+ // For each parameter in the original function...
+ for (size_t param_idx = 0; param_idx < old_params.Length(); param_idx++) {
+ auto* old_param = old_params[param_idx];
+ if (!ParamNeedsTransforming(old_param)) {
+ // Parameter does not need transforming.
+ new_params.Push(old_param);
+ continue;
+ }
+
+ // Pointer parameter that needs transforming
+ // Grab the access shape of the pointer parameter from the signature
+ auto shape = variant.signature.Get(param_idx);
+ // The root pointer value
+ Value* root_ptr = nullptr;
+
+ // Build the root pointer parameter, if required.
+ FunctionParam* root_ptr_param = nullptr;
+ if (auto* ptr_param = std::get_if<RootPtrParameter>(&shape->root)) {
+ // Root pointer is passed as a parameter
+ root_ptr_param = b.FunctionParam(ptr_param->type);
+ new_params.Push(root_ptr_param);
+ root_ptr = root_ptr_param;
+ } else if (auto* global = std::get_if<RootModuleScopeVar>(&shape->root)) {
+ // Root pointer is a module-scope var
+ root_ptr = global->var->Result();
+ } else {
+ TINT_ICE() << "unhandled AccessShape root variant";
+ }
+
+ // Build the access indices parameter, if required.
+ ir::FunctionParam* indices_param = nullptr;
+ if (uint32_t n = shape->NumIndexAccesses(); n > 0) {
+ // Indices are passed as an array of u32
+ indices_param = b.FunctionParam(ty.array(ty.u32(), n));
+ new_params.Push(indices_param);
+ }
+
+ // Generate names for the new parameter(s) based on the replaced parameter name.
+ if (auto param_name = ir.NameOf(old_param); param_name.IsValid()) {
+ // Propagate old parameter name to the new parameters
+ if (root_ptr_param) {
+ ir.SetName(root_ptr_param, param_name.Name() + "_root");
+ }
+ if (indices_param) {
+ ir.SetName(indices_param, param_name.Name() + "_indices");
+ }
+ }
+
+ // Rebuild the pointer from the root pointer and accesses.
+ uint32_t index_index = 0;
+ auto chain = Transform(shape->ops, [&](const AccessOp& op) -> Value* {
+ if (auto* m = std::get_if<MemberAccess>(&op)) {
+ return b.Constant(u32(m->member->Index()));
+ }
+ auto* access = b.Access(ty.u32(), indices_param, u32(index_index++));
+ return access->Result();
+ });
+ auto* access = b.Access(old_param->Type(), root_ptr, std::move(chain));
+
+ // Replace the now removed parameter value with the access instruction
+ old_param->ReplaceAllUsesWith(access->Result());
+ old_param->Destroy();
+ }
+
+ // Replace the function's parameters
+ variant.fn->SetParams(std::move(new_params));
+ });
+ }
+
+ /// Repopulates #ir.functions with the functions in #need_forking replaced with their generated
+ /// variants.
+ /// @param input_fns the content of #ir.functions before transformation began.
+ void EmitFunctions(VectorRef<Function*> input_fns) {
+ ir.functions.Clear();
+ for (auto* fn : input_fns) {
+ if (auto info = need_forking.Get(fn)) {
+ for (auto variant : (*info)->ordered_variants) {
+ ir.functions.Push(variant);
+ }
+ } else {
+ ir.functions.Push(fn);
+ }
+ }
+ }
+
+ /// @returns a string describing the given AccessShape, used to suffix the generated function
+ /// variants.
+ std::string AccessShapeName(const AccessShape& shape) {
+ StringStream ss;
+
+ if (auto* global = std::get_if<RootModuleScopeVar>(&shape.root)) {
+ ss << ir.NameOf(global->var).NameView();
+ } else {
+ ss << "P";
+ }
+
+ for (auto& op : shape.ops) {
+ ss << "_";
+
+ if (std::holds_alternative<IndexAccess>(op)) {
+ /// The op uses an index taken from an array parameter.
+ ss << "X";
+ continue;
+ }
+
+ if (auto* access = std::get_if<MemberAccess>(&op); TINT_LIKELY(access)) {
+ ss << access->member->Name().NameView();
+ continue;
+ }
+
+ TINT_ICE() << "unhandled variant for access chain";
+ break;
+ }
+ return ss.str();
+ }
+
+ /// @return true if @p param is a pointer parameter that requires transforming, based on the
+ /// address space and transform options.
+ /// @param param the function parameter
+ bool ParamNeedsTransforming(FunctionParam* param) const {
+ if (auto* ptr = param->Type()->As<type::Pointer>()) {
+ switch (ptr->AddressSpace()) {
+ case core::AddressSpace::kStorage:
+ case core::AddressSpace::kUniform:
+ case core::AddressSpace::kWorkgroup:
+ return true;
+ case core::AddressSpace::kFunction:
+ return options.transform_function;
+ case core::AddressSpace::kPrivate:
+ return options.transform_private;
+ default:
+ break;
+ }
+ }
+ return false;
+ }
+
+ /// Walks the instructions that built @p value, deleting those that are no longer used.
+ /// @param value the pointer value that was used as a now replaced pointer argument.
+ void DeleteDeadInstructions(ir::Value* value) {
+ // While value has no uses...
+ while (value && value->Usages().Count() == 0) {
+ auto* inst_res = value->As<InstructionResult>();
+ if (!inst_res) {
+ return; // Only instructions can be removed.
+ }
+ value = tint::Switch(
+ inst_res->Source(), //
+ [&](Access* access) {
+ TINT_DEFER(access->Destroy());
+ return access->Object();
+ },
+ [&](Let* let) {
+ TINT_DEFER(let->Destroy());
+ return let->Value();
+ });
+ }
+ }
+};
+
+} // namespace
+
+Result<SuccessType> DirectVariableAccess(Module& ir, const DirectVariableAccessOptions& options) {
+ auto result = ValidateAndDumpIfNeeded(ir, "DirectVariableAccess transform");
+ if (!result) {
+ return result;
+ }
+
+ State{ir, options}.Process();
+
+ return Success;
+}
+
+} // namespace tint::core::ir::transform
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access.h b/src/tint/lang/core/ir/transform/direct_variable_access.h
new file mode 100644
index 0000000..5f6917f
--- /dev/null
+++ b/src/tint/lang/core/ir/transform/direct_variable_access.h
@@ -0,0 +1,53 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_TINT_LANG_CORE_IR_TRANSFORM_DIRECT_VARIABLE_ACCESS_H_
+#define SRC_TINT_LANG_CORE_IR_TRANSFORM_DIRECT_VARIABLE_ACCESS_H_
+
+#include "src/tint/utils/result/result.h"
+
+// Forward declarations.
+namespace tint::core::ir {
+class Module;
+}
+
+namespace tint::core::ir::transform {
+
+/// DirectVariableAccessOptions adjusts the behaviour of the transform.
+struct DirectVariableAccessOptions {
+ /// If true, then 'private' sub-object pointer arguments will be transformed.
+ bool transform_private = false;
+ /// If true, then 'function' sub-object pointer arguments will be transformed.
+ bool transform_function = false;
+};
+
+/// DirectVariableAccess is a transform that transforms pointer parameters in the 'storage',
+/// 'uniform' and 'workgroup' address space so that they're accessed directly by the function,
+/// instead of being passed by pointer.
+///
+/// DirectVariableAccess works by creating specializations of functions that have pointer
+/// parameters, one specialization for each pointer argument's unique access chain 'shape' from a
+/// unique variable. Calls to specialized functions are transformed so that the pointer arguments
+/// are replaced with an array of access-chain indicies, and if the pointer is in the 'function' or
+/// 'private' address space, also with a pointer to the root object. For more information, see the
+/// comments in src/tint/lang/wgsl/ast/transform/direct_variable_access.cc.
+///
+/// @param module the module to transform
+/// @returns error diagnostics on failure
+Result<SuccessType> DirectVariableAccess(Module& module,
+ const DirectVariableAccessOptions& options);
+
+} // namespace tint::core::ir::transform
+
+#endif // SRC_TINT_LANG_CORE_IR_TRANSFORM_DIRECT_VARIABLE_ACCESS_H_
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access_test.cc b/src/tint/lang/core/ir/transform/direct_variable_access_test.cc
new file mode 100644
index 0000000..5bccb80
--- /dev/null
+++ b/src/tint/lang/core/ir/transform/direct_variable_access_test.cc
@@ -0,0 +1,4823 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "src/tint/lang/core/ir/transform/direct_variable_access.h"
+
+#include <utility>
+
+#include "src/tint/lang/core/ir/transform/helper_test.h"
+#include "src/tint/lang/core/type/array.h"
+#include "src/tint/lang/core/type/matrix.h"
+#include "src/tint/lang/core/type/pointer.h"
+#include "src/tint/lang/core/type/struct.h"
+
+#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
+#include "src/tint/lang/wgsl/reader/reader.h"
+#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
+#include "src/tint/lang/wgsl/writer/writer.h"
+
+namespace tint::core::ir::transform {
+namespace {
+
+using namespace tint::core::fluent_types; // NOLINT
+using namespace tint::core::number_suffixes; // NOLINT
+
+namespace {
+
+static constexpr DirectVariableAccessOptions kTransformPrivate = {
+ /* transform_private */ true,
+ /* transform_function */ false,
+};
+
+static constexpr DirectVariableAccessOptions kTransformFunction = {
+ /* transform_private */ false,
+ /* transform_function */ true,
+};
+
+} // namespace
+
+////////////////////////////////////////////////////////////////////////////////
+// remove uncalled
+////////////////////////////////////////////////////////////////////////////////
+namespace remove_uncalled {
+
+using IR_DirectVariableAccessTest_RemoveUncalled = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrUniform) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* u = b.Function("u", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<uniform, i32, read>());
+ u->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(u->Block(), [&] { b.Return(u, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%u = func(%pre:i32, %p:ptr<uniform, i32, read>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrStorage) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* s = b.Function("s", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<storage, i32, read>());
+ s->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(s->Block(), [&] { b.Return(s, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%s = func(%pre:i32, %p:ptr<storage, i32, read>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrWorkgroup) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* w = b.Function("w", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<workgroup, i32>());
+ w->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(w->Block(), [&] { b.Return(w, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%w = func(%pre:i32, %p:ptr<workgroup, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrPrivate_Disabled) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* f = b.Function("f", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ f->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%f = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrPrivate_Enabled) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* f = b.Function("f", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ f->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%f = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+)";
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrFunction_Disabled) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* f = b.Function("f", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<function, i32>());
+ f->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%f = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_RemoveUncalled, PtrFunction_Enabled) {
+ b.Append(b.ir.root_block, [&] { b.Var<private_>("keep_me", 42_i); });
+
+ auto* f = b.Function("f", ty.i32());
+ auto* p = b.FunctionParam("p", ty.ptr<function, i32>());
+ f->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
+
+ auto* src = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+%f = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+)";
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %keep_me:ptr<private, i32, read_write> = var, 42i
+}
+
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace remove_uncalled
+
+////////////////////////////////////////////////////////////////////////////////
+// pointer chains
+////////////////////////////////////////////////////////////////////////////////
+namespace pointer_chains_tests {
+
+using IR_DirectVariableAccessTest_PtrChains = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_PtrChains, ConstantIndices) {
+ Var* U = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>("U");
+ U->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.vec4<i32>());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<uniform, vec4<i32>, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* p0 = b.Let("p0", U);
+ auto* p1 = b.Access(ty.ptr<uniform, array<array<vec4<i32>, 8>, 8>, read>(), p0, 1_i);
+ b.ir.SetName(p1, "p1");
+ auto* p2 = b.Access(ty.ptr<uniform, array<vec4<i32>, 8>, read>(), p1, 2_i);
+ b.ir.SetName(p2, "p2");
+ auto* p3 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), p2, 3_i);
+ b.ir.SetName(p3, "p3");
+ b.Call(ty.vec4<i32>(), fn_a, 10_i, p3, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* fn_c = b.Function("c", ty.void_());
+ auto* fn_c_p =
+ b.FunctionParam("p", ty.ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>());
+ fn_c->SetParams({fn_c_p});
+ b.Append(fn_c->Block(), [&] {
+ auto* p0 = b.Let("p0", fn_c_p);
+ auto* p1 = b.Access(ty.ptr<uniform, array<array<vec4<i32>, 8>, 8>, read>(), p0, 1_i);
+ b.ir.SetName(p1, "p1");
+ auto* p2 = b.Access(ty.ptr<uniform, array<vec4<i32>, 8>, read>(), p1, 2_i);
+ b.ir.SetName(p2, "p2");
+ auto* p3 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), p2, 3_i);
+ b.ir.SetName(p3, "p3");
+ b.Call(ty.vec4<i32>(), fn_a, 10_i, p3, 20_i);
+ b.Return(fn_c);
+ });
+
+ auto* fn_d = b.Function("d", ty.void_());
+ b.Append(fn_d->Block(), [&] {
+ b.Call(ty.void_(), fn_c, U);
+ b.Return(fn_d);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:vec4<i32> = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %p0:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %U
+ %p1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0, 1i
+ %p2:ptr<uniform, array<vec4<i32>, 8>, read> = access %p1, 2i
+ %p3:ptr<uniform, vec4<i32>, read> = access %p2, 3i
+ %12:vec4<i32> = call %a, 10i, %p3, 20i
+ ret
+ }
+}
+%c = func(%p_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>):void -> %b4 { # %p_1: 'p'
+ %b4 = block {
+ %p0_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %p_1 # %p0_1: 'p0'
+ %p1_1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0_1, 1i # %p1_1: 'p1'
+ %p2_1:ptr<uniform, array<vec4<i32>, 8>, read> = access %p1_1, 2i # %p2_1: 'p2'
+ %p3_1:ptr<uniform, vec4<i32>, read> = access %p2_1, 3i # %p3_1: 'p3'
+ %19:vec4<i32> = call %a, 10i, %p3_1, 20i
+ ret
+ }
+}
+%d = func():void -> %b5 {
+ %b5 = block {
+ %21:void = call %c, %U
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect =
+ R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
+}
+
+%a_U_X_X_X = func(%pre:i32, %p_indices:array<u32, 3>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:u32 = access %p_indices, 1u
+ %8:u32 = access %p_indices, 2u
+ %9:ptr<uniform, vec4<i32>, read> = access %U, %6, %7, %8
+ %10:vec4<i32> = load %9
+ ret %10
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %12:u32 = convert 3i
+ %13:u32 = convert 2i
+ %14:u32 = convert 1i
+ %15:array<u32, 3> = construct %14, %13, %12
+ %16:vec4<i32> = call %a_U_X_X_X, 10i, %15, 20i
+ ret
+ }
+}
+%c_U = func():void -> %b4 {
+ %b4 = block {
+ %18:u32 = convert 3i
+ %19:u32 = convert 2i
+ %20:u32 = convert 1i
+ %21:array<u32, 3> = construct %20, %19, %18
+ %22:vec4<i32> = call %a_U_X_X_X, 10i, %21, 20i
+ ret
+ }
+}
+%d = func():void -> %b5 {
+ %b5 = block {
+ %24:void = call %c_U
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PtrChains, DynamicIndices) {
+ Var* U = nullptr;
+ Var* i = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>("U");
+ U->SetBindingPoint(0, 0);
+ i = b.Var<private_, i32>("i");
+ });
+
+ auto* fn_first = b.Function("first", ty.i32());
+ auto* fn_second = b.Function("second", ty.i32());
+ auto* fn_third = b.Function("third", ty.i32());
+ for (auto fn : {fn_first, fn_second, fn_third}) {
+ b.Append(fn->Block(), [&] {
+ b.Store(i, b.Add(ty.i32(), b.Load(i), 1_i));
+ b.Return(fn, b.Load(i));
+ });
+ }
+
+ auto* fn_a = b.Function("a", ty.vec4<i32>());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<uniform, vec4<i32>, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* p0 = b.Let("p0", U);
+ auto* first = b.Call(fn_first);
+ auto* p1 = b.Access(ty.ptr<uniform, array<array<vec4<i32>, 8>, 8>, read>(), p0, first);
+ b.ir.SetName(p1, "p1");
+ auto* second = b.Call(fn_second);
+ auto* third = b.Call(fn_third);
+ auto* p2 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), p1, second, third);
+ b.ir.SetName(p2, "p2");
+ b.Call(ty.vec4<i32>(), fn_a, 10_i, p2, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* fn_c = b.Function("c", ty.void_());
+ auto* fn_c_p =
+ b.FunctionParam("p", ty.ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>());
+ fn_c->SetParams({fn_c_p});
+ b.Append(fn_c->Block(), [&] {
+ auto* p0 = b.Let("p0", fn_c_p);
+ auto* first = b.Call(fn_first);
+ auto* p1 = b.Access(ty.ptr<uniform, array<array<vec4<i32>, 8>, 8>, read>(), p0, first);
+ b.ir.SetName(p1, "p1");
+ auto* second = b.Call(fn_second);
+ auto* third = b.Call(fn_third);
+ auto* p2 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), p1, second, third);
+ b.ir.SetName(p2, "p2");
+ b.Call(ty.vec4<i32>(), fn_a, 10_i, p2, 20_i);
+ b.Return(fn_c);
+ });
+
+ auto* fn_d = b.Function("d", ty.void_());
+ b.Append(fn_d->Block(), [&] {
+ b.Call(ty.void_(), fn_c, U);
+ b.Return(fn_d);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
+ %i:ptr<private, i32, read_write> = var
+}
+
+%first = func():i32 -> %b2 {
+ %b2 = block {
+ %4:i32 = load %i
+ %5:i32 = add %4, 1i
+ store %i, %5
+ %6:i32 = load %i
+ ret %6
+ }
+}
+%second = func():i32 -> %b3 {
+ %b3 = block {
+ %8:i32 = load %i
+ %9:i32 = add %8, 1i
+ store %i, %9
+ %10:i32 = load %i
+ ret %10
+ }
+}
+%third = func():i32 -> %b4 {
+ %b4 = block {
+ %12:i32 = load %i
+ %13:i32 = add %12, 1i
+ store %i, %13
+ %14:i32 = load %i
+ ret %14
+ }
+}
+%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> -> %b5 {
+ %b5 = block {
+ %19:vec4<i32> = load %p
+ ret %19
+ }
+}
+%b = func():void -> %b6 {
+ %b6 = block {
+ %p0:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %U
+ %22:i32 = call %first
+ %p1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0, %22
+ %24:i32 = call %second
+ %25:i32 = call %third
+ %p2:ptr<uniform, vec4<i32>, read> = access %p1, %24, %25
+ %27:vec4<i32> = call %a, 10i, %p2, 20i
+ ret
+ }
+}
+%c = func(%p_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>):void -> %b7 { # %p_1: 'p'
+ %b7 = block {
+ %p0_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %p_1 # %p0_1: 'p0'
+ %31:i32 = call %first
+ %p1_1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0_1, %31 # %p1_1: 'p1'
+ %33:i32 = call %second
+ %34:i32 = call %third
+ %p2_1:ptr<uniform, vec4<i32>, read> = access %p1_1, %33, %34 # %p2_1: 'p2'
+ %36:vec4<i32> = call %a, 10i, %p2_1, 20i
+ ret
+ }
+}
+%d = func():void -> %b8 {
+ %b8 = block {
+ %38:void = call %c, %U
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
+ %i:ptr<private, i32, read_write> = var
+}
+
+%first = func():i32 -> %b2 {
+ %b2 = block {
+ %4:i32 = load %i
+ %5:i32 = add %4, 1i
+ store %i, %5
+ %6:i32 = load %i
+ ret %6
+ }
+}
+%second = func():i32 -> %b3 {
+ %b3 = block {
+ %8:i32 = load %i
+ %9:i32 = add %8, 1i
+ store %i, %9
+ %10:i32 = load %i
+ ret %10
+ }
+}
+%third = func():i32 -> %b4 {
+ %b4 = block {
+ %12:i32 = load %i
+ %13:i32 = add %12, 1i
+ store %i, %13
+ %14:i32 = load %i
+ ret %14
+ }
+}
+%a_U_X_X_X = func(%pre:i32, %p_indices:array<u32, 3>, %post:i32):vec4<i32> -> %b5 {
+ %b5 = block {
+ %19:u32 = access %p_indices, 0u
+ %20:u32 = access %p_indices, 1u
+ %21:u32 = access %p_indices, 2u
+ %22:ptr<uniform, vec4<i32>, read> = access %U, %19, %20, %21
+ %23:vec4<i32> = load %22
+ ret %23
+ }
+}
+%b = func():void -> %b6 {
+ %b6 = block {
+ %25:i32 = call %first
+ %26:i32 = call %second
+ %27:i32 = call %third
+ %28:u32 = convert %26
+ %29:u32 = convert %27
+ %30:u32 = convert %25
+ %31:array<u32, 3> = construct %30, %28, %29
+ %32:vec4<i32> = call %a_U_X_X_X, 10i, %31, 20i
+ ret
+ }
+}
+%c_U = func():void -> %b7 {
+ %b7 = block {
+ %34:i32 = call %first
+ %35:i32 = call %second
+ %36:i32 = call %third
+ %37:u32 = convert %35
+ %38:u32 = convert %36
+ %39:u32 = convert %34
+ %40:array<u32, 3> = construct %39, %37, %38
+ %41:vec4<i32> = call %a_U_X_X_X, 10i, %40, 20i
+ ret
+ }
+}
+%d = func():void -> %b8 {
+ %b8 = block {
+ %43:void = call %c_U
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace pointer_chains_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'uniform' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace uniform_as_tests {
+
+using IR_DirectVariableAccessTest_UniformAS = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_UniformAS, Param_ptr_i32_read) {
+ Var* U = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var<uniform, i32, read>("U");
+ U->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<uniform, i32, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(fn_a, 10_i, U, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %U:ptr<uniform, i32, read> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<uniform, i32, read>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a, 10i, %U, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %U:ptr<uniform, i32, read> = var @binding_point(0, 0)
+}
+
+%a_U = func(%pre:i32, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %5:ptr<uniform, i32, read> = access %U
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a_U, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_UniformAS, Param_ptr_vec4i32_Via_array_DynamicRead) {
+ Var* U = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var<uniform, array<vec4<i32>, 8>, read>("U");
+ U->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.vec4<i32>());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<uniform, vec4<i32>, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* I = b.Let("I", 3_i);
+ auto* access = b.Access(ty.ptr<uniform, vec4<i32>, read>(), U, I);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:vec4<i32> = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %I:i32 = let 3i
+ %9:ptr<uniform, vec4<i32>, read> = access %U, %I
+ %10:vec4<i32> = call %a, 10i, %9, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %U:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 0)
+}
+
+%a_U_X = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:ptr<uniform, vec4<i32>, read> = access %U, %6
+ %8:vec4<i32> = load %7
+ ret %8
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %I:i32 = let 3i
+ %11:u32 = convert %I
+ %12:array<u32, 1> = construct %11
+ %13:vec4<i32> = call %a_U_X, 10i, %12, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_UniformAS, CallChaining) {
+ auto* Inner =
+ ty.Struct(mod.symbols.New("Inner"), {
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ auto* Outer =
+ ty.Struct(mod.symbols.New("Outer"), {
+ {mod.symbols.Register("arr"), ty.array(Inner, 4)},
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ Var* U = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var("U", ty.ptr<uniform, read>(Outer));
+ U->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_0 = b.Function("f0", ty.f32());
+ auto* fn_0_p = b.FunctionParam("p", ty.ptr<uniform, vec4<f32>, read>());
+ fn_0->SetParams({fn_0_p});
+ b.Append(fn_0->Block(), [&] { b.Return(fn_0, b.LoadVectorElement(fn_0_p, 0_u)); });
+
+ auto* fn_1 = b.Function("f1", ty.f32());
+ auto* fn_1_p = b.FunctionParam("p", ty.ptr<uniform, mat3x4<f32>, read>());
+ fn_1->SetParams({fn_1_p});
+ b.Append(fn_1->Block(), [&] {
+ auto* res = b.Var<function, f32>("res");
+ {
+ // res += f0(&(*p)[1]);
+ auto* call_0 = b.Call(fn_0, b.Access(ty.ptr<uniform, vec4<f32>, read>(), fn_1_p, 1_i));
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &(*p)[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<uniform, vec4<f32>, read>(), fn_1_p, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // res += f0(&U.arr[2].mat[1]);
+ auto* access = b.Access(ty.ptr<uniform, vec4<f32>, read>(), U, 0_u, 2_i, 0_u, 1_i);
+ auto* call_0 = b.Call(fn_0, access);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &U.arr[2].mat[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<uniform, vec4<f32>, read>(), U, 0_u, 2_i, 0_u, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+
+ b.Return(fn_1, b.Load(res));
+ });
+
+ auto* fn_2 = b.Function("f2", ty.f32());
+ auto* fn_2_p = b.FunctionParam("p", ty.ptr<uniform, read>(Inner));
+ fn_2->SetParams({fn_2_p});
+ b.Append(fn_2->Block(), [&] {
+ auto* p_mat = b.Access(ty.ptr<uniform, mat3x4<f32>, read>(), fn_2_p, 0_u);
+ b.ir.SetName(p_mat, "p_mat");
+ b.Return(fn_2, b.Call(fn_1, p_mat));
+ });
+
+ auto* fn_3 = b.Function("f3", ty.f32());
+ auto* fn_3_p0 = b.FunctionParam("p0", ty.ptr<uniform, read>(ty.array(Inner, 4)));
+ auto* fn_3_p1 = b.FunctionParam("p1", ty.ptr<uniform, mat3x4<f32>, read>());
+ fn_3->SetParams({fn_3_p0, fn_3_p1});
+ b.Append(fn_3->Block(), [&] {
+ auto* p0_inner = b.Access(ty.ptr<uniform, read>(Inner), fn_3_p0, 3_i);
+ b.ir.SetName(p0_inner, "p0_inner");
+ auto* call_0 = b.Call(ty.f32(), fn_2, p0_inner);
+ auto* call_1 = b.Call(ty.f32(), fn_1, fn_3_p1);
+ b.Return(fn_3, b.Add(ty.f32(), call_0, call_1));
+ });
+
+ auto* fn_4 = b.Function("f4", ty.f32());
+ auto* fn_4_p = b.FunctionParam("p", ty.ptr<uniform, read>(Outer));
+ fn_4->SetParams({fn_4_p});
+ b.Append(fn_4->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<uniform, read>(ty.array(Inner, 4)), fn_4_p, 0_u);
+ auto* access_1 = b.Access(ty.ptr<uniform, mat3x4<f32>, read>(), U, 1_u);
+ b.Return(fn_4, b.Call(ty.f32(), fn_3, access_0, access_1));
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(ty.f32(), fn_4, U);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %U:ptr<uniform, Outer, read> = var @binding_point(0, 0)
+}
+
+%f0 = func(%p:ptr<uniform, vec4<f32>, read>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = load_vector_element %p, 0u
+ ret %4
+ }
+}
+%f1 = func(%p_1:ptr<uniform, mat3x4<f32>, read>):f32 -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %res:ptr<function, f32, read_write> = var
+ %8:ptr<uniform, vec4<f32>, read> = access %p_1, 1i
+ %9:f32 = call %f0, %8
+ %10:f32 = load %res
+ %11:f32 = add %10, %9
+ store %res, %11
+ %p_vec:ptr<uniform, vec4<f32>, read> = access %p_1, 1i
+ %13:f32 = call %f0, %p_vec
+ %14:f32 = load %res
+ %15:f32 = add %14, %13
+ store %res, %15
+ %16:ptr<uniform, vec4<f32>, read> = access %U, 0u, 2i, 0u, 1i
+ %17:f32 = call %f0, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %p_vec_1:ptr<uniform, vec4<f32>, read> = access %U, 0u, 2i, 0u, 1i # %p_vec_1: 'p_vec'
+ %21:f32 = call %f0, %p_vec_1
+ %22:f32 = load %res
+ %23:f32 = add %22, %21
+ store %res, %23
+ %24:f32 = load %res
+ ret %24
+ }
+}
+%f2 = func(%p_2:ptr<uniform, Inner, read>):f32 -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %p_mat:ptr<uniform, mat3x4<f32>, read> = access %p_2, 0u
+ %28:f32 = call %f1, %p_mat
+ ret %28
+ }
+}
+%f3 = func(%p0:ptr<uniform, array<Inner, 4>, read>, %p1:ptr<uniform, mat3x4<f32>, read>):f32 -> %b5 {
+ %b5 = block {
+ %p0_inner:ptr<uniform, Inner, read> = access %p0, 3i
+ %33:f32 = call %f2, %p0_inner
+ %34:f32 = call %f1, %p1
+ %35:f32 = add %33, %34
+ ret %35
+ }
+}
+%f4 = func(%p_3:ptr<uniform, Outer, read>):f32 -> %b6 { # %p_3: 'p'
+ %b6 = block {
+ %38:ptr<uniform, array<Inner, 4>, read> = access %p_3, 0u
+ %39:ptr<uniform, mat3x4<f32>, read> = access %U, 1u
+ %40:f32 = call %f3, %38, %39
+ ret %40
+ }
+}
+%b = func():void -> %b7 {
+ %b7 = block {
+ %42:f32 = call %f4, %U
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %U:ptr<uniform, Outer, read> = var @binding_point(0, 0)
+}
+
+%f0_U_mat_X = func(%p_indices:array<u32, 1>):f32 -> %b2 {
+ %b2 = block {
+ %4:u32 = access %p_indices, 0u
+ %5:ptr<uniform, vec4<f32>, read> = access %U, 1u, %4
+ %6:f32 = load_vector_element %5, 0u
+ ret %6
+ }
+}
+%f0_U_arr_X_mat_X = func(%p_indices_1:array<u32, 2>):f32 -> %b3 { # %p_indices_1: 'p_indices'
+ %b3 = block {
+ %9:u32 = access %p_indices_1, 0u
+ %10:u32 = access %p_indices_1, 1u
+ %11:ptr<uniform, vec4<f32>, read> = access %U, 0u, %9, 0u, %10
+ %12:f32 = load_vector_element %11, 0u
+ ret %12
+ }
+}
+%f1_U_mat = func():f32 -> %b4 {
+ %b4 = block {
+ %res:ptr<function, f32, read_write> = var
+ %15:u32 = convert 1i
+ %16:array<u32, 1> = construct %15
+ %17:f32 = call %f0_U_mat_X, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %20:u32 = convert 1i
+ %21:array<u32, 1> = construct %20
+ %22:f32 = call %f0_U_mat_X, %21
+ %23:f32 = load %res
+ %24:f32 = add %23, %22
+ store %res, %24
+ %25:u32 = convert 2i
+ %26:u32 = convert 1i
+ %27:array<u32, 2> = construct %25, %26
+ %28:f32 = call %f0_U_arr_X_mat_X, %27
+ %29:f32 = load %res
+ %30:f32 = add %29, %28
+ store %res, %30
+ %31:u32 = convert 2i
+ %32:u32 = convert 1i
+ %33:array<u32, 2> = construct %31, %32
+ %34:f32 = call %f0_U_arr_X_mat_X, %33
+ %35:f32 = load %res
+ %36:f32 = add %35, %34
+ store %res, %36
+ %37:f32 = load %res
+ ret %37
+ }
+}
+%f1_U_arr_X_mat = func(%p_indices_2:array<u32, 1>):f32 -> %b5 { # %p_indices_2: 'p_indices'
+ %b5 = block {
+ %40:u32 = access %p_indices_2, 0u
+ %res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
+ %42:u32 = convert 1i
+ %43:array<u32, 2> = construct %40, %42
+ %44:f32 = call %f0_U_arr_X_mat_X, %43
+ %45:f32 = load %res_1
+ %46:f32 = add %45, %44
+ store %res_1, %46
+ %47:u32 = convert 1i
+ %48:array<u32, 2> = construct %40, %47
+ %49:f32 = call %f0_U_arr_X_mat_X, %48
+ %50:f32 = load %res_1
+ %51:f32 = add %50, %49
+ store %res_1, %51
+ %52:u32 = convert 2i
+ %53:u32 = convert 1i
+ %54:array<u32, 2> = construct %52, %53
+ %55:f32 = call %f0_U_arr_X_mat_X, %54
+ %56:f32 = load %res_1
+ %57:f32 = add %56, %55
+ store %res_1, %57
+ %58:u32 = convert 2i
+ %59:u32 = convert 1i
+ %60:array<u32, 2> = construct %58, %59
+ %61:f32 = call %f0_U_arr_X_mat_X, %60
+ %62:f32 = load %res_1
+ %63:f32 = add %62, %61
+ store %res_1, %63
+ %64:f32 = load %res_1
+ ret %64
+ }
+}
+%f2_U_arr_X = func(%p_indices_3:array<u32, 1>):f32 -> %b6 { # %p_indices_3: 'p_indices'
+ %b6 = block {
+ %67:u32 = access %p_indices_3, 0u
+ %68:array<u32, 1> = construct %67
+ %69:f32 = call %f1_U_arr_X_mat, %68
+ ret %69
+ }
+}
+%f3_U_arr_U_mat = func():f32 -> %b7 {
+ %b7 = block {
+ %71:u32 = convert 3i
+ %72:array<u32, 1> = construct %71
+ %73:f32 = call %f2_U_arr_X, %72
+ %74:f32 = call %f1_U_mat
+ %75:f32 = add %73, %74
+ ret %75
+ }
+}
+%f4_U = func():f32 -> %b8 {
+ %b8 = block {
+ %77:f32 = call %f3_U_arr_U_mat
+ ret %77
+ }
+}
+%b = func():void -> %b9 {
+ %b9 = block {
+ %79:f32 = call %f4_U
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace uniform_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'storage' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace storage_as_tests {
+
+using IR_DirectVariableAccessTest_StorageAS = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_StorageAS, Param_ptr_i32_Via_struct_read) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var("S", ty.ptr<storage, read>(str_));
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<storage, i32, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<storage, i32, read>(), S, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, str, read> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<storage, i32, read>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:ptr<storage, i32, read> = access %S, 0u
+ %9:i32 = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, str, read> = var @binding_point(0, 0)
+}
+
+%a_S_i = func(%pre:i32, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %5:ptr<storage, i32, read> = access %S, 0u
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a_S_i, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_StorageAS, Param_ptr_arr_i32_Via_struct_write) {
+ auto* str_ =
+ ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("arr"), ty.array<i32, 4>()},
+ });
+
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var("S", ty.ptr<storage>(str_));
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<storage, array<i32, 4>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.array<i32, 4>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<storage, array<i32, 4>>(), S, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, str, read_write> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<storage, array<i32, 4>, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:ptr<storage, array<i32, 4>, read_write> = access %S, 0u
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, str, read_write> = var @binding_point(0, 0)
+}
+
+%a_S_arr = func(%pre:i32, %post:i32):void -> %b2 {
+ %b2 = block {
+ %5:ptr<storage, array<i32, 4>, read_write> = access %S, 0u
+ store %5, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:void = call %a_S_arr, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_StorageAS, Param_ptr_vec4i32_Via_array_DynamicWrite) {
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var<storage, array<vec4<i32>, 8>>("S");
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<storage, vec4<i32>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.vec4<i32>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* I = b.Let("I", 3_i);
+ auto* access = b.Access(ty.ptr<storage, vec4<i32>>(), S, I);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<vec4<i32>, 8>, read_write> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %p:ptr<storage, vec4<i32>, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, vec4<i32>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %I:i32 = let 3i
+ %8:ptr<storage, vec4<i32>, read_write> = access %S, %I
+ %9:void = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<vec4<i32>, 8>, read_write> = var @binding_point(0, 0)
+}
+
+%a_S_X = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):void -> %b2 {
+ %b2 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:ptr<storage, vec4<i32>, read_write> = access %S, %6
+ store %7, vec4<i32>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %I:i32 = let 3i
+ %10:u32 = convert %I
+ %11:array<u32, 1> = construct %10
+ %12:void = call %a_S_X, 10i, %11, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_StorageAS, CallChaining) {
+ auto* Inner =
+ ty.Struct(mod.symbols.New("Inner"), {
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ auto* Outer =
+ ty.Struct(mod.symbols.New("Outer"), {
+ {mod.symbols.Register("arr"), ty.array(Inner, 4)},
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var("S", ty.ptr<storage, read>(Outer));
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_0 = b.Function("f0", ty.f32());
+ auto* fn_0_p = b.FunctionParam("p", ty.ptr<storage, vec4<f32>, read>());
+ fn_0->SetParams({fn_0_p});
+ b.Append(fn_0->Block(), [&] { b.Return(fn_0, b.LoadVectorElement(fn_0_p, 0_u)); });
+
+ auto* fn_1 = b.Function("f1", ty.f32());
+ auto* fn_1_p = b.FunctionParam("p", ty.ptr<storage, mat3x4<f32>, read>());
+ fn_1->SetParams({fn_1_p});
+ b.Append(fn_1->Block(), [&] {
+ auto* res = b.Var<function, f32>("res");
+ {
+ // res += f0(&(*p)[1]);
+ auto* call_0 = b.Call(fn_0, b.Access(ty.ptr<storage, vec4<f32>, read>(), fn_1_p, 1_i));
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &(*p)[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<storage, vec4<f32>, read>(), fn_1_p, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // res += f0(&U.arr[2].mat[1]);
+ auto* access = b.Access(ty.ptr<storage, vec4<f32>, read>(), S, 0_u, 2_i, 0_u, 1_i);
+ auto* call_0 = b.Call(fn_0, access);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &U.arr[2].mat[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<storage, vec4<f32>, read>(), S, 0_u, 2_i, 0_u, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+
+ b.Return(fn_1, b.Load(res));
+ });
+
+ auto* fn_2 = b.Function("f2", ty.f32());
+ auto* fn_2_p = b.FunctionParam("p", ty.ptr<storage, read>(Inner));
+ fn_2->SetParams({fn_2_p});
+ b.Append(fn_2->Block(), [&] {
+ auto* p_mat = b.Access(ty.ptr<storage, mat3x4<f32>, read>(), fn_2_p, 0_u);
+ b.ir.SetName(p_mat, "p_mat");
+ b.Return(fn_2, b.Call(fn_1, p_mat));
+ });
+
+ auto* fn_3 = b.Function("f3", ty.f32());
+ auto* fn_3_p0 = b.FunctionParam("p0", ty.ptr<storage, read>(ty.array(Inner, 4)));
+ auto* fn_3_p1 = b.FunctionParam("p1", ty.ptr<storage, mat3x4<f32>, read>());
+ fn_3->SetParams({fn_3_p0, fn_3_p1});
+ b.Append(fn_3->Block(), [&] {
+ auto* p0_inner = b.Access(ty.ptr<storage, read>(Inner), fn_3_p0, 3_i);
+ b.ir.SetName(p0_inner, "p0_inner");
+ auto* call_0 = b.Call(ty.f32(), fn_2, p0_inner);
+ auto* call_1 = b.Call(ty.f32(), fn_1, fn_3_p1);
+ b.Return(fn_3, b.Add(ty.f32(), call_0, call_1));
+ });
+
+ auto* fn_4 = b.Function("f4", ty.f32());
+ auto* fn_4_p = b.FunctionParam("p", ty.ptr<storage, read>(Outer));
+ fn_4->SetParams({fn_4_p});
+ b.Append(fn_4->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<storage, read>(ty.array(Inner, 4)), fn_4_p, 0_u);
+ auto* access_1 = b.Access(ty.ptr<storage, mat3x4<f32>, read>(), S, 1_u);
+ b.Return(fn_4, b.Call(ty.f32(), fn_3, access_0, access_1));
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(ty.f32(), fn_4, S);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, Outer, read> = var @binding_point(0, 0)
+}
+
+%f0 = func(%p:ptr<storage, vec4<f32>, read>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = load_vector_element %p, 0u
+ ret %4
+ }
+}
+%f1 = func(%p_1:ptr<storage, mat3x4<f32>, read>):f32 -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %res:ptr<function, f32, read_write> = var
+ %8:ptr<storage, vec4<f32>, read> = access %p_1, 1i
+ %9:f32 = call %f0, %8
+ %10:f32 = load %res
+ %11:f32 = add %10, %9
+ store %res, %11
+ %p_vec:ptr<storage, vec4<f32>, read> = access %p_1, 1i
+ %13:f32 = call %f0, %p_vec
+ %14:f32 = load %res
+ %15:f32 = add %14, %13
+ store %res, %15
+ %16:ptr<storage, vec4<f32>, read> = access %S, 0u, 2i, 0u, 1i
+ %17:f32 = call %f0, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %p_vec_1:ptr<storage, vec4<f32>, read> = access %S, 0u, 2i, 0u, 1i # %p_vec_1: 'p_vec'
+ %21:f32 = call %f0, %p_vec_1
+ %22:f32 = load %res
+ %23:f32 = add %22, %21
+ store %res, %23
+ %24:f32 = load %res
+ ret %24
+ }
+}
+%f2 = func(%p_2:ptr<storage, Inner, read>):f32 -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %p_mat:ptr<storage, mat3x4<f32>, read> = access %p_2, 0u
+ %28:f32 = call %f1, %p_mat
+ ret %28
+ }
+}
+%f3 = func(%p0:ptr<storage, array<Inner, 4>, read>, %p1:ptr<storage, mat3x4<f32>, read>):f32 -> %b5 {
+ %b5 = block {
+ %p0_inner:ptr<storage, Inner, read> = access %p0, 3i
+ %33:f32 = call %f2, %p0_inner
+ %34:f32 = call %f1, %p1
+ %35:f32 = add %33, %34
+ ret %35
+ }
+}
+%f4 = func(%p_3:ptr<storage, Outer, read>):f32 -> %b6 { # %p_3: 'p'
+ %b6 = block {
+ %38:ptr<storage, array<Inner, 4>, read> = access %p_3, 0u
+ %39:ptr<storage, mat3x4<f32>, read> = access %S, 1u
+ %40:f32 = call %f3, %38, %39
+ ret %40
+ }
+}
+%b = func():void -> %b7 {
+ %b7 = block {
+ %42:f32 = call %f4, %S
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %S:ptr<storage, Outer, read> = var @binding_point(0, 0)
+}
+
+%f0_S_mat_X = func(%p_indices:array<u32, 1>):f32 -> %b2 {
+ %b2 = block {
+ %4:u32 = access %p_indices, 0u
+ %5:ptr<storage, vec4<f32>, read> = access %S, 1u, %4
+ %6:f32 = load_vector_element %5, 0u
+ ret %6
+ }
+}
+%f0_S_arr_X_mat_X = func(%p_indices_1:array<u32, 2>):f32 -> %b3 { # %p_indices_1: 'p_indices'
+ %b3 = block {
+ %9:u32 = access %p_indices_1, 0u
+ %10:u32 = access %p_indices_1, 1u
+ %11:ptr<storage, vec4<f32>, read> = access %S, 0u, %9, 0u, %10
+ %12:f32 = load_vector_element %11, 0u
+ ret %12
+ }
+}
+%f1_S_mat = func():f32 -> %b4 {
+ %b4 = block {
+ %res:ptr<function, f32, read_write> = var
+ %15:u32 = convert 1i
+ %16:array<u32, 1> = construct %15
+ %17:f32 = call %f0_S_mat_X, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %20:u32 = convert 1i
+ %21:array<u32, 1> = construct %20
+ %22:f32 = call %f0_S_mat_X, %21
+ %23:f32 = load %res
+ %24:f32 = add %23, %22
+ store %res, %24
+ %25:u32 = convert 2i
+ %26:u32 = convert 1i
+ %27:array<u32, 2> = construct %25, %26
+ %28:f32 = call %f0_S_arr_X_mat_X, %27
+ %29:f32 = load %res
+ %30:f32 = add %29, %28
+ store %res, %30
+ %31:u32 = convert 2i
+ %32:u32 = convert 1i
+ %33:array<u32, 2> = construct %31, %32
+ %34:f32 = call %f0_S_arr_X_mat_X, %33
+ %35:f32 = load %res
+ %36:f32 = add %35, %34
+ store %res, %36
+ %37:f32 = load %res
+ ret %37
+ }
+}
+%f1_S_arr_X_mat = func(%p_indices_2:array<u32, 1>):f32 -> %b5 { # %p_indices_2: 'p_indices'
+ %b5 = block {
+ %40:u32 = access %p_indices_2, 0u
+ %res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
+ %42:u32 = convert 1i
+ %43:array<u32, 2> = construct %40, %42
+ %44:f32 = call %f0_S_arr_X_mat_X, %43
+ %45:f32 = load %res_1
+ %46:f32 = add %45, %44
+ store %res_1, %46
+ %47:u32 = convert 1i
+ %48:array<u32, 2> = construct %40, %47
+ %49:f32 = call %f0_S_arr_X_mat_X, %48
+ %50:f32 = load %res_1
+ %51:f32 = add %50, %49
+ store %res_1, %51
+ %52:u32 = convert 2i
+ %53:u32 = convert 1i
+ %54:array<u32, 2> = construct %52, %53
+ %55:f32 = call %f0_S_arr_X_mat_X, %54
+ %56:f32 = load %res_1
+ %57:f32 = add %56, %55
+ store %res_1, %57
+ %58:u32 = convert 2i
+ %59:u32 = convert 1i
+ %60:array<u32, 2> = construct %58, %59
+ %61:f32 = call %f0_S_arr_X_mat_X, %60
+ %62:f32 = load %res_1
+ %63:f32 = add %62, %61
+ store %res_1, %63
+ %64:f32 = load %res_1
+ ret %64
+ }
+}
+%f2_S_arr_X = func(%p_indices_3:array<u32, 1>):f32 -> %b6 { # %p_indices_3: 'p_indices'
+ %b6 = block {
+ %67:u32 = access %p_indices_3, 0u
+ %68:array<u32, 1> = construct %67
+ %69:f32 = call %f1_S_arr_X_mat, %68
+ ret %69
+ }
+}
+%f3_S_arr_S_mat = func():f32 -> %b7 {
+ %b7 = block {
+ %71:u32 = convert 3i
+ %72:array<u32, 1> = construct %71
+ %73:f32 = call %f2_S_arr_X, %72
+ %74:f32 = call %f1_S_mat
+ %75:f32 = add %73, %74
+ ret %75
+ }
+}
+%f4_S = func():f32 -> %b8 {
+ %b8 = block {
+ %77:f32 = call %f3_S_arr_S_mat
+ ret %77
+ }
+}
+%b = func():void -> %b9 {
+ %b9 = block {
+ %79:f32 = call %f4_S
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace storage_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'workgroup' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace workgroup_as_tests {
+
+using IR_DirectVariableAccessTest_WorkgroupAS = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_WorkgroupAS, Param_ptr_vec4i32_Via_array_StaticRead) {
+ Var* W = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ W = b.Var("W", ty.ptr<workgroup, array<vec4<i32>, 8>>());
+ });
+
+ auto* fn_a = b.Function("a", ty.vec4<i32>());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<workgroup, vec4<i32>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<workgroup, vec4<i32>>(), W, 3_i);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<workgroup, vec4<i32>, read_write>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:vec4<i32> = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:ptr<workgroup, vec4<i32>, read_write> = access %W, 3i
+ %9:vec4<i32> = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+}
+
+%a_W_X = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):vec4<i32> -> %b2 {
+ %b2 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:ptr<workgroup, vec4<i32>, read_write> = access %W, %6
+ %8:vec4<i32> = load %7
+ ret %8
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %10:u32 = convert 3i
+ %11:array<u32, 1> = construct %10
+ %12:vec4<i32> = call %a_W_X, 10i, %11, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_WorkgroupAS, Param_ptr_vec4i32_Via_array_StaticWrite) {
+ Var* W = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ W = b.Var<workgroup, array<vec4<i32>, 8>>("W");
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<workgroup, vec4<i32>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.vec4<i32>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<workgroup, vec4<i32>>(), W, 3_i);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<workgroup, vec4<i32>, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, vec4<i32>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:ptr<workgroup, vec4<i32>, read_write> = access %W, 3i
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+}
+
+%a_W_X = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):void -> %b2 {
+ %b2 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:ptr<workgroup, vec4<i32>, read_write> = access %W, %6
+ store %7, vec4<i32>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %9:u32 = convert 3i
+ %10:array<u32, 1> = construct %9
+ %11:void = call %a_W_X, 10i, %10, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_WorkgroupAS, CallChaining) {
+ auto* Inner =
+ ty.Struct(mod.symbols.New("Inner"), {
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ auto* Outer =
+ ty.Struct(mod.symbols.New("Outer"), {
+ {mod.symbols.Register("arr"), ty.array(Inner, 4)},
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ Var* W = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ W = b.Var("W", ty.ptr<workgroup>(Outer));
+ });
+
+ auto* fn_0 = b.Function("f0", ty.f32());
+ auto* fn_0_p = b.FunctionParam("p", ty.ptr<workgroup, vec4<f32>>());
+ fn_0->SetParams({fn_0_p});
+ b.Append(fn_0->Block(), [&] { b.Return(fn_0, b.LoadVectorElement(fn_0_p, 0_u)); });
+
+ auto* fn_1 = b.Function("f1", ty.f32());
+ auto* fn_1_p = b.FunctionParam("p", ty.ptr<workgroup, mat3x4<f32>>());
+ fn_1->SetParams({fn_1_p});
+ b.Append(fn_1->Block(), [&] {
+ auto* res = b.Var<function, f32>("res");
+ {
+ // res += f0(&(*p)[1]);
+ auto* call_0 = b.Call(fn_0, b.Access(ty.ptr<workgroup, vec4<f32>>(), fn_1_p, 1_i));
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &(*p)[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<workgroup, vec4<f32>>(), fn_1_p, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // res += f0(&U.arr[2].mat[1]);
+ auto* access = b.Access(ty.ptr<workgroup, vec4<f32>>(), W, 0_u, 2_i, 0_u, 1_i);
+ auto* call_0 = b.Call(fn_0, access);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &U.arr[2].mat[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<workgroup, vec4<f32>>(), W, 0_u, 2_i, 0_u, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+
+ b.Return(fn_1, b.Load(res));
+ });
+
+ auto* fn_2 = b.Function("f2", ty.f32());
+ auto* fn_2_p = b.FunctionParam("p", ty.ptr<workgroup>(Inner));
+ fn_2->SetParams({fn_2_p});
+ b.Append(fn_2->Block(), [&] {
+ auto* p_mat = b.Access(ty.ptr<workgroup, mat3x4<f32>>(), fn_2_p, 0_u);
+ b.ir.SetName(p_mat, "p_mat");
+ b.Return(fn_2, b.Call(fn_1, p_mat));
+ });
+
+ auto* fn_3 = b.Function("f3", ty.f32());
+ auto* fn_3_p0 = b.FunctionParam("p0", ty.ptr<workgroup>(ty.array(Inner, 4)));
+ auto* fn_3_p1 = b.FunctionParam("p1", ty.ptr<workgroup, mat3x4<f32>>());
+ fn_3->SetParams({fn_3_p0, fn_3_p1});
+ b.Append(fn_3->Block(), [&] {
+ auto* p0_inner = b.Access(ty.ptr<workgroup>(Inner), fn_3_p0, 3_i);
+ b.ir.SetName(p0_inner, "p0_inner");
+ auto* call_0 = b.Call(ty.f32(), fn_2, p0_inner);
+ auto* call_1 = b.Call(ty.f32(), fn_1, fn_3_p1);
+ b.Return(fn_3, b.Add(ty.f32(), call_0, call_1));
+ });
+
+ auto* fn_4 = b.Function("f4", ty.f32());
+ auto* fn_4_p = b.FunctionParam("p", ty.ptr<workgroup>(Outer));
+ fn_4->SetParams({fn_4_p});
+ b.Append(fn_4->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<workgroup>(ty.array(Inner, 4)), fn_4_p, 0_u);
+ auto* access_1 = b.Access(ty.ptr<workgroup, mat3x4<f32>>(), W, 1_u);
+ b.Return(fn_4, b.Call(ty.f32(), fn_3, access_0, access_1));
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(ty.f32(), fn_4, W);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %W:ptr<workgroup, Outer, read_write> = var
+}
+
+%f0 = func(%p:ptr<workgroup, vec4<f32>, read_write>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = load_vector_element %p, 0u
+ ret %4
+ }
+}
+%f1 = func(%p_1:ptr<workgroup, mat3x4<f32>, read_write>):f32 -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %res:ptr<function, f32, read_write> = var
+ %8:ptr<workgroup, vec4<f32>, read_write> = access %p_1, 1i
+ %9:f32 = call %f0, %8
+ %10:f32 = load %res
+ %11:f32 = add %10, %9
+ store %res, %11
+ %p_vec:ptr<workgroup, vec4<f32>, read_write> = access %p_1, 1i
+ %13:f32 = call %f0, %p_vec
+ %14:f32 = load %res
+ %15:f32 = add %14, %13
+ store %res, %15
+ %16:ptr<workgroup, vec4<f32>, read_write> = access %W, 0u, 2i, 0u, 1i
+ %17:f32 = call %f0, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %p_vec_1:ptr<workgroup, vec4<f32>, read_write> = access %W, 0u, 2i, 0u, 1i # %p_vec_1: 'p_vec'
+ %21:f32 = call %f0, %p_vec_1
+ %22:f32 = load %res
+ %23:f32 = add %22, %21
+ store %res, %23
+ %24:f32 = load %res
+ ret %24
+ }
+}
+%f2 = func(%p_2:ptr<workgroup, Inner, read_write>):f32 -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %p_mat:ptr<workgroup, mat3x4<f32>, read_write> = access %p_2, 0u
+ %28:f32 = call %f1, %p_mat
+ ret %28
+ }
+}
+%f3 = func(%p0:ptr<workgroup, array<Inner, 4>, read_write>, %p1:ptr<workgroup, mat3x4<f32>, read_write>):f32 -> %b5 {
+ %b5 = block {
+ %p0_inner:ptr<workgroup, Inner, read_write> = access %p0, 3i
+ %33:f32 = call %f2, %p0_inner
+ %34:f32 = call %f1, %p1
+ %35:f32 = add %33, %34
+ ret %35
+ }
+}
+%f4 = func(%p_3:ptr<workgroup, Outer, read_write>):f32 -> %b6 { # %p_3: 'p'
+ %b6 = block {
+ %38:ptr<workgroup, array<Inner, 4>, read_write> = access %p_3, 0u
+ %39:ptr<workgroup, mat3x4<f32>, read_write> = access %W, 1u
+ %40:f32 = call %f3, %38, %39
+ ret %40
+ }
+}
+%b = func():void -> %b7 {
+ %b7 = block {
+ %42:f32 = call %f4, %W
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %W:ptr<workgroup, Outer, read_write> = var
+}
+
+%f0_W_mat_X = func(%p_indices:array<u32, 1>):f32 -> %b2 {
+ %b2 = block {
+ %4:u32 = access %p_indices, 0u
+ %5:ptr<workgroup, vec4<f32>, read_write> = access %W, 1u, %4
+ %6:f32 = load_vector_element %5, 0u
+ ret %6
+ }
+}
+%f0_W_arr_X_mat_X = func(%p_indices_1:array<u32, 2>):f32 -> %b3 { # %p_indices_1: 'p_indices'
+ %b3 = block {
+ %9:u32 = access %p_indices_1, 0u
+ %10:u32 = access %p_indices_1, 1u
+ %11:ptr<workgroup, vec4<f32>, read_write> = access %W, 0u, %9, 0u, %10
+ %12:f32 = load_vector_element %11, 0u
+ ret %12
+ }
+}
+%f1_W_mat = func():f32 -> %b4 {
+ %b4 = block {
+ %res:ptr<function, f32, read_write> = var
+ %15:u32 = convert 1i
+ %16:array<u32, 1> = construct %15
+ %17:f32 = call %f0_W_mat_X, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %20:u32 = convert 1i
+ %21:array<u32, 1> = construct %20
+ %22:f32 = call %f0_W_mat_X, %21
+ %23:f32 = load %res
+ %24:f32 = add %23, %22
+ store %res, %24
+ %25:u32 = convert 2i
+ %26:u32 = convert 1i
+ %27:array<u32, 2> = construct %25, %26
+ %28:f32 = call %f0_W_arr_X_mat_X, %27
+ %29:f32 = load %res
+ %30:f32 = add %29, %28
+ store %res, %30
+ %31:u32 = convert 2i
+ %32:u32 = convert 1i
+ %33:array<u32, 2> = construct %31, %32
+ %34:f32 = call %f0_W_arr_X_mat_X, %33
+ %35:f32 = load %res
+ %36:f32 = add %35, %34
+ store %res, %36
+ %37:f32 = load %res
+ ret %37
+ }
+}
+%f1_W_arr_X_mat = func(%p_indices_2:array<u32, 1>):f32 -> %b5 { # %p_indices_2: 'p_indices'
+ %b5 = block {
+ %40:u32 = access %p_indices_2, 0u
+ %res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
+ %42:u32 = convert 1i
+ %43:array<u32, 2> = construct %40, %42
+ %44:f32 = call %f0_W_arr_X_mat_X, %43
+ %45:f32 = load %res_1
+ %46:f32 = add %45, %44
+ store %res_1, %46
+ %47:u32 = convert 1i
+ %48:array<u32, 2> = construct %40, %47
+ %49:f32 = call %f0_W_arr_X_mat_X, %48
+ %50:f32 = load %res_1
+ %51:f32 = add %50, %49
+ store %res_1, %51
+ %52:u32 = convert 2i
+ %53:u32 = convert 1i
+ %54:array<u32, 2> = construct %52, %53
+ %55:f32 = call %f0_W_arr_X_mat_X, %54
+ %56:f32 = load %res_1
+ %57:f32 = add %56, %55
+ store %res_1, %57
+ %58:u32 = convert 2i
+ %59:u32 = convert 1i
+ %60:array<u32, 2> = construct %58, %59
+ %61:f32 = call %f0_W_arr_X_mat_X, %60
+ %62:f32 = load %res_1
+ %63:f32 = add %62, %61
+ store %res_1, %63
+ %64:f32 = load %res_1
+ ret %64
+ }
+}
+%f2_W_arr_X = func(%p_indices_3:array<u32, 1>):f32 -> %b6 { # %p_indices_3: 'p_indices'
+ %b6 = block {
+ %67:u32 = access %p_indices_3, 0u
+ %68:array<u32, 1> = construct %67
+ %69:f32 = call %f1_W_arr_X_mat, %68
+ ret %69
+ }
+}
+%f3_W_arr_W_mat = func():f32 -> %b7 {
+ %b7 = block {
+ %71:u32 = convert 3i
+ %72:array<u32, 1> = construct %71
+ %73:f32 = call %f2_W_arr_X, %72
+ %74:f32 = call %f1_W_mat
+ %75:f32 = add %73, %74
+ ret %75
+ }
+}
+%f4_W = func():f32 -> %b8 {
+ %b8 = block {
+ %77:f32 = call %f3_W_arr_W_mat
+ ret %77
+ }
+}
+%b = func():void -> %b9 {
+ %b9 = block {
+ %79:f32 = call %f4_W
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace workgroup_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'private' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace private_as_tests {
+
+using IR_DirectVariableAccessTest_PrivateAS = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_Param_ptr_i32_read) {
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_, i32>());
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(fn_a, 10_i, P, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %P:ptr<private, i32, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a, 10i, %P, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %P:ptr<private, i32, read_write> = var
+}
+
+%a_P = func(%pre:i32, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %5:ptr<private, i32, read_write> = access %P
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a_P, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_Param_ptr_i32_write) {
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_, i32>());
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, 42_i);
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(fn_a, 10_i, P, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %P:ptr<private, i32, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, 42i
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:void = call %a, 10i, %P, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %P:ptr<private, i32, read_write> = var
+}
+
+%a_P = func(%pre:i32, %post:i32):void -> %b2 {
+ %b2 = block {
+ %5:ptr<private, i32, read_write> = access %P
+ store %5, 42i
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:void = call %a_P, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_Param_ptr_i32_Via_struct_read) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(str_));
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<private_, i32>(), P, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:ptr<private, i32, read_write> = access %P, 0u
+ %9:i32 = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a_P_i = func(%pre:i32, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %5:ptr<private, i32, read_write> = access %P, 0u
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:i32 = call %a_P_i, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Disabled_Param_ptr_i32_Via_struct_read) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(str_));
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<private_, i32>(), P, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %p
+ ret %6
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %8:ptr<private, i32, read_write> = access %P, 0u
+ %9:i32 = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* str_ =
+ ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("arr"), ty.array<i32, 4>()},
+ });
+
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(str_));
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, array<i32, 4>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.array<i32, 4>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<private_, array<i32, 4>>(), P, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, array<i32, 4>, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:ptr<private, array<i32, 4>, read_write> = access %P, 0u
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a_P_arr = func(%pre:i32, %post:i32):void -> %b2 {
+ %b2 = block {
+ %5:ptr<private, array<i32, 4>, read_write> = access %P, 0u
+ store %5, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:void = call %a_P_arr, 10i, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Disabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* str_ =
+ ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("arr"), ty.array<i32, 4>()},
+ });
+
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(str_));
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, array<i32, 4>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.array<i32, 4>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* access = b.Access(ty.ptr<private_, array<i32, 4>>(), P, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%b1 = block { # root
+ %P:ptr<private, str, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, array<i32, 4>, read_write>, %post:i32):void -> %b2 {
+ %b2 = block {
+ store %p, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %7:ptr<private, array<i32, 4>, read_write> = access %P, 0u
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_Param_ptr_i32_mixed) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ Var* Pi = nullptr;
+ Var* Ps = nullptr;
+ Var* Pa = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ Pi = b.Var("Pi", ty.ptr<private_, i32>());
+ Ps = b.Var("Ps", ty.ptr<private_>(str_));
+ Pa = b.Var("Pa", ty.ptr<private_, array<i32, 4>>());
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ { // a(10, &Pi, 20);
+ b.Call(fn_a, 10_i, Pi, 20_i);
+ }
+ { // a(30, &Ps.i, 40);
+ auto* access = b.Access(ty.ptr<private_, i32>(), Ps, 0_u);
+ b.Call(fn_a, 30_i, access, 40_i);
+ }
+ { // a(50, &Pa[2], 60);
+ auto* access = b.Access(ty.ptr<private_, i32>(), Pa, 2_i);
+ b.Call(fn_a, 50_i, access, 60_i);
+ }
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %Pi:ptr<private, i32, read_write> = var
+ %Ps:ptr<private, str, read_write> = var
+ %Pa:ptr<private, array<i32, 4>, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %8:i32 = load %p
+ ret %8
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %10:i32 = call %a, 10i, %Pi, 20i
+ %11:ptr<private, i32, read_write> = access %Ps, 0u
+ %12:i32 = call %a, 30i, %11, 40i
+ %13:ptr<private, i32, read_write> = access %Pa, 2i
+ %14:i32 = call %a, 50i, %13, 60i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %Pi:ptr<private, i32, read_write> = var
+ %Ps:ptr<private, str, read_write> = var
+ %Pa:ptr<private, array<i32, 4>, read_write> = var
+}
+
+%a_Pi = func(%pre:i32, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %7:ptr<private, i32, read_write> = access %Pi
+ %8:i32 = load %7
+ ret %8
+ }
+}
+%a_Ps_i = func(%pre_1:i32, %post_1:i32):i32 -> %b3 { # %pre_1: 'pre', %post_1: 'post'
+ %b3 = block {
+ %12:ptr<private, i32, read_write> = access %Ps, 0u
+ %13:i32 = load %12
+ ret %13
+ }
+}
+%a_Pa_X = func(%pre_2:i32, %p_indices:array<u32, 1>, %post_2:i32):i32 -> %b4 { # %pre_2: 'pre', %post_2: 'post'
+ %b4 = block {
+ %18:u32 = access %p_indices, 0u
+ %19:ptr<private, i32, read_write> = access %Pa, %18
+ %20:i32 = load %19
+ ret %20
+ }
+}
+%b = func():void -> %b5 {
+ %b5 = block {
+ %22:i32 = call %a_Pi, 10i, 20i
+ %23:i32 = call %a_Ps_i, 30i, 40i
+ %24:u32 = convert 2i
+ %25:array<u32, 1> = construct %24
+ %26:i32 = call %a_Pa_X, 50i, %25, 60i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Disabled_Param_ptr_i32_mixed) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ Var* Pi = nullptr;
+ Var* Ps = nullptr;
+ Var* Pa = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ Pi = b.Var("Pi", ty.ptr<private_, i32>());
+ Ps = b.Var("Ps", ty.ptr<private_>(str_));
+ Pa = b.Var("Pa", ty.ptr<private_, array<i32, 4>>());
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<private_, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ { // a(10, &Pi, 20);
+ b.Call(fn_a, 10_i, Pi, 20_i);
+ }
+ { // a(30, &Ps.i, 40);
+ auto* access = b.Access(ty.ptr<private_, i32>(), Ps, 0_u);
+ b.Call(fn_a, 30_i, access, 40_i);
+ }
+ { // a(50, &Pa[2], 60);
+ auto* access = b.Access(ty.ptr<private_, i32>(), Pa, 2_i);
+ b.Call(fn_a, 50_i, access, 60_i);
+ }
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%b1 = block { # root
+ %Pi:ptr<private, i32, read_write> = var
+ %Ps:ptr<private, str, read_write> = var
+ %Pa:ptr<private, array<i32, 4>, read_write> = var
+}
+
+%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %8:i32 = load %p
+ ret %8
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %10:i32 = call %a, 10i, %Pi, 20i
+ %11:ptr<private, i32, read_write> = access %Ps, 0u
+ %12:i32 = call %a, 30i, %11, 40i
+ %13:ptr<private, i32, read_write> = access %Pa, 2i
+ %14:i32 = call %a, 50i, %13, 60i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Enabled_CallChaining) {
+ auto* Inner =
+ ty.Struct(mod.symbols.New("Inner"), {
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ auto* Outer =
+ ty.Struct(mod.symbols.New("Outer"), {
+ {mod.symbols.Register("arr"), ty.array(Inner, 4)},
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(Outer));
+ });
+
+ auto* fn_0 = b.Function("f0", ty.f32());
+ auto* fn_0_p = b.FunctionParam("p", ty.ptr<private_, vec4<f32>>());
+ fn_0->SetParams({fn_0_p});
+ b.Append(fn_0->Block(), [&] { b.Return(fn_0, b.LoadVectorElement(fn_0_p, 0_u)); });
+
+ auto* fn_1 = b.Function("f1", ty.f32());
+ auto* fn_1_p = b.FunctionParam("p", ty.ptr<private_, mat3x4<f32>>());
+ fn_1->SetParams({fn_1_p});
+ b.Append(fn_1->Block(), [&] {
+ auto* res = b.Var<function, f32>("res");
+ {
+ // res += f0(&(*p)[1]);
+ auto* call_0 = b.Call(fn_0, b.Access(ty.ptr<private_, vec4<f32>>(), fn_1_p, 1_i));
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &(*p)[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<private_, vec4<f32>>(), fn_1_p, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // res += f0(&U.arr[2].mat[1]);
+ auto* access = b.Access(ty.ptr<private_, vec4<f32>>(), P, 0_u, 2_i, 0_u, 1_i);
+ auto* call_0 = b.Call(fn_0, access);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &U.arr[2].mat[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<private_, vec4<f32>>(), P, 0_u, 2_i, 0_u, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+
+ b.Return(fn_1, b.Load(res));
+ });
+
+ auto* fn_2 = b.Function("f2", ty.f32());
+ auto* fn_2_p = b.FunctionParam("p", ty.ptr<private_>(Inner));
+ fn_2->SetParams({fn_2_p});
+ b.Append(fn_2->Block(), [&] {
+ auto* p_mat = b.Access(ty.ptr<private_, mat3x4<f32>>(), fn_2_p, 0_u);
+ b.ir.SetName(p_mat, "p_mat");
+ b.Return(fn_2, b.Call(fn_1, p_mat));
+ });
+
+ auto* fn_3 = b.Function("f3", ty.f32());
+ auto* fn_3_p0 = b.FunctionParam("p0", ty.ptr<private_>(ty.array(Inner, 4)));
+ auto* fn_3_p1 = b.FunctionParam("p1", ty.ptr<private_, mat3x4<f32>>());
+ fn_3->SetParams({fn_3_p0, fn_3_p1});
+ b.Append(fn_3->Block(), [&] {
+ auto* p0_inner = b.Access(ty.ptr<private_>(Inner), fn_3_p0, 3_i);
+ b.ir.SetName(p0_inner, "p0_inner");
+ auto* call_0 = b.Call(ty.f32(), fn_2, p0_inner);
+ auto* call_1 = b.Call(ty.f32(), fn_1, fn_3_p1);
+ b.Return(fn_3, b.Add(ty.f32(), call_0, call_1));
+ });
+
+ auto* fn_4 = b.Function("f4", ty.f32());
+ auto* fn_4_p = b.FunctionParam("p", ty.ptr<private_>(Outer));
+ fn_4->SetParams({fn_4_p});
+ b.Append(fn_4->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<private_>(ty.array(Inner, 4)), fn_4_p, 0_u);
+ auto* access_1 = b.Access(ty.ptr<private_, mat3x4<f32>>(), P, 1_u);
+ b.Return(fn_4, b.Call(ty.f32(), fn_3, access_0, access_1));
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(ty.f32(), fn_4, P);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %P:ptr<private, Outer, read_write> = var
+}
+
+%f0 = func(%p:ptr<private, vec4<f32>, read_write>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = load_vector_element %p, 0u
+ ret %4
+ }
+}
+%f1 = func(%p_1:ptr<private, mat3x4<f32>, read_write>):f32 -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %res:ptr<function, f32, read_write> = var
+ %8:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
+ %9:f32 = call %f0, %8
+ %10:f32 = load %res
+ %11:f32 = add %10, %9
+ store %res, %11
+ %p_vec:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
+ %13:f32 = call %f0, %p_vec
+ %14:f32 = load %res
+ %15:f32 = add %14, %13
+ store %res, %15
+ %16:ptr<private, vec4<f32>, read_write> = access %P, 0u, 2i, 0u, 1i
+ %17:f32 = call %f0, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %p_vec_1:ptr<private, vec4<f32>, read_write> = access %P, 0u, 2i, 0u, 1i # %p_vec_1: 'p_vec'
+ %21:f32 = call %f0, %p_vec_1
+ %22:f32 = load %res
+ %23:f32 = add %22, %21
+ store %res, %23
+ %24:f32 = load %res
+ ret %24
+ }
+}
+%f2 = func(%p_2:ptr<private, Inner, read_write>):f32 -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %p_mat:ptr<private, mat3x4<f32>, read_write> = access %p_2, 0u
+ %28:f32 = call %f1, %p_mat
+ ret %28
+ }
+}
+%f3 = func(%p0:ptr<private, array<Inner, 4>, read_write>, %p1:ptr<private, mat3x4<f32>, read_write>):f32 -> %b5 {
+ %b5 = block {
+ %p0_inner:ptr<private, Inner, read_write> = access %p0, 3i
+ %33:f32 = call %f2, %p0_inner
+ %34:f32 = call %f1, %p1
+ %35:f32 = add %33, %34
+ ret %35
+ }
+}
+%f4 = func(%p_3:ptr<private, Outer, read_write>):f32 -> %b6 { # %p_3: 'p'
+ %b6 = block {
+ %38:ptr<private, array<Inner, 4>, read_write> = access %p_3, 0u
+ %39:ptr<private, mat3x4<f32>, read_write> = access %P, 1u
+ %40:f32 = call %f3, %38, %39
+ ret %40
+ }
+}
+%b = func():void -> %b7 {
+ %b7 = block {
+ %42:f32 = call %f4, %P
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %P:ptr<private, Outer, read_write> = var
+}
+
+%f0_P_mat_X = func(%p_indices:array<u32, 1>):f32 -> %b2 {
+ %b2 = block {
+ %4:u32 = access %p_indices, 0u
+ %5:ptr<private, vec4<f32>, read_write> = access %P, 1u, %4
+ %6:f32 = load_vector_element %5, 0u
+ ret %6
+ }
+}
+%f0_P_arr_X_mat_X = func(%p_indices_1:array<u32, 2>):f32 -> %b3 { # %p_indices_1: 'p_indices'
+ %b3 = block {
+ %9:u32 = access %p_indices_1, 0u
+ %10:u32 = access %p_indices_1, 1u
+ %11:ptr<private, vec4<f32>, read_write> = access %P, 0u, %9, 0u, %10
+ %12:f32 = load_vector_element %11, 0u
+ ret %12
+ }
+}
+%f1_P_mat = func():f32 -> %b4 {
+ %b4 = block {
+ %res:ptr<function, f32, read_write> = var
+ %15:u32 = convert 1i
+ %16:array<u32, 1> = construct %15
+ %17:f32 = call %f0_P_mat_X, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %20:u32 = convert 1i
+ %21:array<u32, 1> = construct %20
+ %22:f32 = call %f0_P_mat_X, %21
+ %23:f32 = load %res
+ %24:f32 = add %23, %22
+ store %res, %24
+ %25:u32 = convert 2i
+ %26:u32 = convert 1i
+ %27:array<u32, 2> = construct %25, %26
+ %28:f32 = call %f0_P_arr_X_mat_X, %27
+ %29:f32 = load %res
+ %30:f32 = add %29, %28
+ store %res, %30
+ %31:u32 = convert 2i
+ %32:u32 = convert 1i
+ %33:array<u32, 2> = construct %31, %32
+ %34:f32 = call %f0_P_arr_X_mat_X, %33
+ %35:f32 = load %res
+ %36:f32 = add %35, %34
+ store %res, %36
+ %37:f32 = load %res
+ ret %37
+ }
+}
+%f1_P_arr_X_mat = func(%p_indices_2:array<u32, 1>):f32 -> %b5 { # %p_indices_2: 'p_indices'
+ %b5 = block {
+ %40:u32 = access %p_indices_2, 0u
+ %res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
+ %42:u32 = convert 1i
+ %43:array<u32, 2> = construct %40, %42
+ %44:f32 = call %f0_P_arr_X_mat_X, %43
+ %45:f32 = load %res_1
+ %46:f32 = add %45, %44
+ store %res_1, %46
+ %47:u32 = convert 1i
+ %48:array<u32, 2> = construct %40, %47
+ %49:f32 = call %f0_P_arr_X_mat_X, %48
+ %50:f32 = load %res_1
+ %51:f32 = add %50, %49
+ store %res_1, %51
+ %52:u32 = convert 2i
+ %53:u32 = convert 1i
+ %54:array<u32, 2> = construct %52, %53
+ %55:f32 = call %f0_P_arr_X_mat_X, %54
+ %56:f32 = load %res_1
+ %57:f32 = add %56, %55
+ store %res_1, %57
+ %58:u32 = convert 2i
+ %59:u32 = convert 1i
+ %60:array<u32, 2> = construct %58, %59
+ %61:f32 = call %f0_P_arr_X_mat_X, %60
+ %62:f32 = load %res_1
+ %63:f32 = add %62, %61
+ store %res_1, %63
+ %64:f32 = load %res_1
+ ret %64
+ }
+}
+%f2_P_arr_X = func(%p_indices_3:array<u32, 1>):f32 -> %b6 { # %p_indices_3: 'p_indices'
+ %b6 = block {
+ %67:u32 = access %p_indices_3, 0u
+ %68:array<u32, 1> = construct %67
+ %69:f32 = call %f1_P_arr_X_mat, %68
+ ret %69
+ }
+}
+%f3_P_arr_P_mat = func():f32 -> %b7 {
+ %b7 = block {
+ %71:u32 = convert 3i
+ %72:array<u32, 1> = construct %71
+ %73:f32 = call %f2_P_arr_X, %72
+ %74:f32 = call %f1_P_mat
+ %75:f32 = add %73, %74
+ ret %75
+ }
+}
+%f4_P = func():f32 -> %b8 {
+ %b8 = block {
+ %77:f32 = call %f3_P_arr_P_mat
+ ret %77
+ }
+}
+%b = func():void -> %b9 {
+ %b9 = block {
+ %79:f32 = call %f4_P
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformPrivate);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_PrivateAS, Disabled_CallChaining) {
+ auto* Inner =
+ ty.Struct(mod.symbols.New("Inner"), {
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ auto* Outer =
+ ty.Struct(mod.symbols.New("Outer"), {
+ {mod.symbols.Register("arr"), ty.array(Inner, 4)},
+ {mod.symbols.Register("mat"), ty.mat3x4<f32>()},
+ });
+ Var* P = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ P = b.Var("P", ty.ptr<private_>(Outer));
+ });
+
+ auto* fn_0 = b.Function("f0", ty.f32());
+ auto* fn_0_p = b.FunctionParam("p", ty.ptr<private_, vec4<f32>>());
+ fn_0->SetParams({fn_0_p});
+ b.Append(fn_0->Block(), [&] { b.Return(fn_0, b.LoadVectorElement(fn_0_p, 0_u)); });
+
+ auto* fn_1 = b.Function("f1", ty.f32());
+ auto* fn_1_p = b.FunctionParam("p", ty.ptr<private_, mat3x4<f32>>());
+ fn_1->SetParams({fn_1_p});
+ b.Append(fn_1->Block(), [&] {
+ auto* res = b.Var<function, f32>("res");
+ {
+ // res += f0(&(*p)[1]);
+ auto* call_0 = b.Call(fn_0, b.Access(ty.ptr<private_, vec4<f32>>(), fn_1_p, 1_i));
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &(*p)[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<private_, vec4<f32>>(), fn_1_p, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // res += f0(&U.arr[2].mat[1]);
+ auto* access = b.Access(ty.ptr<private_, vec4<f32>>(), P, 0_u, 2_i, 0_u, 1_i);
+ auto* call_0 = b.Call(fn_0, access);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+ {
+ // let p_vec = &U.arr[2].mat[1];
+ // res += f0(p_vec);
+ auto* p_vec = b.Access(ty.ptr<private_, vec4<f32>>(), P, 0_u, 2_i, 0_u, 1_i);
+ b.ir.SetName(p_vec, "p_vec");
+ auto* call_0 = b.Call(fn_0, p_vec);
+ b.Store(res, b.Add(ty.f32(), b.Load(res), call_0));
+ }
+
+ b.Return(fn_1, b.Load(res));
+ });
+
+ auto* fn_2 = b.Function("f2", ty.f32());
+ auto* fn_2_p = b.FunctionParam("p", ty.ptr<private_>(Inner));
+ fn_2->SetParams({fn_2_p});
+ b.Append(fn_2->Block(), [&] {
+ auto* p_mat = b.Access(ty.ptr<private_, mat3x4<f32>>(), fn_2_p, 0_u);
+ b.ir.SetName(p_mat, "p_mat");
+ b.Return(fn_2, b.Call(fn_1, p_mat));
+ });
+
+ auto* fn_3 = b.Function("f3", ty.f32());
+ auto* fn_3_p0 = b.FunctionParam("p0", ty.ptr<private_>(ty.array(Inner, 4)));
+ auto* fn_3_p1 = b.FunctionParam("p1", ty.ptr<private_, mat3x4<f32>>());
+ fn_3->SetParams({fn_3_p0, fn_3_p1});
+ b.Append(fn_3->Block(), [&] {
+ auto* p0_inner = b.Access(ty.ptr<private_>(Inner), fn_3_p0, 3_i);
+ b.ir.SetName(p0_inner, "p0_inner");
+ auto* call_0 = b.Call(ty.f32(), fn_2, p0_inner);
+ auto* call_1 = b.Call(ty.f32(), fn_1, fn_3_p1);
+ b.Return(fn_3, b.Add(ty.f32(), call_0, call_1));
+ });
+
+ auto* fn_4 = b.Function("f4", ty.f32());
+ auto* fn_4_p = b.FunctionParam("p", ty.ptr<private_>(Outer));
+ fn_4->SetParams({fn_4_p});
+ b.Append(fn_4->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<private_>(ty.array(Inner, 4)), fn_4_p, 0_u);
+ auto* access_1 = b.Access(ty.ptr<private_, mat3x4<f32>>(), P, 1_u);
+ b.Return(fn_4, b.Call(ty.f32(), fn_3, access_0, access_1));
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ b.Call(ty.f32(), fn_4, P);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+Inner = struct @align(16) {
+ mat:mat3x4<f32> @offset(0)
+}
+
+Outer = struct @align(16) {
+ arr:array<Inner, 4> @offset(0)
+ mat:mat3x4<f32> @offset(192)
+}
+
+%b1 = block { # root
+ %P:ptr<private, Outer, read_write> = var
+}
+
+%f0 = func(%p:ptr<private, vec4<f32>, read_write>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = load_vector_element %p, 0u
+ ret %4
+ }
+}
+%f1 = func(%p_1:ptr<private, mat3x4<f32>, read_write>):f32 -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %res:ptr<function, f32, read_write> = var
+ %8:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
+ %9:f32 = call %f0, %8
+ %10:f32 = load %res
+ %11:f32 = add %10, %9
+ store %res, %11
+ %p_vec:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
+ %13:f32 = call %f0, %p_vec
+ %14:f32 = load %res
+ %15:f32 = add %14, %13
+ store %res, %15
+ %16:ptr<private, vec4<f32>, read_write> = access %P, 0u, 2i, 0u, 1i
+ %17:f32 = call %f0, %16
+ %18:f32 = load %res
+ %19:f32 = add %18, %17
+ store %res, %19
+ %p_vec_1:ptr<private, vec4<f32>, read_write> = access %P, 0u, 2i, 0u, 1i # %p_vec_1: 'p_vec'
+ %21:f32 = call %f0, %p_vec_1
+ %22:f32 = load %res
+ %23:f32 = add %22, %21
+ store %res, %23
+ %24:f32 = load %res
+ ret %24
+ }
+}
+%f2 = func(%p_2:ptr<private, Inner, read_write>):f32 -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %p_mat:ptr<private, mat3x4<f32>, read_write> = access %p_2, 0u
+ %28:f32 = call %f1, %p_mat
+ ret %28
+ }
+}
+%f3 = func(%p0:ptr<private, array<Inner, 4>, read_write>, %p1:ptr<private, mat3x4<f32>, read_write>):f32 -> %b5 {
+ %b5 = block {
+ %p0_inner:ptr<private, Inner, read_write> = access %p0, 3i
+ %33:f32 = call %f2, %p0_inner
+ %34:f32 = call %f1, %p1
+ %35:f32 = add %33, %34
+ ret %35
+ }
+}
+%f4 = func(%p_3:ptr<private, Outer, read_write>):f32 -> %b6 { # %p_3: 'p'
+ %b6 = block {
+ %38:ptr<private, array<Inner, 4>, read_write> = access %p_3, 0u
+ %39:ptr<private, mat3x4<f32>, read_write> = access %P, 1u
+ %40:f32 = call %f3, %38, %39
+ ret %40
+ }
+}
+%b = func():void -> %b7 {
+ %b7 = block {
+ %42:f32 = call %f4, %P
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace private_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'function' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace function_as_tests {
+
+using IR_DirectVariableAccessTest_FunctionAS = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_LocalPtr) {
+ auto* fn = b.Function("f", ty.void_());
+ b.Append(fn->Block(), [&] {
+ auto* v = b.Var<function, i32>("v");
+ auto* p = b.Let("p", v);
+ b.Var<function>("x", b.Load(p));
+ b.Return(fn);
+ });
+
+ auto* src = R"(
+%f = func():void -> %b1 {
+ %b1 = block {
+ %v:ptr<function, i32, read_write> = var
+ %p:ptr<function, i32, read_write> = let %v
+ %4:i32 = load %p
+ %x:ptr<function, i32, read_write> = var, %4
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src; // Nothing changes
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_Param_ptr_i32_read) {
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var<function, i32>("F");
+ b.Call(fn_a, 10_i, F, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:i32 = load %p
+ ret %5
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, i32, read_write> = var
+ %8:i32 = call %a, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%a_P = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:ptr<function, i32, read_write> = access %p_root
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, i32, read_write> = var
+ %9:i32 = call %a_P, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_Param_ptr_i32_write) {
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, 42_i);
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var<function, i32>("F");
+ b.Call(fn_a, 10_i, F, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):void -> %b1 {
+ %b1 = block {
+ store %p, 42i
+ ret
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, i32, read_write> = var
+ %7:void = call %a, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%a_P = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):void -> %b1 {
+ %b1 = block {
+ %5:ptr<function, i32, read_write> = access %p_root
+ store %5, 42i
+ ret
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, i32, read_write> = var
+ %8:void = call %a_P, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_Param_ptr_i32_Via_struct_read) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var("F", ty.ptr<function>(str_));
+ auto* access = b.Access(ty.ptr<function, i32>(), F, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:i32 = load %p
+ ret %5
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %8:ptr<function, i32, read_write> = access %F, 0u
+ %9:i32 = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%a_P_i = func(%pre:i32, %p_root:ptr<function, str, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:ptr<function, i32, read_write> = access %p_root, 0u
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %9:i32 = call %a_P_i, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* str_ =
+ ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("arr"), ty.array<i32, 4>()},
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, array<i32, 4>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.array<i32, 4>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var("F", ty.ptr<function>(str_));
+ auto* access = b.Access(ty.ptr<function, array<i32, 4>>(), F, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%a = func(%pre:i32, %p:ptr<function, array<i32, 4>, read_write>, %post:i32):void -> %b1 {
+ %b1 = block {
+ store %p, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %7:ptr<function, array<i32, 4>, read_write> = access %F, 0u
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%a_P_arr = func(%pre:i32, %p_root:ptr<function, str, read_write>, %post:i32):void -> %b1 {
+ %b1 = block {
+ %5:ptr<function, array<i32, 4>, read_write> = access %p_root, 0u
+ store %5, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %8:void = call %a_P_arr, 10i, %F, 20i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Enabled_Param_ptr_i32_mixed) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* Fi = b.Var("Fi", ty.ptr<function, i32>());
+ auto* Fs = b.Var("Fs", ty.ptr<function>(str_));
+ auto* Fa = b.Var("Fa", ty.ptr<function, array<i32, 4>>());
+ { // a(10, &Fi, 20);
+ b.Call(fn_a, 10_i, Fi, 20_i);
+ }
+ { // a(30, &Fs.i, 40);
+ auto* access = b.Access(ty.ptr<function, i32>(), Fs, 0_u);
+ b.Call(fn_a, 30_i, access, 40_i);
+ }
+ { // a(50, &Fa[2], 60);
+ auto* access = b.Access(ty.ptr<function, i32>(), Fa, 2_i);
+ b.Call(fn_a, 50_i, access, 60_i);
+ }
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:i32 = load %p
+ ret %5
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %Fi:ptr<function, i32, read_write> = var
+ %Fs:ptr<function, str, read_write> = var
+ %Fa:ptr<function, array<i32, 4>, read_write> = var
+ %10:i32 = call %a, 10i, %Fi, 20i
+ %11:ptr<function, i32, read_write> = access %Fs, 0u
+ %12:i32 = call %a, 30i, %11, 40i
+ %13:ptr<function, i32, read_write> = access %Fa, 2i
+ %14:i32 = call %a, 50i, %13, 60i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%a_P = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:ptr<function, i32, read_write> = access %p_root
+ %6:i32 = load %5
+ ret %6
+ }
+}
+%a_P_i = func(%pre_1:i32, %p_root_1:ptr<function, str, read_write>, %post_1:i32):i32 -> %b2 { # %pre_1: 'pre', %p_root_1: 'p_root', %post_1: 'post'
+ %b2 = block {
+ %11:ptr<function, i32, read_write> = access %p_root_1, 0u
+ %12:i32 = load %11
+ ret %12
+ }
+}
+%a_P_X = func(%pre_2:i32, %p_root_2:ptr<function, array<i32, 4>, read_write>, %p_indices:array<u32, 1>, %post_2:i32):i32 -> %b3 { # %pre_2: 'pre', %p_root_2: 'p_root', %post_2: 'post'
+ %b3 = block {
+ %18:u32 = access %p_indices, 0u
+ %19:ptr<function, i32, read_write> = access %p_root_2, %18
+ %20:i32 = load %19
+ ret %20
+ }
+}
+%b = func():void -> %b4 {
+ %b4 = block {
+ %Fi:ptr<function, i32, read_write> = var
+ %Fs:ptr<function, str, read_write> = var
+ %Fa:ptr<function, array<i32, 4>, read_write> = var
+ %25:i32 = call %a_P, 10i, %Fi, 20i
+ %26:i32 = call %a_P_i, 30i, %Fs, 40i
+ %27:u32 = convert 2i
+ %28:array<u32, 1> = construct %27
+ %29:i32 = call %a_P_X, 50i, %Fa, %28, 60i
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, kTransformFunction);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Disabled_Param_ptr_i32_Via_struct_read) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.i32()},
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, i32>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var("F", ty.ptr<function>(str_));
+ auto* access = b.Access(ty.ptr<function, i32>(), F, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ i:i32 @offset(0)
+}
+
+%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 -> %b1 {
+ %b1 = block {
+ %5:i32 = load %p
+ ret %5
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %8:ptr<function, i32, read_write> = access %F, 0u
+ %9:i32 = call %a, 10i, %8, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_FunctionAS, Disabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* str_ =
+ ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("arr"), ty.array<i32, 4>()},
+ });
+
+ auto* fn_a = b.Function("a", ty.void_());
+ auto* fn_a_p = b.FunctionParam("p", ty.ptr<function, array<i32, 4>>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_p,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] {
+ b.Store(fn_a_p, b.Splat(ty.array<i32, 4>(), 0_i, 4));
+ b.Return(fn_a);
+ });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* F = b.Var("F", ty.ptr<function>(str_));
+ auto* access = b.Access(ty.ptr<function, array<i32, 4>>(), F, 0_u);
+ b.Call(fn_a, 10_i, access, 20_i);
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(4) {
+ arr:array<i32, 4> @offset(0)
+}
+
+%a = func(%pre:i32, %p:ptr<function, array<i32, 4>, read_write>, %post:i32):void -> %b1 {
+ %b1 = block {
+ store %p, array<i32, 4>(0i)
+ ret
+ }
+}
+%b = func():void -> %b2 {
+ %b2 = block {
+ %F:ptr<function, str, read_write> = var
+ %7:ptr<function, array<i32, 4>, read_write> = access %F, 0u
+ %8:void = call %a, 10i, %7, 20i
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = src;
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace function_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// builtin function calls
+////////////////////////////////////////////////////////////////////////////////
+namespace builtin_fn_calls {
+
+using IR_DirectVariableAccessTest_BuiltinFn = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_BuiltinFn, ArrayLength) {
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var<storage, array<f32>>("S");
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_len = b.Function("len", ty.u32());
+ auto* fn_len_p = b.FunctionParam("p", ty.ptr<storage, array<f32>>());
+ fn_len->SetParams({fn_len_p});
+ b.Append(fn_len->Block(),
+ [&] { //
+ b.Return(fn_len, b.Call(ty.u32(), core::BuiltinFn::kArrayLength, fn_len_p));
+ });
+
+ auto* fn_f = b.Function("b", ty.void_());
+ b.Append(fn_f->Block(), [&] {
+ b.Call(fn_len, S);
+ b.Return(fn_f);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%len = func(%p:ptr<storage, array<f32>, read_write>):u32 -> %b2 {
+ %b2 = block {
+ %4:u32 = arrayLength %p
+ ret %4
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %6:u32 = call %len, %S
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%len_S = func():u32 -> %b2 {
+ %b2 = block {
+ %3:ptr<storage, array<f32>, read_write> = access %S
+ %4:u32 = arrayLength %3
+ ret %4
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %6:u32 = call %len_S
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_BuiltinFn, WorkgroupUniformLoad) {
+ Var* W = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ W = b.Var<workgroup, f32>("W");
+ });
+
+ auto* fn_load = b.Function("load", ty.f32());
+ auto* fn_load_p = b.FunctionParam("p", ty.ptr<workgroup, f32>());
+ fn_load->SetParams({fn_load_p});
+ b.Append(fn_load->Block(),
+ [&] { //
+ b.Return(fn_load,
+ b.Call(ty.f32(), core::BuiltinFn::kWorkgroupUniformLoad, fn_load_p));
+ });
+
+ auto* fn_f = b.Function("b", ty.void_());
+ b.Append(fn_f->Block(), [&] {
+ b.Call(fn_load, W);
+ b.Return(fn_f);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, f32, read_write> = var
+}
+
+%load = func(%p:ptr<workgroup, f32, read_write>):f32 -> %b2 {
+ %b2 = block {
+ %4:f32 = workgroupUniformLoad %p
+ ret %4
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %6:f32 = call %load, %W
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %W:ptr<workgroup, f32, read_write> = var
+}
+
+%load_W = func():f32 -> %b2 {
+ %b2 = block {
+ %3:ptr<workgroup, f32, read_write> = access %W
+ %4:f32 = workgroupUniformLoad %3
+ ret %4
+ }
+}
+%b = func():void -> %b3 {
+ %b3 = block {
+ %6:f32 = call %load_W
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace builtin_fn_calls
+
+////////////////////////////////////////////////////////////////////////////////
+// complex tests
+////////////////////////////////////////////////////////////////////////////////
+namespace complex_tests {
+
+using IR_DirectVariableAccessTest_Complex = TransformTest;
+
+TEST_F(IR_DirectVariableAccessTest_Complex, Param_ptr_mixed_vec4i32_ViaMultiple) {
+ auto* str_ = ty.Struct(mod.symbols.New("str"), {
+ {mod.symbols.Register("i"), ty.vec4<i32>()},
+ });
+
+ Var* U = nullptr;
+ Var* U_str = nullptr;
+ Var* U_arr = nullptr;
+ Var* U_arr_arr = nullptr;
+ Var* S = nullptr;
+ Var* S_str = nullptr;
+ Var* S_arr = nullptr;
+ Var* S_arr_arr = nullptr;
+ Var* W = nullptr;
+ Var* W_str = nullptr;
+ Var* W_arr = nullptr;
+ Var* W_arr_arr = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ U = b.Var<uniform, vec4<i32>, read>("U");
+ U->SetBindingPoint(0, 0);
+ U_str = b.Var("U_str", ty.ptr<uniform, read>(str_));
+ U_str->SetBindingPoint(0, 1);
+ U_arr = b.Var<uniform, array<vec4<i32>, 8>, read>("U_arr");
+ U_arr->SetBindingPoint(0, 2);
+ U_arr_arr = b.Var<uniform, array<array<vec4<i32>, 8>, 4>, read>("U_arr_arr");
+ U_arr_arr->SetBindingPoint(0, 3);
+
+ S = b.Var<storage, vec4<i32>, read>("S");
+ S->SetBindingPoint(1, 0);
+ S_str = b.Var("S_str", ty.ptr<storage, read>(str_));
+ S_str->SetBindingPoint(1, 1);
+ S_arr = b.Var<storage, array<vec4<i32>, 8>, read>("S_arr");
+ S_arr->SetBindingPoint(1, 2);
+ S_arr_arr = b.Var<storage, array<array<vec4<i32>, 8>, 4>, read>("S_arr_arr");
+ S_arr_arr->SetBindingPoint(1, 3);
+
+ W = b.Var<workgroup, vec4<i32>>("W");
+ W_str = b.Var("W_str", ty.ptr<workgroup>(str_));
+ W_arr = b.Var<workgroup, array<vec4<i32>, 8>>("W_arr");
+ W_arr_arr = b.Var<workgroup, array<array<vec4<i32>, 8>, 4>>("W_arr_arr");
+ });
+
+ auto* fn_u = b.Function("fn_u", ty.vec4<i32>());
+ auto* fn_u_p = b.FunctionParam("p", ty.ptr<uniform, vec4<i32>, read>());
+ fn_u->SetParams({fn_u_p});
+ b.Append(fn_u->Block(), [&] { b.Return(fn_u, b.Load(fn_u_p)); });
+
+ auto* fn_s = b.Function("fn_s", ty.vec4<i32>());
+ auto* fn_s_p = b.FunctionParam("p", ty.ptr<storage, vec4<i32>, read>());
+ fn_s->SetParams({fn_s_p});
+ b.Append(fn_s->Block(), [&] { b.Return(fn_s, b.Load(fn_s_p)); });
+
+ auto* fn_w = b.Function("fn_w", ty.vec4<i32>());
+ auto* fn_w_p = b.FunctionParam("p", ty.ptr<workgroup, vec4<i32>>());
+ fn_w->SetParams({fn_w_p});
+ b.Append(fn_w->Block(), [&] { b.Return(fn_w, b.Load(fn_w_p)); });
+
+ auto* fn_b = b.Function("b", ty.void_());
+ b.Append(fn_b->Block(), [&] {
+ auto* I = b.Let("I", 3_i);
+ auto* J = b.Let("J", 4_i);
+
+ auto* u = b.Call(fn_u, U);
+ b.ir.SetName(u, "u");
+ auto* u_str = b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_str, 0_u));
+ b.ir.SetName(u_str, "u_str");
+ auto* u_arr0 = b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr, 0_i));
+ b.ir.SetName(u_arr0, "u_arr0");
+ auto* u_arr1 = b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr, 1_i));
+ b.ir.SetName(u_arr1, "u_arr1");
+ auto* u_arrI = b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr, I));
+ b.ir.SetName(u_arrI, "u_arrI");
+ auto* u_arr1_arr0 =
+ b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr_arr, 1_i, 0_i));
+ b.ir.SetName(u_arr1_arr0, "u_arr1_arr0");
+ auto* u_arr2_arrI =
+ b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr_arr, 2_i, I));
+ b.ir.SetName(u_arr2_arrI, "u_arr2_arrI");
+ auto* u_arrI_arr2 =
+ b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr_arr, I, 2_i));
+ b.ir.SetName(u_arrI_arr2, "u_arrI_arr2");
+ auto* u_arrI_arrJ =
+ b.Call(fn_u, b.Access(ty.ptr<uniform, vec4<i32>, read>(), U_arr_arr, I, J));
+ b.ir.SetName(u_arrI_arrJ, "u_arrI_arrJ");
+
+ auto* s = b.Call(fn_s, S);
+ b.ir.SetName(s, "s");
+ auto* s_str = b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_str, 0_u));
+ b.ir.SetName(s_str, "s_str");
+ auto* s_arr0 = b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr, 0_i));
+ b.ir.SetName(s_arr0, "s_arr0");
+ auto* s_arr1 = b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr, 1_i));
+ b.ir.SetName(s_arr1, "s_arr1");
+ auto* s_arrI = b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr, I));
+ b.ir.SetName(s_arrI, "s_arrI");
+ auto* s_arr1_arr0 =
+ b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr_arr, 1_i, 0_i));
+ b.ir.SetName(s_arr1_arr0, "s_arr1_arr0");
+ auto* s_arr2_arrI =
+ b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr_arr, 2_i, I));
+ b.ir.SetName(s_arr2_arrI, "s_arr2_arrI");
+ auto* s_arrI_arr2 =
+ b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr_arr, I, 2_i));
+ b.ir.SetName(s_arrI_arr2, "s_arrI_arr2");
+ auto* s_arrI_arrJ =
+ b.Call(fn_s, b.Access(ty.ptr<storage, vec4<i32>, read>(), S_arr_arr, I, J));
+ b.ir.SetName(s_arrI_arrJ, "s_arrI_arrJ");
+
+ auto* w = b.Call(fn_w, W);
+ b.ir.SetName(w, "w");
+ auto* w_str = b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_str, 0_u));
+ b.ir.SetName(w_str, "w_str");
+ auto* w_arr0 = b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr, 0_i));
+ b.ir.SetName(w_arr0, "w_arr0");
+ auto* w_arr1 = b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr, 1_i));
+ b.ir.SetName(w_arr1, "w_arr1");
+ auto* w_arrI = b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr, I));
+ b.ir.SetName(w_arrI, "w_arrI");
+ auto* w_arr1_arr0 =
+ b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr_arr, 1_i, 0_i));
+ b.ir.SetName(w_arr1_arr0, "w_arr1_arr0");
+ auto* w_arr2_arrI =
+ b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr_arr, 2_i, I));
+ b.ir.SetName(w_arr2_arrI, "w_arr2_arrI");
+ auto* w_arrI_arr2 =
+ b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr_arr, I, 2_i));
+ b.ir.SetName(w_arrI_arr2, "w_arrI_arr2");
+ auto* w_arrI_arrJ = b.Call(fn_w, b.Access(ty.ptr<workgroup, vec4<i32>>(), W_arr_arr, I, J));
+ b.ir.SetName(w_arrI_arrJ, "w_arrI_arrJ");
+
+ b.Return(fn_b);
+ });
+
+ auto* src = R"(
+str = struct @align(16) {
+ i:vec4<i32> @offset(0)
+}
+
+%b1 = block { # root
+ %U:ptr<uniform, vec4<i32>, read> = var @binding_point(0, 0)
+ %U_str:ptr<uniform, str, read> = var @binding_point(0, 1)
+ %U_arr:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 2)
+ %U_arr_arr:ptr<uniform, array<array<vec4<i32>, 8>, 4>, read> = var @binding_point(0, 3)
+ %S:ptr<storage, vec4<i32>, read> = var @binding_point(1, 0)
+ %S_str:ptr<storage, str, read> = var @binding_point(1, 1)
+ %S_arr:ptr<storage, array<vec4<i32>, 8>, read> = var @binding_point(1, 2)
+ %S_arr_arr:ptr<storage, array<array<vec4<i32>, 8>, 4>, read> = var @binding_point(1, 3)
+ %W:ptr<workgroup, vec4<i32>, read_write> = var
+ %W_str:ptr<workgroup, str, read_write> = var
+ %W_arr:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+ %W_arr_arr:ptr<workgroup, array<array<vec4<i32>, 8>, 4>, read_write> = var
+}
+
+%fn_u = func(%p:ptr<uniform, vec4<i32>, read>):vec4<i32> -> %b2 {
+ %b2 = block {
+ %15:vec4<i32> = load %p
+ ret %15
+ }
+}
+%fn_s = func(%p_1:ptr<storage, vec4<i32>, read>):vec4<i32> -> %b3 { # %p_1: 'p'
+ %b3 = block {
+ %18:vec4<i32> = load %p_1
+ ret %18
+ }
+}
+%fn_w = func(%p_2:ptr<workgroup, vec4<i32>, read_write>):vec4<i32> -> %b4 { # %p_2: 'p'
+ %b4 = block {
+ %21:vec4<i32> = load %p_2
+ ret %21
+ }
+}
+%b = func():void -> %b5 {
+ %b5 = block {
+ %I:i32 = let 3i
+ %J:i32 = let 4i
+ %u:vec4<i32> = call %fn_u, %U
+ %26:ptr<uniform, vec4<i32>, read> = access %U_str, 0u
+ %u_str:vec4<i32> = call %fn_u, %26
+ %28:ptr<uniform, vec4<i32>, read> = access %U_arr, 0i
+ %u_arr0:vec4<i32> = call %fn_u, %28
+ %30:ptr<uniform, vec4<i32>, read> = access %U_arr, 1i
+ %u_arr1:vec4<i32> = call %fn_u, %30
+ %32:ptr<uniform, vec4<i32>, read> = access %U_arr, %I
+ %u_arrI:vec4<i32> = call %fn_u, %32
+ %34:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, 1i, 0i
+ %u_arr1_arr0:vec4<i32> = call %fn_u, %34
+ %36:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, 2i, %I
+ %u_arr2_arrI:vec4<i32> = call %fn_u, %36
+ %38:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, %I, 2i
+ %u_arrI_arr2:vec4<i32> = call %fn_u, %38
+ %40:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, %I, %J
+ %u_arrI_arrJ:vec4<i32> = call %fn_u, %40
+ %s:vec4<i32> = call %fn_s, %S
+ %43:ptr<storage, vec4<i32>, read> = access %S_str, 0u
+ %s_str:vec4<i32> = call %fn_s, %43
+ %45:ptr<storage, vec4<i32>, read> = access %S_arr, 0i
+ %s_arr0:vec4<i32> = call %fn_s, %45
+ %47:ptr<storage, vec4<i32>, read> = access %S_arr, 1i
+ %s_arr1:vec4<i32> = call %fn_s, %47
+ %49:ptr<storage, vec4<i32>, read> = access %S_arr, %I
+ %s_arrI:vec4<i32> = call %fn_s, %49
+ %51:ptr<storage, vec4<i32>, read> = access %S_arr_arr, 1i, 0i
+ %s_arr1_arr0:vec4<i32> = call %fn_s, %51
+ %53:ptr<storage, vec4<i32>, read> = access %S_arr_arr, 2i, %I
+ %s_arr2_arrI:vec4<i32> = call %fn_s, %53
+ %55:ptr<storage, vec4<i32>, read> = access %S_arr_arr, %I, 2i
+ %s_arrI_arr2:vec4<i32> = call %fn_s, %55
+ %57:ptr<storage, vec4<i32>, read> = access %S_arr_arr, %I, %J
+ %s_arrI_arrJ:vec4<i32> = call %fn_s, %57
+ %w:vec4<i32> = call %fn_w, %W
+ %60:ptr<workgroup, vec4<i32>, read_write> = access %W_str, 0u
+ %w_str:vec4<i32> = call %fn_w, %60
+ %62:ptr<workgroup, vec4<i32>, read_write> = access %W_arr, 0i
+ %w_arr0:vec4<i32> = call %fn_w, %62
+ %64:ptr<workgroup, vec4<i32>, read_write> = access %W_arr, 1i
+ %w_arr1:vec4<i32> = call %fn_w, %64
+ %66:ptr<workgroup, vec4<i32>, read_write> = access %W_arr, %I
+ %w_arrI:vec4<i32> = call %fn_w, %66
+ %68:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, 1i, 0i
+ %w_arr1_arr0:vec4<i32> = call %fn_w, %68
+ %70:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, 2i, %I
+ %w_arr2_arrI:vec4<i32> = call %fn_w, %70
+ %72:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, %I, 2i
+ %w_arrI_arr2:vec4<i32> = call %fn_w, %72
+ %74:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, %I, %J
+ %w_arrI_arrJ:vec4<i32> = call %fn_w, %74
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+str = struct @align(16) {
+ i:vec4<i32> @offset(0)
+}
+
+%b1 = block { # root
+ %U:ptr<uniform, vec4<i32>, read> = var @binding_point(0, 0)
+ %U_str:ptr<uniform, str, read> = var @binding_point(0, 1)
+ %U_arr:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 2)
+ %U_arr_arr:ptr<uniform, array<array<vec4<i32>, 8>, 4>, read> = var @binding_point(0, 3)
+ %S:ptr<storage, vec4<i32>, read> = var @binding_point(1, 0)
+ %S_str:ptr<storage, str, read> = var @binding_point(1, 1)
+ %S_arr:ptr<storage, array<vec4<i32>, 8>, read> = var @binding_point(1, 2)
+ %S_arr_arr:ptr<storage, array<array<vec4<i32>, 8>, 4>, read> = var @binding_point(1, 3)
+ %W:ptr<workgroup, vec4<i32>, read_write> = var
+ %W_str:ptr<workgroup, str, read_write> = var
+ %W_arr:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
+ %W_arr_arr:ptr<workgroup, array<array<vec4<i32>, 8>, 4>, read_write> = var
+}
+
+%fn_u_U = func():vec4<i32> -> %b2 {
+ %b2 = block {
+ %14:ptr<uniform, vec4<i32>, read> = access %U
+ %15:vec4<i32> = load %14
+ ret %15
+ }
+}
+%fn_u_U_str_i = func():vec4<i32> -> %b3 {
+ %b3 = block {
+ %17:ptr<uniform, vec4<i32>, read> = access %U_str, 0u
+ %18:vec4<i32> = load %17
+ ret %18
+ }
+}
+%fn_u_U_arr_X = func(%p_indices:array<u32, 1>):vec4<i32> -> %b4 {
+ %b4 = block {
+ %21:u32 = access %p_indices, 0u
+ %22:ptr<uniform, vec4<i32>, read> = access %U_arr, %21
+ %23:vec4<i32> = load %22
+ ret %23
+ }
+}
+%fn_u_U_arr_arr_X_X = func(%p_indices_1:array<u32, 2>):vec4<i32> -> %b5 { # %p_indices_1: 'p_indices'
+ %b5 = block {
+ %26:u32 = access %p_indices_1, 0u
+ %27:u32 = access %p_indices_1, 1u
+ %28:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, %26, %27
+ %29:vec4<i32> = load %28
+ ret %29
+ }
+}
+%fn_s_S = func():vec4<i32> -> %b6 {
+ %b6 = block {
+ %31:ptr<storage, vec4<i32>, read> = access %S
+ %32:vec4<i32> = load %31
+ ret %32
+ }
+}
+%fn_s_S_str_i = func():vec4<i32> -> %b7 {
+ %b7 = block {
+ %34:ptr<storage, vec4<i32>, read> = access %S_str, 0u
+ %35:vec4<i32> = load %34
+ ret %35
+ }
+}
+%fn_s_S_arr_X = func(%p_indices_2:array<u32, 1>):vec4<i32> -> %b8 { # %p_indices_2: 'p_indices'
+ %b8 = block {
+ %38:u32 = access %p_indices_2, 0u
+ %39:ptr<storage, vec4<i32>, read> = access %S_arr, %38
+ %40:vec4<i32> = load %39
+ ret %40
+ }
+}
+%fn_s_S_arr_arr_X_X = func(%p_indices_3:array<u32, 2>):vec4<i32> -> %b9 { # %p_indices_3: 'p_indices'
+ %b9 = block {
+ %43:u32 = access %p_indices_3, 0u
+ %44:u32 = access %p_indices_3, 1u
+ %45:ptr<storage, vec4<i32>, read> = access %S_arr_arr, %43, %44
+ %46:vec4<i32> = load %45
+ ret %46
+ }
+}
+%fn_w_W = func():vec4<i32> -> %b10 {
+ %b10 = block {
+ %48:ptr<workgroup, vec4<i32>, read_write> = access %W
+ %49:vec4<i32> = load %48
+ ret %49
+ }
+}
+%fn_w_W_str_i = func():vec4<i32> -> %b11 {
+ %b11 = block {
+ %51:ptr<workgroup, vec4<i32>, read_write> = access %W_str, 0u
+ %52:vec4<i32> = load %51
+ ret %52
+ }
+}
+%fn_w_W_arr_X = func(%p_indices_4:array<u32, 1>):vec4<i32> -> %b12 { # %p_indices_4: 'p_indices'
+ %b12 = block {
+ %55:u32 = access %p_indices_4, 0u
+ %56:ptr<workgroup, vec4<i32>, read_write> = access %W_arr, %55
+ %57:vec4<i32> = load %56
+ ret %57
+ }
+}
+%fn_w_W_arr_arr_X_X = func(%p_indices_5:array<u32, 2>):vec4<i32> -> %b13 { # %p_indices_5: 'p_indices'
+ %b13 = block {
+ %60:u32 = access %p_indices_5, 0u
+ %61:u32 = access %p_indices_5, 1u
+ %62:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, %60, %61
+ %63:vec4<i32> = load %62
+ ret %63
+ }
+}
+%b = func():void -> %b14 {
+ %b14 = block {
+ %I:i32 = let 3i
+ %J:i32 = let 4i
+ %u:vec4<i32> = call %fn_u_U
+ %u_str:vec4<i32> = call %fn_u_U_str_i
+ %69:u32 = convert 0i
+ %70:array<u32, 1> = construct %69
+ %u_arr0:vec4<i32> = call %fn_u_U_arr_X, %70
+ %72:u32 = convert 1i
+ %73:array<u32, 1> = construct %72
+ %u_arr1:vec4<i32> = call %fn_u_U_arr_X, %73
+ %75:u32 = convert %I
+ %76:array<u32, 1> = construct %75
+ %u_arrI:vec4<i32> = call %fn_u_U_arr_X, %76
+ %78:u32 = convert 1i
+ %79:u32 = convert 0i
+ %80:array<u32, 2> = construct %78, %79
+ %u_arr1_arr0:vec4<i32> = call %fn_u_U_arr_arr_X_X, %80
+ %82:u32 = convert 2i
+ %83:u32 = convert %I
+ %84:array<u32, 2> = construct %82, %83
+ %u_arr2_arrI:vec4<i32> = call %fn_u_U_arr_arr_X_X, %84
+ %86:u32 = convert %I
+ %87:u32 = convert 2i
+ %88:array<u32, 2> = construct %86, %87
+ %u_arrI_arr2:vec4<i32> = call %fn_u_U_arr_arr_X_X, %88
+ %90:u32 = convert %I
+ %91:u32 = convert %J
+ %92:array<u32, 2> = construct %90, %91
+ %u_arrI_arrJ:vec4<i32> = call %fn_u_U_arr_arr_X_X, %92
+ %s:vec4<i32> = call %fn_s_S
+ %s_str:vec4<i32> = call %fn_s_S_str_i
+ %96:u32 = convert 0i
+ %97:array<u32, 1> = construct %96
+ %s_arr0:vec4<i32> = call %fn_s_S_arr_X, %97
+ %99:u32 = convert 1i
+ %100:array<u32, 1> = construct %99
+ %s_arr1:vec4<i32> = call %fn_s_S_arr_X, %100
+ %102:u32 = convert %I
+ %103:array<u32, 1> = construct %102
+ %s_arrI:vec4<i32> = call %fn_s_S_arr_X, %103
+ %105:u32 = convert 1i
+ %106:u32 = convert 0i
+ %107:array<u32, 2> = construct %105, %106
+ %s_arr1_arr0:vec4<i32> = call %fn_s_S_arr_arr_X_X, %107
+ %109:u32 = convert 2i
+ %110:u32 = convert %I
+ %111:array<u32, 2> = construct %109, %110
+ %s_arr2_arrI:vec4<i32> = call %fn_s_S_arr_arr_X_X, %111
+ %113:u32 = convert %I
+ %114:u32 = convert 2i
+ %115:array<u32, 2> = construct %113, %114
+ %s_arrI_arr2:vec4<i32> = call %fn_s_S_arr_arr_X_X, %115
+ %117:u32 = convert %I
+ %118:u32 = convert %J
+ %119:array<u32, 2> = construct %117, %118
+ %s_arrI_arrJ:vec4<i32> = call %fn_s_S_arr_arr_X_X, %119
+ %w:vec4<i32> = call %fn_w_W
+ %w_str:vec4<i32> = call %fn_w_W_str_i
+ %123:u32 = convert 0i
+ %124:array<u32, 1> = construct %123
+ %w_arr0:vec4<i32> = call %fn_w_W_arr_X, %124
+ %126:u32 = convert 1i
+ %127:array<u32, 1> = construct %126
+ %w_arr1:vec4<i32> = call %fn_w_W_arr_X, %127
+ %129:u32 = convert %I
+ %130:array<u32, 1> = construct %129
+ %w_arrI:vec4<i32> = call %fn_w_W_arr_X, %130
+ %132:u32 = convert 1i
+ %133:u32 = convert 0i
+ %134:array<u32, 2> = construct %132, %133
+ %w_arr1_arr0:vec4<i32> = call %fn_w_W_arr_arr_X_X, %134
+ %136:u32 = convert 2i
+ %137:u32 = convert %I
+ %138:array<u32, 2> = construct %136, %137
+ %w_arr2_arrI:vec4<i32> = call %fn_w_W_arr_arr_X_X, %138
+ %140:u32 = convert %I
+ %141:u32 = convert 2i
+ %142:array<u32, 2> = construct %140, %141
+ %w_arrI_arr2:vec4<i32> = call %fn_w_W_arr_arr_X_X, %142
+ %144:u32 = convert %I
+ %145:u32 = convert %J
+ %146:array<u32, 2> = construct %144, %145
+ %w_arrI_arrJ:vec4<i32> = call %fn_w_W_arr_arr_X_X, %146
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_Complex, Indexing) {
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read>("S");
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_i = b.FunctionParam("i", ty.i32());
+ fn_a->SetParams({fn_a_i});
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, fn_a_i); });
+
+ auto* fn_b = b.Function("b", ty.i32());
+ auto* fn_b_p = b.FunctionParam("p", ty.ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>());
+ fn_b->SetParams({fn_b_p});
+ b.Append(fn_b->Block(), [&] {
+ auto load_0 = b.Load(b.Access(ty.ptr<storage, i32, read>(), fn_b_p, 0_i, 1_i, 2_i));
+ auto call_0 = b.Call(fn_a, load_0);
+ auto call_1 = b.Call(fn_a, 3_i);
+ auto load_1 = b.Load(b.Access(ty.ptr<storage, i32, read>(), fn_b_p, call_1, 4_i, 5_i));
+ auto call_2 = b.Call(fn_a, load_1);
+ auto call_3 = b.Call(fn_a, 7_i);
+ auto load_2 = b.Load(b.Access(ty.ptr<storage, i32, read>(), fn_b_p, 6_i, call_3, 8_i));
+ auto call_4 = b.Call(fn_a, load_2);
+ auto load_3 =
+ b.Load(b.Access(ty.ptr<storage, i32, read>(), fn_b_p, call_0, call_2, call_4));
+
+ b.Return(fn_b, load_3);
+ });
+
+ auto* fn_c = b.Function("c", ty.void_());
+ b.Append(fn_c->Block(), [&] {
+ auto* access =
+ b.Access(ty.ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>(), S, 42_i);
+ auto* v = b.Call(fn_b, access);
+ b.ir.SetName(v, "v");
+ b.Return(fn_c);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%i:i32):i32 -> %b2 {
+ %b2 = block {
+ ret %i
+ }
+}
+%b = func(%p:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>):i32 -> %b3 {
+ %b3 = block {
+ %6:ptr<storage, i32, read> = access %p, 0i, 1i, 2i
+ %7:i32 = load %6
+ %8:i32 = call %a, %7
+ %9:i32 = call %a, 3i
+ %10:ptr<storage, i32, read> = access %p, %9, 4i, 5i
+ %11:i32 = load %10
+ %12:i32 = call %a, %11
+ %13:i32 = call %a, 7i
+ %14:ptr<storage, i32, read> = access %p, 6i, %13, 8i
+ %15:i32 = load %14
+ %16:i32 = call %a, %15
+ %17:ptr<storage, i32, read> = access %p, %8, %12, %16
+ %18:i32 = load %17
+ ret %18
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %20:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, 42i
+ %v:i32 = call %b, %20
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%i:i32):i32 -> %b2 {
+ %b2 = block {
+ ret %i
+ }
+}
+%b_S_X = func(%p_indices:array<u32, 1>):i32 -> %b3 {
+ %b3 = block {
+ %6:u32 = access %p_indices, 0u
+ %7:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, %6
+ %8:ptr<storage, i32, read> = access %7, 0i, 1i, 2i
+ %9:i32 = load %8
+ %10:i32 = call %a, %9
+ %11:i32 = call %a, 3i
+ %12:ptr<storage, i32, read> = access %7, %11, 4i, 5i
+ %13:i32 = load %12
+ %14:i32 = call %a, %13
+ %15:i32 = call %a, 7i
+ %16:ptr<storage, i32, read> = access %7, 6i, %15, 8i
+ %17:i32 = load %16
+ %18:i32 = call %a, %17
+ %19:ptr<storage, i32, read> = access %7, %10, %14, %18
+ %20:i32 = load %19
+ ret %20
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %22:u32 = convert 42i
+ %23:array<u32, 1> = construct %22
+ %v:i32 = call %b_S_X, %23
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_Complex, IndexingInPtrCall) {
+ Var* S = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read>("S");
+ S->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_i = b.FunctionParam("i", ty.ptr<storage, i32, read>());
+ fn_a->SetParams({
+ b.FunctionParam("pre", ty.i32()),
+ fn_a_i,
+ b.FunctionParam("post", ty.i32()),
+ });
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, b.Load(fn_a_i)); });
+
+ auto* fn_b = b.Function("b", ty.i32());
+ auto* fn_b_p = b.FunctionParam("p", ty.ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>());
+ fn_b->SetParams({fn_b_p});
+ b.Append(fn_b->Block(), [&] {
+ auto access_0 = b.Access(ty.ptr<storage, i32, read>(), fn_b_p, 0_i, 1_i, 2_i);
+ auto call_0 = b.Call(fn_a, 20_i, access_0, 30_i);
+
+ auto access_1 = b.Access(ty.ptr<storage, i32, read>(), fn_b_p, 3_i, 4_i, 5_i);
+ auto call_1 = b.Call(fn_a, 40_i, access_1, 50_i);
+
+ auto access_2 = b.Access(ty.ptr<storage, i32, read>(), fn_b_p, 6_i, 7_i, 8_i);
+ auto call_2 = b.Call(fn_a, 60_i, access_2, 70_i);
+
+ auto access_3 = b.Access(ty.ptr<storage, i32, read>(), fn_b_p, call_0, call_1, call_2);
+ auto call_3 = b.Call(fn_a, 10_i, access_3, 80_i);
+
+ b.Return(fn_b, call_3);
+ });
+
+ auto* fn_c = b.Function("c", ty.void_());
+ b.Append(fn_c->Block(), [&] {
+ auto* access =
+ b.Access(ty.ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>(), S, 42_i);
+ auto* v = b.Call(fn_b, access);
+ b.ir.SetName(v, "v");
+ b.Return(fn_c);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%pre:i32, %i:ptr<storage, i32, read>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:i32 = load %i
+ ret %6
+ }
+}
+%b = func(%p:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>):i32 -> %b3 {
+ %b3 = block {
+ %9:ptr<storage, i32, read> = access %p, 0i, 1i, 2i
+ %10:i32 = call %a, 20i, %9, 30i
+ %11:ptr<storage, i32, read> = access %p, 3i, 4i, 5i
+ %12:i32 = call %a, 40i, %11, 50i
+ %13:ptr<storage, i32, read> = access %p, 6i, 7i, 8i
+ %14:i32 = call %a, 60i, %13, 70i
+ %15:ptr<storage, i32, read> = access %p, %10, %12, %14
+ %16:i32 = call %a, 10i, %15, 80i
+ ret %16
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %18:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, 42i
+ %v:i32 = call %b, %18
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a_S_X_X_X_X = func(%pre:i32, %i_indices:array<u32, 4>, %post:i32):i32 -> %b2 {
+ %b2 = block {
+ %6:u32 = access %i_indices, 0u
+ %7:u32 = access %i_indices, 1u
+ %8:u32 = access %i_indices, 2u
+ %9:u32 = access %i_indices, 3u
+ %10:ptr<storage, i32, read> = access %S, %6, %7, %8, %9
+ %11:i32 = load %10
+ ret %11
+ }
+}
+%b_S_X = func(%p_indices:array<u32, 1>):i32 -> %b3 {
+ %b3 = block {
+ %14:u32 = access %p_indices, 0u
+ %15:u32 = convert 0i
+ %16:u32 = convert 1i
+ %17:u32 = convert 2i
+ %18:array<u32, 4> = construct %14, %15, %16, %17
+ %19:i32 = call %a_S_X_X_X_X, 20i, %18, 30i
+ %20:u32 = convert 3i
+ %21:u32 = convert 4i
+ %22:u32 = convert 5i
+ %23:array<u32, 4> = construct %14, %20, %21, %22
+ %24:i32 = call %a_S_X_X_X_X, 40i, %23, 50i
+ %25:u32 = convert 6i
+ %26:u32 = convert 7i
+ %27:u32 = convert 8i
+ %28:array<u32, 4> = construct %14, %25, %26, %27
+ %29:i32 = call %a_S_X_X_X_X, 60i, %28, 70i
+ %30:u32 = convert %19
+ %31:u32 = convert %24
+ %32:u32 = convert %29
+ %33:array<u32, 4> = construct %14, %30, %31, %32
+ %34:i32 = call %a_S_X_X_X_X, 10i, %33, 80i
+ ret %34
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %36:u32 = convert 42i
+ %37:array<u32, 1> = construct %36
+ %v:i32 = call %b_S_X, %37
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(IR_DirectVariableAccessTest_Complex, IndexingDualPointers) {
+ Var* S = nullptr;
+ Var* U = nullptr;
+ b.Append(b.ir.root_block,
+ [&] { //
+ S = b.Var<storage, array<array<array<i32, 9>, 9>, 50>, read>("S");
+ S->SetBindingPoint(0, 0);
+ U = b.Var<uniform, array<array<array<vec4<i32>, 9>, 9>, 50>, read>("U");
+ U->SetBindingPoint(0, 0);
+ });
+
+ auto* fn_a = b.Function("a", ty.i32());
+ auto* fn_a_i = b.FunctionParam("i", ty.i32());
+ fn_a->SetParams({fn_a_i});
+ b.Append(fn_a->Block(), [&] { b.Return(fn_a, fn_a_i); });
+
+ auto* fn_b = b.Function("b", ty.i32());
+ auto* fn_b_s = b.FunctionParam("s", ty.ptr<storage, array<array<i32, 9>, 9>, read>());
+ auto* fn_b_u = b.FunctionParam("u", ty.ptr<uniform, array<array<vec4<i32>, 9>, 9>, read>());
+ fn_b->SetParams({fn_b_s, fn_b_u});
+ b.Append(fn_b->Block(), [&] {
+ auto access_0 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), fn_b_u, 0_i, 1_i);
+ auto call_0 = b.Call(fn_a, b.LoadVectorElement(access_0, 0_u));
+ auto call_1 = b.Call(fn_a, 3_i);
+
+ auto access_1 = b.Access(ty.ptr<uniform, vec4<i32>, read>(), fn_b_u, call_1, 4_i);
+ auto call_2 = b.Call(fn_a, b.LoadVectorElement(access_1, 1_u));
+
+ auto access_2 = b.Access(ty.ptr<storage, i32, read>(), fn_b_s, call_0, call_2);
+
+ b.Return(fn_b, b.Load(access_2));
+ });
+
+ auto* fn_c = b.Function("c", ty.void_());
+ b.Append(fn_c->Block(), [&] {
+ auto* access_0 = b.Access(ty.ptr<storage, array<array<i32, 9>, 9>, read>(), S, 42_i);
+ auto* access_1 = b.Access(ty.ptr<uniform, array<array<vec4<i32>, 9>, 9>, read>(), U, 24_i);
+ auto* v = b.Call(fn_b, access_0, access_1);
+ b.ir.SetName(v, "v");
+ b.Return(fn_c);
+ });
+
+ auto* src = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<i32, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+ %U:ptr<uniform, array<array<array<vec4<i32>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%i:i32):i32 -> %b2 {
+ %b2 = block {
+ ret %i
+ }
+}
+%b = func(%s:ptr<storage, array<array<i32, 9>, 9>, read>, %u:ptr<uniform, array<array<vec4<i32>, 9>, 9>, read>):i32 -> %b3 {
+ %b3 = block {
+ %8:ptr<uniform, vec4<i32>, read> = access %u, 0i, 1i
+ %9:i32 = load_vector_element %8, 0u
+ %10:i32 = call %a, %9
+ %11:i32 = call %a, 3i
+ %12:ptr<uniform, vec4<i32>, read> = access %u, %11, 4i
+ %13:i32 = load_vector_element %12, 1u
+ %14:i32 = call %a, %13
+ %15:ptr<storage, i32, read> = access %s, %10, %14
+ %16:i32 = load %15
+ ret %16
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %18:ptr<storage, array<array<i32, 9>, 9>, read> = access %S, 42i
+ %19:ptr<uniform, array<array<vec4<i32>, 9>, 9>, read> = access %U, 24i
+ %v:i32 = call %b, %18, %19
+ ret
+ }
+}
+)";
+
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%b1 = block { # root
+ %S:ptr<storage, array<array<array<i32, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+ %U:ptr<uniform, array<array<array<vec4<i32>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
+}
+
+%a = func(%i:i32):i32 -> %b2 {
+ %b2 = block {
+ ret %i
+ }
+}
+%b_S_X_U_X = func(%s_indices:array<u32, 1>, %u_indices:array<u32, 1>):i32 -> %b3 {
+ %b3 = block {
+ %8:u32 = access %s_indices, 0u
+ %9:ptr<storage, array<array<i32, 9>, 9>, read> = access %S, %8
+ %10:u32 = access %u_indices, 0u
+ %11:ptr<uniform, array<array<vec4<i32>, 9>, 9>, read> = access %U, %10
+ %12:ptr<uniform, vec4<i32>, read> = access %11, 0i, 1i
+ %13:i32 = load_vector_element %12, 0u
+ %14:i32 = call %a, %13
+ %15:i32 = call %a, 3i
+ %16:ptr<uniform, vec4<i32>, read> = access %11, %15, 4i
+ %17:i32 = load_vector_element %16, 1u
+ %18:i32 = call %a, %17
+ %19:ptr<storage, i32, read> = access %9, %14, %18
+ %20:i32 = load %19
+ ret %20
+ }
+}
+%c = func():void -> %b4 {
+ %b4 = block {
+ %22:u32 = convert 42i
+ %23:array<u32, 1> = construct %22
+ %24:u32 = convert 24i
+ %25:array<u32, 1> = construct %24
+ %v:i32 = call %b_S_X_U_X, %23, %25
+ ret
+ }
+}
+)";
+
+ Run(DirectVariableAccess, DirectVariableAccessOptions{});
+
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace complex_tests
+
+} // namespace
+} // namespace tint::core::ir::transform
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc b/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc
new file mode 100644
index 0000000..a764250
--- /dev/null
+++ b/src/tint/lang/core/ir/transform/direct_variable_access_wgsl_test.cc
@@ -0,0 +1,2525 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// GEN_BUILD:CONDITION(tint_build_wgsl_reader && tint_build_wgsl_writer)
+
+#include "src/tint/lang/core/ir/transform/direct_variable_access.h"
+
+#include <utility>
+
+#include "src/tint/lang/core/ir/transform/helper_test.h"
+
+#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
+#include "src/tint/lang/wgsl/reader/reader.h"
+#include "src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.h"
+#include "src/tint/lang/wgsl/writer/writer.h"
+
+namespace tint::core::ir::transform {
+namespace {
+
+using namespace tint::core::fluent_types; // NOLINT
+using namespace tint::core::number_suffixes; // NOLINT
+
+namespace {
+
+static constexpr DirectVariableAccessOptions kTransformPrivate = {
+ /* transform_private */ true,
+ /* transform_function */ false,
+};
+
+static constexpr DirectVariableAccessOptions kTransformFunction = {
+ /* transform_private */ false,
+ /* transform_function */ true,
+};
+
+class DirectVariableAccessTest : public TransformTestBase<testing::Test> {
+ public:
+ std::string Run(std::string in, const DirectVariableAccessOptions& options = {}) {
+ Source::File file{"test", in};
+ auto program = wgsl::reader::Parse(&file);
+ if (!program.IsValid()) {
+ return "wgsl::reader::Parse() failed: \n" + program.Diagnostics().str();
+ }
+
+ auto module = wgsl::reader::ProgramToIR(program);
+ if (!module) {
+ return "ProgramToIR() failed:\n" + module.Failure().reason.str();
+ }
+
+ auto res = DirectVariableAccess(module.Get(), options);
+ if (!res) {
+ return "DirectVariableAccess failed:\n" + res.Failure().reason.str();
+ }
+
+ auto transformed = wgsl::writer::IRToProgram(module.Get());
+ if (!transformed.IsValid()) {
+ return "wgsl::writer::IRToProgram() failed: \n" + transformed.Diagnostics().str() +
+ "\n\nIR:\n" + ir::Disassembler(module.Get()).Disassemble() + //
+ "\n\nAST:\n" + Program::printer(transformed);
+ }
+
+ auto output = wgsl::writer::Generate(transformed, wgsl::writer::Options{});
+ if (!output) {
+ return "wgsl::writer::Generate() failed: \n" + output.Failure().reason.str();
+ }
+
+ return "\n" + output->wgsl;
+ }
+};
+
+} // namespace
+
+////////////////////////////////////////////////////////////////////////////////
+// remove uncalled
+////////////////////////////////////////////////////////////////////////////////
+namespace remove_uncalled {
+
+using IR_DirectVariableAccessWgslTest_RemoveUncalled = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrUniform) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<private> keep_me : i32 = 42i;
+
+fn u(pre : i32, p : ptr<uniform, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+)";
+
+ auto* expect = R"(
+var<private> keep_me : i32 = 42i;
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrStorage) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<private> keep_me : i32 = 42i;
+
+fn s(pre : i32, p : ptr<storage, i32>, post : i32) -> i32 {
+ return *(p);
+}
+)";
+
+ auto* expect = R"(
+var<private> keep_me : i32 = 42i;
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrWorkgroup) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<private> keep_me : i32 = 42i;
+
+fn w(pre : i32, p : ptr<workgroup, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+)";
+
+ auto* expect = R"(
+var<private> keep_me : i32 = 42i;
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrPrivate_Disabled) {
+ auto* src = R"(
+var<private> keep_me : i32 = 42i;
+
+fn f(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *(p);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrPrivate_Enabled) {
+ auto* src = R"(
+var<private> keep_me : i32 = 42i;
+
+fn f(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *(p);
+}
+)";
+
+ auto* expect = R"(
+var<private> keep_me : i32 = 42i;
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrFunction_Disabled) {
+ auto* src = R"(
+var<private> keep_me : i32 = 42i;
+
+fn f(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *(p);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_RemoveUncalled, PtrFunction_Enabled) {
+ auto* src = R"(
+var<private> keep_me : i32 = 42i;
+
+fn f(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *(p);
+}
+)";
+
+ auto* expect = R"(
+var<private> keep_me : i32 = 42i;
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace remove_uncalled
+
+////////////////////////////////////////////////////////////////////////////////
+// pointer chains
+////////////////////////////////////////////////////////////////////////////////
+namespace pointer_chains_tests {
+
+using IR_DirectVariableAccessWgslTest_PtrChains = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, ConstantIndices) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 8>, 8>, 8>;
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let p0 = &U;
+ let p1 = &(*p0)[1];
+ let p2 = &(*p1)[1+1];
+ let p3 = &(*p2)[2*2 - 1];
+ a(10, p3, 20);
+}
+
+fn c(p : ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>>) {
+ let p0 = p;
+ let p1 = &(*p0)[1];
+ let p2 = &(*p1)[1+1];
+ let p3 = &(*p2)[2*2 - 1];
+ a(10, p3, 20);
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect =
+ R"(
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 8u>, 8u>, 8u>;
+
+fn a_U_X_X_X(pre : i32, p_indices : array<u32, 3u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]][p_indices[2u]];
+}
+
+fn b() {
+ a_U_X_X_X(10i, array<u32, 3u>(u32(1i), u32(2i), u32(3i)), 20i);
+}
+
+fn c_U() {
+ a_U_X_X_X(10i, array<u32, 3u>(u32(1i), u32(2i), u32(3i)), 20i);
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, DynamicIndices) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 8>, 8>, 8>;
+
+var<private> i : i32;
+fn first() -> i32 {
+ i++;
+ return i;
+}
+fn second() -> i32 {
+ i++;
+ return i;
+}
+fn third() -> i32 {
+ i++;
+ return i;
+}
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let p0 = &U;
+ let p1 = &(*p0)[first()];
+ let p2 = &(*p1)[second()][third()];
+ a(10, p2, 20);
+}
+
+fn c(p : ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>>) {
+ let p0 = p;
+ let p1 = &(*p0)[first()];
+ let p2 = &(*p1)[second()][third()];
+ a(10, p2, 20);
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 8u>, 8u>, 8u>;
+
+var<private> i : i32;
+
+fn first() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn second() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn third() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn a_U_X_X_X(pre : i32, p_indices : array<u32, 3u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]][p_indices[2u]];
+}
+
+fn b() {
+ let v = first();
+ let v_1 = second();
+ a_U_X_X_X(10i, array<u32, 3u>(u32(v), u32(v_1), u32(third())), 20i);
+}
+
+fn c_U() {
+ let v_2 = first();
+ let v_3 = second();
+ a_U_X_X_X(10i, array<u32, 3u>(u32(v_2), u32(v_3), u32(third())), 20i);
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, DynamicIndicesForLoopInit) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8>, 8>;
+
+var<private> i : i32;
+fn first() -> i32 {
+ i++;
+ return i;
+}
+fn second() -> i32 {
+ i++;
+ return i;
+}
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ for (let p1 = &U[first()]; true; ) {
+ a(10, &(*p1)[second()], 20);
+ }
+}
+
+fn c(p : ptr<uniform, array<array<vec4<i32>, 8>, 8>>) {
+ for (let p1 = &(*p)[first()]; true; ) {
+ a(10, &(*p1)[second()], 20);
+ }
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8u>, 8u>;
+
+var<private> i : i32;
+
+fn first() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn second() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn a_U_X_X(pre : i32, p_indices : array<u32, 2u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]];
+}
+
+fn b() {
+ for(let v = first(); true; ) {
+ a_U_X_X(10i, array<u32, 2u>(u32(v), u32(second())), 20i);
+ }
+}
+
+fn c_U() {
+ for(let v_1 = first(); true; ) {
+ a_U_X_X(10i, array<u32, 2u>(u32(v_1), u32(second())), 20i);
+ }
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, DynamicIndicesForLoopCond) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8>, 8>;
+
+var<private> i : i32;
+fn first() -> i32 {
+ i++;
+ return i;
+}
+fn second() -> i32 {
+ i++;
+ return i;
+}
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let p = &U[first()][second()];
+ for (; a(10, p, 20).x < 4; ) {
+ let body = 1;
+ }
+}
+
+fn c(p : ptr<uniform, array<array<vec4<i32>, 8>, 8>>) {
+ let p2 = &(*p)[first()][second()];
+ for (; a(10, p2, 20).x < 4; ) {
+ let body = 1;
+ }
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8u>, 8u>;
+
+var<private> i : i32;
+
+fn first() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn second() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn a_U_X_X(pre : i32, p_indices : array<u32, 2u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]];
+}
+
+fn b() {
+ let v = first();
+ let v_1 = second();
+ while((a_U_X_X(10i, array<u32, 2u>(u32(v), u32(v_1)), 20i).x < 4i)) {
+ let body = 1i;
+ }
+}
+
+fn c_U() {
+ let v_2 = first();
+ let v_3 = second();
+ while((a_U_X_X(10i, array<u32, 2u>(u32(v_2), u32(v_3)), 20i).x < 4i)) {
+ let body = 1i;
+ }
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, DynamicIndicesForLoopCont) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8>, 8>;
+
+var<private> i : i32;
+fn first() -> i32 {
+ i++;
+ return i;
+}
+fn second() -> i32 {
+ i++;
+ return i;
+}
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let p = &U[first()][second()];
+ for (var i = 0; i < 3; a(10, p, 20)) {
+ i++;
+ }
+}
+
+fn c(p : ptr<uniform, array<array<vec4<i32>, 8>, 8>>) {
+ let p2 = &(*p)[first()][second()];
+ for (var i = 0; i < 3; a(10, p2, 20)) {
+ i++;
+ }
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8u>, 8u>;
+
+var<private> i : i32;
+
+fn first() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn second() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn a_U_X_X(pre : i32, p_indices : array<u32, 2u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]];
+}
+
+fn b() {
+ let v = first();
+ let v_1 = second();
+ for(var i : i32 = 0i; (i < 3i); a_U_X_X(10i, array<u32, 2u>(u32(v), u32(v_1)), 20i)) {
+ i = (i + 1i);
+ }
+}
+
+fn c_U() {
+ let v_2 = first();
+ let v_3 = second();
+ for(var i : i32; (i < 3i); a_U_X_X(10i, array<u32, 2u>(u32(v_2), u32(v_3)), 20i)) {
+ i = (i + 1i);
+ }
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PtrChains, DynamicIndicesWhileCond) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8>, 8>;
+
+var<private> i : i32;
+fn first() -> i32 {
+ i++;
+ return i;
+}
+fn second() -> i32 {
+ i++;
+ return i;
+}
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let p = &U[first()][second()];
+ while (a(10, p, 20).x < 4) {
+ let body = 1;
+ }
+}
+
+fn c(p : ptr<uniform, array<array<vec4<i32>, 8>, 8>>) {
+ let p2 = &(*p)[first()][second()];
+ while (a(10, p2, 20).x < 4) {
+ let body = 1;
+ }
+}
+
+fn d() {
+ c(&U);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<array<vec4<i32>, 8u>, 8u>;
+
+var<private> i : i32;
+
+fn first() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn second() -> i32 {
+ i = (i + 1i);
+ return i;
+}
+
+fn a_U_X_X(pre : i32, p_indices : array<u32, 2u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]][p_indices[1u]];
+}
+
+fn b() {
+ let v = first();
+ let v_1 = second();
+ while((a_U_X_X(10i, array<u32, 2u>(u32(v), u32(v_1)), 20i).x < 4i)) {
+ let body = 1i;
+ }
+}
+
+fn c_U() {
+ let v_2 = first();
+ let v_3 = second();
+ while((a_U_X_X(10i, array<u32, 2u>(u32(v_2), u32(v_3)), 20i).x < 4i)) {
+ let body = 1i;
+ }
+}
+
+fn d() {
+ c_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+} // namespace pointer_chains_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'uniform' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace uniform_as_tests {
+
+using IR_DirectVariableAccessWgslTest_UniformAS = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_UniformAS, Param_ptr_i32_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : i32;
+
+fn a(pre : i32, p : ptr<uniform, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+fn b() {
+ a(10, &U, 20);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : i32;
+
+fn a_U(pre : i32, post : i32) -> i32 {
+ return U;
+}
+
+fn b() {
+ a_U(10i, 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_UniformAS, Param_ptr_vec4i32_Via_array_DynamicRead) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<uniform> U : array<vec4<i32>, 8>;
+
+fn a(pre : i32, p : ptr<uniform, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let I = 3;
+ a(10, &U[I], 20);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : array<vec4<i32>, 8u>;
+
+fn a_U_X(pre : i32, p_indices : array<u32, 1u>, post : i32) -> vec4<i32> {
+ return U[p_indices[0u]];
+}
+
+fn b() {
+ let I = 3i;
+ a_U_X(10i, array<u32, 1u>(u32(I)), 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_UniformAS, CallChaining) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct Inner {
+ mat : mat3x4<f32>,
+};
+
+alias InnerArr = array<Inner, 4>;
+
+struct Outer {
+ arr : InnerArr,
+ mat : mat3x4<f32>,
+};
+
+@group(0) @binding(0) var<uniform> U : Outer;
+
+fn f0(p : ptr<uniform, vec4<f32>>) -> f32 {
+ return (*p).x;
+}
+
+fn f1(p : ptr<uniform, mat3x4<f32>>) -> f32 {
+ var res : f32;
+ {
+ // call f0() with inline usage of p
+ res += f0(&(*p)[1]);
+ }
+ {
+ // call f0() with pointer-let usage of p
+ let p_vec = &(*p)[1];
+ res += f0(p_vec);
+ }
+ {
+ // call f0() with inline usage of U
+ res += f0(&U.arr[2].mat[1]);
+ }
+ {
+ // call f0() with pointer-let usage of U
+ let p_vec = &U.arr[2].mat[1];
+ res += f0(p_vec);
+ }
+ return res;
+}
+
+fn f2(p : ptr<uniform, Inner>) -> f32 {
+ let p_mat = &(*p).mat;
+ return f1(p_mat);
+}
+
+fn f3(p0 : ptr<uniform, InnerArr>, p1 : ptr<uniform, mat3x4<f32>>) -> f32 {
+ let p0_inner = &(*p0)[3];
+ return f2(p0_inner) + f1(p1);
+}
+
+fn f4(p : ptr<uniform, Outer>) -> f32 {
+ return f3(&(*p).arr, &U.mat);
+}
+
+fn b() {
+ f4(&U);
+}
+)";
+
+ auto* expect = R"(
+struct Inner {
+ mat : mat3x4<f32>,
+}
+
+struct Outer {
+ arr : array<Inner, 4u>,
+ mat : mat3x4<f32>,
+}
+
+@group(0) @binding(0) var<uniform> U : Outer;
+
+fn f0_U_mat_X(p_indices : array<u32, 1u>) -> f32 {
+ return U.mat[p_indices[0u]].x;
+}
+
+fn f0_U_arr_X_mat_X(p_indices : array<u32, 2u>) -> f32 {
+ return U.arr[p_indices[0u]].mat[p_indices[1u]].x;
+}
+
+fn f1_U_mat() -> f32 {
+ var res : f32;
+ let v = f0_U_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v);
+ let v_1 = f0_U_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v_1);
+ let v_2 = f0_U_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_2);
+ let v_3 = f0_U_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_3);
+ return res;
+}
+
+fn f1_U_arr_X_mat(p_indices : array<u32, 1u>) -> f32 {
+ let v_4 = p_indices[0u];
+ var res : f32;
+ let v_5 = f0_U_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_5);
+ let v_6 = f0_U_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_6);
+ let v_7 = f0_U_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_7);
+ let v_8 = f0_U_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_8);
+ return res;
+}
+
+fn f2_U_arr_X(p_indices : array<u32, 1u>) -> f32 {
+ return f1_U_arr_X_mat(array<u32, 1u>(p_indices[0u]));
+}
+
+fn f3_U_arr_U_mat() -> f32 {
+ return (f2_U_arr_X(array<u32, 1u>(u32(3i))) + f1_U_mat());
+}
+
+fn f4_U() -> f32 {
+ return f3_U_arr_U_mat();
+}
+
+fn b() {
+ f4_U();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace uniform_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'storage' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace storage_as_tests {
+
+using IR_DirectVariableAccessWgslTest_StorageAS = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_StorageAS, Param_ptr_i32_Via_struct_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+};
+
+@group(0) @binding(0) var<storage> S : str;
+
+fn a(pre : i32, p : ptr<storage, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+fn b() {
+ a(10, &S.i, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ i : i32,
+}
+
+@group(0) @binding(0) var<storage, read> S : str;
+
+fn a_S_i(pre : i32, post : i32) -> i32 {
+ return S.i;
+}
+
+fn b() {
+ a_S_i(10i, 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_StorageAS, Param_ptr_arr_i32_Via_struct_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ arr : array<i32, 4>,
+};
+
+@group(0) @binding(0) var<storage, read_write> S : str;
+
+fn a(pre : i32, p : ptr<storage, array<i32, 4>, read_write>, post : i32) {
+ *p = array<i32, 4>();
+}
+
+fn b() {
+ a(10, &S.arr, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ arr : array<i32, 4u>,
+}
+
+@group(0) @binding(0) var<storage, read_write> S : str;
+
+fn a_S_arr(pre : i32, post : i32) {
+ S.arr = array<i32, 4u>();
+}
+
+fn b() {
+ a_S_arr(10i, 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_StorageAS, Param_ptr_vec4i32_Via_array_DynamicWrite) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<storage, read_write> S : array<vec4<i32>, 8>;
+
+fn a(pre : i32, p : ptr<storage, vec4<i32>, read_write>, post : i32) {
+ *p = vec4<i32>();
+}
+
+fn b() {
+ let I = 3;
+ a(10, &S[I], 20);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<storage, read_write> S : array<vec4<i32>, 8u>;
+
+fn a_S_X(pre : i32, p_indices : array<u32, 1u>, post : i32) {
+ S[p_indices[0u]] = vec4<i32>();
+}
+
+fn b() {
+ let I = 3i;
+ a_S_X(10i, array<u32, 1u>(u32(I)), 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_StorageAS, CallChaining) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct Inner {
+ mat : mat3x4<f32>,
+};
+
+alias InnerArr = array<Inner, 4>;
+
+struct Outer {
+ arr : InnerArr,
+ mat : mat3x4<f32>,
+};
+
+@group(0) @binding(0) var<storage> S : Outer;
+
+fn f0(p : ptr<storage, vec4<f32>>) -> f32 {
+ return (*p).x;
+}
+
+fn f1(p : ptr<storage, mat3x4<f32>>) -> f32 {
+ var res : f32;
+ {
+ // call f0() with inline usage of p
+ res += f0(&(*p)[1]);
+ }
+ {
+ // call f0() with pointer-let usage of p
+ let p_vec = &(*p)[1];
+ res += f0(p_vec);
+ }
+ {
+ // call f0() with inline usage of S
+ res += f0(&S.arr[2].mat[1]);
+ }
+ {
+ // call f0() with pointer-let usage of S
+ let p_vec = &S.arr[2].mat[1];
+ res += f0(p_vec);
+ }
+ return res;
+}
+
+fn f2(p : ptr<storage, Inner>) -> f32 {
+ let p_mat = &(*p).mat;
+ return f1(p_mat);
+}
+
+fn f3(p0 : ptr<storage, InnerArr>, p1 : ptr<storage, mat3x4<f32>>) -> f32 {
+ let p0_inner = &(*p0)[3];
+ return f2(p0_inner) + f1(p1);
+}
+
+fn f4(p : ptr<storage, Outer>) -> f32 {
+ return f3(&(*p).arr, &S.mat);
+}
+
+fn b() {
+ f4(&S);
+}
+)";
+
+ auto* expect = R"(
+struct Inner {
+ mat : mat3x4<f32>,
+}
+
+struct Outer {
+ arr : array<Inner, 4u>,
+ mat : mat3x4<f32>,
+}
+
+@group(0) @binding(0) var<storage, read> S : Outer;
+
+fn f0_S_mat_X(p_indices : array<u32, 1u>) -> f32 {
+ return S.mat[p_indices[0u]].x;
+}
+
+fn f0_S_arr_X_mat_X(p_indices : array<u32, 2u>) -> f32 {
+ return S.arr[p_indices[0u]].mat[p_indices[1u]].x;
+}
+
+fn f1_S_mat() -> f32 {
+ var res : f32;
+ let v = f0_S_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v);
+ let v_1 = f0_S_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v_1);
+ let v_2 = f0_S_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_2);
+ let v_3 = f0_S_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_3);
+ return res;
+}
+
+fn f1_S_arr_X_mat(p_indices : array<u32, 1u>) -> f32 {
+ let v_4 = p_indices[0u];
+ var res : f32;
+ let v_5 = f0_S_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_5);
+ let v_6 = f0_S_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_6);
+ let v_7 = f0_S_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_7);
+ let v_8 = f0_S_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_8);
+ return res;
+}
+
+fn f2_S_arr_X(p_indices : array<u32, 1u>) -> f32 {
+ return f1_S_arr_X_mat(array<u32, 1u>(p_indices[0u]));
+}
+
+fn f3_S_arr_S_mat() -> f32 {
+ return (f2_S_arr_X(array<u32, 1u>(u32(3i))) + f1_S_mat());
+}
+
+fn f4_S() -> f32 {
+ return f3_S_arr_S_mat();
+}
+
+fn b() {
+ f4_S();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace storage_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'workgroup' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace workgroup_as_tests {
+
+using IR_DirectVariableAccessWgslTest_WorkgroupAS = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_WorkgroupAS, Param_ptr_vec4i32_Via_array_StaticRead) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<workgroup> W : array<vec4<i32>, 8>;
+
+fn a(pre : i32, p : ptr<workgroup, vec4<i32>>, post : i32) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ a(10, &W[3], 20);
+}
+)";
+
+ auto* expect = R"(
+var<workgroup> W : array<vec4<i32>, 8u>;
+
+fn a_W_X(pre : i32, p_indices : array<u32, 1u>, post : i32) -> vec4<i32> {
+ return W[p_indices[0u]];
+}
+
+fn b() {
+ a_W_X(10i, array<u32, 1u>(u32(3i)), 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_WorkgroupAS, Param_ptr_vec4i32_Via_array_StaticWrite) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<workgroup> W : array<vec4<i32>, 8>;
+
+fn a(pre : i32, p : ptr<workgroup, vec4<i32>>, post : i32) {
+ *p = vec4<i32>();
+}
+
+fn b() {
+ a(10, &W[3], 20);
+}
+)";
+
+ auto* expect = R"(
+var<workgroup> W : array<vec4<i32>, 8u>;
+
+fn a_W_X(pre : i32, p_indices : array<u32, 1u>, post : i32) {
+ W[p_indices[0u]] = vec4<i32>();
+}
+
+fn b() {
+ a_W_X(10i, array<u32, 1u>(u32(3i)), 20i);
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_WorkgroupAS, CallChaining) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct Inner {
+ mat : mat3x4<f32>,
+};
+
+alias InnerArr = array<Inner, 4>;
+
+struct Outer {
+ arr : InnerArr,
+ mat : mat3x4<f32>,
+};
+
+var<workgroup> W : Outer;
+
+fn f0(p : ptr<workgroup, vec4<f32>>) -> f32 {
+ return (*p).x;
+}
+
+fn f1(p : ptr<workgroup, mat3x4<f32>>) -> f32 {
+ var res : f32;
+ {
+ // call f0() with inline usage of p
+ res += f0(&(*p)[1]);
+ }
+ {
+ // call f0() with pointer-let usage of p
+ let p_vec = &(*p)[1];
+ res += f0(p_vec);
+ }
+ {
+ // call f0() with inline usage of W
+ res += f0(&W.arr[2].mat[1]);
+ }
+ {
+ // call f0() with pointer-let usage of W
+ let p_vec = &W.arr[2].mat[1];
+ res += f0(p_vec);
+ }
+ return res;
+}
+
+fn f2(p : ptr<workgroup, Inner>) -> f32 {
+ let p_mat = &(*p).mat;
+ return f1(p_mat);
+}
+
+fn f3(p0 : ptr<workgroup, InnerArr>, p1 : ptr<workgroup, mat3x4<f32>>) -> f32 {
+ let p0_inner = &(*p0)[3];
+ return f2(p0_inner) + f1(p1);
+}
+
+fn f4(p : ptr<workgroup, Outer>) -> f32 {
+ return f3(&(*p).arr, &W.mat);
+}
+
+fn b() {
+ f4(&W);
+}
+)";
+
+ auto* expect = R"(
+struct Inner {
+ mat : mat3x4<f32>,
+}
+
+struct Outer {
+ arr : array<Inner, 4u>,
+ mat : mat3x4<f32>,
+}
+
+var<workgroup> W : Outer;
+
+fn f0_W_mat_X(p_indices : array<u32, 1u>) -> f32 {
+ return W.mat[p_indices[0u]].x;
+}
+
+fn f0_W_arr_X_mat_X(p_indices : array<u32, 2u>) -> f32 {
+ return W.arr[p_indices[0u]].mat[p_indices[1u]].x;
+}
+
+fn f1_W_mat() -> f32 {
+ var res : f32;
+ let v = f0_W_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v);
+ let v_1 = f0_W_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v_1);
+ let v_2 = f0_W_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_2);
+ let v_3 = f0_W_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_3);
+ return res;
+}
+
+fn f1_W_arr_X_mat(p_indices : array<u32, 1u>) -> f32 {
+ let v_4 = p_indices[0u];
+ var res : f32;
+ let v_5 = f0_W_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_5);
+ let v_6 = f0_W_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_6);
+ let v_7 = f0_W_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_7);
+ let v_8 = f0_W_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_8);
+ return res;
+}
+
+fn f2_W_arr_X(p_indices : array<u32, 1u>) -> f32 {
+ return f1_W_arr_X_mat(array<u32, 1u>(p_indices[0u]));
+}
+
+fn f3_W_arr_W_mat() -> f32 {
+ return (f2_W_arr_X(array<u32, 1u>(u32(3i))) + f1_W_mat());
+}
+
+fn f4_W() -> f32 {
+ return f3_W_arr_W_mat();
+}
+
+fn b() {
+ f4_W();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace workgroup_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'private' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace private_as_tests {
+
+using IR_DirectVariableAccessWgslTest_PrivateAS = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_Param_ptr_i32_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+var<private> P : i32;
+
+fn b() {
+ a(10, &(P), 20);
+}
+)";
+
+ auto* expect = R"(
+var<private> P : i32;
+
+fn a_P(pre : i32, post : i32) -> i32 {
+ return P;
+}
+
+fn b() {
+ a_P(10i, 20i);
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_Param_ptr_i32_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) {
+ *(p) = 42;
+}
+
+var<private> P : i32;
+
+fn b() {
+ a(10, &(P), 20);
+}
+)";
+
+ auto* expect = R"(
+var<private> P : i32;
+
+fn a_P(pre : i32, post : i32) {
+ P = 42i;
+}
+
+fn b() {
+ a_P(10i, 20i);
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_Param_ptr_i32_Via_struct_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+};
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+var<private> P : str;
+
+fn b() {
+ a(10, &P.i, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ i : i32,
+}
+
+var<private> P : str;
+
+fn a_P_i(pre : i32, post : i32) -> i32 {
+ return P.i;
+}
+
+fn b() {
+ a_P_i(10i, 20i);
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Disabled_Param_ptr_i32_Via_struct_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+}
+
+var<private> P : str;
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+fn b() {
+ a(10i, &(P.i), 20i);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ arr : array<i32, 4>,
+};
+
+fn a(pre : i32, p : ptr<private, array<i32, 4>>, post : i32) {
+ *p = array<i32, 4>();
+}
+
+var<private> P : str;
+
+fn b() {
+ a(10, &P.arr, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ arr : array<i32, 4u>,
+}
+
+var<private> P : str;
+
+fn a_P_arr(pre : i32, post : i32) {
+ P.arr = array<i32, 4u>();
+}
+
+fn b() {
+ a_P_arr(10i, 20i);
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Disabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ arr : array<i32, 4u>,
+}
+
+var<private> P : str;
+
+fn a(pre : i32, p : ptr<private, array<i32, 4u>>, post : i32) {
+ *(p) = array<i32, 4u>();
+}
+
+fn b() {
+ a(10i, &(P.arr), 20i);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_Param_ptr_i32_mixed) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+};
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+var<private> Pi : i32;
+var<private> Ps : str;
+var<private> Pa : array<i32, 4>;
+
+fn b() {
+ a(10, &Pi, 20);
+ a(30, &Ps.i, 40);
+ a(50, &Pa[2], 60);
+}
+)";
+
+ auto* expect = R"(
+var<private> Pi : i32;
+
+struct str {
+ i : i32,
+}
+
+var<private> Ps : str;
+
+var<private> Pa : array<i32, 4u>;
+
+fn a_Pi(pre : i32, post : i32) -> i32 {
+ return Pi;
+}
+
+fn a_Ps_i(pre : i32, post : i32) -> i32 {
+ return Ps.i;
+}
+
+fn a_Pa_X(pre : i32, p_indices : array<u32, 1u>, post : i32) -> i32 {
+ return Pa[p_indices[0u]];
+}
+
+fn b() {
+ a_Pi(10i, 20i);
+ a_Ps_i(30i, 40i);
+ a_Pa_X(50i, array<u32, 1u>(u32(2i)), 60i);
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Disabled_Param_ptr_i32_mixed) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<private> Pi : i32;
+
+struct str {
+ i : i32,
+}
+
+var<private> Ps : str;
+
+var<private> Pa : array<i32, 4u>;
+
+fn a(pre : i32, p : ptr<private, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+fn b() {
+ a(10i, &(Pi), 20i);
+ a(30i, &(Ps.i), 40i);
+ a(50i, &(Pa[2i]), 60i);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Enabled_CallChaining) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct Inner {
+ mat : mat3x4<f32>,
+};
+
+alias InnerArr = array<Inner, 4>;
+
+struct Outer {
+ arr : InnerArr,
+ mat : mat3x4<f32>,
+};
+
+var<private> P : Outer;
+
+fn f0(p : ptr<private, vec4<f32>>) -> f32 {
+ return (*p).x;
+}
+
+fn f1(p : ptr<private, mat3x4<f32>>) -> f32 {
+ var res : f32;
+ {
+ // call f0() with inline usage of p
+ res += f0(&(*p)[1]);
+ }
+ {
+ // call f0() with pointer-let usage of p
+ let p_vec = &(*p)[1];
+ res += f0(p_vec);
+ }
+ {
+ // call f0() with inline usage of P
+ res += f0(&P.arr[2].mat[1]);
+ }
+ {
+ // call f0() with pointer-let usage of P
+ let p_vec = &P.arr[2].mat[1];
+ res += f0(p_vec);
+ }
+ return res;
+}
+
+fn f2(p : ptr<private, Inner>) -> f32 {
+ let p_mat = &(*p).mat;
+ return f1(p_mat);
+}
+
+fn f3(p0 : ptr<private, InnerArr>, p1 : ptr<private, mat3x4<f32>>) -> f32 {
+ let p0_inner = &(*p0)[3];
+ return f2(p0_inner) + f1(p1);
+}
+
+fn f4(p : ptr<private, Outer>) -> f32 {
+ return f3(&(*p).arr, &P.mat);
+}
+
+fn b() {
+ f4(&P);
+}
+)";
+
+ auto* expect = R"(
+struct Inner {
+ mat : mat3x4<f32>,
+}
+
+struct Outer {
+ arr : array<Inner, 4u>,
+ mat : mat3x4<f32>,
+}
+
+var<private> P : Outer;
+
+fn f0_P_mat_X(p_indices : array<u32, 1u>) -> f32 {
+ return P.mat[p_indices[0u]].x;
+}
+
+fn f0_P_arr_X_mat_X(p_indices : array<u32, 2u>) -> f32 {
+ return P.arr[p_indices[0u]].mat[p_indices[1u]].x;
+}
+
+fn f1_P_mat() -> f32 {
+ var res : f32;
+ let v = f0_P_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v);
+ let v_1 = f0_P_mat_X(array<u32, 1u>(u32(1i)));
+ res = (res + v_1);
+ let v_2 = f0_P_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_2);
+ let v_3 = f0_P_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_3);
+ return res;
+}
+
+fn f1_P_arr_X_mat(p_indices : array<u32, 1u>) -> f32 {
+ let v_4 = p_indices[0u];
+ var res : f32;
+ let v_5 = f0_P_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_5);
+ let v_6 = f0_P_arr_X_mat_X(array<u32, 2u>(v_4, u32(1i)));
+ res = (res + v_6);
+ let v_7 = f0_P_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_7);
+ let v_8 = f0_P_arr_X_mat_X(array<u32, 2u>(u32(2i), u32(1i)));
+ res = (res + v_8);
+ return res;
+}
+
+fn f2_P_arr_X(p_indices : array<u32, 1u>) -> f32 {
+ return f1_P_arr_X_mat(array<u32, 1u>(p_indices[0u]));
+}
+
+fn f3_P_arr_P_mat() -> f32 {
+ return (f2_P_arr_X(array<u32, 1u>(u32(3i))) + f1_P_mat());
+}
+
+fn f4_P() -> f32 {
+ return f3_P_arr_P_mat();
+}
+
+fn b() {
+ f4_P();
+}
+)";
+
+ auto got = Run(src, kTransformPrivate);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_PrivateAS, Disabled_CallChaining) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct Inner {
+ mat : mat3x4<f32>,
+}
+
+struct Outer {
+ arr : array<Inner, 4u>,
+ mat : mat3x4<f32>,
+}
+
+var<private> P : Outer;
+
+fn f0(p : ptr<private, vec4<f32>>) -> f32 {
+ return (*(p)).x;
+}
+
+fn f1(p : ptr<private, mat3x4<f32>>) -> f32 {
+ var res : f32;
+ let v = f0(&((*(p))[1i]));
+ res = (res + v);
+ let p_vec = &((*(p))[1i]);
+ let v_1 = f0(p_vec);
+ res = (res + v_1);
+ let v_2 = f0(&(P.arr[2i].mat[1i]));
+ res = (res + v_2);
+ let p_vec_1 = &(P.arr[2i].mat[1i]);
+ let v_3 = f0(p_vec_1);
+ res = (res + v_3);
+ return res;
+}
+
+fn f2(p : ptr<private, Inner>) -> f32 {
+ let p_mat = &((*(p)).mat);
+ return f1(p_mat);
+}
+
+fn f3(p0 : ptr<private, array<Inner, 4u>>, p1 : ptr<private, mat3x4<f32>>) -> f32 {
+ let p0_inner = &((*(p0))[3i]);
+ return (f2(p0_inner) + f1(p1));
+}
+
+fn f4(p : ptr<private, Outer>) -> f32 {
+ return f3(&((*(p)).arr), &(P.mat));
+}
+
+fn b() {
+ f4(&(P));
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace private_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// 'function' address space
+////////////////////////////////////////////////////////////////////////////////
+namespace function_as_tests {
+
+using IR_DirectVariableAccessWgslTest_FunctionAS = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_LocalPtr) {
+ auto* src = R"(
+fn f() {
+ var v : i32;
+ let p = &(v);
+ var x : i32 = *(p);
+}
+)";
+
+ auto* expect = src; // Nothing changes
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_Param_ptr_i32_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+fn b() {
+ var F : i32;
+ a(10, &(F), 20);
+}
+)";
+
+ auto* expect = R"(
+fn a_P(pre : i32, p_root : ptr<function, i32>, post : i32) -> i32 {
+ return *(p_root);
+}
+
+fn b() {
+ var F : i32;
+ a_P(10i, &(F), 20i);
+}
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_Param_ptr_i32_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<function, i32>, post : i32) {
+ *(p) = 42;
+}
+
+fn b() {
+ var F : i32;
+ a(10, &(F), 20);
+}
+)";
+
+ auto* expect = R"(
+fn a_P(pre : i32, p_root : ptr<function, i32>, post : i32) {
+ *(p_root) = 42i;
+}
+
+fn b() {
+ var F : i32;
+ a_P(10i, &(F), 20i);
+}
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_Param_ptr_i32_Via_struct_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+};
+
+fn a(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+fn b() {
+ var F : str;
+ a(10, &F.i, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ i : i32,
+}
+
+fn a_P_i(pre : i32, p_root : ptr<function, str>, post : i32) -> i32 {
+ return (*(p_root)).i;
+}
+
+fn b() {
+ var F : str;
+ a_P_i(10i, &(F), 20i);
+}
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ arr : array<i32, 4>,
+};
+
+fn a(pre : i32, p : ptr<function, array<i32, 4>>, post : i32) {
+ *p = array<i32, 4>();
+}
+
+fn b() {
+ var F : str;
+ a(10, &F.arr, 20);
+}
+)";
+
+ auto* expect = R"(
+struct str {
+ arr : array<i32, 4u>,
+}
+
+fn a_P_arr(pre : i32, p_root : ptr<function, str>, post : i32) {
+ (*(p_root)).arr = array<i32, 4u>();
+}
+
+fn b() {
+ var F : str;
+ a_P_arr(10i, &(F), 20i);
+}
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Enabled_Param_ptr_i32_mixed) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : i32,
+};
+
+fn a(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *p;
+}
+
+fn b() {
+ var Fi : i32;
+ var Fs : str;
+ var Fa : array<i32, 4>;
+
+ a(10, &Fi, 20);
+ a(30, &Fs.i, 40);
+ a(50, &Fa[2], 60);
+}
+)";
+
+ auto* expect = R"(
+fn a_P(pre : i32, p_root : ptr<function, i32>, post : i32) -> i32 {
+ return *(p_root);
+}
+
+struct str {
+ i : i32,
+}
+
+fn a_P_i(pre : i32, p_root : ptr<function, str>, post : i32) -> i32 {
+ return (*(p_root)).i;
+}
+
+fn a_P_X(pre : i32, p_root : ptr<function, array<i32, 4u>>, p_indices : array<u32, 1u>, post : i32) -> i32 {
+ return (*(p_root))[p_indices[0u]];
+}
+
+fn b() {
+ var Fi : i32;
+ var Fs : str;
+ var Fa : array<i32, 4u>;
+ a_P(10i, &(Fi), 20i);
+ a_P_i(30i, &(Fs), 40i);
+ a_P_X(50i, &(Fa), array<u32, 1u>(u32(2i)), 60i);
+}
+)";
+
+ auto got = Run(src, kTransformFunction);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Disabled_Param_ptr_i32_Via_struct_read) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<function, i32>, post : i32) -> i32 {
+ return *(p);
+}
+
+struct str {
+ i : i32,
+}
+
+fn b() {
+ var F : str;
+ a(10i, &(F.i), 20i);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_FunctionAS, Disabled_Param_ptr_arr_i32_Via_struct_write) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn a(pre : i32, p : ptr<function, array<i32, 4u>>, post : i32) {
+ *(p) = array<i32, 4u>();
+}
+
+struct str {
+ arr : array<i32, 4u>,
+}
+
+fn b() {
+ var F : str;
+ a(10i, &(F.arr), 20i);
+}
+)";
+
+ auto* expect = src;
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace function_as_tests
+
+////////////////////////////////////////////////////////////////////////////////
+// builtin function calls
+////////////////////////////////////////////////////////////////////////////////
+namespace builtin_fn_calls {
+
+using IR_DirectVariableAccessWgslTest_BuiltinFn = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_BuiltinFn, ArrayLength) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<storage> S : array<f32>;
+
+fn len(p : ptr<storage, array<f32>>) -> u32 {
+ return arrayLength(p);
+}
+
+fn f() {
+ let n = len(&S);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<storage, read> S : array<f32>;
+
+fn len_S() -> u32 {
+ return arrayLength(&(S));
+}
+
+fn f() {
+ len_S();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_BuiltinFn, WorkgroupUniformLoad) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+var<workgroup> W : f32;
+
+fn load(p : ptr<workgroup, f32>) -> f32 {
+ return workgroupUniformLoad(p);
+}
+
+fn f() {
+ let v = load(&W);
+}
+)";
+
+ auto* expect = R"(
+var<workgroup> W : f32;
+
+fn load_W() -> f32 {
+ return workgroupUniformLoad(&(W));
+}
+
+fn f() {
+ load_W();
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace builtin_fn_calls
+
+////////////////////////////////////////////////////////////////////////////////
+// complex tests
+////////////////////////////////////////////////////////////////////////////////
+namespace complex_tests {
+
+using IR_DirectVariableAccessWgslTest_Complex = DirectVariableAccessTest;
+
+TEST_F(IR_DirectVariableAccessWgslTest_Complex, Param_ptr_mixed_vec4i32_ViaMultiple) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+struct str {
+ i : vec4<i32>,
+};
+
+@group(0) @binding(0) var<uniform> U : vec4<i32>;
+@group(0) @binding(1) var<uniform> U_str : str;
+@group(0) @binding(2) var<uniform> U_arr : array<vec4<i32>, 8>;
+@group(0) @binding(3) var<uniform> U_arr_arr : array<array<vec4<i32>, 8>, 4>;
+
+@group(1) @binding(0) var<storage> S : vec4<i32>;
+@group(1) @binding(1) var<storage> S_str : str;
+@group(1) @binding(2) var<storage> S_arr : array<vec4<i32>, 8>;
+@group(1) @binding(3) var<storage> S_arr_arr : array<array<vec4<i32>, 8>, 4>;
+
+ var<workgroup> W : vec4<i32>;
+ var<workgroup> W_str : str;
+ var<workgroup> W_arr : array<vec4<i32>, 8>;
+ var<workgroup> W_arr_arr : array<array<vec4<i32>, 8>, 4>;
+
+fn fn_u(p : ptr<uniform, vec4<i32>>) -> vec4<i32> {
+ return *p;
+}
+
+fn fn_s(p : ptr<storage, vec4<i32>>) -> vec4<i32> {
+ return *p;
+}
+
+fn fn_w(p : ptr<workgroup, vec4<i32>>) -> vec4<i32> {
+ return *p;
+}
+
+fn b() {
+ let I = 3;
+ let J = 4;
+
+ let u = fn_u(&U);
+ let u_str = fn_u(&U_str.i);
+ let u_arr0 = fn_u(&U_arr[0]);
+ let u_arr1 = fn_u(&U_arr[1]);
+ let u_arrI = fn_u(&U_arr[I]);
+ let u_arr1_arr0 = fn_u(&U_arr_arr[1][0]);
+ let u_arr2_arrI = fn_u(&U_arr_arr[2][I]);
+ let u_arrI_arr2 = fn_u(&U_arr_arr[I][2]);
+ let u_arrI_arrJ = fn_u(&U_arr_arr[I][J]);
+
+ let s = fn_s(&S);
+ let s_str = fn_s(&S_str.i);
+ let s_arr0 = fn_s(&S_arr[0]);
+ let s_arr1 = fn_s(&S_arr[1]);
+ let s_arrI = fn_s(&S_arr[I]);
+ let s_arr1_arr0 = fn_s(&S_arr_arr[1][0]);
+ let s_arr2_arrI = fn_s(&S_arr_arr[2][I]);
+ let s_arrI_arr2 = fn_s(&S_arr_arr[I][2]);
+ let s_arrI_arrJ = fn_s(&S_arr_arr[I][J]);
+
+ let w = fn_w(&W);
+ let w_str = fn_w(&W_str.i);
+ let w_arr0 = fn_w(&W_arr[0]);
+ let w_arr1 = fn_w(&W_arr[1]);
+ let w_arrI = fn_w(&W_arr[I]);
+ let w_arr1_arr0 = fn_w(&W_arr_arr[1][0]);
+ let w_arr2_arrI = fn_w(&W_arr_arr[2][I]);
+ let w_arrI_arr2 = fn_w(&W_arr_arr[I][2]);
+ let w_arrI_arrJ = fn_w(&W_arr_arr[I][J]);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<uniform> U : vec4<i32>;
+
+struct str {
+ i : vec4<i32>,
+}
+
+@group(0) @binding(1) var<uniform> U_str : str;
+
+@group(0) @binding(2) var<uniform> U_arr : array<vec4<i32>, 8u>;
+
+@group(0) @binding(3) var<uniform> U_arr_arr : array<array<vec4<i32>, 8u>, 4u>;
+
+@group(1) @binding(0) var<storage, read> S : vec4<i32>;
+
+@group(1) @binding(1) var<storage, read> S_str : str;
+
+@group(1) @binding(2) var<storage, read> S_arr : array<vec4<i32>, 8u>;
+
+@group(1) @binding(3) var<storage, read> S_arr_arr : array<array<vec4<i32>, 8u>, 4u>;
+
+var<workgroup> W : vec4<i32>;
+
+var<workgroup> W_str : str;
+
+var<workgroup> W_arr : array<vec4<i32>, 8u>;
+
+var<workgroup> W_arr_arr : array<array<vec4<i32>, 8u>, 4u>;
+
+fn fn_u_U() -> vec4<i32> {
+ return U;
+}
+
+fn fn_u_U_str_i() -> vec4<i32> {
+ return U_str.i;
+}
+
+fn fn_u_U_arr_X(p_indices : array<u32, 1u>) -> vec4<i32> {
+ return U_arr[p_indices[0u]];
+}
+
+fn fn_u_U_arr_arr_X_X(p_indices : array<u32, 2u>) -> vec4<i32> {
+ return U_arr_arr[p_indices[0u]][p_indices[1u]];
+}
+
+fn fn_s_S() -> vec4<i32> {
+ return S;
+}
+
+fn fn_s_S_str_i() -> vec4<i32> {
+ return S_str.i;
+}
+
+fn fn_s_S_arr_X(p_indices : array<u32, 1u>) -> vec4<i32> {
+ return S_arr[p_indices[0u]];
+}
+
+fn fn_s_S_arr_arr_X_X(p_indices : array<u32, 2u>) -> vec4<i32> {
+ return S_arr_arr[p_indices[0u]][p_indices[1u]];
+}
+
+fn fn_w_W() -> vec4<i32> {
+ return W;
+}
+
+fn fn_w_W_str_i() -> vec4<i32> {
+ return W_str.i;
+}
+
+fn fn_w_W_arr_X(p_indices : array<u32, 1u>) -> vec4<i32> {
+ return W_arr[p_indices[0u]];
+}
+
+fn fn_w_W_arr_arr_X_X(p_indices : array<u32, 2u>) -> vec4<i32> {
+ return W_arr_arr[p_indices[0u]][p_indices[1u]];
+}
+
+fn b() {
+ let I = 3i;
+ let J = 4i;
+ fn_u_U();
+ fn_u_U_str_i();
+ fn_u_U_arr_X(array<u32, 1u>(u32(0i)));
+ fn_u_U_arr_X(array<u32, 1u>(u32(1i)));
+ fn_u_U_arr_X(array<u32, 1u>(u32(I)));
+ fn_u_U_arr_arr_X_X(array<u32, 2u>(u32(1i), u32(0i)));
+ fn_u_U_arr_arr_X_X(array<u32, 2u>(u32(2i), u32(I)));
+ fn_u_U_arr_arr_X_X(array<u32, 2u>(u32(I), u32(2i)));
+ fn_u_U_arr_arr_X_X(array<u32, 2u>(u32(I), u32(J)));
+ fn_s_S();
+ fn_s_S_str_i();
+ fn_s_S_arr_X(array<u32, 1u>(u32(0i)));
+ fn_s_S_arr_X(array<u32, 1u>(u32(1i)));
+ fn_s_S_arr_X(array<u32, 1u>(u32(I)));
+ fn_s_S_arr_arr_X_X(array<u32, 2u>(u32(1i), u32(0i)));
+ fn_s_S_arr_arr_X_X(array<u32, 2u>(u32(2i), u32(I)));
+ fn_s_S_arr_arr_X_X(array<u32, 2u>(u32(I), u32(2i)));
+ fn_s_S_arr_arr_X_X(array<u32, 2u>(u32(I), u32(J)));
+ fn_w_W();
+ fn_w_W_str_i();
+ fn_w_W_arr_X(array<u32, 1u>(u32(0i)));
+ fn_w_W_arr_X(array<u32, 1u>(u32(1i)));
+ fn_w_W_arr_X(array<u32, 1u>(u32(I)));
+ fn_w_W_arr_arr_X_X(array<u32, 2u>(u32(1i), u32(0i)));
+ fn_w_W_arr_arr_X_X(array<u32, 2u>(u32(2i), u32(I)));
+ fn_w_W_arr_arr_X_X(array<u32, 2u>(u32(I), u32(2i)));
+ fn_w_W_arr_arr_X_X(array<u32, 2u>(u32(I), u32(J)));
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_Complex, Indexing) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<storage> S : array<array<array<array<i32, 9>, 9>, 9>, 50>;
+
+fn a(i : i32) -> i32 { return i; }
+
+fn b(p : ptr<storage, array<array<array<i32, 9>, 9>, 9>>) -> i32 {
+ return (*p) [ a( (*p)[0][1][2] )]
+ [ a( (*p)[a(3)][4][5] )]
+ [ a( (*p)[6][a(7)][8] )];
+}
+
+fn c() {
+ let v = b(&S[42]);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<storage, read> S : array<array<array<array<i32, 9u>, 9u>, 9u>, 50u>;
+
+fn a(i : i32) -> i32 {
+ return i;
+}
+
+fn b_S_X(p_indices : array<u32, 1u>) -> i32 {
+ let v = &(S[p_indices[0u]]);
+ return (*(v))[a((*(v))[0i][1i][2i])][a((*(v))[a(3i)][4i][5i])][a((*(v))[6i][a(7i)][8i])];
+}
+
+fn c() {
+ b_S_X(array<u32, 1u>(u32(42i)));
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_Complex, IndexingInPtrCall) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<storage> S : array<array<array<array<i32, 9>, 9>, 9>, 50>;
+
+fn a(pre : i32, i : ptr<storage, i32>, post : i32) -> i32 {
+ return *i;
+}
+
+fn b(p : ptr<storage, array<array<array<i32, 9>, 9>, 9>>) -> i32 {
+ return a(10, &(*p)[ a( 20, &(*p)[0][1][2], 30 )]
+ [ a( 40, &(*p)[3][4][5], 50 )]
+ [ a( 60, &(*p)[6][7][8], 70 )], 80);
+}
+
+fn c() {
+ let v = b(&S[42]);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<storage, read> S : array<array<array<array<i32, 9u>, 9u>, 9u>, 50u>;
+
+fn a_S_X_X_X_X(pre : i32, i_indices : array<u32, 4u>, post : i32) -> i32 {
+ return S[i_indices[0u]][i_indices[1u]][i_indices[2u]][i_indices[3u]];
+}
+
+fn b_S_X(p_indices : array<u32, 1u>) -> i32 {
+ let v = p_indices[0u];
+ let v_1 = a_S_X_X_X_X(20i, array<u32, 4u>(v, u32(0i), u32(1i), u32(2i)), 30i);
+ let v_2 = a_S_X_X_X_X(40i, array<u32, 4u>(v, u32(3i), u32(4i), u32(5i)), 50i);
+ return a_S_X_X_X_X(10i, array<u32, 4u>(v, u32(v_1), u32(v_2), u32(a_S_X_X_X_X(60i, array<u32, 4u>(v, u32(6i), u32(7i), u32(8i)), 70i))), 80i);
+}
+
+fn c() {
+ b_S_X(array<u32, 1u>(u32(42i)));
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+TEST_F(IR_DirectVariableAccessWgslTest_Complex, IndexingDualPointers) {
+ auto* src = R"(
+enable chromium_experimental_full_ptr_parameters;
+
+@group(0) @binding(0) var<storage> S : array<array<array<i32, 9>, 9>, 50>;
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 9>, 9>, 50>;
+
+fn a(i : i32) -> i32 { return i; }
+
+fn b(s : ptr<storage, array<array<i32, 9>, 9>>,
+ u : ptr<uniform, array<array<vec4<i32>, 9>, 9>>) -> i32 {
+ return (*s) [ a( (*u)[0][1].x )]
+ [ a( (*u)[a(3)][4].y )];
+}
+
+fn c() {
+ let v = b(&S[42], &U[24]);
+}
+)";
+
+ auto* expect = R"(
+@group(0) @binding(0) var<storage, read> S : array<array<array<i32, 9u>, 9u>, 50u>;
+
+@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 9u>, 9u>, 50u>;
+
+fn a(i : i32) -> i32 {
+ return i;
+}
+
+fn b_S_X_U_X(s_indices : array<u32, 1u>, u_indices : array<u32, 1u>) -> i32 {
+ let v = &(U[u_indices[0u]]);
+ return S[s_indices[0u]][a((*(v))[0i][1i].x)][a((*(v))[a(3i)][4i].y)];
+}
+
+fn c() {
+ b_S_X_U_X(array<u32, 1u>(u32(42i)), array<u32, 1u>(u32(24i)));
+}
+)";
+
+ auto got = Run(src);
+
+ EXPECT_EQ(expect, got);
+}
+
+} // namespace complex_tests
+
+} // namespace
+} // namespace tint::core::ir::transform
diff --git a/src/tint/lang/core/ir/traverse.h b/src/tint/lang/core/ir/traverse.h
new file mode 100644
index 0000000..cde6fcb
--- /dev/null
+++ b/src/tint/lang/core/ir/traverse.h
@@ -0,0 +1,65 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_TINT_LANG_CORE_IR_TRAVERSE_H_
+#define SRC_TINT_LANG_CORE_IR_TRAVERSE_H_
+
+#include "src/tint/lang/core/ir/block.h"
+#include "src/tint/lang/core/ir/control_instruction.h"
+#include "src/tint/utils/containers/reverse.h"
+#include "src/tint/utils/containers/vector.h"
+#include "src/tint/utils/traits/traits.h"
+
+namespace tint::core::ir {
+
+/// Traverse calls @p callback with each instruction in @p block and all child blocks of @p block
+/// that matches the callback parameter type.
+/// @param block the block to traverse
+/// @param callback a function with the signature `void(T*)`
+template <typename CALLBACK>
+void Traverse(Block* block, CALLBACK&& callback) {
+ using T = std::remove_pointer_t<traits::ParameterType<CALLBACK, 0>>;
+
+ Vector<ir::Instruction*, 8> queue;
+ if (!block->IsEmpty()) {
+ queue.Push(block->Front());
+ }
+ while (!queue.IsEmpty()) {
+ for (auto* inst = queue.Pop(); inst != nullptr; inst = inst->next) {
+ if (auto* as_t = inst->As<T>()) {
+ callback(as_t);
+ }
+ if (auto* ctrl = inst->As<ControlInstruction>()) {
+ if (auto* next = inst->next) {
+ queue.Push(next); // Resume iteration of this block
+ }
+
+ Vector<ir::Instruction*, 8> children;
+ ctrl->ForeachBlock([&](ir::Block* b) {
+ if (!b->IsEmpty()) {
+ children.Push(b->Front());
+ }
+ });
+ for (auto* child : Reverse(children)) {
+ queue.Push(child);
+ }
+ break;
+ }
+ }
+ }
+}
+
+} // namespace tint::core::ir
+
+#endif // SRC_TINT_LANG_CORE_IR_TRAVERSE_H_
diff --git a/src/tint/lang/core/ir/traverse_test.cc b/src/tint/lang/core/ir/traverse_test.cc
new file mode 100644
index 0000000..2a8f138
--- /dev/null
+++ b/src/tint/lang/core/ir/traverse_test.cc
@@ -0,0 +1,119 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "src/tint/lang/core/ir/traverse.h"
+
+#include "gmock/gmock.h"
+#include "src/tint/lang/core/ir/builder.h"
+#include "src/tint/lang/core/ir/ir_helper_test.h"
+
+using namespace tint::core::number_suffixes; // NOLINT
+using namespace tint::core::fluent_types; // NOLINT
+
+namespace tint::core::ir {
+namespace {
+
+using IR_TraverseTest = IRTestHelper;
+
+TEST_F(IR_TraverseTest, Blocks) {
+ Vector<Instruction*, 8> expect;
+
+ auto fn = b.Function("f", ty.void_());
+ b.Append(fn->Block(), [&] {
+ expect.Push(b.Var<function, i32>());
+
+ auto* if_ = b.If(true);
+ expect.Push(if_);
+ b.Append(if_->True(), [&] {
+ auto* if2_ = b.If(true);
+ expect.Push(if2_);
+ b.Append(if2_->True(), [&] { expect.Push(b.ExitIf(if2_)); });
+ expect.Push(b.ExitIf(if_));
+ });
+
+ b.Append(if_->False(), [&] { expect.Push(b.ExitIf(if_)); });
+
+ auto* loop_ = b.Loop();
+ expect.Push(loop_);
+ b.Append(loop_->Initializer(), [&] { expect.Push(b.NextIteration(loop_)); });
+ b.Append(loop_->Body(), [&] {
+ auto* if2_ = b.If(true);
+ expect.Push(if2_);
+ b.Append(if2_->True(), [&] { expect.Push(b.ExitIf(if2_)); });
+ expect.Push(b.Continue(loop_));
+ });
+ b.Append(loop_->Continuing(), [&] { expect.Push(b.NextIteration(loop_)); });
+
+ auto* switch_ = b.Switch(1_i);
+ expect.Push(switch_);
+
+ auto* case_0 = b.Case(switch_, {Switch::CaseSelector{b.Constant(0_i)}});
+ b.Append(case_0, [&] { expect.Push(b.Var<function, i32>()); });
+
+ auto* case_1 = b.Case(switch_, {Switch::CaseSelector{b.Constant(1_i)}});
+ b.Append(case_1, [&] { expect.Push(b.Var<function, i32>()); });
+
+ expect.Push(b.Var<function, i32>());
+ });
+
+ Vector<Instruction*, 8> got;
+ Traverse(fn->Block(), [&](Instruction* inst) { got.Push(inst); });
+
+ EXPECT_THAT(got, testing::ContainerEq(expect));
+}
+
+TEST_F(IR_TraverseTest, Filtered) {
+ Vector<ExitIf*, 8> expect;
+
+ auto fn = b.Function("f", ty.void_());
+ b.Append(fn->Block(), [&] {
+ b.Var<function, i32>();
+
+ auto* if_ = b.If(true);
+ b.Append(if_->True(), [&] {
+ auto* if2_ = b.If(true);
+ b.Append(if2_->True(), [&] { expect.Push(b.ExitIf(if2_)); });
+ expect.Push(b.ExitIf(if_));
+ });
+
+ b.Append(if_->False(), [&] { expect.Push(b.ExitIf(if_)); });
+
+ auto* loop_ = b.Loop();
+ b.Append(loop_->Initializer(), [&] { b.NextIteration(loop_); });
+ b.Append(loop_->Body(), [&] {
+ auto* if2_ = b.If(true);
+ b.Append(if2_->True(), [&] { expect.Push(b.ExitIf(if2_)); });
+ b.Continue(loop_);
+ });
+ b.Append(loop_->Continuing(), [&] { b.NextIteration(loop_); });
+
+ auto* switch_ = b.Switch(1_i);
+
+ auto* case_0 = b.Case(switch_, {Switch::CaseSelector{b.Constant(0_i)}});
+ b.Append(case_0, [&] { b.Var<function, i32>(); });
+
+ auto* case_1 = b.Case(switch_, {Switch::CaseSelector{b.Constant(1_i)}});
+ b.Append(case_1, [&] { b.Var<function, i32>(); });
+
+ b.Var<function, i32>();
+ });
+
+ Vector<ExitIf*, 8> got;
+ Traverse(fn->Block(), [&](ExitIf* inst) { got.Push(inst); });
+
+ EXPECT_THAT(got, testing::ContainerEq(expect));
+}
+
+} // namespace
+} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/unary.cc b/src/tint/lang/core/ir/unary.cc
index 69b6857..13ac7c4 100644
--- a/src/tint/lang/core/ir/unary.cc
+++ b/src/tint/lang/core/ir/unary.cc
@@ -30,8 +30,8 @@
Unary* Unary::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_val = ctx.Clone(Val());
- return ctx.ir.instructions.Create<Unary>(new_result, kind_, new_val);
+ auto* val = ctx.Remap(Val());
+ return ctx.ir.instructions.Create<Unary>(new_result, kind_, val);
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/user_call.cc b/src/tint/lang/core/ir/user_call.cc
index 5c6f4e3..641dc20 100644
--- a/src/tint/lang/core/ir/user_call.cc
+++ b/src/tint/lang/core/ir/user_call.cc
@@ -34,9 +34,16 @@
UserCall* UserCall::Clone(CloneContext& ctx) {
auto* new_result = ctx.Clone(Result());
- auto* new_target = ctx.Clone(Target());
- auto new_args = ctx.Clone<UserCall::kDefaultNumOperands>(Args());
- return ctx.ir.instructions.Create<UserCall>(new_result, new_target, new_args);
+ auto* target = ctx.Remap(Target());
+ auto args = ctx.Remap<UserCall::kDefaultNumOperands>(Args());
+ return ctx.ir.instructions.Create<UserCall>(new_result, target, args);
+}
+
+void UserCall::SetArgs(VectorRef<Value*> arguments) {
+ auto* fn = Target();
+ ClearOperands();
+ AddOperand(UserCall::kFunctionOperandOffset, fn);
+ AddOperands(UserCall::kArgsOperandOffset, std::move(arguments));
}
} // namespace tint::core::ir
diff --git a/src/tint/lang/core/ir/user_call.h b/src/tint/lang/core/ir/user_call.h
index f6688e2..21d2416 100644
--- a/src/tint/lang/core/ir/user_call.h
+++ b/src/tint/lang/core/ir/user_call.h
@@ -45,12 +45,16 @@
/// @returns the call arguments
tint::Slice<Value*> Args() override { return operands_.Slice().Offset(kArgsOperandOffset); }
+ /// Replaces the call arguments to @p arguments
+ /// @param arguments the new call arguments
+ void SetArgs(VectorRef<Value*> arguments);
+
/// @returns the called function
Function* Target() { return operands_[kFunctionOperandOffset]->As<ir::Function>(); }
/// Sets called function
/// @param target the new target of the call
- void SetTarget(Function* target) { operands_[kFunctionOperandOffset] = target; }
+ void SetTarget(Function* target) { SetOperand(kFunctionOperandOffset, target); }
/// @returns the friendly name for the instruction
std::string FriendlyName() override { return "call"; }
diff --git a/src/tint/lang/core/ir/validator.cc b/src/tint/lang/core/ir/validator.cc
index 013fcb0..8edf526 100644
--- a/src/tint/lang/core/ir/validator.cc
+++ b/src/tint/lang/core/ir/validator.cc
@@ -547,8 +547,8 @@
auto args = Transform<8>(call->Args(), [&](ir::Value* v) { return v->Type(); });
intrinsic::Context context{call->TableData(), mod_.Types(), mod_.symbols, diagnostics_};
- auto result = core::intrinsic::Lookup(context, call->FriendlyName().c_str(), call->FuncId(),
- args, core::EvaluationStage::kRuntime, Source{});
+ auto result = core::intrinsic::LookupFn(context, call->FriendlyName().c_str(), call->FuncId(),
+ args, core::EvaluationStage::kRuntime, Source{});
if (result) {
if (result->return_type != call->Result()->Type()) {
AddError(call, InstError(call, "call result type does not match builtin return type"));
diff --git a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
index e61c9c6..6bf0f92 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -246,7 +246,7 @@
data.Add<ast::transform::BindingRemapper::Remappings>(
options.binding_remapper_options.binding_points,
std::unordered_map<BindingPoint, core::Access>{},
- options.binding_remapper_options.allow_collisions);
+ /* allow_collisions */ true);
manager.Add<ast::transform::BindingRemapper>();
manager.Add<ast::transform::PromoteInitializersToLet>();
diff --git a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
index 976266a..f19e36d 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -216,9 +216,13 @@
// BindingRemapper must come after MultiplanarExternalTexture
manager.Add<ast::transform::BindingRemapper>();
+
+ // D3D11 and 12 registers like `t3` and `c3` have the same bindingOffset number in
+ // the remapping but should not be considered a collision because they have
+ // different types.
data.Add<ast::transform::BindingRemapper::Remappings>(
options.binding_remapper_options.binding_points, options.access_controls,
- options.binding_remapper_options.allow_collisions);
+ /* allow_collisions */ true);
{ // Builtin polyfills
ast::transform::BuiltinPolyfill::Builtins polyfills;
diff --git a/src/tint/lang/msl/writer/BUILD.bazel b/src/tint/lang/msl/writer/BUILD.bazel
index b3e89ef..4348b90 100644
--- a/src/tint/lang/msl/writer/BUILD.bazel
+++ b/src/tint/lang/msl/writer/BUILD.bazel
@@ -44,6 +44,7 @@
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
"//src/tint/lang/wgsl/program",
+ "//src/tint/lang/wgsl/reader/lower",
"//src/tint/lang/wgsl/reader/program_to_ir",
"//src/tint/lang/wgsl/sem",
"//src/tint/utils/containers",
diff --git a/src/tint/lang/msl/writer/BUILD.cmake b/src/tint/lang/msl/writer/BUILD.cmake
index 15752d1..d3291bc 100644
--- a/src/tint/lang/msl/writer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/BUILD.cmake
@@ -51,6 +51,7 @@
tint_lang_wgsl
tint_lang_wgsl_ast
tint_lang_wgsl_program
+ tint_lang_wgsl_reader_lower
tint_lang_wgsl_reader_program_to_ir
tint_lang_wgsl_sem
tint_utils_containers
diff --git a/src/tint/lang/msl/writer/BUILD.gn b/src/tint/lang/msl/writer/BUILD.gn
index 560486c..9f13b86 100644
--- a/src/tint/lang/msl/writer/BUILD.gn
+++ b/src/tint/lang/msl/writer/BUILD.gn
@@ -43,6 +43,7 @@
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
"${tint_src_dir}/lang/wgsl/program",
+ "${tint_src_dir}/lang/wgsl/reader/lower",
"${tint_src_dir}/lang/wgsl/reader/program_to_ir",
"${tint_src_dir}/lang/wgsl/sem",
"${tint_src_dir}/utils/containers",
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
index 796f53f..254e2b2 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
@@ -187,8 +187,7 @@
manager.Add<ast::transform::BindingRemapper>();
data.Add<ast::transform::BindingRemapper::Remappings>(
options.binding_remapper_options.binding_points,
- std::unordered_map<BindingPoint, core::Access>{},
- options.binding_remapper_options.allow_collisions);
+ std::unordered_map<BindingPoint, core::Access>{}, /* allow_collisions */ true);
if (!options.disable_workgroup_init) {
// ZeroInitWorkgroupMemory must come before CanonicalizeEntryPointIO as
diff --git a/src/tint/lang/msl/writer/printer/BUILD.bazel b/src/tint/lang/msl/writer/printer/BUILD.bazel
index b56908f..6f326c0 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.bazel
+++ b/src/tint/lang/msl/writer/printer/BUILD.bazel
@@ -79,7 +79,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/msl/writer/raise",
diff --git a/src/tint/lang/msl/writer/printer/BUILD.cmake b/src/tint/lang/msl/writer/printer/BUILD.cmake
index b716984..211c5e0 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/printer/BUILD.cmake
@@ -84,7 +84,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_msl_writer_raise
diff --git a/src/tint/lang/msl/writer/printer/BUILD.gn b/src/tint/lang/msl/writer/printer/BUILD.gn
index 52f1d40..cf2af5a 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.gn
+++ b/src/tint/lang/msl/writer/printer/BUILD.gn
@@ -82,7 +82,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/msl/writer/raise",
diff --git a/src/tint/lang/msl/writer/writer.cc b/src/tint/lang/msl/writer/writer.cc
index aa69687..54fffe0 100644
--- a/src/tint/lang/msl/writer/writer.cc
+++ b/src/tint/lang/msl/writer/writer.cc
@@ -20,6 +20,7 @@
#include "src/tint/lang/msl/writer/ast_printer/ast_printer.h"
#include "src/tint/lang/msl/writer/printer/printer.h"
#include "src/tint/lang/msl/writer/raise/raise.h"
+#include "src/tint/lang/wgsl/reader/lower/lower.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
namespace tint::msl::writer {
@@ -40,10 +41,14 @@
auto ir = converted.Move();
- // Raise the IR to the MSL dialect.
- auto raised = raise::Raise(ir);
- if (!raised) {
- return raised.Failure();
+ // Lower from WGSL-dialect to core-dialect
+ if (auto res = wgsl::reader::Lower(ir); !res) {
+ return res.Failure();
+ }
+
+ // Raise from core-dialect to MSL-dialect.
+ if (auto res = raise::Raise(ir); !res) {
+ return res.Failure();
}
// Generate the MSL code.
diff --git a/src/tint/lang/spirv/builtin_fn.cc b/src/tint/lang/spirv/builtin_fn.cc
index 602d0aa..c019c92 100644
--- a/src/tint/lang/spirv/builtin_fn.cc
+++ b/src/tint/lang/spirv/builtin_fn.cc
@@ -95,6 +95,10 @@
return "vector_times_matrix";
case BuiltinFn::kVectorTimesScalar:
return "vector_times_scalar";
+ case BuiltinFn::kSdot:
+ return "sdot";
+ case BuiltinFn::kUdot:
+ return "udot";
}
return "<unknown>";
}
diff --git a/src/tint/lang/spirv/builtin_fn.h b/src/tint/lang/spirv/builtin_fn.h
index e65a27f..b768dbe 100644
--- a/src/tint/lang/spirv/builtin_fn.h
+++ b/src/tint/lang/spirv/builtin_fn.h
@@ -67,6 +67,8 @@
kSelect,
kVectorTimesMatrix,
kVectorTimesScalar,
+ kSdot,
+ kUdot,
kNone,
};
diff --git a/src/tint/lang/spirv/intrinsic/BUILD.bazel b/src/tint/lang/spirv/intrinsic/BUILD.bazel
index 9f81589..d7d16d9 100644
--- a/src/tint/lang/spirv/intrinsic/BUILD.bazel
+++ b/src/tint/lang/spirv/intrinsic/BUILD.bazel
@@ -23,4 +23,37 @@
load("//src/tint:flags.bzl", "COPTS")
load("@bazel_skylib//lib:selects.bzl", "selects")
+cc_library(
+ name = "intrinsic",
+ srcs = [
+ "data.cc",
+ ],
+ hdrs = [
+ "dialect.h",
+ "type_matchers.h",
+ ],
+ deps = [
+ "//src/tint/lang/core",
+ "//src/tint/lang/core/constant",
+ "//src/tint/lang/core/intrinsic",
+ "//src/tint/lang/core/ir",
+ "//src/tint/lang/core/type",
+ "//src/tint/lang/spirv",
+ "//src/tint/lang/spirv/type",
+ "//src/tint/utils/containers",
+ "//src/tint/utils/diagnostic",
+ "//src/tint/utils/ice",
+ "//src/tint/utils/id",
+ "//src/tint/utils/macros",
+ "//src/tint/utils/math",
+ "//src/tint/utils/memory",
+ "//src/tint/utils/result",
+ "//src/tint/utils/rtti",
+ "//src/tint/utils/symbol",
+ "//src/tint/utils/text",
+ "//src/tint/utils/traits",
+ ],
+ copts = COPTS,
+ visibility = ["//visibility:public"],
+)
diff --git a/src/tint/lang/spirv/intrinsic/BUILD.cmake b/src/tint/lang/spirv/intrinsic/BUILD.cmake
index af6fdc2..545fc3b 100644
--- a/src/tint/lang/spirv/intrinsic/BUILD.cmake
+++ b/src/tint/lang/spirv/intrinsic/BUILD.cmake
@@ -21,4 +21,34 @@
# Do not modify this file directly
################################################################################
-include(lang/spirv/intrinsic/data/BUILD.cmake)
+################################################################################
+# Target: tint_lang_spirv_intrinsic
+# Kind: lib
+################################################################################
+tint_add_target(tint_lang_spirv_intrinsic lib
+ lang/spirv/intrinsic/data.cc
+ lang/spirv/intrinsic/dialect.h
+ lang/spirv/intrinsic/type_matchers.h
+)
+
+tint_target_add_dependencies(tint_lang_spirv_intrinsic lib
+ tint_lang_core
+ tint_lang_core_constant
+ tint_lang_core_intrinsic
+ tint_lang_core_ir
+ tint_lang_core_type
+ tint_lang_spirv
+ tint_lang_spirv_type
+ tint_utils_containers
+ tint_utils_diagnostic
+ tint_utils_ice
+ tint_utils_id
+ tint_utils_macros
+ tint_utils_math
+ tint_utils_memory
+ tint_utils_result
+ tint_utils_rtti
+ tint_utils_symbol
+ tint_utils_text
+ tint_utils_traits
+)
diff --git a/src/tint/lang/spirv/intrinsic/BUILD.gn b/src/tint/lang/spirv/intrinsic/BUILD.gn
index b502e46..175a3b2 100644
--- a/src/tint/lang/spirv/intrinsic/BUILD.gn
+++ b/src/tint/lang/spirv/intrinsic/BUILD.gn
@@ -24,3 +24,32 @@
import("../../../../../scripts/tint_overrides_with_defaults.gni")
import("${tint_src_dir}/tint.gni")
+
+libtint_source_set("intrinsic") {
+ sources = [
+ "data.cc",
+ "dialect.h",
+ "type_matchers.h",
+ ]
+ deps = [
+ "${tint_src_dir}/lang/core",
+ "${tint_src_dir}/lang/core/constant",
+ "${tint_src_dir}/lang/core/intrinsic",
+ "${tint_src_dir}/lang/core/ir",
+ "${tint_src_dir}/lang/core/type",
+ "${tint_src_dir}/lang/spirv",
+ "${tint_src_dir}/lang/spirv/type",
+ "${tint_src_dir}/utils/containers",
+ "${tint_src_dir}/utils/diagnostic",
+ "${tint_src_dir}/utils/ice",
+ "${tint_src_dir}/utils/id",
+ "${tint_src_dir}/utils/macros",
+ "${tint_src_dir}/utils/math",
+ "${tint_src_dir}/utils/memory",
+ "${tint_src_dir}/utils/result",
+ "${tint_src_dir}/utils/rtti",
+ "${tint_src_dir}/utils/symbol",
+ "${tint_src_dir}/utils/text",
+ "${tint_src_dir}/utils/traits",
+ ]
+}
diff --git a/src/tint/lang/spirv/intrinsic/data/data.cc b/src/tint/lang/spirv/intrinsic/data.cc
similarity index 98%
rename from src/tint/lang/spirv/intrinsic/data/data.cc
rename to src/tint/lang/spirv/intrinsic/data.cc
index 3ae440d..9688aa4 100644
--- a/src/tint/lang/spirv/intrinsic/data/data.cc
+++ b/src/tint/lang/spirv/intrinsic/data.cc
@@ -14,7 +14,7 @@
////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
-// src/tint/lang/spirv/intrinsic/data/data.cc.tmpl
+// src/tint/lang/spirv/intrinsic/data.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
@@ -24,14 +24,14 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
-#include "src/tint/lang/spirv/intrinsic/data/data.h"
-#include "src/tint/lang/spirv/intrinsic/data/type_matchers.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
+#include "src/tint/lang/spirv/intrinsic/dialect.h"
+#include "src/tint/lang/spirv/intrinsic/type_matchers.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::spirv::intrinsic::data {
+namespace tint::spirv::intrinsic {
-using namespace tint::core::intrinsic::data; // NOLINT(build/namespaces)
+using namespace tint::core::intrinsic; // NOLINT(build/namespaces)
namespace {
@@ -2982,161 +2982,179 @@
{
/* [282] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(0),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [283] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [284] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(7),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [285] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(0),
},
{
/* [286] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [287] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(7),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [288] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(13),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [289] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [290] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(16),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [291] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(13),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [292] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(19),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [293] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(16),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [294] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [295] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(19),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [296] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(34),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [297] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [298] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(38),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [299] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(34),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [300] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(40),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [301] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(38),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [302] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [303] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(40),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
/* [304] */
/* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(3),
- },
- {
- /* [305] */
- /* usage */ core::ParameterUsage::kNone,
/* type_matcher_indices */ TypeMatcherIndicesIndex(2),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
},
{
+ /* [305] */
+ /* usage */ core::ParameterUsage::kNone,
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
+ },
+ {
/* [306] */
/* usage */ core::ParameterUsage::kNone,
/* type_matcher_indices */ TypeMatcherIndicesIndex(67),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
+ },
+ {
+ /* [307] */
+ /* usage */ core::ParameterUsage::kNone,
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
/* number_matcher_indices */ NumberMatcherIndicesIndex(3),
},
{
- /* [307] */
+ /* [308] */
+ /* usage */ core::ParameterUsage::kNone,
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
+ },
+ {
+ /* [309] */
+ /* usage */ core::ParameterUsage::kNone,
+ /* type_matcher_indices */ TypeMatcherIndicesIndex(67),
+ /* number_matcher_indices */ NumberMatcherIndicesIndex(3),
+ },
+ {
+ /* [310] */
/* usage */ core::ParameterUsage::kNone,
/* type_matcher_indices */ TypeMatcherIndicesIndex(23),
/* number_matcher_indices */ NumberMatcherIndicesIndex(1),
},
{
- /* [308] */
+ /* [311] */
/* usage */ core::ParameterUsage::kNone,
/* type_matcher_indices */ TypeMatcherIndicesIndex(2),
/* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
@@ -4017,7 +4035,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(0),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(290),
+ /* parameters */ ParameterIndex(293),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4030,7 +4048,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(0),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(292),
+ /* parameters */ ParameterIndex(295),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4082,7 +4100,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(/* invalid */),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(298),
+ /* parameters */ ParameterIndex(301),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4095,7 +4113,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(/* invalid */),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(300),
+ /* parameters */ ParameterIndex(303),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4680,7 +4698,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(4),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(284),
+ /* parameters */ ParameterIndex(287),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4693,7 +4711,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(4),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(286),
+ /* parameters */ ParameterIndex(289),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4706,7 +4724,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(4),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(288),
+ /* parameters */ ParameterIndex(291),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4719,7 +4737,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(4),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(290),
+ /* parameters */ ParameterIndex(293),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4732,7 +4750,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(4),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(292),
+ /* parameters */ ParameterIndex(295),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4745,7 +4763,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(5),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(294),
+ /* parameters */ ParameterIndex(297),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4758,7 +4776,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(5),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(296),
+ /* parameters */ ParameterIndex(299),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4771,7 +4789,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(5),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(298),
+ /* parameters */ ParameterIndex(301),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4784,7 +4802,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(5),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(300),
+ /* parameters */ ParameterIndex(303),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(55),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4810,7 +4828,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(21),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(284),
+ /* parameters */ ParameterIndex(287),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4823,7 +4841,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(21),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(286),
+ /* parameters */ ParameterIndex(289),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4836,7 +4854,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(21),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(288),
+ /* parameters */ ParameterIndex(291),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4849,7 +4867,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(21),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(290),
+ /* parameters */ ParameterIndex(293),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4862,7 +4880,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(21),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(292),
+ /* parameters */ ParameterIndex(295),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(18),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4875,7 +4893,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(22),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(294),
+ /* parameters */ ParameterIndex(297),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(27),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4888,7 +4906,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(22),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(296),
+ /* parameters */ ParameterIndex(299),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(33),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4901,7 +4919,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(22),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(298),
+ /* parameters */ ParameterIndex(301),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(37),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -4914,7 +4932,7 @@
/* num_template_numbers */ 0,
/* template_types */ TemplateTypeIndex(22),
/* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(300),
+ /* parameters */ ParameterIndex(303),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(39),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -5291,7 +5309,7 @@
/* num_template_numbers */ 1,
/* template_types */ TemplateTypeIndex(23),
/* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(282),
+ /* parameters */ ParameterIndex(285),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(54),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -5369,7 +5387,7 @@
/* num_template_numbers */ 3,
/* template_types */ TemplateTypeIndex(24),
/* template_numbers */ TemplateNumberIndex(0),
- /* parameters */ ParameterIndex(302),
+ /* parameters */ ParameterIndex(305),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(67),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(4),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -5382,7 +5400,7 @@
/* num_template_numbers */ 2,
/* template_types */ TemplateTypeIndex(24),
/* template_numbers */ TemplateNumberIndex(11),
- /* parameters */ ParameterIndex(304),
+ /* parameters */ ParameterIndex(307),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(67),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(3),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -5395,7 +5413,7 @@
/* num_template_numbers */ 2,
/* template_types */ TemplateTypeIndex(24),
/* template_numbers */ TemplateNumberIndex(11),
- /* parameters */ ParameterIndex(306),
+ /* parameters */ ParameterIndex(309),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(23),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(4),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
@@ -5421,11 +5439,37 @@
/* num_template_numbers */ 1,
/* template_types */ TemplateTypeIndex(24),
/* template_numbers */ TemplateNumberIndex(11),
- /* parameters */ ParameterIndex(307),
+ /* parameters */ ParameterIndex(310),
/* return_type_matcher_indices */ TypeMatcherIndicesIndex(23),
/* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
/* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
},
+ {
+ /* [159] */
+ /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+ /* num_parameters */ 3,
+ /* num_template_types */ 0,
+ /* num_template_numbers */ 0,
+ /* template_types */ TemplateTypeIndex(/* invalid */),
+ /* template_numbers */ TemplateNumberIndex(/* invalid */),
+ /* parameters */ ParameterIndex(282),
+ /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
+ /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
+ /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+ },
+ {
+ /* [160] */
+ /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+ /* num_parameters */ 3,
+ /* num_template_types */ 0,
+ /* num_template_numbers */ 0,
+ /* template_types */ TemplateTypeIndex(/* invalid */),
+ /* template_numbers */ TemplateNumberIndex(/* invalid */),
+ /* parameters */ ParameterIndex(282),
+ /* return_type_matcher_indices */ TypeMatcherIndicesIndex(54),
+ /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
+ /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+ },
};
static_assert(OverloadIndex::CanIndex(kOverloads),
@@ -5765,13 +5809,25 @@
/* num overloads */ 1,
/* overloads */ OverloadIndex(158),
},
+ {
+ /* [33] */
+ /* fn sdot(u32, u32, u32) -> i32 */
+ /* num overloads */ 1,
+ /* overloads */ OverloadIndex(159),
+ },
+ {
+ /* [34] */
+ /* fn udot(u32, u32, u32) -> u32 */
+ /* num overloads */ 1,
+ /* overloads */ OverloadIndex(160),
+ },
};
// clang-format on
} // anonymous namespace
-const core::intrinsic::TableData kData{
+const core::intrinsic::TableData Dialect::kData{
/* template_types */ kTemplateTypes,
/* template_numbers */ kTemplateNumbers,
/* type_matcher_indices */ kTypeMatcherIndices,
@@ -5806,4 +5862,4 @@
/* unary '-' */ tint::core::intrinsic::kNoOverloads,
};
-} // namespace tint::spirv::intrinsic::data
+} // namespace tint::spirv::intrinsic
diff --git a/src/tint/lang/spirv/intrinsic/data/data.cc.tmpl b/src/tint/lang/spirv/intrinsic/data.cc.tmpl
similarity index 67%
rename from src/tint/lang/spirv/intrinsic/data/data.cc.tmpl
rename to src/tint/lang/spirv/intrinsic/data.cc.tmpl
index 8130aea..6086b0a 100644
--- a/src/tint/lang/spirv/intrinsic/data/data.cc.tmpl
+++ b/src/tint/lang/spirv/intrinsic/data.cc.tmpl
@@ -19,17 +19,17 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
-#include "src/tint/lang/spirv/intrinsic/data/type_matchers.h"
-#include "src/tint/lang/spirv/intrinsic/data/data.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
+#include "src/tint/lang/spirv/intrinsic/dialect.h"
+#include "src/tint/lang/spirv/intrinsic/type_matchers.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::spirv::intrinsic::data {
+namespace tint::spirv::intrinsic {
-using namespace tint::core::intrinsic::data; // NOLINT(build/namespaces)
+using namespace tint::core::intrinsic; // NOLINT(build/namespaces)
{{ Eval "Data"
"Intrinsics" $I
- "Name" "kData" -}}
+ "Name" "Dialect::kData" -}}
-} // namespace tint::spirv::intrinsic::data
+} // namespace tint::spirv::intrinsic
diff --git a/src/tint/lang/spirv/intrinsic/data/BUILD.bazel b/src/tint/lang/spirv/intrinsic/data/BUILD.bazel
deleted file mode 100644
index 3a2673d..0000000
--- a/src/tint/lang/spirv/intrinsic/data/BUILD.bazel
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.bazel.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-load("//src/tint:flags.bzl", "COPTS")
-load("@bazel_skylib//lib:selects.bzl", "selects")
-cc_library(
- name = "data",
- srcs = [
- "data.cc",
- ],
- hdrs = [
- "data.h",
- "type_matchers.h",
- ],
- deps = [
- "//src/tint/lang/core",
- "//src/tint/lang/core/constant",
- "//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
- "//src/tint/lang/core/ir",
- "//src/tint/lang/core/type",
- "//src/tint/lang/spirv/type",
- "//src/tint/utils/containers",
- "//src/tint/utils/diagnostic",
- "//src/tint/utils/ice",
- "//src/tint/utils/id",
- "//src/tint/utils/macros",
- "//src/tint/utils/math",
- "//src/tint/utils/memory",
- "//src/tint/utils/result",
- "//src/tint/utils/rtti",
- "//src/tint/utils/symbol",
- "//src/tint/utils/text",
- "//src/tint/utils/traits",
- ],
- copts = COPTS,
- visibility = ["//visibility:public"],
-)
-
diff --git a/src/tint/lang/spirv/intrinsic/data/BUILD.cmake b/src/tint/lang/spirv/intrinsic/data/BUILD.cmake
deleted file mode 100644
index dc7d4da..0000000
--- a/src/tint/lang/spirv/intrinsic/data/BUILD.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.cmake.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-################################################################################
-# Target: tint_lang_spirv_intrinsic_data
-# Kind: lib
-################################################################################
-tint_add_target(tint_lang_spirv_intrinsic_data lib
- lang/spirv/intrinsic/data/data.cc
- lang/spirv/intrinsic/data/data.h
- lang/spirv/intrinsic/data/type_matchers.h
-)
-
-tint_target_add_dependencies(tint_lang_spirv_intrinsic_data lib
- tint_lang_core
- tint_lang_core_constant
- tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
- tint_lang_core_ir
- tint_lang_core_type
- tint_lang_spirv_type
- tint_utils_containers
- tint_utils_diagnostic
- tint_utils_ice
- tint_utils_id
- tint_utils_macros
- tint_utils_math
- tint_utils_memory
- tint_utils_result
- tint_utils_rtti
- tint_utils_symbol
- tint_utils_text
- tint_utils_traits
-)
diff --git a/src/tint/lang/spirv/intrinsic/data/BUILD.gn b/src/tint/lang/spirv/intrinsic/data/BUILD.gn
deleted file mode 100644
index 17a0d59..0000000
--- a/src/tint/lang/spirv/intrinsic/data/BUILD.gn
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.gn.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-import("../../../../../../scripts/tint_overrides_with_defaults.gni")
-
-import("${tint_src_dir}/tint.gni")
-
-libtint_source_set("data") {
- sources = [
- "data.cc",
- "data.h",
- "type_matchers.h",
- ]
- deps = [
- "${tint_src_dir}/lang/core",
- "${tint_src_dir}/lang/core/constant",
- "${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
- "${tint_src_dir}/lang/core/ir",
- "${tint_src_dir}/lang/core/type",
- "${tint_src_dir}/lang/spirv/type",
- "${tint_src_dir}/utils/containers",
- "${tint_src_dir}/utils/diagnostic",
- "${tint_src_dir}/utils/ice",
- "${tint_src_dir}/utils/id",
- "${tint_src_dir}/utils/macros",
- "${tint_src_dir}/utils/math",
- "${tint_src_dir}/utils/memory",
- "${tint_src_dir}/utils/result",
- "${tint_src_dir}/utils/rtti",
- "${tint_src_dir}/utils/symbol",
- "${tint_src_dir}/utils/text",
- "${tint_src_dir}/utils/traits",
- ]
-}
diff --git a/src/tint/lang/spirv/intrinsic/data/data.h b/src/tint/lang/spirv/intrinsic/data/data.h
deleted file mode 100644
index 60b0c2a..0000000
--- a/src/tint/lang/spirv/intrinsic/data/data.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2023 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_DATA_H_
-#define SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_DATA_H_
-
-#include "src/tint/lang/core/intrinsic/table_data.h"
-
-namespace tint::spirv::intrinsic::data {
-
-extern const core::intrinsic::TableData kData;
-
-} // namespace tint::spirv::intrinsic::data
-
-#endif // SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_DATA_H_
diff --git a/src/tint/lang/spirv/intrinsic/dialect.h b/src/tint/lang/spirv/intrinsic/dialect.h
new file mode 100644
index 0000000..37fb3c7
--- /dev/null
+++ b/src/tint/lang/spirv/intrinsic/dialect.h
@@ -0,0 +1,38 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_
+#define SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_
+
+#include "src/tint/lang/core/intrinsic/table_data.h"
+#include "src/tint/lang/spirv/builtin_fn.h"
+
+namespace tint::spirv::intrinsic {
+
+/// Dialect holds the intrinsic table data and types for the SPIR-V dialect
+struct Dialect {
+ /// The dialect's intrinsic table data
+ static const core::intrinsic::TableData kData;
+
+ /// The dialect's builtin function enumerator
+ using BuiltinFn = spirv::BuiltinFn;
+
+ /// @returns the name of the builtin function @p fn
+ /// @param fn the builtin function
+ static std::string_view ToString(BuiltinFn fn) { return str(fn); }
+};
+
+} // namespace tint::spirv::intrinsic
+
+#endif // SRC_TINT_LANG_SPIRV_INTRINSIC_DIALECT_H_
diff --git a/src/tint/lang/spirv/intrinsic/data/type_matchers.h b/src/tint/lang/spirv/intrinsic/type_matchers.h
similarity index 88%
rename from src/tint/lang/spirv/intrinsic/data/type_matchers.h
rename to src/tint/lang/spirv/intrinsic/type_matchers.h
index 9840ab8..afe545d 100644
--- a/src/tint/lang/spirv/intrinsic/data/type_matchers.h
+++ b/src/tint/lang/spirv/intrinsic/type_matchers.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_TYPE_MATCHERS_H_
-#define SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_TYPE_MATCHERS_H_
+#ifndef SRC_TINT_LANG_SPIRV_INTRINSIC_TYPE_MATCHERS_H_
+#define SRC_TINT_LANG_SPIRV_INTRINSIC_TYPE_MATCHERS_H_
#include "src/tint/lang/core/intrinsic/table.h"
#include "src/tint/lang/core/type/array.h"
@@ -21,7 +21,7 @@
#include "src/tint/lang/core/type/struct.h"
#include "src/tint/lang/spirv/type/sampled_image.h"
-namespace tint::spirv::intrinsic::data {
+namespace tint::spirv::intrinsic {
inline bool MatchStructWithRuntimeArray(core::intrinsic::MatchState&, const core::type::Type* ty) {
if (auto* str = ty->As<core::type::Struct>()) {
@@ -62,6 +62,6 @@
return state.types.Get<type::SampledImage>(T);
}
-} // namespace tint::spirv::intrinsic::data
+} // namespace tint::spirv::intrinsic
-#endif // SRC_TINT_LANG_SPIRV_INTRINSIC_DATA_TYPE_MATCHERS_H_
+#endif // SRC_TINT_LANG_SPIRV_INTRINSIC_TYPE_MATCHERS_H_
diff --git a/src/tint/lang/spirv/ir/BUILD.bazel b/src/tint/lang/spirv/ir/BUILD.bazel
index 4bc4c29..c6570fc 100644
--- a/src/tint/lang/spirv/ir/BUILD.bazel
+++ b/src/tint/lang/spirv/ir/BUILD.bazel
@@ -39,7 +39,7 @@
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
"//src/tint/utils/ice",
@@ -68,12 +68,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir:test",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
diff --git a/src/tint/lang/spirv/ir/BUILD.cmake b/src/tint/lang/spirv/ir/BUILD.cmake
index 120c578..e17a474 100644
--- a/src/tint/lang/spirv/ir/BUILD.cmake
+++ b/src/tint/lang/spirv/ir/BUILD.cmake
@@ -38,7 +38,7 @@
tint_lang_core_ir
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_utils_containers
tint_utils_diagnostic
tint_utils_ice
@@ -67,12 +67,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_test
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_utils_containers
tint_utils_diagnostic
diff --git a/src/tint/lang/spirv/ir/BUILD.gn b/src/tint/lang/spirv/ir/BUILD.gn
index b558471..2a81280 100644
--- a/src/tint/lang/spirv/ir/BUILD.gn
+++ b/src/tint/lang/spirv/ir/BUILD.gn
@@ -42,7 +42,7 @@
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
"${tint_src_dir}/utils/ice",
@@ -68,12 +68,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir:unittests",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
diff --git a/src/tint/lang/spirv/ir/builtin_call.cc b/src/tint/lang/spirv/ir/builtin_call.cc
index 2e077fa..548b120 100644
--- a/src/tint/lang/spirv/ir/builtin_call.cc
+++ b/src/tint/lang/spirv/ir/builtin_call.cc
@@ -28,6 +28,7 @@
BuiltinFn func,
VectorRef<core::ir::Value*> arguments)
: Base(result, arguments), func_(func) {
+ flags_.Add(Flag::kSequenced);
TINT_ASSERT(func != BuiltinFn::kNone);
}
diff --git a/src/tint/lang/spirv/ir/builtin_call.h b/src/tint/lang/spirv/ir/builtin_call.h
index 5eeefb9..0892e1c 100644
--- a/src/tint/lang/spirv/ir/builtin_call.h
+++ b/src/tint/lang/spirv/ir/builtin_call.h
@@ -20,7 +20,7 @@
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/ir/builtin_call.h"
#include "src/tint/lang/spirv/builtin_fn.h"
-#include "src/tint/lang/spirv/intrinsic/data/data.h"
+#include "src/tint/lang/spirv/intrinsic/dialect.h"
#include "src/tint/utils/rtti/castable.h"
namespace tint::spirv::ir {
@@ -50,7 +50,9 @@
std::string FriendlyName() override { return std::string("spirv.") + str(func_); }
/// @returns the table data to validate this builtin
- const core::intrinsic::TableData& TableData() override { return spirv::intrinsic::data::kData; }
+ const core::intrinsic::TableData& TableData() override {
+ return spirv::intrinsic::Dialect::kData;
+ }
private:
BuiltinFn func_;
diff --git a/src/tint/lang/spirv/spirv.def b/src/tint/lang/spirv/spirv.def
index bc5d60c..da3c346 100644
--- a/src/tint/lang/spirv/spirv.def
+++ b/src/tint/lang/spirv/spirv.def
@@ -296,3 +296,8 @@
fn vector_times_matrix<T: f32_f16, N: num, M: num>(vec<N, T>, mat<M, N, T>) -> vec<M, T>
fn vector_times_scalar<T: f32_f16, N: num>(vec<N, T>, T) -> vec<N, T>
+////////////////////////////////////////////////////////////////////////////////
+// SPV_KHR_integer_dot_product instructions
+////////////////////////////////////////////////////////////////////////////////
+fn sdot(u32, u32, u32) -> i32
+fn udot(u32, u32, u32) -> u32
diff --git a/src/tint/lang/spirv/writer/BUILD.bazel b/src/tint/lang/spirv/writer/BUILD.bazel
index 4123059..f8d6a11 100644
--- a/src/tint/lang/spirv/writer/BUILD.bazel
+++ b/src/tint/lang/spirv/writer/BUILD.bazel
@@ -38,16 +38,15 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
- "//src/tint/lang/core/ir/transform",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
"//src/tint/lang/wgsl/program",
+ "//src/tint/lang/wgsl/reader/lower",
"//src/tint/lang/wgsl/reader/program_to_ir",
"//src/tint/lang/wgsl/sem",
"//src/tint/utils/containers",
@@ -111,11 +110,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
diff --git a/src/tint/lang/spirv/writer/BUILD.cmake b/src/tint/lang/spirv/writer/BUILD.cmake
index d62c4a1..0910cfb 100644
--- a/src/tint/lang/spirv/writer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/BUILD.cmake
@@ -45,16 +45,15 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
- tint_lang_core_ir_transform
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_lang_wgsl
tint_lang_wgsl_ast
tint_lang_wgsl_program
+ tint_lang_wgsl_reader_lower
tint_lang_wgsl_reader_program_to_ir
tint_lang_wgsl_sem
tint_utils_containers
@@ -123,11 +122,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_utils_containers
tint_utils_diagnostic
diff --git a/src/tint/lang/spirv/writer/BUILD.gn b/src/tint/lang/spirv/writer/BUILD.gn
index a7dd432..38d4260 100644
--- a/src/tint/lang/spirv/writer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/BUILD.gn
@@ -41,16 +41,15 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
- "${tint_src_dir}/lang/core/ir/transform",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
"${tint_src_dir}/lang/wgsl/program",
+ "${tint_src_dir}/lang/wgsl/reader/lower",
"${tint_src_dir}/lang/wgsl/reader/program_to_ir",
"${tint_src_dir}/lang/wgsl/sem",
"${tint_src_dir}/utils/containers",
@@ -115,11 +114,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
diff --git a/src/tint/lang/spirv/writer/ast_printer/ast_printer.cc b/src/tint/lang/spirv/writer/ast_printer/ast_printer.cc
index be77357..fa7d322 100644
--- a/src/tint/lang/spirv/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/spirv/writer/ast_printer/ast_printer.cc
@@ -98,8 +98,7 @@
manager.Add<ast::transform::BindingRemapper>();
data.Add<ast::transform::BindingRemapper::Remappings>(
options.binding_remapper_options.binding_points,
- std::unordered_map<BindingPoint, core::Access>{},
- options.binding_remapper_options.allow_collisions);
+ std::unordered_map<BindingPoint, core::Access>{}, /* allow_collisions */ false);
// Note: it is more efficient for MultiplanarExternalTexture to come after Robustness
data.Add<ast::transform::MultiplanarExternalTexture::NewBindingPoints>(
diff --git a/src/tint/lang/spirv/writer/builtin_test.cc b/src/tint/lang/spirv/writer/builtin_test.cc
index 64dc0c7..ababde5 100644
--- a/src/tint/lang/spirv/writer/builtin_test.cc
+++ b/src/tint/lang/spirv/writer/builtin_test.cc
@@ -1436,8 +1436,6 @@
SpirvWriterTest,
Builtin_3arg,
testing::Values(BuiltinTestCase{kF32, core::BuiltinFn::kClamp, "NClamp"},
- BuiltinTestCase{kI32, core::BuiltinFn::kClamp, "SClamp"},
- BuiltinTestCase{kU32, core::BuiltinFn::kClamp, "UClamp"},
BuiltinTestCase{kF32, core::BuiltinFn::kFma, "Fma"},
BuiltinTestCase{kF16, core::BuiltinFn::kFma, "Fma"},
BuiltinTestCase{kF32, core::BuiltinFn::kMix, "Mix"},
@@ -1445,6 +1443,86 @@
BuiltinTestCase{kF32, core::BuiltinFn::kSmoothstep, "SmoothStep"},
BuiltinTestCase{kF16, core::BuiltinFn::kSmoothstep, "SmoothStep"}));
+TEST_F(SpirvWriterTest, Builtin_Clamp_Scalar_I32) {
+ auto* value = b.FunctionParam("value", ty.i32());
+ auto* low = b.FunctionParam("low", ty.i32());
+ auto* high = b.FunctionParam("high", ty.i32());
+ auto* func = b.Function("foo", ty.i32());
+ func->SetParams({value, low, high});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.i32(), core::BuiltinFn::kClamp, value, low, high);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ %8 = OpExtInst %int %9 SMax %value %low
+ %result = OpExtInst %int %9 SMin %8 %high
+)");
+}
+
+TEST_F(SpirvWriterTest, Builtin_Clamp_Scalar_U32) {
+ auto* value = b.FunctionParam("value", ty.u32());
+ auto* low = b.FunctionParam("low", ty.u32());
+ auto* high = b.FunctionParam("high", ty.u32());
+ auto* func = b.Function("foo", ty.u32());
+ func->SetParams({value, low, high});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.u32(), core::BuiltinFn::kClamp, value, low, high);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ %8 = OpExtInst %uint %9 UMax %value %low
+ %result = OpExtInst %uint %9 UMin %8 %high
+)");
+}
+
+TEST_F(SpirvWriterTest, Builtin_Clamp_Vector_I32) {
+ auto* value = b.FunctionParam("value", ty.vec4<i32>());
+ auto* low = b.FunctionParam("low", ty.vec4<i32>());
+ auto* high = b.FunctionParam("high", ty.vec4<i32>());
+ auto* func = b.Function("foo", ty.vec4<i32>());
+ func->SetParams({value, low, high});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.vec4<i32>(), core::BuiltinFn::kClamp, value, low, high);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ %9 = OpExtInst %v4int %10 SMax %value %low
+ %result = OpExtInst %v4int %10 SMin %9 %high
+)");
+}
+
+TEST_F(SpirvWriterTest, Builtin_Clamp_Vector_U32) {
+ auto* value = b.FunctionParam("value", ty.vec2<u32>());
+ auto* low = b.FunctionParam("low", ty.vec2<u32>());
+ auto* high = b.FunctionParam("high", ty.vec2<u32>());
+ auto* func = b.Function("foo", ty.vec2<u32>());
+ func->SetParams({value, low, high});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.vec2<u32>(), core::BuiltinFn::kClamp, value, low, high);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ %9 = OpExtInst %v2uint %10 UMax %value %low
+ %result = OpExtInst %v2uint %10 UMin %9 %high
+)");
+}
+
TEST_F(SpirvWriterTest, Builtin_ExtractBits_Scalar_I32) {
auto* arg = b.FunctionParam("arg", ty.i32());
auto* offset = b.FunctionParam("offset", ty.u32());
@@ -1459,7 +1537,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldSExtract %int %arg %offset %count");
+ EXPECT_INST(R"(
+ %9 = OpExtInst %uint %10 UMin %offset %uint_32
+ %12 = OpISub %uint %uint_32 %9
+ %13 = OpExtInst %uint %10 UMin %count %12
+ %result = OpBitFieldSExtract %int %arg %9 %13
+)");
}
TEST_F(SpirvWriterTest, Builtin_ExtractBits_Scalar_U32) {
@@ -1476,7 +1559,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldUExtract %uint %arg %offset %count");
+ EXPECT_INST(R"(
+ %8 = OpExtInst %uint %9 UMin %offset %uint_32
+ %11 = OpISub %uint %uint_32 %8
+ %12 = OpExtInst %uint %9 UMin %count %11
+ %result = OpBitFieldUExtract %uint %arg %8 %12
+)");
}
TEST_F(SpirvWriterTest, Builtin_ExtractBits_Vector_I32) {
@@ -1493,7 +1581,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldSExtract %v4int %arg %offset %count");
+ EXPECT_INST(R"(
+ %10 = OpExtInst %uint %11 UMin %offset %uint_32
+ %13 = OpISub %uint %uint_32 %10
+ %14 = OpExtInst %uint %11 UMin %count %13
+ %result = OpBitFieldSExtract %v4int %arg %10 %14
+)");
}
TEST_F(SpirvWriterTest, Builtin_ExtractBits_Vector_U32) {
@@ -1510,7 +1603,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldUExtract %v2uint %arg %offset %count");
+ EXPECT_INST(R"(
+ %9 = OpExtInst %uint %10 UMin %offset %uint_32
+ %12 = OpISub %uint %uint_32 %9
+ %13 = OpExtInst %uint %10 UMin %count %12
+ %result = OpBitFieldUExtract %v2uint %arg %9 %13
+)");
}
TEST_F(SpirvWriterTest, Builtin_InsertBits_Scalar_I32) {
@@ -1528,7 +1626,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldInsert %int %arg %newbits %offset %count");
+ EXPECT_INST(R"(
+ %10 = OpExtInst %uint %11 UMin %offset %uint_32
+ %13 = OpISub %uint %uint_32 %10
+ %14 = OpExtInst %uint %11 UMin %count %13
+ %result = OpBitFieldInsert %int %arg %newbits %10 %14
+)");
}
TEST_F(SpirvWriterTest, Builtin_InsertBits_Scalar_U32) {
@@ -1546,7 +1649,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldInsert %uint %arg %newbits %offset %count");
+ EXPECT_INST(R"(
+ %9 = OpExtInst %uint %10 UMin %offset %uint_32
+ %12 = OpISub %uint %uint_32 %9
+ %13 = OpExtInst %uint %10 UMin %count %12
+ %result = OpBitFieldInsert %uint %arg %newbits %9 %13
+)");
}
TEST_F(SpirvWriterTest, Builtin_InsertBits_Vector_I32) {
@@ -1565,7 +1673,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldInsert %v4int %arg %newbits %offset %count");
+ EXPECT_INST(R"(
+ %11 = OpExtInst %uint %12 UMin %offset %uint_32
+ %14 = OpISub %uint %uint_32 %11
+ %15 = OpExtInst %uint %12 UMin %count %14
+ %result = OpBitFieldInsert %v4int %arg %newbits %11 %15
+)");
}
TEST_F(SpirvWriterTest, Builtin_InsertBits_Vector_U32) {
@@ -1584,7 +1697,12 @@
});
ASSERT_TRUE(Generate()) << Error() << output_;
- EXPECT_INST("%result = OpBitFieldInsert %v2uint %arg %newbits %offset %count");
+ EXPECT_INST(R"(
+ %10 = OpExtInst %uint %11 UMin %offset %uint_32
+ %13 = OpISub %uint %uint_32 %10
+ %14 = OpExtInst %uint %11 UMin %count %13
+ %result = OpBitFieldInsert %v2uint %arg %newbits %10 %14
+)");
}
TEST_F(SpirvWriterTest, Builtin_FaceForward_F32) {
@@ -1867,5 +1985,98 @@
EXPECT_INST("%result = OpArrayLength %uint %1 2");
}
+////////////////////////////////////////////////////////////////////////////////
+// DP4A builtins
+////////////////////////////////////////////////////////////////////////////////
+
+TEST_F(SpirvWriterTest, Builtin_Dot4I8Packed) {
+ auto* arg1 = b.FunctionParam("arg1", ty.u32());
+ auto* arg2 = b.FunctionParam("arg2", ty.u32());
+ auto* func = b.Function("foo", ty.i32());
+ func->SetParams({arg1, arg2});
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.i32(), core::BuiltinFn::kDot4I8Packed, arg1, arg2);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ OpCapability DotProduct
+ OpCapability DotProductInput4x8BitPacked
+ OpExtension "SPV_KHR_integer_dot_product"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
+ OpExecutionMode %unused_entry_point LocalSize 1 1 1
+
+ ; Debug Information
+ OpName %foo "foo" ; id %1
+ OpName %arg1 "arg1" ; id %4
+ OpName %arg2 "arg2" ; id %5
+ OpName %result "result" ; id %8
+ OpName %unused_entry_point "unused_entry_point" ; id %9
+
+ ; Types, variables and constants
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %6 = OpTypeFunction %int %uint %uint
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+
+ ; Function foo
+ %foo = OpFunction %int None %6
+ %arg1 = OpFunctionParameter %uint
+ %arg2 = OpFunctionParameter %uint
+ %7 = OpLabel
+ %result = OpSDot %int %arg1 %arg2 PackedVectorFormat4x8Bit
+ OpReturnValue %result
+ OpFunctionEnd
+)");
+}
+
+TEST_F(SpirvWriterTest, Builtin_Dot4U8Packed) {
+ auto* arg1 = b.FunctionParam("arg1", ty.u32());
+ auto* arg2 = b.FunctionParam("arg2", ty.u32());
+ auto* func = b.Function("foo", ty.u32());
+ func->SetParams({arg1, arg2});
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.u32(), core::BuiltinFn::kDot4U8Packed, arg1, arg2);
+ b.Return(func, result);
+ mod.SetName(result, "result");
+ });
+
+ ASSERT_TRUE(Generate()) << Error() << output_;
+ EXPECT_INST(R"(
+ OpCapability DotProduct
+ OpCapability DotProductInput4x8BitPacked
+ OpExtension "SPV_KHR_integer_dot_product"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
+ OpExecutionMode %unused_entry_point LocalSize 1 1 1
+
+ ; Debug Information
+ OpName %foo "foo" ; id %1
+ OpName %arg1 "arg1" ; id %3
+ OpName %arg2 "arg2" ; id %4
+ OpName %result "result" ; id %7
+ OpName %unused_entry_point "unused_entry_point" ; id %8
+
+ ; Types, variables and constants
+ %uint = OpTypeInt 32 0
+ %5 = OpTypeFunction %uint %uint %uint
+ %void = OpTypeVoid
+ %10 = OpTypeFunction %void
+
+ ; Function foo
+ %foo = OpFunction %uint None %5
+ %arg1 = OpFunctionParameter %uint
+ %arg2 = OpFunctionParameter %uint
+ %6 = OpLabel
+ %result = OpUDot %uint %arg1 %arg2 PackedVectorFormat4x8Bit
+ OpReturnValue %result
+ OpFunctionEnd
+)");
+}
+
} // namespace
} // namespace tint::spirv::writer
diff --git a/src/tint/lang/spirv/writer/common/BUILD.bazel b/src/tint/lang/spirv/writer/common/BUILD.bazel
index 679753a..bf196f2 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.bazel
+++ b/src/tint/lang/spirv/writer/common/BUILD.bazel
@@ -44,9 +44,13 @@
"//src/tint/api/common",
"//src/tint/api/options",
"//src/tint/lang/core",
+ "//src/tint/utils/containers",
+ "//src/tint/utils/ice",
"//src/tint/utils/macros",
"//src/tint/utils/math",
+ "//src/tint/utils/memory",
"//src/tint/utils/reflection",
+ "//src/tint/utils/rtti",
"//src/tint/utils/text",
"//src/tint/utils/traits",
] + select({
@@ -76,11 +80,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
diff --git a/src/tint/lang/spirv/writer/common/BUILD.cmake b/src/tint/lang/spirv/writer/common/BUILD.cmake
index 8e00115..086cac1 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/common/BUILD.cmake
@@ -45,9 +45,13 @@
tint_api_common
tint_api_options
tint_lang_core
+ tint_utils_containers
+ tint_utils_ice
tint_utils_macros
tint_utils_math
+ tint_utils_memory
tint_utils_reflection
+ tint_utils_rtti
tint_utils_text
tint_utils_traits
)
@@ -81,11 +85,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_utils_containers
tint_utils_diagnostic
diff --git a/src/tint/lang/spirv/writer/common/BUILD.gn b/src/tint/lang/spirv/writer/common/BUILD.gn
index 17330ef..5c12785 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.gn
+++ b/src/tint/lang/spirv/writer/common/BUILD.gn
@@ -47,9 +47,13 @@
"${tint_src_dir}/api/common",
"${tint_src_dir}/api/options",
"${tint_src_dir}/lang/core",
+ "${tint_src_dir}/utils/containers",
+ "${tint_src_dir}/utils/ice",
"${tint_src_dir}/utils/macros",
"${tint_src_dir}/utils/math",
+ "${tint_src_dir}/utils/memory",
"${tint_src_dir}/utils/reflection",
+ "${tint_src_dir}/utils/rtti",
"${tint_src_dir}/utils/text",
"${tint_src_dir}/utils/traits",
]
@@ -79,11 +83,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
diff --git a/src/tint/lang/spirv/writer/common/module.cc b/src/tint/lang/spirv/writer/common/module.cc
index 0dfc43f..5d9cc72 100644
--- a/src/tint/lang/spirv/writer/common/module.cc
+++ b/src/tint/lang/spirv/writer/common/module.cc
@@ -88,14 +88,15 @@
}
void Module::PushCapability(uint32_t cap) {
- if (capability_set_.count(cap) == 0) {
- capability_set_.insert(cap);
+ if (capability_set_.Add(cap)) {
capabilities_.push_back(Instruction{spv::Op::OpCapability, {Operand(cap)}});
}
}
void Module::PushExtension(const char* extension) {
- extensions_.push_back(Instruction{spv::Op::OpExtension, {Operand(extension)}});
+ if (extension_set_.Add(extension)) {
+ extensions_.push_back(Instruction{spv::Op::OpExtension, {Operand(extension)}});
+ }
}
} // namespace tint::spirv::writer
diff --git a/src/tint/lang/spirv/writer/common/module.h b/src/tint/lang/spirv/writer/common/module.h
index 8fb4c08..df95adc 100644
--- a/src/tint/lang/spirv/writer/common/module.h
+++ b/src/tint/lang/spirv/writer/common/module.h
@@ -17,11 +17,11 @@
#include <cstdint>
#include <functional>
-#include <unordered_set>
#include <vector>
#include "src/tint/lang/spirv/writer/common/function.h"
#include "src/tint/lang/spirv/writer/common/instruction.h"
+#include "src/tint/utils/containers/hashset.h"
namespace tint::spirv::writer {
@@ -153,7 +153,8 @@
InstructionList types_;
InstructionList annotations_;
std::vector<Function> functions_;
- std::unordered_set<uint32_t> capability_set_;
+ Hashset<uint32_t, 8> capability_set_;
+ Hashset<const char*, 8> extension_set_;
};
} // namespace tint::spirv::writer
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.bazel b/src/tint/lang/spirv/writer/printer/BUILD.bazel
index 6cbbbbe..f595547 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.bazel
+++ b/src/tint/lang/spirv/writer/printer/BUILD.bazel
@@ -37,11 +37,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/lang/spirv/type",
"//src/tint/lang/wgsl",
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.cmake b/src/tint/lang/spirv/writer/printer/BUILD.cmake
index 2eccda6..81c1626 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/printer/BUILD.cmake
@@ -38,11 +38,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_lang_spirv_type
tint_lang_wgsl
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.gn b/src/tint/lang/spirv/writer/printer/BUILD.gn
index 69b21cd..476271a 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/printer/BUILD.gn
@@ -36,11 +36,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/lang/spirv/type",
"${tint_src_dir}/lang/wgsl",
diff --git a/src/tint/lang/spirv/writer/printer/printer.cc b/src/tint/lang/spirv/writer/printer/printer.cc
index 258335c..43ed467 100644
--- a/src/tint/lang/spirv/writer/printer/printer.cc
+++ b/src/tint/lang/spirv/writer/printer/printer.cc
@@ -1121,9 +1121,21 @@
case spirv::BuiltinFn::kSampledImage:
op = spv::Op::OpSampledImage;
break;
+ case spirv::BuiltinFn::kSdot:
+ module_.PushExtension("SPV_KHR_integer_dot_product");
+ module_.PushCapability(SpvCapabilityDotProductKHR);
+ module_.PushCapability(SpvCapabilityDotProductInput4x8BitPackedKHR);
+ op = spv::Op::OpSDot;
+ break;
case spirv::BuiltinFn::kSelect:
op = spv::Op::OpSelect;
break;
+ case spirv::BuiltinFn::kUdot:
+ module_.PushExtension("SPV_KHR_integer_dot_product");
+ module_.PushCapability(SpvCapabilityDotProductKHR);
+ module_.PushCapability(SpvCapabilityDotProductInput4x8BitPackedKHR);
+ op = spv::Op::OpUDot;
+ break;
case spirv::BuiltinFn::kVectorTimesMatrix:
op = spv::Op::OpVectorTimesMatrix;
break;
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.bazel b/src/tint/lang/spirv/writer/raise/BUILD.bazel
index 6c76444..f233c85 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.bazel
+++ b/src/tint/lang/spirv/writer/raise/BUILD.bazel
@@ -49,12 +49,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir/transform",
"//src/tint/lang/core/type",
"//src/tint/lang/spirv",
- "//src/tint/lang/spirv/intrinsic/data",
+ "//src/tint/lang/spirv/intrinsic",
"//src/tint/lang/spirv/ir",
"//src/tint/lang/spirv/type",
"//src/tint/utils/containers",
@@ -100,7 +99,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir/transform:test",
"//src/tint/lang/core/type",
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.cmake b/src/tint/lang/spirv/writer/raise/BUILD.cmake
index 7e56366..8385c91 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/raise/BUILD.cmake
@@ -50,12 +50,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_transform
tint_lang_core_type
tint_lang_spirv
- tint_lang_spirv_intrinsic_data
+ tint_lang_spirv_intrinsic
tint_lang_spirv_ir
tint_lang_spirv_type
tint_utils_containers
@@ -106,7 +105,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_transform_test
tint_lang_core_type
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.gn b/src/tint/lang/spirv/writer/raise/BUILD.gn
index db76051..6d187d6 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.gn
+++ b/src/tint/lang/spirv/writer/raise/BUILD.gn
@@ -52,12 +52,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir/transform",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/spirv",
- "${tint_src_dir}/lang/spirv/intrinsic/data",
+ "${tint_src_dir}/lang/spirv/intrinsic",
"${tint_src_dir}/lang/spirv/ir",
"${tint_src_dir}/lang/spirv/type",
"${tint_src_dir}/utils/containers",
@@ -102,7 +101,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir/transform:unittests",
"${tint_src_dir}/lang/core/type",
diff --git a/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc b/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
index 678397f..dc5ff8b 100644
--- a/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/spirv/writer/raise/builtin_polyfill.cc
@@ -75,6 +75,8 @@
case core::BuiltinFn::kAtomicSub:
case core::BuiltinFn::kAtomicXor:
case core::BuiltinFn::kDot:
+ case core::BuiltinFn::kDot4I8Packed:
+ case core::BuiltinFn::kDot4U8Packed:
case core::BuiltinFn::kSelect:
case core::BuiltinFn::kTextureDimensions:
case core::BuiltinFn::kTextureGather:
@@ -124,6 +126,10 @@
case core::BuiltinFn::kDot:
replacement = Dot(builtin);
break;
+ case core::BuiltinFn::kDot4I8Packed:
+ case core::BuiltinFn::kDot4U8Packed:
+ replacement = DotPacked4x8(builtin);
+ break;
case core::BuiltinFn::kSelect:
replacement = Select(builtin);
break;
@@ -342,6 +348,23 @@
return call->Result();
}
+ /// Handle a `dot4{I,U}8Packed()` builtin.
+ /// @param builtin the builtin call instruction
+ /// @returns the replacement value
+ core::ir::Value* DotPacked4x8(core::ir::CoreBuiltinCall* builtin) {
+ // Replace the builtin call with a call to the spirv.{s,u}dot intrinsic.
+ auto* type = builtin->Result()->Type();
+ auto is_signed = builtin->Func() == core::BuiltinFn::kDot4I8Packed;
+ auto inst = is_signed ? spirv::BuiltinFn::kSdot : spirv::BuiltinFn::kUdot;
+
+ auto args = Vector<core::ir::Value*, 3>(builtin->Args());
+ args.Push(Literal(u32(SpvPackedVectorFormatPackedVectorFormat4x8Bit)));
+
+ auto* call = b.Call<spirv::ir::BuiltinCall>(type, inst, std::move(args));
+ call->InsertBefore(builtin);
+ return call->Result();
+ }
+
/// Handle a `select()` builtin.
/// @param builtin the builtin call instruction
/// @returns the replacement value
diff --git a/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc b/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
index ee8626e..0dd0269 100644
--- a/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
+++ b/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
@@ -995,6 +995,76 @@
EXPECT_EQ(expect, str());
}
+TEST_F(SpirvWriter_BuiltinPolyfillTest, Dot4I8Packed) {
+ auto* arg1 = b.FunctionParam("arg1", ty.u32());
+ auto* arg2 = b.FunctionParam("arg2", ty.u32());
+ auto* func = b.Function("foo", ty.i32());
+ func->SetParams({arg1, arg2});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.i32(), core::BuiltinFn::kDot4I8Packed, arg1, arg2);
+ b.Return(func, result);
+ });
+
+ auto* src = R"(
+%foo = func(%arg1:u32, %arg2:u32):i32 -> %b1 {
+ %b1 = block {
+ %4:i32 = dot4I8Packed %arg1, %arg2
+ ret %4
+ }
+}
+)";
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%foo = func(%arg1:u32, %arg2:u32):i32 -> %b1 {
+ %b1 = block {
+ %4:i32 = spirv.sdot %arg1, %arg2, 0u
+ ret %4
+ }
+}
+)";
+
+ Run(BuiltinPolyfill);
+
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(SpirvWriter_BuiltinPolyfillTest, Dot4U8Packed) {
+ auto* arg1 = b.FunctionParam("arg1", ty.u32());
+ auto* arg2 = b.FunctionParam("arg2", ty.u32());
+ auto* func = b.Function("foo", ty.u32());
+ func->SetParams({arg1, arg2});
+
+ b.Append(func->Block(), [&] {
+ auto* result = b.Call(ty.u32(), core::BuiltinFn::kDot4U8Packed, arg1, arg2);
+ b.Return(func, result);
+ });
+
+ auto* src = R"(
+%foo = func(%arg1:u32, %arg2:u32):u32 -> %b1 {
+ %b1 = block {
+ %4:u32 = dot4U8Packed %arg1, %arg2
+ ret %4
+ }
+}
+)";
+ EXPECT_EQ(src, str());
+
+ auto* expect = R"(
+%foo = func(%arg1:u32, %arg2:u32):u32 -> %b1 {
+ %b1 = block {
+ %4:u32 = spirv.udot %arg1, %arg2, 0u
+ ret %4
+ }
+}
+)";
+
+ Run(BuiltinPolyfill);
+
+ EXPECT_EQ(expect, str());
+}
+
TEST_F(SpirvWriter_BuiltinPolyfillTest, Select_ScalarCondition_ScalarOperands) {
auto* argf = b.FunctionParam("argf", ty.i32());
auto* argt = b.FunctionParam("argt", ty.i32());
diff --git a/src/tint/lang/spirv/writer/raise/raise.cc b/src/tint/lang/spirv/writer/raise/raise.cc
index 93989a4..6045987 100644
--- a/src/tint/lang/spirv/writer/raise/raise.cc
+++ b/src/tint/lang/spirv/writer/raise/raise.cc
@@ -19,6 +19,7 @@
#include "src/tint/lang/core/ir/transform/add_empty_entry_point.h"
#include "src/tint/lang/core/ir/transform/bgra8unorm_polyfill.h"
#include "src/tint/lang/core/ir/transform/binary_polyfill.h"
+#include "src/tint/lang/core/ir/transform/binding_remapper.h"
#include "src/tint/lang/core/ir/transform/block_decorated_structs.h"
#include "src/tint/lang/core/ir/transform/builtin_polyfill.h"
#include "src/tint/lang/core/ir/transform/demote_to_helper.h"
@@ -44,16 +45,21 @@
} \
} while (false)
+ RUN_TRANSFORM(core::ir::transform::BindingRemapper, module, options.binding_remapper_options);
+
core::ir::transform::BinaryPolyfillConfig binary_polyfills;
binary_polyfills.bitshift_modulo = true;
binary_polyfills.int_div_mod = true;
RUN_TRANSFORM(core::ir::transform::BinaryPolyfill, module, binary_polyfills);
core::ir::transform::BuiltinPolyfillConfig core_polyfills;
+ core_polyfills.clamp_int = true;
core_polyfills.count_leading_zeros = true;
core_polyfills.count_trailing_zeros = true;
+ core_polyfills.extract_bits = core::ir::transform::BuiltinPolyfillLevel::kClampOrRangeCheck;
core_polyfills.first_leading_bit = true;
core_polyfills.first_trailing_bit = true;
+ core_polyfills.insert_bits = core::ir::transform::BuiltinPolyfillLevel::kClampOrRangeCheck;
core_polyfills.saturate = true;
core_polyfills.texture_sample_base_clamp_to_edge_2d_f32 = true;
RUN_TRANSFORM(core::ir::transform::BuiltinPolyfill, module, core_polyfills);
diff --git a/src/tint/lang/spirv/writer/writer.cc b/src/tint/lang/spirv/writer/writer.cc
index 08a83fd..1a47183 100644
--- a/src/tint/lang/spirv/writer/writer.cc
+++ b/src/tint/lang/spirv/writer/writer.cc
@@ -17,10 +17,10 @@
#include <memory>
#include <utility>
-#include "src/tint/lang/core/ir/transform/binding_remapper.h"
#include "src/tint/lang/spirv/writer/ast_printer/ast_printer.h"
#include "src/tint/lang/spirv/writer/printer/printer.h"
#include "src/tint/lang/spirv/writer/raise/raise.h"
+#include "src/tint/lang/wgsl/reader/lower/lower.h"
#include "src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.h"
// Included by 'ast_printer.h', included again here for './tools/run gen' track the dependency.
@@ -51,16 +51,14 @@
auto ir = converted.Move();
- // Apply transforms as required by writer options.
- auto remapper = core::ir::transform::BindingRemapper(ir, options.binding_remapper_options);
- if (!remapper) {
- return remapper.Failure();
+ // Lower from WGSL-dialect to core-dialect
+ if (auto res = wgsl::reader::Lower(ir); !res) {
+ return res.Failure();
}
- // Raise the IR to the SPIR-V dialect.
- auto raised = raise::Raise(ir, options);
- if (!raised) {
- return std::move(raised.Failure());
+ // Raise from core-dialect to SPIR-V-dialect.
+ if (auto res = raise::Raise(ir, options); !res) {
+ return std::move(res.Failure());
}
// Generate the SPIR-V code.
diff --git a/src/tint/lang/wgsl/helpers/BUILD.bazel b/src/tint/lang/wgsl/helpers/BUILD.bazel
index 7162fb1..16067dd 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.bazel
+++ b/src/tint/lang/wgsl/helpers/BUILD.bazel
@@ -83,6 +83,7 @@
"//src/tint/lang/wgsl/ast",
"//src/tint/lang/wgsl/ast:test",
"//src/tint/lang/wgsl/helpers",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/reader",
"//src/tint/lang/wgsl/reader/lower",
diff --git a/src/tint/lang/wgsl/helpers/BUILD.cmake b/src/tint/lang/wgsl/helpers/BUILD.cmake
index 8781482..6eb49fb 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.cmake
+++ b/src/tint/lang/wgsl/helpers/BUILD.cmake
@@ -82,6 +82,7 @@
tint_lang_wgsl_ast
tint_lang_wgsl_ast_test
tint_lang_wgsl_helpers
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_program
tint_lang_wgsl_reader
tint_lang_wgsl_reader_lower
diff --git a/src/tint/lang/wgsl/helpers/BUILD.gn b/src/tint/lang/wgsl/helpers/BUILD.gn
index 57843c5..25ea790 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.gn
+++ b/src/tint/lang/wgsl/helpers/BUILD.gn
@@ -85,6 +85,7 @@
"${tint_src_dir}/lang/wgsl/ast",
"${tint_src_dir}/lang/wgsl/ast:unittests",
"${tint_src_dir}/lang/wgsl/helpers",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/reader",
"${tint_src_dir}/lang/wgsl/reader/lower",
diff --git a/src/tint/lang/wgsl/intrinsic/BUILD.bazel b/src/tint/lang/wgsl/intrinsic/BUILD.bazel
index 9f81589..dc3205d 100644
--- a/src/tint/lang/wgsl/intrinsic/BUILD.bazel
+++ b/src/tint/lang/wgsl/intrinsic/BUILD.bazel
@@ -23,4 +23,36 @@
load("//src/tint:flags.bzl", "COPTS")
load("@bazel_skylib//lib:selects.bzl", "selects")
+cc_library(
+ name = "intrinsic",
+ srcs = [
+ "ctor_conv.cc",
+ "data.cc",
+ ],
+ hdrs = [
+ "ctor_conv.h",
+ "dialect.h",
+ ],
+ deps = [
+ "//src/tint/lang/core",
+ "//src/tint/lang/core/constant",
+ "//src/tint/lang/core/intrinsic",
+ "//src/tint/lang/core/type",
+ "//src/tint/lang/wgsl",
+ "//src/tint/utils/containers",
+ "//src/tint/utils/diagnostic",
+ "//src/tint/utils/ice",
+ "//src/tint/utils/id",
+ "//src/tint/utils/macros",
+ "//src/tint/utils/math",
+ "//src/tint/utils/memory",
+ "//src/tint/utils/result",
+ "//src/tint/utils/rtti",
+ "//src/tint/utils/symbol",
+ "//src/tint/utils/text",
+ "//src/tint/utils/traits",
+ ],
+ copts = COPTS,
+ visibility = ["//visibility:public"],
+)
diff --git a/src/tint/lang/wgsl/intrinsic/BUILD.cmake b/src/tint/lang/wgsl/intrinsic/BUILD.cmake
index f5bf63c..95dcdcd 100644
--- a/src/tint/lang/wgsl/intrinsic/BUILD.cmake
+++ b/src/tint/lang/wgsl/intrinsic/BUILD.cmake
@@ -21,4 +21,33 @@
# Do not modify this file directly
################################################################################
-include(lang/wgsl/intrinsic/data/BUILD.cmake)
+################################################################################
+# Target: tint_lang_wgsl_intrinsic
+# Kind: lib
+################################################################################
+tint_add_target(tint_lang_wgsl_intrinsic lib
+ lang/wgsl/intrinsic/ctor_conv.cc
+ lang/wgsl/intrinsic/ctor_conv.h
+ lang/wgsl/intrinsic/data.cc
+ lang/wgsl/intrinsic/dialect.h
+)
+
+tint_target_add_dependencies(tint_lang_wgsl_intrinsic lib
+ tint_lang_core
+ tint_lang_core_constant
+ tint_lang_core_intrinsic
+ tint_lang_core_type
+ tint_lang_wgsl
+ tint_utils_containers
+ tint_utils_diagnostic
+ tint_utils_ice
+ tint_utils_id
+ tint_utils_macros
+ tint_utils_math
+ tint_utils_memory
+ tint_utils_result
+ tint_utils_rtti
+ tint_utils_symbol
+ tint_utils_text
+ tint_utils_traits
+)
diff --git a/src/tint/lang/wgsl/intrinsic/BUILD.gn b/src/tint/lang/wgsl/intrinsic/BUILD.gn
index b502e46..f211f78 100644
--- a/src/tint/lang/wgsl/intrinsic/BUILD.gn
+++ b/src/tint/lang/wgsl/intrinsic/BUILD.gn
@@ -24,3 +24,31 @@
import("../../../../../scripts/tint_overrides_with_defaults.gni")
import("${tint_src_dir}/tint.gni")
+
+libtint_source_set("intrinsic") {
+ sources = [
+ "ctor_conv.cc",
+ "ctor_conv.h",
+ "data.cc",
+ "dialect.h",
+ ]
+ deps = [
+ "${tint_src_dir}/lang/core",
+ "${tint_src_dir}/lang/core/constant",
+ "${tint_src_dir}/lang/core/intrinsic",
+ "${tint_src_dir}/lang/core/type",
+ "${tint_src_dir}/lang/wgsl",
+ "${tint_src_dir}/utils/containers",
+ "${tint_src_dir}/utils/diagnostic",
+ "${tint_src_dir}/utils/ice",
+ "${tint_src_dir}/utils/id",
+ "${tint_src_dir}/utils/macros",
+ "${tint_src_dir}/utils/math",
+ "${tint_src_dir}/utils/memory",
+ "${tint_src_dir}/utils/result",
+ "${tint_src_dir}/utils/rtti",
+ "${tint_src_dir}/utils/symbol",
+ "${tint_src_dir}/utils/text",
+ "${tint_src_dir}/utils/traits",
+ ]
+}
diff --git a/src/tint/lang/wgsl/intrinsic/ctor_conv.cc b/src/tint/lang/wgsl/intrinsic/ctor_conv.cc
new file mode 100644
index 0000000..8efda05
--- /dev/null
+++ b/src/tint/lang/wgsl/intrinsic/ctor_conv.cc
@@ -0,0 +1,72 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// src/tint/lang/wgsl/intrinsic/ctor_conv.cc.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+#include "src/tint/lang/wgsl/intrinsic/ctor_conv.h"
+
+namespace tint::wgsl::intrinsic {
+
+const char* str(CtorConv i) {
+ switch (i) {
+ case CtorConv::kNone:
+ return "<none>";
+ case CtorConv::kI32:
+ return "i32";
+ case CtorConv::kU32:
+ return "u32";
+ case CtorConv::kF32:
+ return "f32";
+ case CtorConv::kF16:
+ return "f16";
+ case CtorConv::kBool:
+ return "bool";
+ case CtorConv::kVec2:
+ return "vec2";
+ case CtorConv::kVec3:
+ return "vec3";
+ case CtorConv::kVec4:
+ return "vec4";
+ case CtorConv::kMat2x2:
+ return "mat2x2";
+ case CtorConv::kMat2x3:
+ return "mat2x3";
+ case CtorConv::kMat2x4:
+ return "mat2x4";
+ case CtorConv::kMat3x2:
+ return "mat3x2";
+ case CtorConv::kMat3x3:
+ return "mat3x3";
+ case CtorConv::kMat3x4:
+ return "mat3x4";
+ case CtorConv::kMat4x2:
+ return "mat4x2";
+ case CtorConv::kMat4x3:
+ return "mat4x3";
+ case CtorConv::kMat4x4:
+ return "mat4x4";
+ case CtorConv::kPackedVec3:
+ return "packedVec3";
+ }
+ return "<unknown>";
+}
+
+} // namespace tint::wgsl::intrinsic
diff --git a/src/tint/lang/wgsl/intrinsic/ctor_conv.cc.tmpl b/src/tint/lang/wgsl/intrinsic/ctor_conv.cc.tmpl
new file mode 100644
index 0000000..0442801
--- /dev/null
+++ b/src/tint/lang/wgsl/intrinsic/ctor_conv.cc.tmpl
@@ -0,0 +1,32 @@
+{{- /*
+--------------------------------------------------------------------------------
+Template file for use with tools/src/cmd/gen to generate ctor_conv_intrinsic.cc
+
+To update the generated file, run:
+ ./tools/run gen
+
+See:
+* tools/src/cmd/gen for structures used by this template
+* https://golang.org/pkg/text/template/ for documentation on the template syntax
+--------------------------------------------------------------------------------
+*/ -}}
+
+{{- $I := LoadIntrinsics "src/tint/lang/wgsl/wgsl.def" -}}
+
+#include "src/tint/lang/wgsl/intrinsic/ctor_conv.h"
+
+namespace tint::wgsl::intrinsic {
+
+const char* str(CtorConv i) {
+ switch (i) {
+ case CtorConv::kNone:
+ return "<none>";
+{{- range $I.Sem.ConstructorsAndConverters }}
+ case CtorConv::k{{Title .Name}}:
+ return "{{.Name}}";
+{{- end }}
+ }
+ return "<unknown>";
+}
+
+} // namespace tint::wgsl::intrinsic
diff --git a/src/tint/lang/wgsl/intrinsic/ctor_conv.h b/src/tint/lang/wgsl/intrinsic/ctor_conv.h
new file mode 100644
index 0000000..5d6b002
--- /dev/null
+++ b/src/tint/lang/wgsl/intrinsic/ctor_conv.h
@@ -0,0 +1,112 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// src/tint/lang/wgsl/intrinsic/ctor_conv.h.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
+#define SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
+
+#include <cstdint>
+
+#include "src/tint/utils/traits/traits.h"
+
+namespace tint::wgsl::intrinsic {
+
+/// CtorConv is an enumerator of types that have a constructor or converter overload
+/// declared in the intrinsic table.
+enum class CtorConv : uint8_t {
+ kI32,
+ kU32,
+ kF32,
+ kF16,
+ kBool,
+ kVec2,
+ kVec3,
+ kVec4,
+ kMat2x2,
+ kMat2x3,
+ kMat2x4,
+ kMat3x2,
+ kMat3x3,
+ kMat3x4,
+ kMat4x2,
+ kMat4x3,
+ kMat4x4,
+ kPackedVec3,
+ kNone,
+};
+
+/// @returns the name of the type.
+const char* str(CtorConv i);
+
+/// Prints the CtorConv @p c to @p o
+/// @param o the stream to write to
+/// @param c the CtorConv
+/// @return the stream so calls can be chained
+template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
+auto& operator<<(STREAM& o, CtorConv c) {
+ return o << str(c);
+}
+
+/// @param n the width of the vector
+/// @return the CtorConv for a vector of width `n`
+inline CtorConv VectorCtorConv(uint32_t n) {
+ switch (n) {
+ case 2:
+ return CtorConv::kVec2;
+ case 3:
+ return CtorConv::kVec3;
+ case 4:
+ return CtorConv::kVec4;
+ }
+ return CtorConv::kNone;
+}
+
+/// @param c the number of columns in the matrix
+/// @param r the number of rows in the matrix
+/// @return the CtorConv for a matrix with `c` columns and `r` rows
+inline CtorConv MatrixCtorConv(uint32_t c, uint32_t r) {
+ switch ((c - 2) * 3 + (r - 2)) {
+ case 0:
+ return CtorConv::kMat2x2;
+ case 1:
+ return CtorConv::kMat2x3;
+ case 2:
+ return CtorConv::kMat2x4;
+ case 3:
+ return CtorConv::kMat3x2;
+ case 4:
+ return CtorConv::kMat3x3;
+ case 5:
+ return CtorConv::kMat3x4;
+ case 6:
+ return CtorConv::kMat4x2;
+ case 7:
+ return CtorConv::kMat4x3;
+ case 8:
+ return CtorConv::kMat4x4;
+ }
+ return CtorConv::kNone;
+}
+
+} // namespace tint::wgsl::intrinsic
+
+#endif // SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
diff --git a/src/tint/lang/wgsl/intrinsic/ctor_conv.h.tmpl b/src/tint/lang/wgsl/intrinsic/ctor_conv.h.tmpl
new file mode 100644
index 0000000..7386fa4
--- /dev/null
+++ b/src/tint/lang/wgsl/intrinsic/ctor_conv.h.tmpl
@@ -0,0 +1,89 @@
+{{- /*
+--------------------------------------------------------------------------------
+Template file for use with tools/src/cmd/gen to generate ctor_conv_intrinsic.h
+
+To update the generated file, run:
+ ./tools/run gen
+
+See:
+* tools/src/cmd/gen for structures used by this template
+* https://golang.org/pkg/text/template/ for documentation on the template syntax
+--------------------------------------------------------------------------------
+*/ -}}
+
+{{- $I := LoadIntrinsics "src/tint/lang/wgsl/wgsl.def" -}}
+
+#ifndef SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
+#define SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
+
+#include <cstdint>
+
+#include "src/tint/utils/traits/traits.h"
+
+namespace tint::wgsl::intrinsic {
+
+/// CtorConv is an enumerator of types that have a constructor or converter overload
+/// declared in the intrinsic table.
+enum class CtorConv : uint8_t {
+{{- range $I.Sem.ConstructorsAndConverters }}
+ k{{Title .Name}},
+{{- end }}
+ kNone,
+};
+
+/// @returns the name of the type.
+const char* str(CtorConv i);
+
+/// Prints the CtorConv @p c to @p o
+/// @param o the stream to write to
+/// @param c the CtorConv
+/// @return the stream so calls can be chained
+template <typename STREAM, typename = traits::EnableIfIsOStream<STREAM>>
+auto& operator<<(STREAM& o, CtorConv c) {
+ return o << str(c);
+}
+
+/// @param n the width of the vector
+/// @return the CtorConv for a vector of width `n`
+inline CtorConv VectorCtorConv(uint32_t n) {
+ switch (n) {
+ case 2:
+ return CtorConv::kVec2;
+ case 3:
+ return CtorConv::kVec3;
+ case 4:
+ return CtorConv::kVec4;
+ }
+ return CtorConv::kNone;
+}
+
+/// @param c the number of columns in the matrix
+/// @param r the number of rows in the matrix
+/// @return the CtorConv for a matrix with `c` columns and `r` rows
+inline CtorConv MatrixCtorConv(uint32_t c, uint32_t r) {
+ switch ((c - 2) * 3 + (r - 2)) {
+ case 0:
+ return CtorConv::kMat2x2;
+ case 1:
+ return CtorConv::kMat2x3;
+ case 2:
+ return CtorConv::kMat2x4;
+ case 3:
+ return CtorConv::kMat3x2;
+ case 4:
+ return CtorConv::kMat3x3;
+ case 5:
+ return CtorConv::kMat3x4;
+ case 6:
+ return CtorConv::kMat4x2;
+ case 7:
+ return CtorConv::kMat4x3;
+ case 8:
+ return CtorConv::kMat4x4;
+ }
+ return CtorConv::kNone;
+}
+
+} // namespace tint::wgsl::intrinsic
+
+#endif // SRC_TINT_LANG_WGSL_INTRINSIC_CTOR_CONV_H_
diff --git a/src/tint/lang/core/intrinsic/data/data.cc b/src/tint/lang/wgsl/intrinsic/data.cc
similarity index 99%
rename from src/tint/lang/core/intrinsic/data/data.cc
rename to src/tint/lang/wgsl/intrinsic/data.cc
index 94f9779..4b8cc9a 100644
--- a/src/tint/lang/core/intrinsic/data/data.cc
+++ b/src/tint/lang/wgsl/intrinsic/data.cc
@@ -14,7 +14,7 @@
////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
-// src/tint/lang/core/intrinsic/data/data.cc.tmpl
+// src/tint/lang/wgsl/intrinsic/data.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
@@ -24,11 +24,13 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/data.h"
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
+#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::core::intrinsic::data {
+namespace tint::wgsl::intrinsic {
+
+using namespace tint::core::intrinsic; // NOLINT(build/namespaces)
namespace {
@@ -12233,7 +12235,7 @@
} // anonymous namespace
-const core::intrinsic::TableData kData{
+const core::intrinsic::TableData Dialect::kData{
/* template_types */ kTemplateTypes,
/* template_numbers */ kTemplateNumbers,
/* type_matcher_indices */ kTypeMatcherIndices,
@@ -12268,4 +12270,4 @@
/* unary '-' */ kUnaryOperators[kUnaryOperatorMinus],
};
-} // namespace tint::core::intrinsic::data
+} // namespace tint::wgsl::intrinsic
diff --git a/src/tint/lang/wgsl/intrinsic/data/data.cc.tmpl b/src/tint/lang/wgsl/intrinsic/data.cc.tmpl
similarity index 71%
rename from src/tint/lang/wgsl/intrinsic/data/data.cc.tmpl
rename to src/tint/lang/wgsl/intrinsic/data.cc.tmpl
index 5692ef5..da9bb11 100644
--- a/src/tint/lang/wgsl/intrinsic/data/data.cc.tmpl
+++ b/src/tint/lang/wgsl/intrinsic/data.cc.tmpl
@@ -19,16 +19,16 @@
#include <limits>
#include <string>
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
-#include "src/tint/lang/wgsl/intrinsic/data/data.h"
+#include "src/tint/lang/core/intrinsic/type_matchers.h"
+#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/utils/text/string_stream.h"
-namespace tint::wgsl::intrinsic::data {
+namespace tint::wgsl::intrinsic {
-using namespace tint::core::intrinsic::data; // NOLINT(build/namespaces)
+using namespace tint::core::intrinsic; // NOLINT(build/namespaces)
{{ Eval "Data"
"Intrinsics" $I
- "Name" "kData" -}}
+ "Name" "Dialect::kData" -}}
-} // namespace tint::wgsl::intrinsic::data
+} // namespace tint::wgsl::intrinsic
diff --git a/src/tint/lang/wgsl/intrinsic/data/BUILD.bazel b/src/tint/lang/wgsl/intrinsic/data/BUILD.bazel
deleted file mode 100644
index 7a62681..0000000
--- a/src/tint/lang/wgsl/intrinsic/data/BUILD.bazel
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.bazel.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-load("//src/tint:flags.bzl", "COPTS")
-load("@bazel_skylib//lib:selects.bzl", "selects")
-cc_library(
- name = "data",
- srcs = [
- "data.cc",
- ],
- hdrs = [
- "data.h",
- ],
- deps = [
- "//src/tint/lang/core",
- "//src/tint/lang/core/constant",
- "//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
- "//src/tint/lang/core/type",
- "//src/tint/utils/containers",
- "//src/tint/utils/diagnostic",
- "//src/tint/utils/ice",
- "//src/tint/utils/id",
- "//src/tint/utils/macros",
- "//src/tint/utils/math",
- "//src/tint/utils/memory",
- "//src/tint/utils/result",
- "//src/tint/utils/rtti",
- "//src/tint/utils/symbol",
- "//src/tint/utils/text",
- "//src/tint/utils/traits",
- ],
- copts = COPTS,
- visibility = ["//visibility:public"],
-)
-
diff --git a/src/tint/lang/wgsl/intrinsic/data/BUILD.cmake b/src/tint/lang/wgsl/intrinsic/data/BUILD.cmake
deleted file mode 100644
index d676529..0000000
--- a/src/tint/lang/wgsl/intrinsic/data/BUILD.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.cmake.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-################################################################################
-# Target: tint_lang_wgsl_intrinsic_data
-# Kind: lib
-################################################################################
-tint_add_target(tint_lang_wgsl_intrinsic_data lib
- lang/wgsl/intrinsic/data/data.cc
- lang/wgsl/intrinsic/data/data.h
-)
-
-tint_target_add_dependencies(tint_lang_wgsl_intrinsic_data lib
- tint_lang_core
- tint_lang_core_constant
- tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
- tint_lang_core_type
- tint_utils_containers
- tint_utils_diagnostic
- tint_utils_ice
- tint_utils_id
- tint_utils_macros
- tint_utils_math
- tint_utils_memory
- tint_utils_result
- tint_utils_rtti
- tint_utils_symbol
- tint_utils_text
- tint_utils_traits
-)
diff --git a/src/tint/lang/wgsl/intrinsic/data/BUILD.gn b/src/tint/lang/wgsl/intrinsic/data/BUILD.gn
deleted file mode 100644
index ba1f02a..0000000
--- a/src/tint/lang/wgsl/intrinsic/data/BUILD.gn
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2023 The Tint Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-################################################################################
-# File generated by 'tools/src/cmd/gen' using the template:
-# tools/src/cmd/gen/build/BUILD.gn.tmpl
-#
-# To regenerate run: './tools/run gen'
-#
-# Do not modify this file directly
-################################################################################
-
-import("../../../../../../scripts/tint_overrides_with_defaults.gni")
-
-import("${tint_src_dir}/tint.gni")
-
-libtint_source_set("data") {
- sources = [
- "data.cc",
- "data.h",
- ]
- deps = [
- "${tint_src_dir}/lang/core",
- "${tint_src_dir}/lang/core/constant",
- "${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
- "${tint_src_dir}/lang/core/type",
- "${tint_src_dir}/utils/containers",
- "${tint_src_dir}/utils/diagnostic",
- "${tint_src_dir}/utils/ice",
- "${tint_src_dir}/utils/id",
- "${tint_src_dir}/utils/macros",
- "${tint_src_dir}/utils/math",
- "${tint_src_dir}/utils/memory",
- "${tint_src_dir}/utils/result",
- "${tint_src_dir}/utils/rtti",
- "${tint_src_dir}/utils/symbol",
- "${tint_src_dir}/utils/text",
- "${tint_src_dir}/utils/traits",
- ]
-}
diff --git a/src/tint/lang/wgsl/intrinsic/data/data.cc b/src/tint/lang/wgsl/intrinsic/data/data.cc
deleted file mode 100644
index 4548260..0000000
--- a/src/tint/lang/wgsl/intrinsic/data/data.cc
+++ /dev/null
@@ -1,12273 +0,0 @@
-// Copyright 2023 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by 'tools/src/cmd/gen' using the template:
-// src/tint/lang/wgsl/intrinsic/data/data.cc.tmpl
-//
-// To regenerate run: './tools/run gen'
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-#include <limits>
-#include <string>
-
-#include "src/tint/lang/core/intrinsic/data/type_matchers.h"
-#include "src/tint/lang/wgsl/intrinsic/data/data.h"
-#include "src/tint/utils/text/string_stream.h"
-
-namespace tint::wgsl::intrinsic::data {
-
-using namespace tint::core::intrinsic::data; // NOLINT(build/namespaces)
-
-namespace {
-
-using ConstEvalFunctionIndex = tint::core::intrinsic::ConstEvalFunctionIndex;
-using IntrinsicInfo = tint::core::intrinsic::IntrinsicInfo;
-using MatchState = tint::core::intrinsic::MatchState;
-using Number = tint::core::intrinsic::Number;
-using NumberMatcher = tint::core::intrinsic::NumberMatcher;
-using NumberMatcherIndex = tint::core::intrinsic::NumberMatcherIndex;
-using NumberMatcherIndicesIndex = tint::core::intrinsic::NumberMatcherIndicesIndex;
-using OverloadFlag = tint::core::intrinsic::OverloadFlag;
-using OverloadFlags = tint::core::intrinsic::OverloadFlags;
-using OverloadIndex = tint::core::intrinsic::OverloadIndex;
-using OverloadInfo = tint::core::intrinsic::OverloadInfo;
-using ParameterIndex = tint::core::intrinsic::ParameterIndex;
-using ParameterInfo = tint::core::intrinsic::ParameterInfo;
-using StringStream = tint::StringStream;
-using TemplateNumberIndex = tint::core::intrinsic::TemplateNumberIndex;
-using TemplateNumberInfo = tint::core::intrinsic::TemplateNumberInfo;
-using TemplateTypeIndex = tint::core::intrinsic::TemplateTypeIndex;
-using TemplateTypeInfo = tint::core::intrinsic::TemplateTypeInfo;
-using Type = tint::core::type::Type;
-using TypeMatcher = tint::core::intrinsic::TypeMatcher;
-using TypeMatcherIndex = tint::core::intrinsic::TypeMatcherIndex;
-using TypeMatcherIndicesIndex = tint::core::intrinsic::TypeMatcherIndicesIndex;
-
-template <size_t N>
-using TemplateNumberMatcher = tint::core::intrinsic::TemplateNumberMatcher<N>;
-
-template <size_t N>
-using TemplateTypeMatcher = tint::core::intrinsic::TemplateTypeMatcher<N>;
-
-// clang-format off
-
-/// TypeMatcher for 'type bool'
-constexpr TypeMatcher kBoolMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchBool(state, ty)) {
- return nullptr;
- }
- return BuildBool(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "bool";
- }
-};
-
-
-/// TypeMatcher for 'type ia'
-constexpr TypeMatcher kIaMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchIa(state, ty)) {
- return nullptr;
- }
- return BuildIa(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- ss << "abstract-int";
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type fa'
-constexpr TypeMatcher kFaMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchFa(state, ty)) {
- return nullptr;
- }
- return BuildFa(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- ss << "abstract-float";
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type i32'
-constexpr TypeMatcher kI32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchI32(state, ty)) {
- return nullptr;
- }
- return BuildI32(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "i32";
- }
-};
-
-
-/// TypeMatcher for 'type u32'
-constexpr TypeMatcher kU32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchU32(state, ty)) {
- return nullptr;
- }
- return BuildU32(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "u32";
- }
-};
-
-
-/// TypeMatcher for 'type f32'
-constexpr TypeMatcher kF32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchF32(state, ty)) {
- return nullptr;
- }
- return BuildF32(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "f32";
- }
-};
-
-
-/// TypeMatcher for 'type f16'
-constexpr TypeMatcher kF16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchF16(state, ty)) {
- return nullptr;
- }
- return BuildF16(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "f16";
- }
-};
-
-
-/// TypeMatcher for 'type vec2'
-constexpr TypeMatcher kVec2Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchVec2(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildVec2(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "vec2<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type vec3'
-constexpr TypeMatcher kVec3Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchVec3(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildVec3(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "vec3<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type vec4'
-constexpr TypeMatcher kVec4Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchVec4(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildVec4(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "vec4<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat2x2'
-constexpr TypeMatcher kMat2X2Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat2X2(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat2X2(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat2x2<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat2x3'
-constexpr TypeMatcher kMat2X3Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat2X3(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat2X3(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat2x3<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat2x4'
-constexpr TypeMatcher kMat2X4Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat2X4(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat2X4(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat2x4<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat3x2'
-constexpr TypeMatcher kMat3X2Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat3X2(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat3X2(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat3x2<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat3x3'
-constexpr TypeMatcher kMat3X3Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat3X3(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat3X3(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat3x3<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat3x4'
-constexpr TypeMatcher kMat3X4Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat3X4(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat3X4(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat3x4<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat4x2'
-constexpr TypeMatcher kMat4X2Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat4X2(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat4X2(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat4x2<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat4x3'
-constexpr TypeMatcher kMat4X3Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat4X3(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat4X3(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat4x3<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type mat4x4'
-constexpr TypeMatcher kMat4X4Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchMat4X4(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat4X4(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "mat4x4<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type vec'
-constexpr TypeMatcher kVecMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number N = Number::invalid;
- const Type* T = nullptr;
- if (!MatchVec(state, ty, N, T)) {
- return nullptr;
- }
- N = state.Num(N);
- if (!N.IsValid()) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildVec(state, ty, N, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string N = state->NumName();
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "vec" << N << "<" << T << ">";
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type mat'
-constexpr TypeMatcher kMatMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number N = Number::invalid;
- Number M = Number::invalid;
- const Type* T = nullptr;
- if (!MatchMat(state, ty, N, M, T)) {
- return nullptr;
- }
- N = state.Num(N);
- if (!N.IsValid()) {
- return nullptr;
- }
- M = state.Num(M);
- if (!M.IsValid()) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildMat(state, ty, N, M, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string N = state->NumName();
- const std::string M = state->NumName();
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "mat" << N << "x" << M << "<" << T << ">";
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type ptr'
-constexpr TypeMatcher kPtrMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number S = Number::invalid;
- const Type* T = nullptr;
- Number A = Number::invalid;
- if (!MatchPtr(state, ty, S, T, A)) {
- return nullptr;
- }
- S = state.Num(S);
- if (!S.IsValid()) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- A = state.Num(A);
- if (!A.IsValid()) {
- return nullptr;
- }
- return BuildPtr(state, ty, S, T, A);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string S = state->NumName();
- const std::string T = state->TypeName();
- const std::string A = state->NumName();
- return "ptr<" + S + ", " + T + ", " + A + ">";
- }
-};
-
-
-/// TypeMatcher for 'type atomic'
-constexpr TypeMatcher kAtomicMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchAtomic(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildAtomic(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "atomic<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type array'
-constexpr TypeMatcher kArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchArray(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildArray(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "array<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type sampler'
-constexpr TypeMatcher kSamplerMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchSampler(state, ty)) {
- return nullptr;
- }
- return BuildSampler(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "sampler";
- }
-};
-
-
-/// TypeMatcher for 'type sampler_comparison'
-constexpr TypeMatcher kSamplerComparisonMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchSamplerComparison(state, ty)) {
- return nullptr;
- }
- return BuildSamplerComparison(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "sampler_comparison";
- }
-};
-
-
-/// TypeMatcher for 'type texture_1d'
-constexpr TypeMatcher kTexture1DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTexture1D(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTexture1D(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_1d<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_2d'
-constexpr TypeMatcher kTexture2DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTexture2D(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTexture2D(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_2d<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_2d_array'
-constexpr TypeMatcher kTexture2DArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTexture2DArray(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTexture2DArray(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_2d_array<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_3d'
-constexpr TypeMatcher kTexture3DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTexture3D(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTexture3D(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_3d<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_cube'
-constexpr TypeMatcher kTextureCubeMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTextureCube(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTextureCube(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_cube<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_cube_array'
-constexpr TypeMatcher kTextureCubeArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTextureCubeArray(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTextureCubeArray(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_cube_array<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_multisampled_2d'
-constexpr TypeMatcher kTextureMultisampled2DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchTextureMultisampled2D(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildTextureMultisampled2D(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "texture_multisampled_2d<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_depth_2d'
-constexpr TypeMatcher kTextureDepth2DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureDepth2D(state, ty)) {
- return nullptr;
- }
- return BuildTextureDepth2D(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_depth_2d";
- }
-};
-
-
-/// TypeMatcher for 'type texture_depth_2d_array'
-constexpr TypeMatcher kTextureDepth2DArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureDepth2DArray(state, ty)) {
- return nullptr;
- }
- return BuildTextureDepth2DArray(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_depth_2d_array";
- }
-};
-
-
-/// TypeMatcher for 'type texture_depth_cube'
-constexpr TypeMatcher kTextureDepthCubeMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureDepthCube(state, ty)) {
- return nullptr;
- }
- return BuildTextureDepthCube(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_depth_cube";
- }
-};
-
-
-/// TypeMatcher for 'type texture_depth_cube_array'
-constexpr TypeMatcher kTextureDepthCubeArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureDepthCubeArray(state, ty)) {
- return nullptr;
- }
- return BuildTextureDepthCubeArray(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_depth_cube_array";
- }
-};
-
-
-/// TypeMatcher for 'type texture_depth_multisampled_2d'
-constexpr TypeMatcher kTextureDepthMultisampled2DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureDepthMultisampled2D(state, ty)) {
- return nullptr;
- }
- return BuildTextureDepthMultisampled2D(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_depth_multisampled_2d";
- }
-};
-
-
-/// TypeMatcher for 'type texture_storage_1d'
-constexpr TypeMatcher kTextureStorage1DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number F = Number::invalid;
- Number A = Number::invalid;
- if (!MatchTextureStorage1D(state, ty, F, A)) {
- return nullptr;
- }
- F = state.Num(F);
- if (!F.IsValid()) {
- return nullptr;
- }
- A = state.Num(A);
- if (!A.IsValid()) {
- return nullptr;
- }
- return BuildTextureStorage1D(state, ty, F, A);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string F = state->NumName();
- const std::string A = state->NumName();
- return "texture_storage_1d<" + F + ", " + A + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_storage_2d'
-constexpr TypeMatcher kTextureStorage2DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number F = Number::invalid;
- Number A = Number::invalid;
- if (!MatchTextureStorage2D(state, ty, F, A)) {
- return nullptr;
- }
- F = state.Num(F);
- if (!F.IsValid()) {
- return nullptr;
- }
- A = state.Num(A);
- if (!A.IsValid()) {
- return nullptr;
- }
- return BuildTextureStorage2D(state, ty, F, A);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string F = state->NumName();
- const std::string A = state->NumName();
- return "texture_storage_2d<" + F + ", " + A + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_storage_2d_array'
-constexpr TypeMatcher kTextureStorage2DArrayMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number F = Number::invalid;
- Number A = Number::invalid;
- if (!MatchTextureStorage2DArray(state, ty, F, A)) {
- return nullptr;
- }
- F = state.Num(F);
- if (!F.IsValid()) {
- return nullptr;
- }
- A = state.Num(A);
- if (!A.IsValid()) {
- return nullptr;
- }
- return BuildTextureStorage2DArray(state, ty, F, A);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string F = state->NumName();
- const std::string A = state->NumName();
- return "texture_storage_2d_array<" + F + ", " + A + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_storage_3d'
-constexpr TypeMatcher kTextureStorage3DMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number F = Number::invalid;
- Number A = Number::invalid;
- if (!MatchTextureStorage3D(state, ty, F, A)) {
- return nullptr;
- }
- F = state.Num(F);
- if (!F.IsValid()) {
- return nullptr;
- }
- A = state.Num(A);
- if (!A.IsValid()) {
- return nullptr;
- }
- return BuildTextureStorage3D(state, ty, F, A);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string F = state->NumName();
- const std::string A = state->NumName();
- return "texture_storage_3d<" + F + ", " + A + ">";
- }
-};
-
-
-/// TypeMatcher for 'type texture_external'
-constexpr TypeMatcher kTextureExternalMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (!MatchTextureExternal(state, ty)) {
- return nullptr;
- }
- return BuildTextureExternal(state, ty);
- },
-/* string */ [](MatchState*) -> std::string {
- return "texture_external";
- }
-};
-
-
-/// TypeMatcher for 'type packedVec3'
-constexpr TypeMatcher kPackedVec3Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchPackedVec3(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildPackedVec3(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "packedVec3<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'type __modf_result'
-constexpr TypeMatcher kModfResultMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchModfResult(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildModfResult(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "__modf_result_" << T;
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type __modf_result_vec'
-constexpr TypeMatcher kModfResultVecMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number N = Number::invalid;
- const Type* T = nullptr;
- if (!MatchModfResultVec(state, ty, N, T)) {
- return nullptr;
- }
- N = state.Num(N);
- if (!N.IsValid()) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildModfResultVec(state, ty, N, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string N = state->NumName();
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "__modf_result_vec" << N << "_" << T;
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type __frexp_result'
-constexpr TypeMatcher kFrexpResultMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchFrexpResult(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildFrexpResult(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "__frexp_result_" << T;
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type __frexp_result_vec'
-constexpr TypeMatcher kFrexpResultVecMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- Number N = Number::invalid;
- const Type* T = nullptr;
- if (!MatchFrexpResultVec(state, ty, N, T)) {
- return nullptr;
- }
- N = state.Num(N);
- if (!N.IsValid()) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildFrexpResultVec(state, ty, N, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string N = state->NumName();
- const std::string T = state->TypeName();
- StringStream ss;
- ss << "__frexp_result_vec" << N << "_" << T;
- return ss.str();
- }
-};
-
-
-/// TypeMatcher for 'type __atomic_compare_exchange_result'
-constexpr TypeMatcher kAtomicCompareExchangeResultMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- const Type* T = nullptr;
- if (!MatchAtomicCompareExchangeResult(state, ty, T)) {
- return nullptr;
- }
- T = state.Type(T);
- if (T == nullptr) {
- return nullptr;
- }
- return BuildAtomicCompareExchangeResult(state, ty, T);
- },
-/* string */ [](MatchState* state) -> std::string {
- const std::string T = state->TypeName();
- return "__atomic_compare_exchange_result<" + T + ">";
- }
-};
-
-
-/// TypeMatcher for 'match scalar'
-constexpr TypeMatcher kScalarMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match concrete_scalar'
-constexpr TypeMatcher kConcreteScalarMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match scalar_no_f32'
-constexpr TypeMatcher kScalarNoF32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match scalar_no_f16'
-constexpr TypeMatcher kScalarNoF16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match scalar_no_i32'
-constexpr TypeMatcher kScalarNoI32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match scalar_no_u32'
-constexpr TypeMatcher kScalarNoU32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- if (MatchBool(state, ty)) {
- return BuildBool(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match scalar_no_bool'
-constexpr TypeMatcher kScalarNoBoolMatcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fia_fiu32_f16'
-constexpr TypeMatcher kFiaFiu32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kFaMatcher.string(nullptr) << ", " << kIaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fia_fi32_f16'
-constexpr TypeMatcher kFiaFi32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kFaMatcher.string(nullptr) << ", " << kIaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fia_fiu32'
-constexpr TypeMatcher kFiaFiu32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kFaMatcher.string(nullptr) << ", " << kIaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fa_f32'
-constexpr TypeMatcher kFaF32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kFaMatcher.string(nullptr) << " or " << kF32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fa_f32_f16'
-constexpr TypeMatcher kFaF32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchFa(state, ty)) {
- return BuildFa(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kFaMatcher.string(nullptr) << ", " << kF32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match ia_iu32'
-constexpr TypeMatcher kIaIu32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match ia_i32'
-constexpr TypeMatcher kIaI32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchIa(state, ty)) {
- return BuildIa(state, ty);
- }
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kIaMatcher.string(nullptr) << " or " << kI32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fiu32_f16'
-constexpr TypeMatcher kFiu32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fiu32'
-constexpr TypeMatcher kFiu32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fi32_f16'
-constexpr TypeMatcher kFi32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match fi32'
-constexpr TypeMatcher kFi32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << " or " << kI32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match f32_f16'
-constexpr TypeMatcher kF32F16Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchF32(state, ty)) {
- return BuildF32(state, ty);
- }
- if (MatchF16(state, ty)) {
- return BuildF16(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kF32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// TypeMatcher for 'match iu32'
-constexpr TypeMatcher kIu32Matcher {
-/* match */ [](MatchState& state, const Type* ty) -> const Type* {
- if (MatchI32(state, ty)) {
- return BuildI32(state, ty);
- }
- if (MatchU32(state, ty)) {
- return BuildU32(state, ty);
- }
- return nullptr;
- },
-/* string */ [](MatchState*) -> std::string {
- StringStream ss;
- // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support
- // template arguments, nor can they match sub-types. As such, they have no use for the MatchState.
- ss << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr);
- return ss.str();
- }
-};
-
-/// EnumMatcher for 'match f32_texel_format'
-constexpr NumberMatcher kF32TexelFormatMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::TexelFormat>(number.Value())) {
- case core::TexelFormat::kBgra8Unorm:
- case core::TexelFormat::kRgba8Unorm:
- case core::TexelFormat::kRgba8Snorm:
- case core::TexelFormat::kRgba16Float:
- case core::TexelFormat::kR32Float:
- case core::TexelFormat::kRg32Float:
- case core::TexelFormat::kRgba32Float:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "bgra8unorm, rgba8unorm, rgba8snorm, rgba16float, r32float, rg32float or rgba32float";
- }
-};
-
-/// EnumMatcher for 'match i32_texel_format'
-constexpr NumberMatcher kI32TexelFormatMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::TexelFormat>(number.Value())) {
- case core::TexelFormat::kRgba8Sint:
- case core::TexelFormat::kRgba16Sint:
- case core::TexelFormat::kR32Sint:
- case core::TexelFormat::kRg32Sint:
- case core::TexelFormat::kRgba32Sint:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "rgba8sint, rgba16sint, r32sint, rg32sint or rgba32sint";
- }
-};
-
-/// EnumMatcher for 'match u32_texel_format'
-constexpr NumberMatcher kU32TexelFormatMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::TexelFormat>(number.Value())) {
- case core::TexelFormat::kRgba8Uint:
- case core::TexelFormat::kRgba16Uint:
- case core::TexelFormat::kR32Uint:
- case core::TexelFormat::kRg32Uint:
- case core::TexelFormat::kRgba32Uint:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "rgba8uint, rgba16uint, r32uint, rg32uint or rgba32uint";
- }
-};
-
-/// EnumMatcher for 'match write'
-constexpr NumberMatcher kWriteMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::Access::kWrite)) {
- return Number(static_cast<uint32_t>(core::Access::kWrite));
- }
- return Number::invalid;
- },
-/* string */ [](MatchState*) -> std::string {
- return "write";
- }
-};
-
-/// EnumMatcher for 'match read_write'
-constexpr NumberMatcher kReadWriteMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::Access::kReadWrite)) {
- return Number(static_cast<uint32_t>(core::Access::kReadWrite));
- }
- return Number::invalid;
- },
-/* string */ [](MatchState*) -> std::string {
- return "read_write";
- }
-};
-
-/// EnumMatcher for 'match readable'
-constexpr NumberMatcher kReadableMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::Access>(number.Value())) {
- case core::Access::kRead:
- case core::Access::kReadWrite:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "read or read_write";
- }
-};
-
-/// EnumMatcher for 'match writable'
-constexpr NumberMatcher kWritableMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::Access>(number.Value())) {
- case core::Access::kWrite:
- case core::Access::kReadWrite:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "write or read_write";
- }
-};
-
-/// EnumMatcher for 'match function_private_workgroup'
-constexpr NumberMatcher kFunctionPrivateWorkgroupMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::AddressSpace>(number.Value())) {
- case core::AddressSpace::kFunction:
- case core::AddressSpace::kPrivate:
- case core::AddressSpace::kWorkgroup:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "function, private or workgroup";
- }
-};
-
-/// EnumMatcher for 'match workgroup_or_storage'
-constexpr NumberMatcher kWorkgroupOrStorageMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- switch (static_cast<core::AddressSpace>(number.Value())) {
- case core::AddressSpace::kWorkgroup:
- case core::AddressSpace::kStorage:
- return number;
- default:
- return Number::invalid;
- }
- },
-/* string */ [](MatchState*) -> std::string {
- return "workgroup or storage";
- }
-};
-
-/// EnumMatcher for 'match storage'
-constexpr NumberMatcher kStorageMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::AddressSpace::kStorage)) {
- return Number(static_cast<uint32_t>(core::AddressSpace::kStorage));
- }
- return Number::invalid;
- },
-/* string */ [](MatchState*) -> std::string {
- return "storage";
- }
-};
-
-/// EnumMatcher for 'match workgroup'
-constexpr NumberMatcher kWorkgroupMatcher {
-/* match */ [](MatchState&, Number number) -> Number {
- if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::AddressSpace::kWorkgroup)) {
- return Number(static_cast<uint32_t>(core::AddressSpace::kWorkgroup));
- }
- return Number::invalid;
- },
-/* string */ [](MatchState*) -> std::string {
- return "workgroup";
- }
-};
-
-/// Type and number matchers
-
-/// The template types, types, and type matchers
-constexpr TypeMatcher kTypeMatchers[] = {
- /* [0] */ TemplateTypeMatcher<0>::matcher,
- /* [1] */ TemplateTypeMatcher<1>::matcher,
- /* [2] */ TemplateTypeMatcher<2>::matcher,
- /* [3] */ TemplateTypeMatcher<3>::matcher,
- /* [4] */ kBoolMatcher,
- /* [5] */ kIaMatcher,
- /* [6] */ kFaMatcher,
- /* [7] */ kI32Matcher,
- /* [8] */ kU32Matcher,
- /* [9] */ kF32Matcher,
- /* [10] */ kF16Matcher,
- /* [11] */ kVec2Matcher,
- /* [12] */ kVec3Matcher,
- /* [13] */ kVec4Matcher,
- /* [14] */ kMat2X2Matcher,
- /* [15] */ kMat2X3Matcher,
- /* [16] */ kMat2X4Matcher,
- /* [17] */ kMat3X2Matcher,
- /* [18] */ kMat3X3Matcher,
- /* [19] */ kMat3X4Matcher,
- /* [20] */ kMat4X2Matcher,
- /* [21] */ kMat4X3Matcher,
- /* [22] */ kMat4X4Matcher,
- /* [23] */ kVecMatcher,
- /* [24] */ kMatMatcher,
- /* [25] */ kPtrMatcher,
- /* [26] */ kAtomicMatcher,
- /* [27] */ kArrayMatcher,
- /* [28] */ kSamplerMatcher,
- /* [29] */ kSamplerComparisonMatcher,
- /* [30] */ kTexture1DMatcher,
- /* [31] */ kTexture2DMatcher,
- /* [32] */ kTexture2DArrayMatcher,
- /* [33] */ kTexture3DMatcher,
- /* [34] */ kTextureCubeMatcher,
- /* [35] */ kTextureCubeArrayMatcher,
- /* [36] */ kTextureMultisampled2DMatcher,
- /* [37] */ kTextureDepth2DMatcher,
- /* [38] */ kTextureDepth2DArrayMatcher,
- /* [39] */ kTextureDepthCubeMatcher,
- /* [40] */ kTextureDepthCubeArrayMatcher,
- /* [41] */ kTextureDepthMultisampled2DMatcher,
- /* [42] */ kTextureStorage1DMatcher,
- /* [43] */ kTextureStorage2DMatcher,
- /* [44] */ kTextureStorage2DArrayMatcher,
- /* [45] */ kTextureStorage3DMatcher,
- /* [46] */ kTextureExternalMatcher,
- /* [47] */ kPackedVec3Matcher,
- /* [48] */ kModfResultMatcher,
- /* [49] */ kModfResultVecMatcher,
- /* [50] */ kFrexpResultMatcher,
- /* [51] */ kFrexpResultVecMatcher,
- /* [52] */ kAtomicCompareExchangeResultMatcher,
- /* [53] */ kScalarMatcher,
- /* [54] */ kConcreteScalarMatcher,
- /* [55] */ kScalarNoF32Matcher,
- /* [56] */ kScalarNoF16Matcher,
- /* [57] */ kScalarNoI32Matcher,
- /* [58] */ kScalarNoU32Matcher,
- /* [59] */ kScalarNoBoolMatcher,
- /* [60] */ kFiaFiu32F16Matcher,
- /* [61] */ kFiaFi32F16Matcher,
- /* [62] */ kFiaFiu32Matcher,
- /* [63] */ kFaF32Matcher,
- /* [64] */ kFaF32F16Matcher,
- /* [65] */ kIaIu32Matcher,
- /* [66] */ kIaI32Matcher,
- /* [67] */ kFiu32F16Matcher,
- /* [68] */ kFiu32Matcher,
- /* [69] */ kFi32F16Matcher,
- /* [70] */ kFi32Matcher,
- /* [71] */ kF32F16Matcher,
- /* [72] */ kIu32Matcher,
-};
-
-/// The template numbers, and number matchers
-constexpr NumberMatcher kNumberMatchers[] = {
- /* [0] */ TemplateNumberMatcher<0>::matcher,
- /* [1] */ TemplateNumberMatcher<1>::matcher,
- /* [2] */ TemplateNumberMatcher<2>::matcher,
- /* [3] */ kF32TexelFormatMatcher,
- /* [4] */ kI32TexelFormatMatcher,
- /* [5] */ kU32TexelFormatMatcher,
- /* [6] */ kWriteMatcher,
- /* [7] */ kReadWriteMatcher,
- /* [8] */ kReadableMatcher,
- /* [9] */ kWritableMatcher,
- /* [10] */ kFunctionPrivateWorkgroupMatcher,
- /* [11] */ kWorkgroupOrStorageMatcher,
- /* [12] */ kStorageMatcher,
- /* [13] */ kWorkgroupMatcher,
-};
-
-constexpr TypeMatcherIndex kTypeMatcherIndices[] = {
- /* [0] */ TypeMatcherIndex(25),
- /* [1] */ TypeMatcherIndex(27),
- /* [2] */ TypeMatcherIndex(0),
- /* [3] */ TypeMatcherIndex(25),
- /* [4] */ TypeMatcherIndex(26),
- /* [5] */ TypeMatcherIndex(0),
- /* [6] */ TypeMatcherIndex(23),
- /* [7] */ TypeMatcherIndex(0),
- /* [8] */ TypeMatcherIndex(23),
- /* [9] */ TypeMatcherIndex(4),
- /* [10] */ TypeMatcherIndex(12),
- /* [11] */ TypeMatcherIndex(0),
- /* [12] */ TypeMatcherIndex(24),
- /* [13] */ TypeMatcherIndex(0),
- /* [14] */ TypeMatcherIndex(23),
- /* [15] */ TypeMatcherIndex(9),
- /* [16] */ TypeMatcherIndex(50),
- /* [17] */ TypeMatcherIndex(0),
- /* [18] */ TypeMatcherIndex(51),
- /* [19] */ TypeMatcherIndex(0),
- /* [20] */ TypeMatcherIndex(23),
- /* [21] */ TypeMatcherIndex(1),
- /* [22] */ TypeMatcherIndex(48),
- /* [23] */ TypeMatcherIndex(0),
- /* [24] */ TypeMatcherIndex(49),
- /* [25] */ TypeMatcherIndex(0),
- /* [26] */ TypeMatcherIndex(11),
- /* [27] */ TypeMatcherIndex(9),
- /* [28] */ TypeMatcherIndex(13),
- /* [29] */ TypeMatcherIndex(9),
- /* [30] */ TypeMatcherIndex(25),
- /* [31] */ TypeMatcherIndex(0),
- /* [32] */ TypeMatcherIndex(30),
- /* [33] */ TypeMatcherIndex(0),
- /* [34] */ TypeMatcherIndex(11),
- /* [35] */ TypeMatcherIndex(8),
- /* [36] */ TypeMatcherIndex(31),
- /* [37] */ TypeMatcherIndex(0),
- /* [38] */ TypeMatcherIndex(32),
- /* [39] */ TypeMatcherIndex(0),
- /* [40] */ TypeMatcherIndex(12),
- /* [41] */ TypeMatcherIndex(8),
- /* [42] */ TypeMatcherIndex(33),
- /* [43] */ TypeMatcherIndex(0),
- /* [44] */ TypeMatcherIndex(34),
- /* [45] */ TypeMatcherIndex(0),
- /* [46] */ TypeMatcherIndex(35),
- /* [47] */ TypeMatcherIndex(0),
- /* [48] */ TypeMatcherIndex(36),
- /* [49] */ TypeMatcherIndex(0),
- /* [50] */ TypeMatcherIndex(13),
- /* [51] */ TypeMatcherIndex(0),
- /* [52] */ TypeMatcherIndex(11),
- /* [53] */ TypeMatcherIndex(7),
- /* [54] */ TypeMatcherIndex(12),
- /* [55] */ TypeMatcherIndex(9),
- /* [56] */ TypeMatcherIndex(30),
- /* [57] */ TypeMatcherIndex(9),
- /* [58] */ TypeMatcherIndex(31),
- /* [59] */ TypeMatcherIndex(9),
- /* [60] */ TypeMatcherIndex(32),
- /* [61] */ TypeMatcherIndex(9),
- /* [62] */ TypeMatcherIndex(33),
- /* [63] */ TypeMatcherIndex(9),
- /* [64] */ TypeMatcherIndex(12),
- /* [65] */ TypeMatcherIndex(7),
- /* [66] */ TypeMatcherIndex(34),
- /* [67] */ TypeMatcherIndex(9),
- /* [68] */ TypeMatcherIndex(35),
- /* [69] */ TypeMatcherIndex(9),
- /* [70] */ TypeMatcherIndex(11),
- /* [71] */ TypeMatcherIndex(0),
- /* [72] */ TypeMatcherIndex(13),
- /* [73] */ TypeMatcherIndex(7),
- /* [74] */ TypeMatcherIndex(13),
- /* [75] */ TypeMatcherIndex(8),
- /* [76] */ TypeMatcherIndex(11),
- /* [77] */ TypeMatcherIndex(1),
- /* [78] */ TypeMatcherIndex(12),
- /* [79] */ TypeMatcherIndex(1),
- /* [80] */ TypeMatcherIndex(52),
- /* [81] */ TypeMatcherIndex(0),
- /* [82] */ TypeMatcherIndex(23),
- /* [83] */ TypeMatcherIndex(8),
- /* [84] */ TypeMatcherIndex(11),
- /* [85] */ TypeMatcherIndex(5),
- /* [86] */ TypeMatcherIndex(11),
- /* [87] */ TypeMatcherIndex(10),
- /* [88] */ TypeMatcherIndex(11),
- /* [89] */ TypeMatcherIndex(4),
- /* [90] */ TypeMatcherIndex(12),
- /* [91] */ TypeMatcherIndex(5),
- /* [92] */ TypeMatcherIndex(12),
- /* [93] */ TypeMatcherIndex(10),
- /* [94] */ TypeMatcherIndex(12),
- /* [95] */ TypeMatcherIndex(4),
- /* [96] */ TypeMatcherIndex(13),
- /* [97] */ TypeMatcherIndex(5),
- /* [98] */ TypeMatcherIndex(13),
- /* [99] */ TypeMatcherIndex(1),
- /* [100] */ TypeMatcherIndex(13),
- /* [101] */ TypeMatcherIndex(10),
- /* [102] */ TypeMatcherIndex(13),
- /* [103] */ TypeMatcherIndex(4),
- /* [104] */ TypeMatcherIndex(14),
- /* [105] */ TypeMatcherIndex(0),
- /* [106] */ TypeMatcherIndex(14),
- /* [107] */ TypeMatcherIndex(10),
- /* [108] */ TypeMatcherIndex(14),
- /* [109] */ TypeMatcherIndex(9),
- /* [110] */ TypeMatcherIndex(15),
- /* [111] */ TypeMatcherIndex(0),
- /* [112] */ TypeMatcherIndex(15),
- /* [113] */ TypeMatcherIndex(10),
- /* [114] */ TypeMatcherIndex(15),
- /* [115] */ TypeMatcherIndex(9),
- /* [116] */ TypeMatcherIndex(16),
- /* [117] */ TypeMatcherIndex(0),
- /* [118] */ TypeMatcherIndex(16),
- /* [119] */ TypeMatcherIndex(10),
- /* [120] */ TypeMatcherIndex(16),
- /* [121] */ TypeMatcherIndex(9),
- /* [122] */ TypeMatcherIndex(17),
- /* [123] */ TypeMatcherIndex(0),
- /* [124] */ TypeMatcherIndex(17),
- /* [125] */ TypeMatcherIndex(10),
- /* [126] */ TypeMatcherIndex(17),
- /* [127] */ TypeMatcherIndex(9),
- /* [128] */ TypeMatcherIndex(18),
- /* [129] */ TypeMatcherIndex(0),
- /* [130] */ TypeMatcherIndex(18),
- /* [131] */ TypeMatcherIndex(10),
- /* [132] */ TypeMatcherIndex(18),
- /* [133] */ TypeMatcherIndex(9),
- /* [134] */ TypeMatcherIndex(19),
- /* [135] */ TypeMatcherIndex(0),
- /* [136] */ TypeMatcherIndex(19),
- /* [137] */ TypeMatcherIndex(10),
- /* [138] */ TypeMatcherIndex(19),
- /* [139] */ TypeMatcherIndex(9),
- /* [140] */ TypeMatcherIndex(20),
- /* [141] */ TypeMatcherIndex(0),
- /* [142] */ TypeMatcherIndex(20),
- /* [143] */ TypeMatcherIndex(10),
- /* [144] */ TypeMatcherIndex(20),
- /* [145] */ TypeMatcherIndex(9),
- /* [146] */ TypeMatcherIndex(21),
- /* [147] */ TypeMatcherIndex(0),
- /* [148] */ TypeMatcherIndex(21),
- /* [149] */ TypeMatcherIndex(10),
- /* [150] */ TypeMatcherIndex(21),
- /* [151] */ TypeMatcherIndex(9),
- /* [152] */ TypeMatcherIndex(22),
- /* [153] */ TypeMatcherIndex(0),
- /* [154] */ TypeMatcherIndex(22),
- /* [155] */ TypeMatcherIndex(10),
- /* [156] */ TypeMatcherIndex(22),
- /* [157] */ TypeMatcherIndex(9),
- /* [158] */ TypeMatcherIndex(47),
- /* [159] */ TypeMatcherIndex(0),
- /* [160] */ TypeMatcherIndex(37),
- /* [161] */ TypeMatcherIndex(38),
- /* [162] */ TypeMatcherIndex(39),
- /* [163] */ TypeMatcherIndex(40),
- /* [164] */ TypeMatcherIndex(41),
- /* [165] */ TypeMatcherIndex(42),
- /* [166] */ TypeMatcherIndex(43),
- /* [167] */ TypeMatcherIndex(44),
- /* [168] */ TypeMatcherIndex(45),
- /* [169] */ TypeMatcherIndex(46),
- /* [170] */ TypeMatcherIndex(28),
- /* [171] */ TypeMatcherIndex(2),
- /* [172] */ TypeMatcherIndex(29),
- /* [173] */ TypeMatcherIndex(3),
-};
-
-static_assert(TypeMatcherIndex::CanIndex(kTypeMatcherIndices),
- "TypeMatcherIndex is not large enough to index kTypeMatcherIndices");
-
-constexpr NumberMatcherIndex kNumberMatcherIndices[] = {
- /* [0] */ NumberMatcherIndex(12),
- /* [1] */ NumberMatcherIndex(0),
- /* [2] */ NumberMatcherIndex(0),
- /* [3] */ NumberMatcherIndex(1),
- /* [4] */ NumberMatcherIndex(0),
- /* [5] */ NumberMatcherIndex(7),
- /* [6] */ NumberMatcherIndex(13),
- /* [7] */ NumberMatcherIndex(7),
- /* [8] */ NumberMatcherIndex(3),
- /* [9] */ NumberMatcherIndex(9),
- /* [10] */ NumberMatcherIndex(4),
- /* [11] */ NumberMatcherIndex(9),
- /* [12] */ NumberMatcherIndex(5),
- /* [13] */ NumberMatcherIndex(9),
- /* [14] */ NumberMatcherIndex(3),
- /* [15] */ NumberMatcherIndex(8),
- /* [16] */ NumberMatcherIndex(4),
- /* [17] */ NumberMatcherIndex(8),
- /* [18] */ NumberMatcherIndex(5),
- /* [19] */ NumberMatcherIndex(8),
- /* [20] */ NumberMatcherIndex(1),
- /* [21] */ NumberMatcherIndex(2),
- /* [22] */ NumberMatcherIndex(0),
- /* [23] */ NumberMatcherIndex(2),
-};
-
-static_assert(NumberMatcherIndex::CanIndex(kNumberMatcherIndices),
- "NumberMatcherIndex is not large enough to index kNumberMatcherIndices");
-
-constexpr ParameterInfo kParameters[] = {
- {
- /* [0] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(3),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(4),
- },
- {
- /* [1] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [2] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [3] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [4] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [5] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [6] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [7] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [8] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [9] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [10] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [11] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [12] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [13] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [14] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [15] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [16] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [17] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [18] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [19] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(60),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [20] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [21] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [22] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [23] */
- /* usage */ core::ParameterUsage::kDdx,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [24] */
- /* usage */ core::ParameterUsage::kDdy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [25] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [26] */
- /* usage */ core::ParameterUsage::kComponent,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [27] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(38),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [28] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [29] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [30] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [31] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [32] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(161),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [33] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(172),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [34] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [35] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [36] */
- /* usage */ core::ParameterUsage::kDepthRef,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [37] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [38] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(60),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [39] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [40] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [41] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [42] */
- /* usage */ core::ParameterUsage::kBias,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [43] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [44] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(58),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [45] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [46] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [47] */
- /* usage */ core::ParameterUsage::kDdx,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [48] */
- /* usage */ core::ParameterUsage::kDdy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [49] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [50] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(62),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [51] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [52] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [53] */
- /* usage */ core::ParameterUsage::kDdx,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [54] */
- /* usage */ core::ParameterUsage::kDdy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [55] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(64),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [56] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(68),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [57] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [58] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [59] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [60] */
- /* usage */ core::ParameterUsage::kDdx,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [61] */
- /* usage */ core::ParameterUsage::kDdy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [62] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(60),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [63] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [64] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [65] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [66] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [67] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [68] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(161),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [69] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [70] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [71] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [72] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [73] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [74] */
- /* usage */ core::ParameterUsage::kComponent,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [75] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(36),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [76] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [77] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [78] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [79] */
- /* usage */ core::ParameterUsage::kComponent,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [80] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(46),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [81] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [82] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [83] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [84] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(161),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [85] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [86] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [87] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [88] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [89] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(160),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [90] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(172),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [91] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [92] */
- /* usage */ core::ParameterUsage::kDepthRef,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [93] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [94] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(163),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [95] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(172),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [96] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [97] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [98] */
- /* usage */ core::ParameterUsage::kDepthRef,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [99] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(60),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [100] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [101] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [102] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [103] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [104] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(58),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [105] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [106] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [107] */
- /* usage */ core::ParameterUsage::kBias,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [108] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [109] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(62),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [110] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [111] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [112] */
- /* usage */ core::ParameterUsage::kBias,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [113] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(64),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [114] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(68),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [115] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [116] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [117] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [118] */
- /* usage */ core::ParameterUsage::kBias,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [119] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(66),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [120] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [121] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [122] */
- /* usage */ core::ParameterUsage::kDdx,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [123] */
- /* usage */ core::ParameterUsage::kDdy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [124] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(58),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [125] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [126] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [127] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [128] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [129] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(62),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [130] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [131] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [132] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [133] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(64),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [134] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(68),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [135] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [136] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [137] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [138] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [139] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(160),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [140] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [141] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [142] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [143] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [144] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(163),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [145] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [146] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [147] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [148] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [149] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [150] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [151] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [152] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [153] */
- /* usage */ core::ParameterUsage::kComponent,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [154] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [155] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [156] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [157] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(160),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [158] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [159] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [160] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [161] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(162),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [162] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(172),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [163] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [164] */
- /* usage */ core::ParameterUsage::kDepthRef,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [165] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(58),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [166] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [167] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [168] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [169] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(62),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [170] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [171] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [172] */
- /* usage */ core::ParameterUsage::kOffset,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(64),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [173] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(66),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [174] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [175] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [176] */
- /* usage */ core::ParameterUsage::kBias,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [177] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(66),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [178] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [179] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [180] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [181] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(162),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [182] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [183] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [184] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [185] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(8),
- },
- {
- /* [186] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [187] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [188] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [189] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(10),
- },
- {
- /* [190] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [191] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [192] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [193] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
- },
- {
- /* [194] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [195] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [196] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [197] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(38),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [198] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(76),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [199] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [200] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(173),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [201] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(161),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [202] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [203] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [204] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [205] */
- /* usage */ core::ParameterUsage::kX,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [206] */
- /* usage */ core::ParameterUsage::kY,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [207] */
- /* usage */ core::ParameterUsage::kZ,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [208] */
- /* usage */ core::ParameterUsage::kW,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [209] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [210] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [211] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [212] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [213] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [214] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [215] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [216] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [217] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [218] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [219] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [220] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [221] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [222] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [223] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [224] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [225] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [226] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [227] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [228] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [229] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [230] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [231] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [232] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [233] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [234] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [235] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(56),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [236] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [237] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [238] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(169),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [239] */
- /* usage */ core::ParameterUsage::kSampler,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(170),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [240] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [241] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(8),
- },
- {
- /* [242] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [243] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [244] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(8),
- },
- {
- /* [245] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [246] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [247] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(8),
- },
- {
- /* [248] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [249] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [250] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(10),
- },
- {
- /* [251] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [252] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [253] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(10),
- },
- {
- /* [254] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [255] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [256] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(10),
- },
- {
- /* [257] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [258] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [259] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
- },
- {
- /* [260] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [261] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [262] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
- },
- {
- /* [263] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [264] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [265] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(12),
- },
- {
- /* [266] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [267] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [268] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(32),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [269] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [270] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [271] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(36),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [272] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(76),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [273] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [274] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(42),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [275] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(78),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [276] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [277] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(48),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [278] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(76),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [279] */
- /* usage */ core::ParameterUsage::kSampleIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(171),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [280] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(160),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [281] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [282] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [283] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(164),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [284] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [285] */
- /* usage */ core::ParameterUsage::kSampleIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [286] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
- },
- {
- /* [287] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [288] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [289] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(16),
- },
- {
- /* [290] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [291] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [292] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(18),
- },
- {
- /* [293] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [294] */
- /* usage */ core::ParameterUsage::kArrayIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [295] */
- /* usage */ core::ParameterUsage::kXy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [296] */
- /* usage */ core::ParameterUsage::kZ,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [297] */
- /* usage */ core::ParameterUsage::kW,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [298] */
- /* usage */ core::ParameterUsage::kX,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [299] */
- /* usage */ core::ParameterUsage::kYz,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [300] */
- /* usage */ core::ParameterUsage::kW,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [301] */
- /* usage */ core::ParameterUsage::kX,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [302] */
- /* usage */ core::ParameterUsage::kY,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [303] */
- /* usage */ core::ParameterUsage::kZw,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [304] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [305] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [306] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [307] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(20),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [308] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(32),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [309] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [310] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(36),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [311] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [312] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(38),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [313] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [314] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(42),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [315] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [316] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(44),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [317] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [318] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(46),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [319] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(21),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [320] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(160),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [321] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [322] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(161),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [323] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [324] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(162),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [325] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [326] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(163),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [327] */
- /* usage */ core::ParameterUsage::kLevel,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [328] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(169),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [329] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [330] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
- },
- {
- /* [331] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [332] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(16),
- },
- {
- /* [333] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [334] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(18),
- },
- {
- /* [335] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [336] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
- },
- {
- /* [337] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [338] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(16),
- },
- {
- /* [339] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [340] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(18),
- },
- {
- /* [341] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [342] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(14),
- },
- {
- /* [343] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [344] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(16),
- },
- {
- /* [345] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [346] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(18),
- },
- {
- /* [347] */
- /* usage */ core::ParameterUsage::kCoords,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [348] */
- /* usage */ core::ParameterUsage::kValue,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [349] */
- /* usage */ core::ParameterUsage::kSourceLaneIndex,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [350] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [351] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [352] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(82),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [353] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [354] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [355] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [356] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [357] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [358] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(3),
- },
- {
- /* [359] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [360] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(22),
- },
- {
- /* [361] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(3),
- },
- {
- /* [362] */
- /* usage */ core::ParameterUsage::kXy,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [363] */
- /* usage */ core::ParameterUsage::kZw,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [364] */
- /* usage */ core::ParameterUsage::kXyz,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [365] */
- /* usage */ core::ParameterUsage::kW,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [366] */
- /* usage */ core::ParameterUsage::kX,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [367] */
- /* usage */ core::ParameterUsage::kZyw,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [368] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(0),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(0),
- },
- {
- /* [369] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [370] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [371] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(14),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(1),
- },
- {
- /* [372] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [373] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [374] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(30),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(6),
- },
- {
- /* [375] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(165),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [376] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(166),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [377] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(167),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [378] */
- /* usage */ core::ParameterUsage::kTexture,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(168),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(2),
- },
- {
- /* [379] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(53),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [380] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(87),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [381] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(76),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [382] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(78),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [383] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(98),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [384] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(104),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [385] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(108),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [386] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(106),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [387] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(110),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [388] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(114),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [389] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(112),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [390] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(116),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [391] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(120),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [392] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(118),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [393] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(122),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [394] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(126),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [395] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(124),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [396] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(128),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [397] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(132),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [398] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(130),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [399] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(134),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [400] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(138),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [401] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(136),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [402] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(140),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [403] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(144),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [404] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(142),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [405] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(146),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [406] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(150),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [407] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(148),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [408] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(152),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [409] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(156),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
- {
- /* [410] */
- /* usage */ core::ParameterUsage::kNone,
- /* type_matcher_indices */ TypeMatcherIndicesIndex(154),
- /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- },
-};
-
-static_assert(ParameterIndex::CanIndex(kParameters),
- "ParameterIndex is not large enough to index kParameters");
-
-constexpr TemplateTypeInfo kTemplateTypes[] = {
- {
- /* [0] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(68),
- },
- {
- /* [1] */
- /* name */ "C",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [2] */
- /* name */ "A",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [3] */
- /* name */ "L",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [4] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(68),
- },
- {
- /* [5] */
- /* name */ "C",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [6] */
- /* name */ "L",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [7] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(68),
- },
- {
- /* [8] */
- /* name */ "C",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [9] */
- /* name */ "S",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [10] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(64),
- },
- {
- /* [11] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(66),
- },
- {
- /* [12] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(68),
- },
- {
- /* [13] */
- /* name */ "L",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [14] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(9),
- },
- {
- /* [15] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(55),
- },
- {
- /* [16] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(10),
- },
- {
- /* [17] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(56),
- },
- {
- /* [18] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(7),
- },
- {
- /* [19] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(57),
- },
- {
- /* [20] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(8),
- },
- {
- /* [21] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(58),
- },
- {
- /* [22] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(4),
- },
- {
- /* [23] */
- /* name */ "U",
- /* matcher_index */ TypeMatcherIndex(59),
- },
- {
- /* [24] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(60),
- },
- {
- /* [25] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(/* invalid */),
- },
- {
- /* [26] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(72),
- },
- {
- /* [27] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(53),
- },
- {
- /* [28] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(61),
- },
- {
- /* [29] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(65),
- },
- {
- /* [30] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(57),
- },
- {
- /* [31] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(58),
- },
- {
- /* [32] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(55),
- },
- {
- /* [33] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(56),
- },
- {
- /* [34] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(59),
- },
- {
- /* [35] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(54),
- },
- {
- /* [36] */
- /* name */ "T",
- /* matcher_index */ TypeMatcherIndex(71),
- },
-};
-
-static_assert(TemplateTypeIndex::CanIndex(kTemplateTypes),
- "TemplateTypeIndex is not large enough to index kTemplateTypes");
-
-constexpr TemplateNumberInfo kTemplateNumbers[] = {
- {
- /* [0] */
- /* name */ "K",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [1] */
- /* name */ "C",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [2] */
- /* name */ "R",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [3] */
- /* name */ "M",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [4] */
- /* name */ "N",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [5] */
- /* name */ "M",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [6] */
- /* name */ "F",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [7] */
- /* name */ "A",
- /* matcher_index */ NumberMatcherIndex(/* invalid */),
- },
- {
- /* [8] */
- /* name */ "S",
- /* matcher_index */ NumberMatcherIndex(11),
- },
-};
-
-static_assert(TemplateNumberIndex::CanIndex(kTemplateNumbers),
- "TemplateNumberIndex is not large enough to index kTemplateNumbers");
-
-constexpr core::constant::Eval::Function kConstEvalFunctions[] = {
- /* [0] */ &core::constant::Eval::abs,
- /* [1] */ &core::constant::Eval::acos,
- /* [2] */ &core::constant::Eval::acosh,
- /* [3] */ &core::constant::Eval::all,
- /* [4] */ &core::constant::Eval::any,
- /* [5] */ &core::constant::Eval::asin,
- /* [6] */ &core::constant::Eval::asinh,
- /* [7] */ &core::constant::Eval::atan,
- /* [8] */ &core::constant::Eval::atan2,
- /* [9] */ &core::constant::Eval::atanh,
- /* [10] */ &core::constant::Eval::ceil,
- /* [11] */ &core::constant::Eval::clamp,
- /* [12] */ &core::constant::Eval::cos,
- /* [13] */ &core::constant::Eval::cosh,
- /* [14] */ &core::constant::Eval::countLeadingZeros,
- /* [15] */ &core::constant::Eval::countOneBits,
- /* [16] */ &core::constant::Eval::countTrailingZeros,
- /* [17] */ &core::constant::Eval::cross,
- /* [18] */ &core::constant::Eval::degrees,
- /* [19] */ &core::constant::Eval::determinant,
- /* [20] */ &core::constant::Eval::distance,
- /* [21] */ &core::constant::Eval::dot,
- /* [22] */ &core::constant::Eval::exp,
- /* [23] */ &core::constant::Eval::exp2,
- /* [24] */ &core::constant::Eval::extractBits,
- /* [25] */ &core::constant::Eval::faceForward,
- /* [26] */ &core::constant::Eval::firstLeadingBit,
- /* [27] */ &core::constant::Eval::firstTrailingBit,
- /* [28] */ &core::constant::Eval::floor,
- /* [29] */ &core::constant::Eval::fma,
- /* [30] */ &core::constant::Eval::fract,
- /* [31] */ &core::constant::Eval::frexp,
- /* [32] */ &core::constant::Eval::insertBits,
- /* [33] */ &core::constant::Eval::inverseSqrt,
- /* [34] */ &core::constant::Eval::ldexp,
- /* [35] */ &core::constant::Eval::length,
- /* [36] */ &core::constant::Eval::log,
- /* [37] */ &core::constant::Eval::log2,
- /* [38] */ &core::constant::Eval::max,
- /* [39] */ &core::constant::Eval::min,
- /* [40] */ &core::constant::Eval::mix,
- /* [41] */ &core::constant::Eval::modf,
- /* [42] */ &core::constant::Eval::normalize,
- /* [43] */ &core::constant::Eval::pack2x16float,
- /* [44] */ &core::constant::Eval::pack2x16snorm,
- /* [45] */ &core::constant::Eval::pack2x16unorm,
- /* [46] */ &core::constant::Eval::pack4x8snorm,
- /* [47] */ &core::constant::Eval::pack4x8unorm,
- /* [48] */ &core::constant::Eval::pow,
- /* [49] */ &core::constant::Eval::quantizeToF16,
- /* [50] */ &core::constant::Eval::radians,
- /* [51] */ &core::constant::Eval::reflect,
- /* [52] */ &core::constant::Eval::refract,
- /* [53] */ &core::constant::Eval::reverseBits,
- /* [54] */ &core::constant::Eval::round,
- /* [55] */ &core::constant::Eval::saturate,
- /* [56] */ &core::constant::Eval::select_bool,
- /* [57] */ &core::constant::Eval::select_boolvec,
- /* [58] */ &core::constant::Eval::sign,
- /* [59] */ &core::constant::Eval::sin,
- /* [60] */ &core::constant::Eval::sinh,
- /* [61] */ &core::constant::Eval::smoothstep,
- /* [62] */ &core::constant::Eval::sqrt,
- /* [63] */ &core::constant::Eval::step,
- /* [64] */ &core::constant::Eval::tan,
- /* [65] */ &core::constant::Eval::tanh,
- /* [66] */ &core::constant::Eval::transpose,
- /* [67] */ &core::constant::Eval::trunc,
- /* [68] */ &core::constant::Eval::unpack2x16float,
- /* [69] */ &core::constant::Eval::unpack2x16snorm,
- /* [70] */ &core::constant::Eval::unpack2x16unorm,
- /* [71] */ &core::constant::Eval::unpack4x8snorm,
- /* [72] */ &core::constant::Eval::unpack4x8unorm,
- /* [73] */ &core::constant::Eval::Identity,
- /* [74] */ &core::constant::Eval::Not,
- /* [75] */ &core::constant::Eval::Complement,
- /* [76] */ &core::constant::Eval::UnaryMinus,
- /* [77] */ &core::constant::Eval::Plus,
- /* [78] */ &core::constant::Eval::Minus,
- /* [79] */ &core::constant::Eval::Multiply,
- /* [80] */ &core::constant::Eval::MultiplyMatVec,
- /* [81] */ &core::constant::Eval::MultiplyVecMat,
- /* [82] */ &core::constant::Eval::MultiplyMatMat,
- /* [83] */ &core::constant::Eval::Divide,
- /* [84] */ &core::constant::Eval::Modulo,
- /* [85] */ &core::constant::Eval::Xor,
- /* [86] */ &core::constant::Eval::And,
- /* [87] */ &core::constant::Eval::Or,
- /* [88] */ &core::constant::Eval::LogicalAnd,
- /* [89] */ &core::constant::Eval::LogicalOr,
- /* [90] */ &core::constant::Eval::Equal,
- /* [91] */ &core::constant::Eval::NotEqual,
- /* [92] */ &core::constant::Eval::LessThan,
- /* [93] */ &core::constant::Eval::GreaterThan,
- /* [94] */ &core::constant::Eval::LessThanEqual,
- /* [95] */ &core::constant::Eval::GreaterThanEqual,
- /* [96] */ &core::constant::Eval::ShiftLeft,
- /* [97] */ &core::constant::Eval::ShiftRight,
- /* [98] */ &core::constant::Eval::Zero,
- /* [99] */ &core::constant::Eval::Conv,
- /* [100] */ &core::constant::Eval::VecSplat,
- /* [101] */ &core::constant::Eval::VecInitS,
- /* [102] */ &core::constant::Eval::VecInitM,
- /* [103] */ &core::constant::Eval::MatInitS,
- /* [104] */ &core::constant::Eval::MatInitV,
-};
-
-static_assert(ConstEvalFunctionIndex::CanIndex(kConstEvalFunctions),
- "ConstEvalFunctionIndex is not large enough to index kConstEvalFunctions");
-
-constexpr OverloadInfo kOverloads[] = {
- {
- /* [0] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(268),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [1] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(308),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [2] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(75),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [3] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(310),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [4] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(27),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [5] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(312),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [6] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(274),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(40),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [7] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(314),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(40),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [8] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(154),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [9] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(316),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [10] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(80),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [11] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(12),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(318),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [12] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(277),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [13] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [14] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(320),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [15] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [16] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(322),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [17] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(161),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [18] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(324),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [19] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [20] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(326),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [21] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(283),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [22] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(6),
- /* parameters */ ParameterIndex(375),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [23] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(6),
- /* parameters */ ParameterIndex(376),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [24] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(6),
- /* parameters */ ParameterIndex(377),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [25] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(6),
- /* parameters */ ParameterIndex(378),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(40),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [26] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(238),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [27] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(4),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(268),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [28] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(4),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(271),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [29] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 4,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(197),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [30] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(4),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(274),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [31] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(7),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(277),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [32] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(5),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(280),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [33] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(201),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [34] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(8),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(283),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [35] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(328),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [36] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(330),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [37] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(332),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [38] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(334),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [39] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(336),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [40] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(338),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [41] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(340),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [42] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(286),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [43] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(289),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [44] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(292),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [45] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(342),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [46] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(344),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [47] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(346),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [48] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(96),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [49] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(35),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [50] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(217),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [51] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(100),
- },
- {
- /* [52] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(205),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(101),
- },
- {
- /* [53] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(295),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [54] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(298),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [55] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(301),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [56] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(362),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [57] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(364),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [58] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(366),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [59] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(383),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [60] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(383),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(100),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [61] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(18),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(383),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(72),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [62] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(20),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(383),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [63] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(22),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(383),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(102),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [64] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(235),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [65] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(44),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [66] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(165),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [67] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(19),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [68] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(99),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [69] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(50),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [70] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(169),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [71] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(119),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [72] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(56),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [73] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(139),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [74] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(157),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [75] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(68),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [76] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(84),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [77] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(181),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [78] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(144),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [79] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(124),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [80] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(124),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [81] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(62),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [82] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(62),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [83] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(129),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [84] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(129),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [85] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(177),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [86] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(134),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [87] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(139),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [88] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(139),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [89] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(68),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [90] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(68),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [91] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(3),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(181),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [92] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(144),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [93] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(74),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [94] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(74),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [95] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(26),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [96] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(26),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [97] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(153),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [98] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 3,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(79),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(50),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [99] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(139),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [100] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(157),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [101] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(68),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [102] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(84),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [103] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(181),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [104] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(144),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [105] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(241),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [106] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(244),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [107] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 4,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(185),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [108] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(247),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [109] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(250),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [110] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(253),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [111] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 4,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(189),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [112] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(256),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [113] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(259),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [114] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(262),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [115] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 4,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(193),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [116] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(1),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(265),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [117] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(90),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [118] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(35),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [119] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [120] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(100),
- },
- {
- /* [121] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(205),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(101),
- },
- {
- /* [122] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(295),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [123] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(298),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(102),
- },
- {
- /* [124] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(382),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(54),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [125] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(382),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(92),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [126] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(18),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(382),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(64),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [127] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(20),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(382),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(40),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [128] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(22),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(382),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(94),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [129] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(268),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [130] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(75),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [131] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(27),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [132] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(274),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [133] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(154),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [134] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(80),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [135] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [136] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [137] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(161),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [138] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [139] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(84),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [140] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(35),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [141] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(209),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [142] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(100),
- },
- {
- /* [143] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(205),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(70),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(101),
- },
- {
- /* [144] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(381),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [145] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(381),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(86),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [146] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(18),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(381),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(52),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [147] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(20),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(381),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(34),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [148] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(22),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(381),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(88),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [149] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [150] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [151] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(223),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [152] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(350),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [153] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(355),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(2),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [154] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(354),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(2),
- /* const_eval_fn */ ConstEvalFunctionIndex(79),
- },
- {
- /* [155] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(1),
- /* parameters */ ParameterIndex(356),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(3),
- /* const_eval_fn */ ConstEvalFunctionIndex(80),
- },
- {
- /* [156] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(1),
- /* parameters */ ParameterIndex(358),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(81),
- },
- {
- /* [157] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 3,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(0),
- /* parameters */ ParameterIndex(360),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(20),
- /* const_eval_fn */ ConstEvalFunctionIndex(82),
- },
- {
- /* [158] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(104),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [159] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(104),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [160] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(38),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [161] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(38),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [162] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(109),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [163] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(109),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [164] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(173),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [165] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(114),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [166] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(44),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [167] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(44),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [168] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(19),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [169] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 7,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(19),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [170] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(50),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [171] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(50),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [172] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(119),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [173] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(56),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [174] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [175] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [176] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [177] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [178] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(161),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [179] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [180] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [181] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [182] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [183] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [184] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(161),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [185] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [186] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [187] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(89),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [188] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [189] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [190] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(161),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [191] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 5,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(2),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [192] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(104),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [193] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(384),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(104),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [194] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(104),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [195] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(209),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(104),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [196] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(385),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(106),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [197] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(386),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(108),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [198] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(110),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [199] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(387),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(110),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [200] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(110),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [201] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(110),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [202] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(388),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(112),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [203] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(389),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(114),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [204] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(116),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [205] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(390),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(116),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [206] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 8,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(116),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [207] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(217),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(116),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [208] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(391),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(118),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [209] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(392),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(120),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [210] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(122),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [211] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(393),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(122),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [212] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 6,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(122),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [213] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(209),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(122),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [214] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(394),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(124),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [215] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(395),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(126),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [216] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(128),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [217] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(396),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(128),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [218] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 9,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(128),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [219] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(128),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [220] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(397),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(130),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [221] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(398),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(132),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [222] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(134),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [223] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(399),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(134),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [224] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 12,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(134),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [225] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(217),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(134),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [226] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(400),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(136),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [227] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(401),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(138),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [228] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(140),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [229] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(402),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(140),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [230] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 8,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(140),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [231] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(209),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(140),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [232] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(403),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(142),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [233] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(404),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(144),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [234] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(146),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [235] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(405),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(146),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [236] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 12,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(146),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [237] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(146),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [238] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(406),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(148),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [239] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(407),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(150),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [240] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(152),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [241] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(36),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(408),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(152),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [242] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 16,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(152),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(103),
- },
- {
- /* [243] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(217),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(152),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(104),
- },
- {
- /* [244] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(16),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(409),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(154),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [245] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(14),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(410),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(156),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [246] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(27),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [247] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(80),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [248] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(32),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [249] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(94),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [250] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(6),
- /* parameters */ ParameterIndex(377),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [251] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(77),
- },
- {
- /* [252] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(77),
- },
- {
- /* [253] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(223),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(77),
- },
- {
- /* [254] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(350),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(77),
- },
- {
- /* [255] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(353),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(2),
- /* const_eval_fn */ ConstEvalFunctionIndex(77),
- },
- {
- /* [256] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(78),
- },
- {
- /* [257] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(78),
- },
- {
- /* [258] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(223),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(78),
- },
- {
- /* [259] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(350),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(78),
- },
- {
- /* [260] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(353),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(2),
- /* const_eval_fn */ ConstEvalFunctionIndex(78),
- },
- {
- /* [261] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(83),
- },
- {
- /* [262] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(83),
- },
- {
- /* [263] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(223),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(83),
- },
- {
- /* [264] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(350),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(83),
- },
- {
- /* [265] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(84),
- },
- {
- /* [266] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(84),
- },
- {
- /* [267] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(223),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(84),
- },
- {
- /* [268] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(350),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(84),
- },
- {
- /* [269] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(86),
- },
- {
- /* [270] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(233),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(86),
- },
- {
- /* [271] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(86),
- },
- {
- /* [272] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(86),
- },
- {
- /* [273] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(87),
- },
- {
- /* [274] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(233),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(87),
- },
- {
- /* [275] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(87),
- },
- {
- /* [276] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(87),
- },
- {
- /* [277] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(40),
- },
- {
- /* [278] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(221),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(40),
- },
- {
- /* [279] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(222),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(40),
- },
- {
- /* [280] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(224),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(56),
- },
- {
- /* [281] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(228),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(56),
- },
- {
- /* [282] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(231),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(57),
- },
- {
- /* [283] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [284] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(379),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [285] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(30),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [286] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [287] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [288] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(31),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [289] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [290] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(370),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [291] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(32),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [292] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(87),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [293] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(380),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(87),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [294] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(33),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(87),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [295] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(98),
- },
- {
- /* [296] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConstructor, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [297] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(34),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
- {
- /* [298] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(0),
- },
- {
- /* [299] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(0),
- },
- {
- /* [300] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(1),
- },
- {
- /* [301] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(1),
- },
- {
- /* [302] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(2),
- },
- {
- /* [303] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(2),
- },
- {
- /* [304] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(3),
- },
- {
- /* [305] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(233),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(3),
- },
- {
- /* [306] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(4),
- },
- {
- /* [307] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(233),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(4),
- },
- {
- /* [308] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(5),
- },
- {
- /* [309] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(5),
- },
- {
- /* [310] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(6),
- },
- {
- /* [311] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(6),
- },
- {
- /* [312] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(7),
- },
- {
- /* [313] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(7),
- },
- {
- /* [314] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(8),
- },
- {
- /* [315] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(8),
- },
- {
- /* [316] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(9),
- },
- {
- /* [317] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(9),
- },
- {
- /* [318] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(10),
- },
- {
- /* [319] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(10),
- },
- {
- /* [320] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(11),
- },
- {
- /* [321] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(221),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(11),
- },
- {
- /* [322] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(12),
- },
- {
- /* [323] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(12),
- },
- {
- /* [324] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(13),
- },
- {
- /* [325] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(13),
- },
- {
- /* [326] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(14),
- },
- {
- /* [327] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(14),
- },
- {
- /* [328] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(15),
- },
- {
- /* [329] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(15),
- },
- {
- /* [330] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(16),
- },
- {
- /* [331] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(16),
- },
- {
- /* [332] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(18),
- },
- {
- /* [333] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(18),
- },
- {
- /* [334] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(20),
- },
- {
- /* [335] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(20),
- },
- {
- /* [336] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(370),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [337] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(371),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(14),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [338] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(22),
- },
- {
- /* [339] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(22),
- },
- {
- /* [340] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(23),
- },
- {
- /* [341] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(23),
- },
- {
- /* [342] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(16),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(24),
- },
- {
- /* [343] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(150),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(24),
- },
- {
- /* [344] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(26),
- },
- {
- /* [345] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(26),
- },
- {
- /* [346] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(27),
- },
- {
- /* [347] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(27),
- },
- {
- /* [348] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(28),
- },
- {
- /* [349] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(28),
- },
- {
- /* [350] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(29),
- },
- {
- /* [351] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(221),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(29),
- },
- {
- /* [352] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(30),
- },
- {
- /* [353] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(30),
- },
- {
- /* [354] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(16),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(31),
- },
- {
- /* [355] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(18),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(31),
- },
- {
- /* [356] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(15),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(32),
- },
- {
- /* [357] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 4,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(32),
- },
- {
- /* [358] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(33),
- },
- {
- /* [359] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(33),
- },
- {
- /* [360] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(304),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(34),
- },
- {
- /* [361] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 2,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(306),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(34),
- },
- {
- /* [362] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(35),
- },
- {
- /* [363] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(35),
- },
- {
- /* [364] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(36),
- },
- {
- /* [365] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(36),
- },
- {
- /* [366] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(37),
- },
- {
- /* [367] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(37),
- },
- {
- /* [368] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(38),
- },
- {
- /* [369] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(38),
- },
- {
- /* [370] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(39),
- },
- {
- /* [371] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(39),
- },
- {
- /* [372] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(22),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(41),
- },
- {
- /* [373] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(24),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(41),
- },
- {
- /* [374] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(48),
- },
- {
- /* [375] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(48),
- },
- {
- /* [376] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(370),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(49),
- },
- {
- /* [377] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(371),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(14),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(49),
- },
- {
- /* [378] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(50),
- },
- {
- /* [379] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(50),
- },
- {
- /* [380] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(53),
- },
- {
- /* [381] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(53),
- },
- {
- /* [382] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(54),
- },
- {
- /* [383] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(54),
- },
- {
- /* [384] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(55),
- },
- {
- /* [385] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(55),
- },
- {
- /* [386] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(28),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(58),
- },
- {
- /* [387] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(28),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(58),
- },
- {
- /* [388] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(59),
- },
- {
- /* [389] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(59),
- },
- {
- /* [390] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(60),
- },
- {
- /* [391] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(60),
- },
- {
- /* [392] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(61),
- },
- {
- /* [393] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(221),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(61),
- },
- {
- /* [394] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(62),
- },
- {
- /* [395] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(62),
- },
- {
- /* [396] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(63),
- },
- {
- /* [397] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(63),
- },
- {
- /* [398] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(64),
- },
- {
- /* [399] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(64),
- },
- {
- /* [400] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(65),
- },
- {
- /* [401] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(65),
- },
- {
- /* [402] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(67),
- },
- {
- /* [403] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(67),
- },
- {
- /* [404] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(277),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [405] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(283),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [406] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(44),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [407] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(238),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [408] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(74),
- },
- {
- /* [409] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(233),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(74),
- },
- {
- /* [410] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(75),
- },
- {
- /* [411] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(75),
- },
- {
- /* [412] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(28),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(76),
- },
- {
- /* [413] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(28),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(76),
- },
- {
- /* [414] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(85),
- },
- {
- /* [415] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(85),
- },
- {
- /* [416] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(90),
- },
- {
- /* [417] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(90),
- },
- {
- /* [418] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(91),
- },
- {
- /* [419] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(27),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(91),
- },
- {
- /* [420] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(92),
- },
- {
- /* [421] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(92),
- },
- {
- /* [422] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(93),
- },
- {
- /* [423] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(93),
- },
- {
- /* [424] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(94),
- },
- {
- /* [425] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(94),
- },
- {
- /* [426] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(95),
- },
- {
- /* [427] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(8),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(95),
- },
- {
- /* [428] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(16),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(96),
- },
- {
- /* [429] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(351),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(96),
- },
- {
- /* [430] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(16),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(97),
- },
- {
- /* [431] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(29),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(351),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(97),
- },
- {
- /* [432] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(25),
- /* template_numbers */ TemplateNumberIndex(7),
- /* parameters */ ParameterIndex(368),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [433] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(10),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(17),
- },
- {
- /* [434] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(369),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(19),
- },
- {
- /* [435] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(24),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(21),
- },
- {
- /* [436] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(53),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [437] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [438] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(221),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(25),
- },
- {
- /* [439] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(42),
- },
- {
- /* [440] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(372),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(43),
- },
- {
- /* [441] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(372),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(44),
- },
- {
- /* [442] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(372),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(45),
- },
- {
- /* [443] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(373),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(46),
- },
- {
- /* [444] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(373),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(35),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(47),
- },
- {
- /* [445] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(149),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(51),
- },
- {
- /* [446] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(4),
- /* parameters */ ParameterIndex(222),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1),
- /* const_eval_fn */ ConstEvalFunctionIndex(52),
- },
- {
- /* [447] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [448] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 2,
- /* template_types */ TemplateTypeIndex(10),
- /* template_numbers */ TemplateNumberIndex(3),
- /* parameters */ ParameterIndex(353),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(3),
- /* const_eval_fn */ ConstEvalFunctionIndex(66),
- },
- {
- /* [449] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(68),
- },
- {
- /* [450] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(69),
- },
- {
- /* [451] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(26),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(70),
- },
- {
- /* [452] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(71),
- },
- {
- /* [453] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(17),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(28),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(72),
- },
- {
- /* [454] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(25),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(374),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [455] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(8),
- /* parameters */ ParameterIndex(0),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [456] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(8),
- /* parameters */ ParameterIndex(0),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [457] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(8),
- /* parameters */ ParameterIndex(0),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [458] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 3,
- /* num_template_types */ 1,
- /* num_template_numbers */ 1,
- /* template_types */ TemplateTypeIndex(26),
- /* template_numbers */ TemplateNumberIndex(8),
- /* parameters */ ParameterIndex(0),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(80),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [459] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 0,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(/* invalid */),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(74),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [460] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(0),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(348),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
- },
- {
- /* [461] */
- /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(25),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(1),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(73),
- },
- {
- /* [462] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(88),
- },
- {
- /* [463] */
- /* flags */ OverloadFlags(OverloadFlag::kIsOperator, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 2,
- /* num_template_types */ 0,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(/* invalid */),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(226),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(89),
- },
- {
- /* [464] */
- /* flags */ OverloadFlags(OverloadFlag::kIsConverter, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMustUse),
- /* num_parameters */ 1,
- /* num_template_types */ 1,
- /* num_template_numbers */ 0,
- /* template_types */ TemplateTypeIndex(35),
- /* template_numbers */ TemplateNumberIndex(/* invalid */),
- /* parameters */ ParameterIndex(213),
- /* return_type_matcher_indices */ TypeMatcherIndicesIndex(158),
- /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */),
- /* const_eval_fn */ ConstEvalFunctionIndex(99),
- },
-};
-
-static_assert(OverloadIndex::CanIndex(kOverloads),
- "OverloadIndex is not large enough to index kOverloads");
-
-constexpr IntrinsicInfo kBuiltins[] = {
- {
- /* [0] */
- /* fn abs<T : fia_fiu32_f16>(T) -> T */
- /* fn abs<N : num, T : fia_fiu32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(298),
- },
- {
- /* [1] */
- /* fn acos<T : fa_f32_f16>(@test_value(0.96891242171) T) -> T */
- /* fn acos<N : num, T : fa_f32_f16>(@test_value(0.96891242171) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(300),
- },
- {
- /* [2] */
- /* fn acosh<T : fa_f32_f16>(@test_value(1.5430806348) T) -> T */
- /* fn acosh<N : num, T : fa_f32_f16>(@test_value(1.5430806348) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(302),
- },
- {
- /* [3] */
- /* fn all(bool) -> bool */
- /* fn all<N : num>(vec<N, bool>) -> bool */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(304),
- },
- {
- /* [4] */
- /* fn any(bool) -> bool */
- /* fn any<N : num>(vec<N, bool>) -> bool */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(306),
- },
- {
- /* [5] */
- /* fn arrayLength<T, A : access>(ptr<storage, array<T>, A>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(432),
- },
- {
- /* [6] */
- /* fn asin<T : fa_f32_f16>(@test_value(0.479425538604) T) -> T */
- /* fn asin<N : num, T : fa_f32_f16>(@test_value(0.479425538604) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(308),
- },
- {
- /* [7] */
- /* fn asinh<T : fa_f32_f16>(T) -> T */
- /* fn asinh<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(310),
- },
- {
- /* [8] */
- /* fn atan<T : fa_f32_f16>(T) -> T */
- /* fn atan<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(312),
- },
- {
- /* [9] */
- /* fn atan2<T : fa_f32_f16>(T, T) -> T */
- /* fn atan2<T : fa_f32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(314),
- },
- {
- /* [10] */
- /* fn atanh<T : fa_f32_f16>(@test_value(0.5) T) -> T */
- /* fn atanh<N : num, T : fa_f32_f16>(@test_value(0.5) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(316),
- },
- {
- /* [11] */
- /* fn ceil<T : fa_f32_f16>(@test_value(1.5) T) -> T */
- /* fn ceil<N : num, T : fa_f32_f16>(@test_value(1.5) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(318),
- },
- {
- /* [12] */
- /* fn clamp<T : fia_fiu32_f16>(T, T, T) -> T */
- /* fn clamp<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(320),
- },
- {
- /* [13] */
- /* fn cos<T : fa_f32_f16>(@test_value(0) T) -> T */
- /* fn cos<N : num, T : fa_f32_f16>(@test_value(0) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(322),
- },
- {
- /* [14] */
- /* fn cosh<T : fa_f32_f16>(@test_value(0) T) -> T */
- /* fn cosh<N : num, T : fa_f32_f16>(@test_value(0) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(324),
- },
- {
- /* [15] */
- /* fn countLeadingZeros<T : iu32>(T) -> T */
- /* fn countLeadingZeros<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(326),
- },
- {
- /* [16] */
- /* fn countOneBits<T : iu32>(T) -> T */
- /* fn countOneBits<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(328),
- },
- {
- /* [17] */
- /* fn countTrailingZeros<T : iu32>(T) -> T */
- /* fn countTrailingZeros<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(330),
- },
- {
- /* [18] */
- /* fn cross<T : fa_f32_f16>(vec3<T>, vec3<T>) -> vec3<T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(433),
- },
- {
- /* [19] */
- /* fn degrees<T : fa_f32_f16>(T) -> T */
- /* fn degrees<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(332),
- },
- {
- /* [20] */
- /* fn determinant<N : num, T : fa_f32_f16>(mat<N, N, T>) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(434),
- },
- {
- /* [21] */
- /* fn distance<T : fa_f32_f16>(T, T) -> T */
- /* fn distance<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> T */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(334),
- },
- {
- /* [22] */
- /* fn dot<N : num, T : fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(435),
- },
- {
- /* [23] */
- /* fn dot4I8Packed(u32, u32) -> i32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(436),
- },
- {
- /* [24] */
- /* fn dot4U8Packed(u32, u32) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(437),
- },
- {
- /* [25] */
- /* fn dpdx(f32) -> f32 */
- /* fn dpdx<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [26] */
- /* fn dpdxCoarse(f32) -> f32 */
- /* fn dpdxCoarse<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [27] */
- /* fn dpdxFine(f32) -> f32 */
- /* fn dpdxFine<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [28] */
- /* fn dpdy(f32) -> f32 */
- /* fn dpdy<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [29] */
- /* fn dpdyCoarse(f32) -> f32 */
- /* fn dpdyCoarse<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [30] */
- /* fn dpdyFine(f32) -> f32 */
- /* fn dpdyFine<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [31] */
- /* fn exp<T : fa_f32_f16>(T) -> T */
- /* fn exp<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(338),
- },
- {
- /* [32] */
- /* fn exp2<T : fa_f32_f16>(T) -> T */
- /* fn exp2<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(340),
- },
- {
- /* [33] */
- /* fn extractBits<T : iu32>(T, u32, u32) -> T */
- /* fn extractBits<N : num, T : iu32>(vec<N, T>, u32, u32) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(342),
- },
- {
- /* [34] */
- /* fn faceForward<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(438),
- },
- {
- /* [35] */
- /* fn firstLeadingBit<T : iu32>(T) -> T */
- /* fn firstLeadingBit<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(344),
- },
- {
- /* [36] */
- /* fn firstTrailingBit<T : iu32>(T) -> T */
- /* fn firstTrailingBit<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(346),
- },
- {
- /* [37] */
- /* fn floor<T : fa_f32_f16>(@test_value(1.5) T) -> T */
- /* fn floor<N : num, T : fa_f32_f16>(@test_value(1.5) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(348),
- },
- {
- /* [38] */
- /* fn fma<T : fa_f32_f16>(T, T, T) -> T */
- /* fn fma<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(350),
- },
- {
- /* [39] */
- /* fn fract<T : fa_f32_f16>(@test_value(1.25) T) -> T */
- /* fn fract<N : num, T : fa_f32_f16>(@test_value(1.25) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(352),
- },
- {
- /* [40] */
- /* fn frexp<T : fa_f32_f16>(T) -> __frexp_result<T> */
- /* fn frexp<N : num, T : fa_f32_f16>(vec<N, T>) -> __frexp_result_vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(354),
- },
- {
- /* [41] */
- /* fn fwidth(f32) -> f32 */
- /* fn fwidth<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [42] */
- /* fn fwidthCoarse(f32) -> f32 */
- /* fn fwidthCoarse<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [43] */
- /* fn fwidthFine(f32) -> f32 */
- /* fn fwidthFine<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(336),
- },
- {
- /* [44] */
- /* fn insertBits<T : iu32>(T, T, u32, u32) -> T */
- /* fn insertBits<N : num, T : iu32>(vec<N, T>, vec<N, T>, u32, u32) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(356),
- },
- {
- /* [45] */
- /* fn inverseSqrt<T : fa_f32_f16>(T) -> T */
- /* fn inverseSqrt<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(358),
- },
- {
- /* [46] */
- /* fn ldexp<T : fa_f32_f16, U : ia_i32>(T, U) -> T */
- /* fn ldexp<N : num, T : fa_f32_f16, U : ia_i32>(vec<N, T>, vec<N, U>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(360),
- },
- {
- /* [47] */
- /* fn length<T : fa_f32_f16>(@test_value(0) T) -> T */
- /* fn length<N : num, T : fa_f32_f16>(@test_value(0) vec<N, T>) -> T */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(362),
- },
- {
- /* [48] */
- /* fn log<T : fa_f32_f16>(T) -> T */
- /* fn log<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(364),
- },
- {
- /* [49] */
- /* fn log2<T : fa_f32_f16>(T) -> T */
- /* fn log2<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(366),
- },
- {
- /* [50] */
- /* fn max<T : fia_fiu32_f16>(T, T) -> T */
- /* fn max<N : num, T : fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(368),
- },
- {
- /* [51] */
- /* fn min<T : fia_fiu32_f16>(T, T) -> T */
- /* fn min<N : num, T : fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(370),
- },
- {
- /* [52] */
- /* fn mix<T : fa_f32_f16>(T, T, T) -> T */
- /* fn mix<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* fn mix<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T> */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(277),
- },
- {
- /* [53] */
- /* fn modf<T : fa_f32_f16>(@test_value(-1.5) T) -> __modf_result<T> */
- /* fn modf<N : num, T : fa_f32_f16>(@test_value(-1.5) vec<N, T>) -> __modf_result_vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(372),
- },
- {
- /* [54] */
- /* fn normalize<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(439),
- },
- {
- /* [55] */
- /* fn pack2x16float(vec2<f32>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(440),
- },
- {
- /* [56] */
- /* fn pack2x16snorm(vec2<f32>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(441),
- },
- {
- /* [57] */
- /* fn pack2x16unorm(vec2<f32>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(442),
- },
- {
- /* [58] */
- /* fn pack4x8snorm(vec4<f32>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(443),
- },
- {
- /* [59] */
- /* fn pack4x8unorm(vec4<f32>) -> u32 */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(444),
- },
- {
- /* [60] */
- /* fn pow<T : fa_f32_f16>(T, T) -> T */
- /* fn pow<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(374),
- },
- {
- /* [61] */
- /* fn quantizeToF16(f32) -> f32 */
- /* fn quantizeToF16<N : num>(vec<N, f32>) -> vec<N, f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(376),
- },
- {
- /* [62] */
- /* fn radians<T : fa_f32_f16>(T) -> T */
- /* fn radians<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(378),
- },
- {
- /* [63] */
- /* fn reflect<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(445),
- },
- {
- /* [64] */
- /* fn refract<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(446),
- },
- {
- /* [65] */
- /* fn reverseBits<T : iu32>(T) -> T */
- /* fn reverseBits<N : num, T : iu32>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(380),
- },
- {
- /* [66] */
- /* fn round<T : fa_f32_f16>(@test_value(3.5) T) -> T */
- /* fn round<N : num, T : fa_f32_f16>(@test_value(3.5) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(382),
- },
- {
- /* [67] */
- /* fn saturate<T : fa_f32_f16>(@test_value(2) T) -> T */
- /* fn saturate<T : fa_f32_f16, N : num>(@test_value(2) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(384),
- },
- {
- /* [68] */
- /* fn select<T : scalar>(T, T, bool) -> T */
- /* fn select<T : scalar, N : num>(vec<N, T>, vec<N, T>, bool) -> vec<N, T> */
- /* fn select<N : num, T : scalar>(vec<N, T>, vec<N, T>, vec<N, bool>) -> vec<N, T> */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(280),
- },
- {
- /* [69] */
- /* fn sign<T : fia_fi32_f16>(T) -> T */
- /* fn sign<N : num, T : fia_fi32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(386),
- },
- {
- /* [70] */
- /* fn sin<T : fa_f32_f16>(@test_value(1.57079632679) T) -> T */
- /* fn sin<N : num, T : fa_f32_f16>(@test_value(1.57079632679) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(388),
- },
- {
- /* [71] */
- /* fn sinh<T : fa_f32_f16>(T) -> T */
- /* fn sinh<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(390),
- },
- {
- /* [72] */
- /* fn smoothstep<T : fa_f32_f16>(@test_value(2) T, @test_value(4) T, @test_value(3) T) -> T */
- /* fn smoothstep<N : num, T : fa_f32_f16>(@test_value(2) vec<N, T>, @test_value(4) vec<N, T>, @test_value(3) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(392),
- },
- {
- /* [73] */
- /* fn sqrt<T : fa_f32_f16>(T) -> T */
- /* fn sqrt<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(394),
- },
- {
- /* [74] */
- /* fn step<T : fa_f32_f16>(T, T) -> T */
- /* fn step<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(396),
- },
- {
- /* [75] */
- /* fn storageBarrier() */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(447),
- },
- {
- /* [76] */
- /* fn tan<T : fa_f32_f16>(T) -> T */
- /* fn tan<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(398),
- },
- {
- /* [77] */
- /* fn tanh<T : fa_f32_f16>(T) -> T */
- /* fn tanh<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(400),
- },
- {
- /* [78] */
- /* fn transpose<M : num, N : num, T : fa_f32_f16>(mat<M, N, T>) -> mat<N, M, T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(448),
- },
- {
- /* [79] */
- /* fn trunc<T : fa_f32_f16>(@test_value(1.5) T) -> T */
- /* fn trunc<N : num, T : fa_f32_f16>(@test_value(1.5) vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(402),
- },
- {
- /* [80] */
- /* fn unpack2x16float(u32) -> vec2<f32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(449),
- },
- {
- /* [81] */
- /* fn unpack2x16snorm(u32) -> vec2<f32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(450),
- },
- {
- /* [82] */
- /* fn unpack2x16unorm(u32) -> vec2<f32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(451),
- },
- {
- /* [83] */
- /* fn unpack4x8snorm(u32) -> vec4<f32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(452),
- },
- {
- /* [84] */
- /* fn unpack4x8unorm(u32) -> vec4<f32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(453),
- },
- {
- /* [85] */
- /* fn workgroupBarrier() */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(447),
- },
- {
- /* [86] */
- /* fn workgroupUniformLoad<T>(ptr<workgroup, T, read_write>) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(454),
- },
- {
- /* [87] */
- /* fn textureBarrier() */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(447),
- },
- {
- /* [88] */
- /* fn textureDimensions<T : fiu32>(texture: texture_1d<T>) -> u32 */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_1d<T>, level: L) -> u32 */
- /* fn textureDimensions<T : fiu32>(texture: texture_2d<T>) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_2d<T>, level: L) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_2d_array<T>) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_2d_array<T>, level: L) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_3d<T>) -> vec3<u32> */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_3d<T>, level: L) -> vec3<u32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_cube<T>) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_cube<T>, level: L) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_cube_array<T>) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32, L : iu32>(texture: texture_cube_array<T>, level: L) -> vec2<u32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_multisampled_2d<T>) -> vec2<u32> */
- /* fn textureDimensions(texture: texture_depth_2d) -> vec2<u32> */
- /* fn textureDimensions<L : iu32>(texture: texture_depth_2d, level: L) -> vec2<u32> */
- /* fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32> */
- /* fn textureDimensions<L : iu32>(texture: texture_depth_2d_array, level: L) -> vec2<u32> */
- /* fn textureDimensions(texture: texture_depth_cube) -> vec2<u32> */
- /* fn textureDimensions<L : iu32>(texture: texture_depth_cube, level: L) -> vec2<u32> */
- /* fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32> */
- /* fn textureDimensions<L : iu32>(texture: texture_depth_cube_array, level: L) -> vec2<u32> */
- /* fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32> */
- /* fn textureDimensions<F : texel_format, A : access>(texture: texture_storage_1d<F, A>) -> u32 */
- /* fn textureDimensions<F : texel_format, A : access>(texture: texture_storage_2d<F, A>) -> vec2<u32> */
- /* fn textureDimensions<F : texel_format, A : access>(texture: texture_storage_2d_array<F, A>) -> vec2<u32> */
- /* fn textureDimensions<F : texel_format, A : access>(texture: texture_storage_3d<F, A>) -> vec3<u32> */
- /* fn textureDimensions(texture: texture_external) -> vec2<u32> */
- /* num overloads */ 27,
- /* overloads */ OverloadIndex(0),
- },
- {
- /* [89] */
- /* fn textureGather<T : fiu32, C : iu32>(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>) -> vec4<T> */
- /* fn textureGather<T : fiu32, C : iu32>(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<T> */
- /* fn textureGather<T : fiu32, C : iu32, A : iu32>(@const component: C, texture: texture_2d_array<T>, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<T> */
- /* fn textureGather<T : fiu32, C : iu32, A : iu32>(@const component: C, texture: texture_2d_array<T>, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<T> */
- /* fn textureGather<T : fiu32, C : iu32>(@const component: C, texture: texture_cube<T>, sampler: sampler, coords: vec3<f32>) -> vec4<T> */
- /* fn textureGather<T : fiu32, C : iu32, A : iu32>(@const component: C, texture: texture_cube_array<T>, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<T> */
- /* fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> vec4<f32> */
- /* fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureGather<A : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<f32> */
- /* fn textureGather<A : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureGather(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> vec4<f32> */
- /* fn textureGather<A : iu32>(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<f32> */
- /* num overloads */ 12,
- /* overloads */ OverloadIndex(93),
- },
- {
- /* [90] */
- /* fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> vec4<f32> */
- /* fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureGatherCompare<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> vec4<f32> */
- /* fn textureGatherCompare<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureGatherCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> vec4<f32> */
- /* fn textureGatherCompare<A : iu32>(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> vec4<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(174),
- },
- {
- /* [91] */
- /* fn textureNumLayers<T : fiu32>(texture: texture_2d_array<T>) -> u32 */
- /* fn textureNumLayers<T : fiu32>(texture: texture_cube_array<T>) -> u32 */
- /* fn textureNumLayers(texture: texture_depth_2d_array) -> u32 */
- /* fn textureNumLayers(texture: texture_depth_cube_array) -> u32 */
- /* fn textureNumLayers<F : texel_format, A : access>(texture: texture_storage_2d_array<F, A>) -> u32 */
- /* num overloads */ 5,
- /* overloads */ OverloadIndex(246),
- },
- {
- /* [92] */
- /* fn textureNumLevels<T : fiu32>(texture: texture_1d<T>) -> u32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_2d<T>) -> u32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_2d_array<T>) -> u32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_3d<T>) -> u32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_cube<T>) -> u32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_cube_array<T>) -> u32 */
- /* fn textureNumLevels(texture: texture_depth_2d) -> u32 */
- /* fn textureNumLevels(texture: texture_depth_2d_array) -> u32 */
- /* fn textureNumLevels(texture: texture_depth_cube) -> u32 */
- /* fn textureNumLevels(texture: texture_depth_cube_array) -> u32 */
- /* num overloads */ 10,
- /* overloads */ OverloadIndex(129),
- },
- {
- /* [93] */
- /* fn textureNumSamples<T : fiu32>(texture: texture_multisampled_2d<T>) -> u32 */
- /* fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32 */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(404),
- },
- {
- /* [94] */
- /* fn textureSample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32> */
- /* fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32> */
- /* fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSample<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<f32> */
- /* fn textureSample<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32> */
- /* fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32> */
- /* fn textureSample(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32> */
- /* fn textureSample<A : iu32>(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<f32> */
- /* fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> f32 */
- /* fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> f32 */
- /* fn textureSample<A : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A) -> f32 */
- /* fn textureSample<A : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> f32 */
- /* fn textureSample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> f32 */
- /* fn textureSample<A : iu32>(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> f32 */
- /* num overloads */ 15,
- /* overloads */ OverloadIndex(64),
- },
- {
- /* [95] */
- /* fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32) -> vec4<f32> */
- /* fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleBias<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, bias: f32) -> vec4<f32> */
- /* fn textureSampleBias<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, bias: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32> */
- /* fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32, @const offset: vec3<i32>) -> vec4<f32> */
- /* fn textureSampleBias(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32> */
- /* fn textureSampleBias<A : iu32>(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, bias: f32) -> vec4<f32> */
- /* num overloads */ 8,
- /* overloads */ OverloadIndex(158),
- },
- {
- /* [96] */
- /* fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32 */
- /* fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleCompare<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> f32 */
- /* fn textureSampleCompare<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32 */
- /* fn textureSampleCompare<A : iu32>(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> f32 */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(180),
- },
- {
- /* [97] */
- /* fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32 */
- /* fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleCompareLevel<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> f32 */
- /* fn textureSampleCompareLevel<A : iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleCompareLevel(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32 */
- /* fn textureSampleCompareLevel<A : iu32>(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> f32 */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(186),
- },
- {
- /* [98] */
- /* fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32> */
- /* fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleGrad<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32> */
- /* fn textureSampleGrad<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> */
- /* fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32> */
- /* fn textureSampleGrad(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> */
- /* fn textureSampleGrad<A : iu32>(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> */
- /* num overloads */ 8,
- /* overloads */ OverloadIndex(166),
- },
- {
- /* [99] */
- /* fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32) -> vec4<f32> */
- /* fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleLevel<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: f32) -> vec4<f32> */
- /* fn textureSampleLevel<A : iu32>(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: f32, @const offset: vec2<i32>) -> vec4<f32> */
- /* fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32> */
- /* fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32, @const offset: vec3<i32>) -> vec4<f32> */
- /* fn textureSampleLevel(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32> */
- /* fn textureSampleLevel<A : iu32>(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, level: f32) -> vec4<f32> */
- /* fn textureSampleLevel<L : iu32>(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: L) -> f32 */
- /* fn textureSampleLevel<L : iu32>(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: L, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleLevel<A : iu32, L : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: L) -> f32 */
- /* fn textureSampleLevel<A : iu32, L : iu32>(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: L, @const offset: vec2<i32>) -> f32 */
- /* fn textureSampleLevel<L : iu32>(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: L) -> f32 */
- /* fn textureSampleLevel<A : iu32, L : iu32>(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A, level: L) -> f32 */
- /* num overloads */ 14,
- /* overloads */ OverloadIndex(79),
- },
- {
- /* [100] */
- /* fn textureSampleBaseClampToEdge(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32> */
- /* fn textureSampleBaseClampToEdge(texture: texture_external, sampler: sampler, coords: vec2<f32>) -> vec4<f32> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(406),
- },
- {
- /* [101] */
- /* fn textureStore<C : iu32>(texture: texture_storage_1d<f32_texel_format, writable>, coords: C, value: vec4<f32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_2d<f32_texel_format, writable>, coords: vec2<C>, value: vec4<f32>) */
- /* fn textureStore<C : iu32, A : iu32>(texture: texture_storage_2d_array<f32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<f32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_3d<f32_texel_format, writable>, coords: vec3<C>, value: vec4<f32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_1d<i32_texel_format, writable>, coords: C, value: vec4<i32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_2d<i32_texel_format, writable>, coords: vec2<C>, value: vec4<i32>) */
- /* fn textureStore<C : iu32, A : iu32>(texture: texture_storage_2d_array<i32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<i32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_3d<i32_texel_format, writable>, coords: vec3<C>, value: vec4<i32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_1d<u32_texel_format, writable>, coords: C, value: vec4<u32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_2d<u32_texel_format, writable>, coords: vec2<C>, value: vec4<u32>) */
- /* fn textureStore<C : iu32, A : iu32>(texture: texture_storage_2d_array<u32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<u32>) */
- /* fn textureStore<C : iu32>(texture: texture_storage_3d<u32_texel_format, writable>, coords: vec3<C>, value: vec4<u32>) */
- /* num overloads */ 12,
- /* overloads */ OverloadIndex(105),
- },
- {
- /* [102] */
- /* fn textureLoad<T : fiu32, C : iu32, L : iu32>(texture: texture_1d<T>, coords: C, level: L) -> vec4<T> */
- /* fn textureLoad<T : fiu32, C : iu32, L : iu32>(texture: texture_2d<T>, coords: vec2<C>, level: L) -> vec4<T> */
- /* fn textureLoad<T : fiu32, C : iu32, A : iu32, L : iu32>(texture: texture_2d_array<T>, coords: vec2<C>, array_index: A, level: L) -> vec4<T> */
- /* fn textureLoad<T : fiu32, C : iu32, L : iu32>(texture: texture_3d<T>, coords: vec3<C>, level: L) -> vec4<T> */
- /* fn textureLoad<T : fiu32, C : iu32, S : iu32>(texture: texture_multisampled_2d<T>, coords: vec2<C>, sample_index: S) -> vec4<T> */
- /* fn textureLoad<C : iu32, L : iu32>(texture: texture_depth_2d, coords: vec2<C>, level: L) -> f32 */
- /* fn textureLoad<C : iu32, A : iu32, L : iu32>(texture: texture_depth_2d_array, coords: vec2<C>, array_index: A, level: L) -> f32 */
- /* fn textureLoad<C : iu32, S : iu32>(texture: texture_depth_multisampled_2d, coords: vec2<C>, sample_index: S) -> f32 */
- /* fn textureLoad<C : iu32>(texture: texture_external, coords: vec2<C>) -> vec4<f32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_1d<f32_texel_format, readable>, coords: C) -> vec4<f32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_1d<i32_texel_format, readable>, coords: C) -> vec4<i32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_1d<u32_texel_format, readable>, coords: C) -> vec4<u32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_2d<f32_texel_format, readable>, coords: vec2<C>) -> vec4<f32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_2d<i32_texel_format, readable>, coords: vec2<C>) -> vec4<i32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_2d<u32_texel_format, readable>, coords: vec2<C>) -> vec4<u32> */
- /* fn textureLoad<C : iu32, A : iu32>(texture: texture_storage_2d_array<f32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<f32> */
- /* fn textureLoad<C : iu32, A : iu32>(texture: texture_storage_2d_array<i32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<i32> */
- /* fn textureLoad<C : iu32, A : iu32>(texture: texture_storage_2d_array<u32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<u32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_3d<f32_texel_format, readable>, coords: vec3<C>) -> vec4<f32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_3d<i32_texel_format, readable>, coords: vec3<C>) -> vec4<i32> */
- /* fn textureLoad<C : iu32>(texture: texture_storage_3d<u32_texel_format, readable>, coords: vec3<C>) -> vec4<u32> */
- /* num overloads */ 21,
- /* overloads */ OverloadIndex(27),
- },
- {
- /* [103] */
- /* fn atomicLoad<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(455),
- },
- {
- /* [104] */
- /* fn atomicStore<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(456),
- },
- {
- /* [105] */
- /* fn atomicAdd<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [106] */
- /* fn atomicSub<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [107] */
- /* fn atomicMax<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [108] */
- /* fn atomicMin<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [109] */
- /* fn atomicAnd<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [110] */
- /* fn atomicOr<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [111] */
- /* fn atomicXor<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [112] */
- /* fn atomicExchange<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(457),
- },
- {
- /* [113] */
- /* fn atomicCompareExchangeWeak<T : iu32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, T, T) -> __atomic_compare_exchange_result<T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(458),
- },
- {
- /* [114] */
- /* fn subgroupBallot() -> vec4<u32> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(459),
- },
- {
- /* [115] */
- /* fn subgroupBroadcast<T : fiu32>(value: T, @const sourceLaneIndex: u32) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(460),
- },
- {
- /* [116] */
- /* fn _tint_materialize<T>(T) -> T */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(461),
- },
-};
-
-constexpr IntrinsicInfo kUnaryOperators[] = {
- {
- /* [0] */
- /* op !(bool) -> bool */
- /* op !<N : num>(vec<N, bool>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(408),
- },
- {
- /* [1] */
- /* op ~<T : ia_iu32>(T) -> T */
- /* op ~<T : ia_iu32, N : num>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(410),
- },
- {
- /* [2] */
- /* op -<T : fia_fi32_f16>(T) -> T */
- /* op -<T : fia_fi32_f16, N : num>(vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(412),
- },
-};
-constexpr uint8_t kUnaryOperatorNot = 0;
-constexpr uint8_t kUnaryOperatorComplement = 1;
-constexpr uint8_t kUnaryOperatorMinus = 2;
-
-constexpr IntrinsicInfo kBinaryOperators[] = {
- {
- /* [0] */
- /* op +<T : fia_fiu32_f16>(T, T) -> T */
- /* op +<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* op +<T : fia_fiu32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */
- /* op +<T : fia_fiu32_f16, N : num>(T, vec<N, T>) -> vec<N, T> */
- /* op +<T : fa_f32_f16, N : num, M : num>(mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T> */
- /* num overloads */ 5,
- /* overloads */ OverloadIndex(251),
- },
- {
- /* [1] */
- /* op -<T : fia_fiu32_f16>(T, T) -> T */
- /* op -<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* op -<T : fia_fiu32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */
- /* op -<T : fia_fiu32_f16, N : num>(T, vec<N, T>) -> vec<N, T> */
- /* op -<T : fa_f32_f16, N : num, M : num>(mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T> */
- /* num overloads */ 5,
- /* overloads */ OverloadIndex(256),
- },
- {
- /* [2] */
- /* op *<T : fia_fiu32_f16>(T, T) -> T */
- /* op *<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* op *<T : fia_fiu32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */
- /* op *<T : fia_fiu32_f16, N : num>(T, vec<N, T>) -> vec<N, T> */
- /* op *<T : fa_f32_f16, N : num, M : num>(T, mat<N, M, T>) -> mat<N, M, T> */
- /* op *<T : fa_f32_f16, N : num, M : num>(mat<N, M, T>, T) -> mat<N, M, T> */
- /* op *<T : fa_f32_f16, C : num, R : num>(mat<C, R, T>, vec<C, T>) -> vec<R, T> */
- /* op *<T : fa_f32_f16, C : num, R : num>(vec<R, T>, mat<C, R, T>) -> vec<C, T> */
- /* op *<T : fa_f32_f16, K : num, C : num, R : num>(mat<K, R, T>, mat<C, K, T>) -> mat<C, R, T> */
- /* num overloads */ 9,
- /* overloads */ OverloadIndex(149),
- },
- {
- /* [3] */
- /* op /<T : fia_fiu32_f16>(T, T) -> T */
- /* op /<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* op /<T : fia_fiu32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */
- /* op /<T : fia_fiu32_f16, N : num>(T, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 4,
- /* overloads */ OverloadIndex(261),
- },
- {
- /* [4] */
- /* op %<T : fia_fiu32_f16>(T, T) -> T */
- /* op %<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* op %<T : fia_fiu32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */
- /* op %<T : fia_fiu32_f16, N : num>(T, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 4,
- /* overloads */ OverloadIndex(265),
- },
- {
- /* [5] */
- /* op ^<T : ia_iu32>(T, T) -> T */
- /* op ^<T : ia_iu32, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(414),
- },
- {
- /* [6] */
- /* op &(bool, bool) -> bool */
- /* op &<N : num>(vec<N, bool>, vec<N, bool>) -> vec<N, bool> */
- /* op &<T : ia_iu32>(T, T) -> T */
- /* op &<T : ia_iu32, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 4,
- /* overloads */ OverloadIndex(269),
- },
- {
- /* [7] */
- /* op |(bool, bool) -> bool */
- /* op |<N : num>(vec<N, bool>, vec<N, bool>) -> vec<N, bool> */
- /* op |<T : ia_iu32>(T, T) -> T */
- /* op |<T : ia_iu32, N : num>(vec<N, T>, vec<N, T>) -> vec<N, T> */
- /* num overloads */ 4,
- /* overloads */ OverloadIndex(273),
- },
- {
- /* [8] */
- /* op &&(bool, bool) -> bool */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(462),
- },
- {
- /* [9] */
- /* op ||(bool, bool) -> bool */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(463),
- },
- {
- /* [10] */
- /* op ==<T : scalar>(T, T) -> bool */
- /* op ==<T : scalar, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(416),
- },
- {
- /* [11] */
- /* op !=<T : scalar>(T, T) -> bool */
- /* op !=<T : scalar, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(418),
- },
- {
- /* [12] */
- /* op <<T : fia_fiu32_f16>(T, T) -> bool */
- /* op <<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(420),
- },
- {
- /* [13] */
- /* op ><T : fia_fiu32_f16>(T, T) -> bool */
- /* op ><T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(422),
- },
- {
- /* [14] */
- /* op <=<T : fia_fiu32_f16>(T, T) -> bool */
- /* op <=<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(424),
- },
- {
- /* [15] */
- /* op >=<T : fia_fiu32_f16>(T, T) -> bool */
- /* op >=<T : fia_fiu32_f16, N : num>(vec<N, T>, vec<N, T>) -> vec<N, bool> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(426),
- },
- {
- /* [16] */
- /* op <<<T : ia_iu32>(T, u32) -> T */
- /* op <<<T : ia_iu32, N : num>(vec<N, T>, vec<N, u32>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(428),
- },
- {
- /* [17] */
- /* op >><T : ia_iu32>(T, u32) -> T */
- /* op >><T : ia_iu32, N : num>(vec<N, T>, vec<N, u32>) -> vec<N, T> */
- /* num overloads */ 2,
- /* overloads */ OverloadIndex(430),
- },
-};
-constexpr uint8_t kBinaryOperatorPlus = 0;
-constexpr uint8_t kBinaryOperatorMinus = 1;
-constexpr uint8_t kBinaryOperatorStar = 2;
-constexpr uint8_t kBinaryOperatorDivide = 3;
-constexpr uint8_t kBinaryOperatorModulo = 4;
-constexpr uint8_t kBinaryOperatorXor = 5;
-constexpr uint8_t kBinaryOperatorAnd = 6;
-constexpr uint8_t kBinaryOperatorOr = 7;
-constexpr uint8_t kBinaryOperatorLogicalAnd = 8;
-constexpr uint8_t kBinaryOperatorLogicalOr = 9;
-constexpr uint8_t kBinaryOperatorEqual = 10;
-constexpr uint8_t kBinaryOperatorNotEqual = 11;
-constexpr uint8_t kBinaryOperatorLessThan = 12;
-constexpr uint8_t kBinaryOperatorGreaterThan = 13;
-constexpr uint8_t kBinaryOperatorLessThanEqual = 14;
-constexpr uint8_t kBinaryOperatorGreaterThanEqual = 15;
-constexpr uint8_t kBinaryOperatorShiftLeft = 16;
-constexpr uint8_t kBinaryOperatorShiftRight = 17;
-
-constexpr IntrinsicInfo kConstructorsAndConverters[] = {
- {
- /* [0] */
- /* ctor i32() -> i32 */
- /* ctor i32(i32) -> i32 */
- /* conv i32<T : scalar_no_i32>(T) -> i32 */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(283),
- },
- {
- /* [1] */
- /* ctor u32() -> u32 */
- /* ctor u32(u32) -> u32 */
- /* conv u32<T : scalar_no_u32>(T) -> u32 */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(286),
- },
- {
- /* [2] */
- /* ctor f32() -> f32 */
- /* ctor f32(f32) -> f32 */
- /* conv f32<T : scalar_no_f32>(T) -> f32 */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(289),
- },
- {
- /* [3] */
- /* ctor f16() -> f16 */
- /* ctor f16(f16) -> f16 */
- /* conv f16<T : scalar_no_f16>(T) -> f16 */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(292),
- },
- {
- /* [4] */
- /* ctor bool() -> bool */
- /* ctor bool(bool) -> bool */
- /* conv bool<T : scalar_no_bool>(T) -> bool */
- /* num overloads */ 3,
- /* overloads */ OverloadIndex(295),
- },
- {
- /* [5] */
- /* ctor vec2() -> vec2<ia> */
- /* ctor vec2<T : concrete_scalar>() -> vec2<T> */
- /* ctor vec2<T : scalar>(vec2<T>) -> vec2<T> */
- /* ctor vec2<T : scalar>(T) -> vec2<T> */
- /* ctor vec2<T : scalar>(x: T, y: T) -> vec2<T> */
- /* conv vec2<T : f32, U : scalar_no_f32>(vec2<U>) -> vec2<f32> */
- /* conv vec2<T : f16, U : scalar_no_f16>(vec2<U>) -> vec2<f16> */
- /* conv vec2<T : i32, U : scalar_no_i32>(vec2<U>) -> vec2<i32> */
- /* conv vec2<T : u32, U : scalar_no_u32>(vec2<U>) -> vec2<u32> */
- /* conv vec2<T : bool, U : scalar_no_bool>(vec2<U>) -> vec2<bool> */
- /* num overloads */ 10,
- /* overloads */ OverloadIndex(139),
- },
- {
- /* [6] */
- /* ctor vec3() -> vec3<ia> */
- /* ctor vec3<T : concrete_scalar>() -> vec3<T> */
- /* ctor vec3<T : scalar>(vec3<T>) -> vec3<T> */
- /* ctor vec3<T : scalar>(T) -> vec3<T> */
- /* ctor vec3<T : scalar>(x: T, y: T, z: T) -> vec3<T> */
- /* ctor vec3<T : scalar>(xy: vec2<T>, z: T) -> vec3<T> */
- /* ctor vec3<T : scalar>(x: T, yz: vec2<T>) -> vec3<T> */
- /* conv vec3<T : f32, U : scalar_no_f32>(vec3<U>) -> vec3<f32> */
- /* conv vec3<T : f16, U : scalar_no_f16>(vec3<U>) -> vec3<f16> */
- /* conv vec3<T : i32, U : scalar_no_i32>(vec3<U>) -> vec3<i32> */
- /* conv vec3<T : u32, U : scalar_no_u32>(vec3<U>) -> vec3<u32> */
- /* conv vec3<T : bool, U : scalar_no_bool>(vec3<U>) -> vec3<bool> */
- /* num overloads */ 12,
- /* overloads */ OverloadIndex(117),
- },
- {
- /* [7] */
- /* ctor vec4() -> vec4<ia> */
- /* ctor vec4<T : concrete_scalar>() -> vec4<T> */
- /* ctor vec4<T : scalar>(vec4<T>) -> vec4<T> */
- /* ctor vec4<T : scalar>(T) -> vec4<T> */
- /* ctor vec4<T : scalar>(x: T, y: T, z: T, w: T) -> vec4<T> */
- /* ctor vec4<T : scalar>(xy: vec2<T>, z: T, w: T) -> vec4<T> */
- /* ctor vec4<T : scalar>(x: T, yz: vec2<T>, w: T) -> vec4<T> */
- /* ctor vec4<T : scalar>(x: T, y: T, zw: vec2<T>) -> vec4<T> */
- /* ctor vec4<T : scalar>(xy: vec2<T>, zw: vec2<T>) -> vec4<T> */
- /* ctor vec4<T : scalar>(xyz: vec3<T>, w: T) -> vec4<T> */
- /* ctor vec4<T : scalar>(x: T, zyw: vec3<T>) -> vec4<T> */
- /* conv vec4<T : f32, U : scalar_no_f32>(vec4<U>) -> vec4<f32> */
- /* conv vec4<T : f16, U : scalar_no_f16>(vec4<U>) -> vec4<f16> */
- /* conv vec4<T : i32, U : scalar_no_i32>(vec4<U>) -> vec4<i32> */
- /* conv vec4<T : u32, U : scalar_no_u32>(vec4<U>) -> vec4<u32> */
- /* conv vec4<T : bool, U : scalar_no_bool>(vec4<U>) -> vec4<bool> */
- /* num overloads */ 16,
- /* overloads */ OverloadIndex(48),
- },
- {
- /* [8] */
- /* ctor mat2x2<T : f32_f16>() -> mat2x2<T> */
- /* ctor mat2x2<T : f32_f16>(mat2x2<T>) -> mat2x2<T> */
- /* ctor mat2x2<T : fa_f32_f16>(T, T, T, T) -> mat2x2<T> */
- /* ctor mat2x2<T : fa_f32_f16>(vec2<T>, vec2<T>) -> mat2x2<T> */
- /* conv mat2x2<T : f16>(mat2x2<f32>) -> mat2x2<f16> */
- /* conv mat2x2<T : f32>(mat2x2<f16>) -> mat2x2<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(192),
- },
- {
- /* [9] */
- /* ctor mat2x3<T : f32_f16>() -> mat2x3<T> */
- /* ctor mat2x3<T : f32_f16>(mat2x3<T>) -> mat2x3<T> */
- /* ctor mat2x3<T : fa_f32_f16>(T, T, T, T, T, T) -> mat2x3<T> */
- /* ctor mat2x3<T : fa_f32_f16>(vec3<T>, vec3<T>) -> mat2x3<T> */
- /* conv mat2x3<T : f16>(mat2x3<f32>) -> mat2x3<f16> */
- /* conv mat2x3<T : f32>(mat2x3<f16>) -> mat2x3<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(198),
- },
- {
- /* [10] */
- /* ctor mat2x4<T : f32_f16>() -> mat2x4<T> */
- /* ctor mat2x4<T : f32_f16>(mat2x4<T>) -> mat2x4<T> */
- /* ctor mat2x4<T : fa_f32_f16>(T, T, T, T, T, T, T, T) -> mat2x4<T> */
- /* ctor mat2x4<T : fa_f32_f16>(vec4<T>, vec4<T>) -> mat2x4<T> */
- /* conv mat2x4<T : f16>(mat2x4<f32>) -> mat2x4<f16> */
- /* conv mat2x4<T : f32>(mat2x4<f16>) -> mat2x4<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(204),
- },
- {
- /* [11] */
- /* ctor mat3x2<T : f32_f16>() -> mat3x2<T> */
- /* ctor mat3x2<T : f32_f16>(mat3x2<T>) -> mat3x2<T> */
- /* ctor mat3x2<T : fa_f32_f16>(T, T, T, T, T, T) -> mat3x2<T> */
- /* ctor mat3x2<T : fa_f32_f16>(vec2<T>, vec2<T>, vec2<T>) -> mat3x2<T> */
- /* conv mat3x2<T : f16>(mat3x2<f32>) -> mat3x2<f16> */
- /* conv mat3x2<T : f32>(mat3x2<f16>) -> mat3x2<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(210),
- },
- {
- /* [12] */
- /* ctor mat3x3<T : f32_f16>() -> mat3x3<T> */
- /* ctor mat3x3<T : f32_f16>(mat3x3<T>) -> mat3x3<T> */
- /* ctor mat3x3<T : fa_f32_f16>(T, T, T, T, T, T, T, T, T) -> mat3x3<T> */
- /* ctor mat3x3<T : fa_f32_f16>(vec3<T>, vec3<T>, vec3<T>) -> mat3x3<T> */
- /* conv mat3x3<T : f16>(mat3x3<f32>) -> mat3x3<f16> */
- /* conv mat3x3<T : f32>(mat3x3<f16>) -> mat3x3<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(216),
- },
- {
- /* [13] */
- /* ctor mat3x4<T : f32_f16>() -> mat3x4<T> */
- /* ctor mat3x4<T : f32_f16>(mat3x4<T>) -> mat3x4<T> */
- /* ctor mat3x4<T : fa_f32_f16>(T, T, T, T, T, T, T, T, T, T, T, T) -> mat3x4<T> */
- /* ctor mat3x4<T : fa_f32_f16>(vec4<T>, vec4<T>, vec4<T>) -> mat3x4<T> */
- /* conv mat3x4<T : f16>(mat3x4<f32>) -> mat3x4<f16> */
- /* conv mat3x4<T : f32>(mat3x4<f16>) -> mat3x4<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(222),
- },
- {
- /* [14] */
- /* ctor mat4x2<T : f32_f16>() -> mat4x2<T> */
- /* ctor mat4x2<T : f32_f16>(mat4x2<T>) -> mat4x2<T> */
- /* ctor mat4x2<T : fa_f32_f16>(T, T, T, T, T, T, T, T) -> mat4x2<T> */
- /* ctor mat4x2<T : fa_f32_f16>(vec2<T>, vec2<T>, vec2<T>, vec2<T>) -> mat4x2<T> */
- /* conv mat4x2<T : f16>(mat4x2<f32>) -> mat4x2<f16> */
- /* conv mat4x2<T : f32>(mat4x2<f16>) -> mat4x2<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(228),
- },
- {
- /* [15] */
- /* ctor mat4x3<T : f32_f16>() -> mat4x3<T> */
- /* ctor mat4x3<T : f32_f16>(mat4x3<T>) -> mat4x3<T> */
- /* ctor mat4x3<T : fa_f32_f16>(T, T, T, T, T, T, T, T, T, T, T, T) -> mat4x3<T> */
- /* ctor mat4x3<T : fa_f32_f16>(vec3<T>, vec3<T>, vec3<T>, vec3<T>) -> mat4x3<T> */
- /* conv mat4x3<T : f16>(mat4x3<f32>) -> mat4x3<f16> */
- /* conv mat4x3<T : f32>(mat4x3<f16>) -> mat4x3<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(234),
- },
- {
- /* [16] */
- /* ctor mat4x4<T : f32_f16>() -> mat4x4<T> */
- /* ctor mat4x4<T : f32_f16>(mat4x4<T>) -> mat4x4<T> */
- /* ctor mat4x4<T : fa_f32_f16>(T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T) -> mat4x4<T> */
- /* ctor mat4x4<T : fa_f32_f16>(vec4<T>, vec4<T>, vec4<T>, vec4<T>) -> mat4x4<T> */
- /* conv mat4x4<T : f16>(mat4x4<f32>) -> mat4x4<f16> */
- /* conv mat4x4<T : f32>(mat4x4<f16>) -> mat4x4<f32> */
- /* num overloads */ 6,
- /* overloads */ OverloadIndex(240),
- },
- {
- /* [17] */
- /* conv packedVec3<T : concrete_scalar>(vec3<T>) -> packedVec3<T> */
- /* num overloads */ 1,
- /* overloads */ OverloadIndex(464),
- },
-};
-
-// clang-format on
-
-} // anonymous namespace
-
-const core::intrinsic::TableData kData{
- /* template_types */ kTemplateTypes,
- /* template_numbers */ kTemplateNumbers,
- /* type_matcher_indices */ kTypeMatcherIndices,
- /* number_matcher_indices */ kNumberMatcherIndices,
- /* type_matchers */ kTypeMatchers,
- /* number_matchers */ kNumberMatchers,
- /* parameters */ kParameters,
- /* overloads */ kOverloads,
- /* const_eval_functions */ kConstEvalFunctions,
- /* ctor_conv */ kConstructorsAndConverters,
- /* builtins */ kBuiltins,
- /* binary '+' */ kBinaryOperators[kBinaryOperatorPlus],
- /* binary '-' */ kBinaryOperators[kBinaryOperatorMinus],
- /* binary '*' */ kBinaryOperators[kBinaryOperatorStar],
- /* binary '/' */ kBinaryOperators[kBinaryOperatorDivide],
- /* binary '%' */ kBinaryOperators[kBinaryOperatorModulo],
- /* binary '^' */ kBinaryOperators[kBinaryOperatorXor],
- /* binary '&' */ kBinaryOperators[kBinaryOperatorAnd],
- /* binary '|' */ kBinaryOperators[kBinaryOperatorOr],
- /* binary '&&' */ kBinaryOperators[kBinaryOperatorLogicalAnd],
- /* binary '||' */ kBinaryOperators[kBinaryOperatorLogicalOr],
- /* binary '==' */ kBinaryOperators[kBinaryOperatorEqual],
- /* binary '!=' */ kBinaryOperators[kBinaryOperatorNotEqual],
- /* binary '<' */ kBinaryOperators[kBinaryOperatorLessThan],
- /* binary '>' */ kBinaryOperators[kBinaryOperatorGreaterThan],
- /* binary '<=' */ kBinaryOperators[kBinaryOperatorLessThanEqual],
- /* binary '>=' */ kBinaryOperators[kBinaryOperatorGreaterThanEqual],
- /* binary '<<' */ kBinaryOperators[kBinaryOperatorShiftLeft],
- /* binary '>>' */ kBinaryOperators[kBinaryOperatorShiftRight],
- /* unary '!' */ kUnaryOperators[kUnaryOperatorNot],
- /* unary '~' */ kUnaryOperators[kUnaryOperatorComplement],
- /* unary '-' */ kUnaryOperators[kUnaryOperatorMinus],
-};
-
-} // namespace tint::wgsl::intrinsic::data
diff --git a/src/tint/lang/wgsl/intrinsic/data/data.h b/src/tint/lang/wgsl/intrinsic/data/data.h
deleted file mode 100644
index 74faeb3..0000000
--- a/src/tint/lang/wgsl/intrinsic/data/data.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2023 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SRC_TINT_LANG_WGSL_INTRINSIC_DATA_DATA_H_
-#define SRC_TINT_LANG_WGSL_INTRINSIC_DATA_DATA_H_
-
-#include "src/tint/lang/core/intrinsic/table_data.h"
-
-namespace tint::wgsl::intrinsic::data {
-
-extern const core::intrinsic::TableData kData;
-
-} // namespace tint::wgsl::intrinsic::data
-
-#endif // SRC_TINT_LANG_WGSL_INTRINSIC_DATA_DATA_H_
diff --git a/src/tint/lang/wgsl/intrinsic/dialect.h b/src/tint/lang/wgsl/intrinsic/dialect.h
new file mode 100644
index 0000000..3a7a8ba
--- /dev/null
+++ b/src/tint/lang/wgsl/intrinsic/dialect.h
@@ -0,0 +1,46 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_TINT_LANG_WGSL_INTRINSIC_DIALECT_H_
+#define SRC_TINT_LANG_WGSL_INTRINSIC_DIALECT_H_
+
+#include "src/tint/lang/core/intrinsic/table_data.h"
+#include "src/tint/lang/wgsl/builtin_fn.h"
+#include "src/tint/lang/wgsl/intrinsic/ctor_conv.h"
+
+namespace tint::wgsl::intrinsic {
+
+/// Dialect holds the intrinsic table data and types for the WGSL dialect
+struct Dialect {
+ /// The dialect's intrinsic table data
+ static const core::intrinsic::TableData kData;
+
+ /// The dialect's builtin function enumerator
+ using BuiltinFn = wgsl::BuiltinFn;
+
+ /// The dialect's type constructor / convertor enumerator
+ using CtorConv = wgsl::intrinsic::CtorConv;
+
+ /// @returns the name of the builtin function @p fn
+ /// @param fn the builtin function
+ static std::string_view ToString(BuiltinFn fn) { return str(fn); }
+
+ /// @returns the name of the type constructor / convertor @p ty
+ /// @param ty the type constructor / convertor
+ static std::string_view ToString(CtorConv ty) { return str(ty); }
+};
+
+} // namespace tint::wgsl::intrinsic
+
+#endif // SRC_TINT_LANG_WGSL_INTRINSIC_DIALECT_H_
diff --git a/src/tint/lang/wgsl/ir/BUILD.bazel b/src/tint/lang/wgsl/ir/BUILD.bazel
index cc09dc5..3d275f9 100644
--- a/src/tint/lang/wgsl/ir/BUILD.bazel
+++ b/src/tint/lang/wgsl/ir/BUILD.bazel
@@ -39,7 +39,7 @@
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
"//src/tint/utils/ice",
diff --git a/src/tint/lang/wgsl/ir/BUILD.cmake b/src/tint/lang/wgsl/ir/BUILD.cmake
index 72ba88a..47523eb 100644
--- a/src/tint/lang/wgsl/ir/BUILD.cmake
+++ b/src/tint/lang/wgsl/ir/BUILD.cmake
@@ -38,7 +38,7 @@
tint_lang_core_ir
tint_lang_core_type
tint_lang_wgsl
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_utils_containers
tint_utils_diagnostic
tint_utils_ice
diff --git a/src/tint/lang/wgsl/ir/BUILD.gn b/src/tint/lang/wgsl/ir/BUILD.gn
index 7be98a4..f947343 100644
--- a/src/tint/lang/wgsl/ir/BUILD.gn
+++ b/src/tint/lang/wgsl/ir/BUILD.gn
@@ -38,7 +38,7 @@
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
"${tint_src_dir}/utils/ice",
diff --git a/src/tint/lang/wgsl/ir/builtin_call.cc b/src/tint/lang/wgsl/ir/builtin_call.cc
index 4511787..c3ba6ae 100644
--- a/src/tint/lang/wgsl/ir/builtin_call.cc
+++ b/src/tint/lang/wgsl/ir/builtin_call.cc
@@ -28,6 +28,7 @@
BuiltinFn fn,
VectorRef<core::ir::Value*> arguments)
: Base(result, arguments), fn_(fn) {
+ flags_.Add(Flag::kSequenced);
TINT_ASSERT(fn != BuiltinFn::kNone);
}
diff --git a/src/tint/lang/wgsl/ir/builtin_call.h b/src/tint/lang/wgsl/ir/builtin_call.h
index 6e1d413..5f68683 100644
--- a/src/tint/lang/wgsl/ir/builtin_call.h
+++ b/src/tint/lang/wgsl/ir/builtin_call.h
@@ -20,7 +20,7 @@
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/ir/builtin_call.h"
#include "src/tint/lang/wgsl/builtin_fn.h"
-#include "src/tint/lang/wgsl/intrinsic/data/data.h"
+#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/utils/rtti/castable.h"
namespace tint::wgsl::ir {
@@ -50,7 +50,7 @@
std::string FriendlyName() override { return std::string("wgsl.") + str(fn_); }
/// @returns the table data to validate this builtin
- const core::intrinsic::TableData& TableData() override { return intrinsic::data::kData; }
+ const core::intrinsic::TableData& TableData() override { return intrinsic::Dialect::kData; }
private:
BuiltinFn fn_;
diff --git a/src/tint/lang/wgsl/reader/lower/BUILD.bazel b/src/tint/lang/wgsl/reader/lower/BUILD.bazel
index 4ff3379..783f5ee 100644
--- a/src/tint/lang/wgsl/reader/lower/BUILD.bazel
+++ b/src/tint/lang/wgsl/reader/lower/BUILD.bazel
@@ -36,11 +36,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/ir",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
@@ -70,12 +69,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir/transform:test",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/ir",
"//src/tint/lang/wgsl/reader/lower",
"//src/tint/utils/containers",
diff --git a/src/tint/lang/wgsl/reader/lower/BUILD.cmake b/src/tint/lang/wgsl/reader/lower/BUILD.cmake
index 3bc145f..5685867 100644
--- a/src/tint/lang/wgsl/reader/lower/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/lower/BUILD.cmake
@@ -35,11 +35,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_wgsl
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_ir
tint_utils_containers
tint_utils_diagnostic
@@ -69,12 +68,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_transform_test
tint_lang_core_type
tint_lang_wgsl
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_ir
tint_lang_wgsl_reader_lower
tint_utils_containers
diff --git a/src/tint/lang/wgsl/reader/lower/BUILD.gn b/src/tint/lang/wgsl/reader/lower/BUILD.gn
index f9c38e3..674130d 100644
--- a/src/tint/lang/wgsl/reader/lower/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/lower/BUILD.gn
@@ -39,11 +39,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/ir",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
@@ -70,12 +69,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir/transform:unittests",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/ir",
"${tint_src_dir}/lang/wgsl/reader/lower",
"${tint_src_dir}/utils/containers",
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.bazel b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.bazel
index 9f6305d..e964d93 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.bazel
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.bazel
@@ -36,12 +36,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/ir",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/sem",
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
index 812feec..7cff404 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
@@ -35,12 +35,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_wgsl
tint_lang_wgsl_ast
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_ir
tint_lang_wgsl_program
tint_lang_wgsl_sem
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn
index 110350a..87f764b 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn
@@ -39,12 +39,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/ir",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/sem",
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
index 7115650..8160549 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir.cc
@@ -1428,7 +1428,9 @@
Impl b(program);
auto r = b.Build();
if (!r) {
- return r.Failure();
+ diag::List err = std::move(r.Failure().reason);
+ err.add_note(diag::System::IR, "AST:\n" + Program::printer(program), Source{});
+ return Failure{err};
}
return r.Move();
diff --git a/src/tint/lang/wgsl/resolver/BUILD.bazel b/src/tint/lang/wgsl/resolver/BUILD.bazel
index aebd08e..5e4635f 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.bazel
+++ b/src/tint/lang/wgsl/resolver/BUILD.bazel
@@ -46,10 +46,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/sem",
"//src/tint/utils/containers",
@@ -143,6 +143,7 @@
"//src/tint/lang/wgsl/ast",
"//src/tint/lang/wgsl/ast/transform",
"//src/tint/lang/wgsl/ast:test",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/reader",
"//src/tint/lang/wgsl/resolver",
diff --git a/src/tint/lang/wgsl/resolver/BUILD.cmake b/src/tint/lang/wgsl/resolver/BUILD.cmake
index e74ab6e..fd17863 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.cmake
+++ b/src/tint/lang/wgsl/resolver/BUILD.cmake
@@ -45,10 +45,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_type
tint_lang_wgsl
tint_lang_wgsl_ast
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_program
tint_lang_wgsl_sem
tint_utils_containers
@@ -142,6 +142,7 @@
tint_lang_wgsl_ast
tint_lang_wgsl_ast_transform
tint_lang_wgsl_ast_test
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_program
tint_lang_wgsl_reader
tint_lang_wgsl_resolver
diff --git a/src/tint/lang/wgsl/resolver/BUILD.gn b/src/tint/lang/wgsl/resolver/BUILD.gn
index 9fd29ec..c10075f 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.gn
+++ b/src/tint/lang/wgsl/resolver/BUILD.gn
@@ -49,10 +49,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/sem",
"${tint_src_dir}/utils/containers",
@@ -145,6 +145,7 @@
"${tint_src_dir}/lang/wgsl/ast",
"${tint_src_dir}/lang/wgsl/ast:unittests",
"${tint_src_dir}/lang/wgsl/ast/transform",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/reader",
"${tint_src_dir}/lang/wgsl/resolver",
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index e54460b..bf0e9b3 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -23,7 +23,6 @@
#include "src/tint/lang/core/builtin_type.h"
#include "src/tint/lang/core/constant/scalar.h"
#include "src/tint/lang/core/fluent_types.h"
-#include "src/tint/lang/core/intrinsic/data/data.h"
#include "src/tint/lang/core/type/abstract_float.h"
#include "src/tint/lang/core/type/abstract_int.h"
#include "src/tint/lang/core/type/array.h"
@@ -60,6 +59,8 @@
#include "src/tint/lang/wgsl/ast/variable_decl_statement.h"
#include "src/tint/lang/wgsl/ast/while_statement.h"
#include "src/tint/lang/wgsl/ast/workgroup_attribute.h"
+#include "src/tint/lang/wgsl/intrinsic/ctor_conv.h"
+#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/lang/wgsl/resolver/uniformity.h"
#include "src/tint/lang/wgsl/sem/break_if_statement.h"
#include "src/tint/lang/wgsl/sem/builtin_enum_expression.h"
@@ -104,7 +105,7 @@
namespace tint::resolver {
namespace {
-using CtorConvIntrinsic = core::intrinsic::CtorConv;
+using CtorConvIntrinsic = wgsl::intrinsic::CtorConv;
using OverloadFlag = core::intrinsic::OverloadFlag;
constexpr int64_t kMaxArrayElementCount = 65536;
@@ -117,8 +118,7 @@
: builder_(builder),
diagnostics_(builder->Diagnostics()),
const_eval_(builder->constants, diagnostics_),
- intrinsic_context_{core::intrinsic::data::kData, builder->Types(), builder->Symbols(),
- builder->Diagnostics()},
+ intrinsic_table_{builder->Types(), builder->Symbols(), builder->Diagnostics()},
sem_(builder),
validator_(builder,
sem_,
@@ -2083,8 +2083,7 @@
auto ctor_or_conv = [&](CtorConvIntrinsic ty,
const core::type::Type* template_arg) -> sem::Call* {
auto arg_tys = tint::Transform(args, [](auto* arg) { return arg->Type(); });
- auto match = core::intrinsic::Lookup(intrinsic_context_, ty, template_arg, arg_tys,
- args_stage, expr->source);
+ auto match = intrinsic_table_.Lookup(ty, template_arg, arg_tys, args_stage, expr->source);
if (!match) {
return nullptr;
}
@@ -2196,10 +2195,10 @@
TINT_ASSERT(v->Width() == 3u);
return ctor_or_conv(CtorConvIntrinsic::kPackedVec3, v->type());
}
- return ctor_or_conv(core::intrinsic::VectorCtorConv(v->Width()), v->type());
+ return ctor_or_conv(wgsl::intrinsic::VectorCtorConv(v->Width()), v->type());
},
[&](const core::type::Matrix* m) {
- return ctor_or_conv(core::intrinsic::MatrixCtorConv(m->columns(), m->rows()),
+ return ctor_or_conv(wgsl::intrinsic::MatrixCtorConv(m->columns(), m->rows()),
m->type());
},
[&](const core::type::Array* arr) -> sem::Call* {
@@ -2408,8 +2407,7 @@
}
auto arg_tys = tint::Transform(args, [](auto* arg) { return arg->Type(); });
- auto overload =
- core::intrinsic::Lookup(intrinsic_context_, fn, arg_tys, arg_stage, expr->source);
+ auto overload = intrinsic_table_.Lookup(fn, arg_tys, arg_stage, expr->source);
if (!overload) {
return nullptr;
}
@@ -3568,8 +3566,8 @@
}
auto stage = core::EarliestStage(lhs->Stage(), rhs->Stage());
- auto overload = core::intrinsic::Lookup(intrinsic_context_, expr->op, lhs->Type(), rhs->Type(),
- stage, expr->source, false);
+ auto overload =
+ intrinsic_table_.Lookup(expr->op, lhs->Type(), rhs->Type(), stage, expr->source, false);
if (!overload) {
return nullptr;
}
@@ -3690,8 +3688,7 @@
default: {
stage = expr->Stage();
- auto overload = core::intrinsic::Lookup(intrinsic_context_, unary->op, expr_ty, stage,
- unary->source);
+ auto overload = intrinsic_table_.Lookup(unary->op, expr_ty, stage, unary->source);
if (!overload) {
return nullptr;
}
@@ -4719,8 +4716,8 @@
auto stage = core::EarliestStage(lhs->Stage(), rhs->Stage());
auto overload =
- core::intrinsic::Lookup(intrinsic_context_, stmt->op, lhs->Type()->UnwrapRef(),
- rhs->Type()->UnwrapRef(), stage, stmt->source, true);
+ intrinsic_table_.Lookup(stmt->op, lhs->Type()->UnwrapRef(), rhs->Type()->UnwrapRef(),
+ stage, stmt->source, true);
if (!overload) {
return false;
}
diff --git a/src/tint/lang/wgsl/resolver/resolver.h b/src/tint/lang/wgsl/resolver/resolver.h
index 04c5243..3846d1a 100644
--- a/src/tint/lang/wgsl/resolver/resolver.h
+++ b/src/tint/lang/wgsl/resolver/resolver.h
@@ -27,6 +27,7 @@
#include "src/tint/lang/core/constant/eval.h"
#include "src/tint/lang/core/constant/value.h"
#include "src/tint/lang/core/intrinsic/table.h"
+#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/lang/wgsl/program/program_builder.h"
#include "src/tint/lang/wgsl/resolver/dependency_graph.h"
#include "src/tint/lang/wgsl/resolver/sem_helper.h"
@@ -612,7 +613,7 @@
ProgramBuilder* const builder_;
diag::List& diagnostics_;
core::constant::Eval const_eval_;
- core::intrinsic::Context intrinsic_context_;
+ core::intrinsic::Table<wgsl::intrinsic::Dialect> intrinsic_table_;
DependencyGraph dependencies_;
SemHelper sem_;
Validator validator_;
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.bazel b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.bazel
index c14817f..c67c82f 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.bazel
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.bazel
@@ -38,12 +38,11 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/ast",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/ir",
"//src/tint/lang/wgsl/program",
"//src/tint/lang/wgsl/resolver",
@@ -79,7 +78,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir:test",
"//src/tint/lang/core/type",
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
index d6e6e5f..1fa4481 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
@@ -37,12 +37,11 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_wgsl
tint_lang_wgsl_ast
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_ir
tint_lang_wgsl_program
tint_lang_wgsl_resolver
@@ -78,7 +77,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_test
tint_lang_core_type
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn
index d2b88ff..c823bb4 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn
@@ -41,12 +41,11 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/ast",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/ir",
"${tint_src_dir}/lang/wgsl/program",
"${tint_src_dir}/lang/wgsl/resolver",
@@ -81,7 +80,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir:unittests",
"${tint_src_dir}/lang/core/type",
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
index 09cd27e..faaacf4 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
+++ b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program.cc
@@ -201,6 +201,10 @@
auto ty = Type(param->Type());
auto name = NameFor(param);
Bind(param, name, PtrKind::kPtr);
+
+ if (ParamRequiresFullPtrParameters(param->Type())) {
+ Enable(wgsl::Extension::kChromiumExperimentalFullPtrParameters);
+ }
return b.Param(name, ty);
});
@@ -571,6 +575,12 @@
tint::Switch(
call, //
[&](core::ir::UserCall* c) {
+ for (auto* arg : call->Args()) {
+ if (ArgRequiresFullPtrParameters(arg)) {
+ Enable(wgsl::Extension::kChromiumExperimentalFullPtrParameters);
+ break;
+ }
+ }
auto* expr = b.Call(NameFor(c->Target()), std::move(args));
if (!call->HasResults() || call->Result()->Usages().IsEmpty()) {
Append(b.CallStmt(expr));
@@ -1160,6 +1170,44 @@
return false;
}
}
+
+ /// @returns true if a parameter of the type @p ty requires the
+ /// kChromiumExperimentalFullPtrParameters extension to be enabled.
+ bool ParamRequiresFullPtrParameters(const core::type::Type* ty) {
+ if (auto* ptr = ty->As<core::type::Pointer>()) {
+ switch (ptr->AddressSpace()) {
+ case core::AddressSpace::kUniform:
+ case core::AddressSpace::kStorage:
+ case core::AddressSpace::kWorkgroup:
+ return true;
+ default:
+ return false;
+ }
+ }
+ return false;
+ }
+
+ /// @returns true if the argument @p arg requires the kChromiumExperimentalFullPtrParameters
+ /// extension to be enabled.
+ bool ArgRequiresFullPtrParameters(core::ir::Value* arg) {
+ if (!arg->Type()->Is<core::type::Pointer>()) {
+ return false;
+ }
+
+ auto res = arg->As<core::ir::InstructionResult>();
+ while (res) {
+ auto* inst = res->Source();
+ if (inst->Is<core::ir::Access>()) {
+ return true; // Passing pointer into sub-object
+ }
+ if (auto* let = inst->As<core::ir::Let>()) {
+ res = let->Value()->As<core::ir::InstructionResult>();
+ } else {
+ break;
+ }
+ }
+ return false;
+ }
};
} // namespace
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
index 2071cf1..537c11a 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
+++ b/src/tint/lang/wgsl/writer/ir_to_program/ir_to_program_test.cc
@@ -3096,5 +3096,104 @@
)");
}
+////////////////////////////////////////////////////////////////////////////////
+// chromium_experimental_full_ptr_parameters
+////////////////////////////////////////////////////////////////////////////////
+TEST_F(IRToProgramTest, Enable_ChromiumExperimentalFullPtrParameters_StoragePtrParameter) {
+ auto* fn = b.Function("f", ty.void_());
+ fn->SetParams({b.FunctionParam("p", ty.ptr<storage, i32>())});
+
+ b.Append(fn->Block(), [&] { b.Return(fn); });
+
+ EXPECT_WGSL(R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn f(p : ptr<storage, i32, read_write>) {
+}
+)");
+}
+
+TEST_F(IRToProgramTest, Enable_ChromiumExperimentalFullPtrParameters_UniformPtrParameter) {
+ auto* fn = b.Function("f", ty.void_());
+ fn->SetParams({b.FunctionParam("p", ty.ptr<uniform, i32>())});
+
+ b.Append(fn->Block(), [&] { b.Return(fn); });
+
+ EXPECT_WGSL(R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn f(p : ptr<uniform, i32>) {
+}
+)");
+}
+
+TEST_F(IRToProgramTest, Enable_ChromiumExperimentalFullPtrParameters_WorkgroupPtrParameter) {
+ auto* fn = b.Function("f", ty.void_());
+ fn->SetParams({b.FunctionParam("p", ty.ptr<workgroup, i32>())});
+
+ b.Append(fn->Block(), [&] { b.Return(fn); });
+
+ EXPECT_WGSL(R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn f(p : ptr<workgroup, i32>) {
+}
+)");
+}
+
+TEST_F(IRToProgramTest, Enable_ChromiumExperimentalFullPtrParameters_SubObjectPtrArg) {
+ auto* x = b.Function("x", ty.void_());
+ x->SetParams({b.FunctionParam("p", ty.ptr<function, vec3<f32>>())});
+ b.Append(x->Block(), [&] { b.Return(x); });
+
+ auto* y = b.Function("y", ty.void_());
+ b.Append(y->Block(), [&] {
+ auto* m = b.Var<function, mat3x3<f32>>();
+ auto* v = b.Access(ty.ptr<function, vec3<f32>>(), m, 1_i);
+ b.Call(ty.void_(), x, v);
+ b.Return(y);
+ });
+
+ EXPECT_WGSL(R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn x(p : ptr<function, vec3<f32>>) {
+}
+
+fn y() {
+ var v : mat3x3<f32>;
+ x(&(v[1i]));
+}
+)");
+}
+
+TEST_F(IRToProgramTest, Enable_ChromiumExperimentalFullPtrParameters_SubObjectPtrArg_ViaLet) {
+ auto* x = b.Function("x", ty.void_());
+ x->SetParams({b.FunctionParam("p", ty.ptr<function, vec3<f32>>())});
+ b.Append(x->Block(), [&] { b.Return(x); });
+
+ auto* y = b.Function("y", ty.void_());
+ b.Append(y->Block(), [&] {
+ auto* m = b.Var<function, mat3x3<f32>>();
+ auto* v = b.Access(ty.ptr<function, vec3<f32>>(), m, 1_i);
+ auto* l = b.Let("l", v);
+ b.Call(ty.void_(), x, l);
+ b.Return(y);
+ });
+
+ EXPECT_WGSL(R"(
+enable chromium_experimental_full_ptr_parameters;
+
+fn x(p : ptr<function, vec3<f32>>) {
+}
+
+fn y() {
+ var v : mat3x3<f32>;
+ let l = &(v[1i]);
+ x(l);
+}
+)");
+}
+
} // namespace
} // namespace tint::wgsl::writer
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.bazel b/src/tint/lang/wgsl/writer/raise/BUILD.bazel
index d49adb4..90b5007 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.bazel
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.bazel
@@ -36,11 +36,10 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
- "//src/tint/lang/wgsl/intrinsic/data",
+ "//src/tint/lang/wgsl/intrinsic",
"//src/tint/lang/wgsl/ir",
"//src/tint/utils/containers",
"//src/tint/utils/diagnostic",
@@ -70,7 +69,6 @@
"//src/tint/lang/core",
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
- "//src/tint/lang/core/intrinsic/data",
"//src/tint/lang/core/ir",
"//src/tint/lang/core/ir/transform:test",
"//src/tint/lang/core/type",
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.cmake b/src/tint/lang/wgsl/writer/raise/BUILD.cmake
index fcbe110..61e716d 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.cmake
@@ -35,11 +35,10 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_type
tint_lang_wgsl
- tint_lang_wgsl_intrinsic_data
+ tint_lang_wgsl_intrinsic
tint_lang_wgsl_ir
tint_utils_containers
tint_utils_diagnostic
@@ -69,7 +68,6 @@
tint_lang_core
tint_lang_core_constant
tint_lang_core_intrinsic
- tint_lang_core_intrinsic_data
tint_lang_core_ir
tint_lang_core_ir_transform_test
tint_lang_core_type
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.gn b/src/tint/lang/wgsl/writer/raise/BUILD.gn
index 18ec5e1..7dc51e0 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.gn
@@ -39,11 +39,10 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
- "${tint_src_dir}/lang/wgsl/intrinsic/data",
+ "${tint_src_dir}/lang/wgsl/intrinsic",
"${tint_src_dir}/lang/wgsl/ir",
"${tint_src_dir}/utils/containers",
"${tint_src_dir}/utils/diagnostic",
@@ -70,7 +69,6 @@
"${tint_src_dir}/lang/core",
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
- "${tint_src_dir}/lang/core/intrinsic/data",
"${tint_src_dir}/lang/core/ir",
"${tint_src_dir}/lang/core/ir/transform:unittests",
"${tint_src_dir}/lang/core/type",
diff --git a/src/tint/lang/wgsl/writer/raise/raise.cc b/src/tint/lang/wgsl/writer/raise/raise.cc
index daacf36..5843d5f 100644
--- a/src/tint/lang/wgsl/writer/raise/raise.cc
+++ b/src/tint/lang/wgsl/writer/raise/raise.cc
@@ -21,7 +21,7 @@
#include "src/tint/lang/wgsl/builtin_fn.h"
#include "src/tint/lang/wgsl/ir/builtin_call.h"
-namespace tint::wgsl::writer::raise {
+namespace tint::wgsl::writer {
namespace {
wgsl::BuiltinFn Convert(core::BuiltinFn fn) {
@@ -166,4 +166,4 @@
return Success;
}
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::wgsl::writer
diff --git a/src/tint/lang/wgsl/writer/raise/raise.h b/src/tint/lang/wgsl/writer/raise/raise.h
index a5b1487..46a68b5 100644
--- a/src/tint/lang/wgsl/writer/raise/raise.h
+++ b/src/tint/lang/wgsl/writer/raise/raise.h
@@ -19,13 +19,13 @@
#include "src/tint/utils/diagnostic/diagnostic.h"
#include "src/tint/utils/result/result.h"
-namespace tint::wgsl::writer::raise {
+namespace tint::wgsl::writer {
/// Raise converts a core-dialect IR module to a WGSL-dialect IR module
/// @param mod the IR module
/// @return the result of the operation
Result<SuccessType> Raise(core::ir::Module& mod);
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::wgsl::writer
#endif // SRC_TINT_LANG_WGSL_WRITER_RAISE_RAISE_H_
diff --git a/src/tint/lang/wgsl/writer/writer.cc b/src/tint/lang/wgsl/writer/writer.cc
index 737f173..94bdbbd 100644
--- a/src/tint/lang/wgsl/writer/writer.cc
+++ b/src/tint/lang/wgsl/writer/writer.cc
@@ -56,7 +56,7 @@
Result<Output> WgslFromIR(core::ir::Module& module) {
// core-dialect -> WGSL-dialect
- if (auto res = raise::Raise(module); !res) {
+ if (auto res = Raise(module); !res) {
return res.Failure();
}
diff --git a/src/tint/utils/containers/vector.h b/src/tint/utils/containers/vector.h
index d2f2c69..8ba1677 100644
--- a/src/tint/utils/containers/vector.h
+++ b/src/tint/utils/containers/vector.h
@@ -365,6 +365,31 @@
}
}
+ /// Removes all the elements from the vector that match the predicate function.
+ /// @param predicate the predicate function with the signature `bool(const T&)`. This function
+ /// should return `true` for elements that should be removed from the vector.
+ template <typename PREDICATE>
+ void EraseIf(PREDICATE&& predicate) {
+ // Shuffle
+ size_t num_removed = 0;
+ for (size_t i = 0; i < impl_.slice.len; i++) {
+ auto& el = impl_.slice.data[i];
+ bool remove = predicate(const_cast<const T&>(el));
+ if (num_removed > 0) {
+ auto& dst = impl_.slice.data[i - num_removed];
+ dst = std::move(el);
+ }
+ if (remove) {
+ num_removed++;
+ }
+ }
+ // Pop
+ for (size_t i = 0; i < num_removed; i++) {
+ auto& el = impl_.slice.data[--impl_.slice.len];
+ el.~T();
+ }
+ }
+
/// Sort sorts the vector in-place using the predicate function @p pred
/// @param pred a function that has the signature `bool(const T& a, const T& b)` which returns
/// true if `a` is ordered before `b`.
@@ -374,8 +399,10 @@
}
/// Sort sorts the vector in-place using `T::operator<()`
- void Sort() {
+ /// @returns this vector so calls can be chained
+ Vector& Sort() {
Sort([](auto& a, auto& b) { return a < b; });
+ return *this;
}
/// Reverse reversed the vector in-place
diff --git a/src/tint/utils/containers/vector_test.cc b/src/tint/utils/containers/vector_test.cc
index ab8a3e2..b276564 100644
--- a/src/tint/utils/containers/vector_test.cc
+++ b/src/tint/utils/containers/vector_test.cc
@@ -238,6 +238,69 @@
EXPECT_EQ(vec[0], "one");
}
+TEST(TintVectorTest, EraseIf_Front) {
+ Vector<std::string, 3> vec;
+ vec.Push("one");
+ vec.Push("two");
+ vec.Push("three");
+ vec.Push("four");
+ EXPECT_EQ(vec.Length(), 4u);
+
+ vec.EraseIf([](const std::string& el) { return el == "one"; });
+ EXPECT_EQ(vec.Length(), 3u);
+ EXPECT_EQ(vec[0], "two");
+ EXPECT_EQ(vec[1], "three");
+ EXPECT_EQ(vec[2], "four");
+
+ vec.EraseIf([](const std::string& el) { return el == "two"; });
+ EXPECT_EQ(vec.Length(), 2u);
+ EXPECT_EQ(vec[0], "three");
+ EXPECT_EQ(vec[1], "four");
+
+ vec.EraseIf([](const std::string&) { return true; });
+ EXPECT_EQ(vec.Length(), 0u);
+}
+
+TEST(TintVectorTest, EraseIf_Mid) {
+ Vector<std::string, 5> vec;
+ vec.Push("one");
+ vec.Push("two");
+ vec.Push("three");
+ vec.Push("four");
+ vec.Push("five");
+ EXPECT_EQ(vec.Length(), 5u);
+
+ vec.EraseIf([](const std::string& el) { return el[0] == 't'; });
+ EXPECT_EQ(vec.Length(), 3u);
+ EXPECT_EQ(vec[0], "one");
+ EXPECT_EQ(vec[1], "four");
+ EXPECT_EQ(vec[2], "five");
+
+ vec.EraseIf([](const std::string& el) { return el == "four"; });
+ EXPECT_EQ(vec.Length(), 2u);
+ EXPECT_EQ(vec[0], "one");
+ EXPECT_EQ(vec[1], "five");
+}
+
+TEST(TintVectorTest, EraseIf_Back) {
+ Vector<std::string, 3> vec;
+ vec.Push("one");
+ vec.Push("two");
+ vec.Push("three");
+ vec.Push("four");
+ EXPECT_EQ(vec.Length(), 4u);
+
+ vec.EraseIf([](const std::string& el) { return el == "four"; });
+ EXPECT_EQ(vec.Length(), 3u);
+ EXPECT_EQ(vec[0], "one");
+ EXPECT_EQ(vec[1], "two");
+ EXPECT_EQ(vec[2], "three");
+
+ vec.EraseIf([](const std::string& el) { return el[0] == 't'; });
+ EXPECT_EQ(vec.Length(), 1u);
+ EXPECT_EQ(vec[0], "one");
+}
+
TEST(TintVectorTest, InferTN_1CString) {
auto vec = Vector{"one"};
static_assert(std::is_same_v<decltype(vec)::value_type, const char*>);