Import Tint changes from Dawn
Changes:
- 7981507e005036b20d2df0d6a76329c26d69ec0e spirv-reader: support OpSRem by David Neto <dneto@google.com>
- 0ceaaa56cbb08e5058212d2d3646c6ecb19ae04c Fix interpretation of depth operand in SPIR-V reader by Alan Baker <alanbaker@google.com>
- 1db4354069d19fbc44335d245fe6bd57341d2881 Metal: Support feature chromium_experimental_dp4a by Jiawei Shao <jiawei.shao@intel.com>
- 05d278e1676a5ec13bc8e0d31ce0f7e83abe512a Revert "Switch to C++20 for CMake builds" by dan sinclair <dsinclair@google.com>
- b0dfccdfc36f7ef237a9cbc20b186023a70b1a4b tint: workaround DXC bug with splatted vector constant te... by Antonio Maiorano <amaiorano@google.com>
- 9dffe91f6a4f715007a2e949dfca94eb02077479 tint_cmd: force DXC to use HLSL 2018 like Dawn by Antonio Maiorano <amaiorano@google.com>
- 3aea52329800f6f08a2c89576cbcfb524fd9205a [glsl-writer] Fix several bugs about storage image by Jiawei Shao <jiawei.shao@intel.com>
- 59269a20da89ad3a6d2af3f927584b1ab026650d Pass TextureBuiltinsFromUniformOptions. by Stephen White <senorblanco@chromium.org>
- 6f992507064eaacc9494ed4fc258f0f6223205ef spirv-reader: test multiple barrier emission when flags a... by David Neto <dneto@google.com>
- fb17bfd98bba75064b04590f7ca71e6e38f8d78e [eval] Make a TransformTernaryElements by dan sinclair <dsinclair@chromium.org>
- debd8ae995a0ee1128c7b9cca3a1f08a4586b157 [eval] Add a TransformUnaryElement method by dan sinclair <dsinclair@chromium.org>
- c858b7634b43995887a446c7aabaee2e590beff5 [eval] Make a un-templated TransformBinaryElement by dan sinclair <dsinclair@chromium.org>
- 7385fbf347f370f1ade238de12798226e33f43d1 [eval] Remove template param from TransformBinaryDifferin... by dan sinclair <dsinclair@chromium.org>
- 5bffb54609d7a9412a6d64219963af7ab8e8000f [eval] Rename method for clarity by dan sinclair <dsinclair@chromium.org>
- 269e6ba855d07c9e68b4435e50885b901e65026c [tint][resolver] Fix use after free, causing UA to be ign... by Ben Clayton <bclayton@google.com>
- aa6769f9ed1f9826f38cdd3bdc65afb603ba714a Switch to C++20 for CMake builds by James Price <jrprice@google.com>
- 182fb64432bdd064dd9b78b0c88cbe3882c4db0f Bump protobuf version by James Price <jrprice@google.com>
- 9bbad3481954273541e8b9ea29e4bc45c0fbe78d [fuzzers] Use is_standard_layout instead of is_pod by James Price <jrprice@google.com>
- f787019f872cf70a4b936b84a2281d245859c8cf [tint] Use INT64_MIN instead of -0x8000000000000000ll by James Price <jrprice@google.com>
- d104651513e8cd63022dea520b84b11d13fffd95 [tint] Use `auto` for enum class lambda parameter by James Price <jrprice@google.com>
- 4bb41e7de844decf056e8b6c856cad87fa72dfb4 [kokoro] Switch to Clang 13.0.1 by James Price <jrprice@google.com>
- 57ded6a946f51c25557b990ff7ba89223b2ee1f3 [tools][gen] Describe how to regenerate files in the header by Ben Clayton <bclayton@google.com>
- 30b420d5ed210cc014d69c8014853bbf9ab76650 [tint][build] Make <thread> an external library by Ben Clayton <bclayton@google.com>
- de3e87384a31e60c135b25b0642b8c90fbe274ea [tint][build] Move 'externals.json' to src/tint. by Ben Clayton <bclayton@google.com>
- e977f5405fe93b1c39148e732aafa21c81e58322 [tint][build] Make msl_metal.mm build for GN by Ben Clayton <bclayton@google.com>
GitOrigin-RevId: 7981507e005036b20d2df0d6a76329c26d69ec0e
Change-Id: I93bae831c0ca6ca57c3dcd072c55e0fab844f8c9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/148340
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/BUILD.cmake b/src/tint/BUILD.cmake
index 2199406..77ab7d4 100644
--- a/src/tint/BUILD.cmake
+++ b/src/tint/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(api/BUILD.cmake)
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index ea62726..51c6b92 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -109,6 +109,17 @@
}
}
+source_set("thread") {
+ # GN doesn't appear to need to depend on any thread libraries.
+}
+
+source_set("metal") {
+ frameworks = [
+ "Foundation.framework",
+ "Metal.framework",
+ ]
+}
+
config("tint_unittests_config") {
include_dirs = [
"${tint_googletest_dir}/googlemock/include",
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt
index ef4ce00..8e14741 100644
--- a/src/tint/CMakeLists.txt
+++ b/src/tint/CMakeLists.txt
@@ -16,12 +16,12 @@
# Target flags
################################################################################
if(NOT TINT_BUILD_AS_OTHER_OS)
- if(UNIX)
- set(IS_LINUX TRUE)
- set(IS_LINUX TRUE)
- elseif(APPLE)
+ if(APPLE) # Must come before UNIX
set(IS_MAC TRUE)
set(IS_MAC TRUE)
+ elseif(UNIX)
+ set(IS_LINUX TRUE)
+ set(IS_LINUX TRUE)
elseif(WIN32)
set(IS_WIN TRUE)
set(IS_WIN TRUE)
@@ -395,7 +395,7 @@
# KIND - The target kind
# DEPENDENCIES - a list of external target names
#
-# See tools/src/cmd/gen/build/externals.json for the list of external dependencies.
+# See src/tint/externals.json for the list of external dependencies.
function(tint_target_add_external_dependencies UNSUFFIXED_TARGET KIND)
set(DEPENDENCIES ${ARGN})
@@ -411,29 +411,11 @@
endif()
foreach(TARGET ${TARGETS})
- foreach(DEPENDENCY ${DEPENDENCIES})
- # Each external dependency requires special handling...
+ foreach(DEPENDENCY ${DEPENDENCIES}) # Each external dependency requires special handling...
if(${DEPENDENCY} STREQUAL "abseil")
target_link_libraries(${TARGET} PRIVATE
absl_strings
)
- elseif(${DEPENDENCY} STREQUAL "gtest")
- target_include_directories(${TARGET} PRIVATE ${gmock_SOURCE_DIR}/include)
- target_link_libraries(${TARGET} PRIVATE gmock)
- elseif(${DEPENDENCY} STREQUAL "spirv-headers")
- tint_spvheaders_compile_options(${TARGET})
- elseif(${DEPENDENCY} STREQUAL "spirv-tools")
- tint_spvtools_compile_options(${TARGET})
- elseif(${DEPENDENCY} STREQUAL "spirv-opt-internal")
- target_link_libraries(${TARGET} PRIVATE
- SPIRV-Tools-opt
- )
- target_include_directories(${TARGET} PRIVATE
- "${TINT_SPIRV_TOOLS_DIR}"
- "${TINT_SPIRV_TOOLS_DIR}/include"
- "${TINT_SPIRV_TOOLS_DIR}/source"
- "${spirv-tools_BINARY_DIR}"
- )
elseif(${DEPENDENCY} STREQUAL "glslang")
target_link_libraries(${TARGET} PRIVATE glslang)
if(NOT MSVC)
@@ -448,6 +430,30 @@
target_link_libraries(${TARGET} PRIVATE
glslang-default-resource-limits
)
+ elseif(${DEPENDENCY} STREQUAL "gtest")
+ target_include_directories(${TARGET} PRIVATE ${gmock_SOURCE_DIR}/include)
+ target_link_libraries(${TARGET} PRIVATE gmock)
+ elseif(${DEPENDENCY} STREQUAL "metal")
+ find_library(FoundationFramework Foundation REQUIRED)
+ find_library(MetalFramework Metal REQUIRED)
+ target_link_libraries(${TARGET} PRIVATE ${FoundationFramework} ${MetalFramework})
+ elseif(${DEPENDENCY} STREQUAL "spirv-headers")
+ tint_spvheaders_compile_options(${TARGET})
+ elseif(${DEPENDENCY} STREQUAL "spirv-tools")
+ tint_spvtools_compile_options(${TARGET})
+ elseif(${DEPENDENCY} STREQUAL "spirv-opt-internal")
+ target_link_libraries(${TARGET} PRIVATE
+ SPIRV-Tools-opt
+ )
+ target_include_directories(${TARGET} PRIVATE
+ "${TINT_SPIRV_TOOLS_DIR}"
+ "${TINT_SPIRV_TOOLS_DIR}/include"
+ "${TINT_SPIRV_TOOLS_DIR}/source"
+ "${spirv-tools_BINARY_DIR}"
+ )
+ elseif(${DEPENDENCY} STREQUAL "thread")
+ find_package(Threads REQUIRED)
+ target_link_libraries(${TARGET} PRIVATE Threads::Threads)
elseif(${DEPENDENCY} STREQUAL "winsock")
target_link_libraries(${TARGET} PRIVATE ws2_32)
else()
@@ -494,24 +500,6 @@
################################################################################
include("BUILD.cmake")
-find_package(Threads REQUIRED)
-target_link_libraries(tint_cmd_remote_compile_cmd PRIVATE Threads::Threads)
-
-# If we're building on mac / ios and we have CoreGraphics, then we can use the
-# metal API to validate our shaders. This is roughly 4x faster than invoking
-# the metal shader compiler executable.
-if(APPLE AND TINT_BUILD_MSL_WRITER)
- find_library(LIB_CORE_GRAPHICS CoreGraphics)
-
- if(LIB_CORE_GRAPHICS)
- target_sources("tint_lang_msl_validate" PRIVATE "lang/msl/validate/msl_metal.mm")
- target_compile_definitions("tint_cmd_remote_compile_cmd" PRIVATE "-DTINT_ENABLE_MSL_VALIDATION_USING_METAL_API=1")
- target_compile_definitions("tint_lang_msl_validate" PUBLIC "-DTINT_ENABLE_MSL_VALIDATION_USING_METAL_API=1")
- target_compile_options("tint_lang_msl_validate" PRIVATE "-fmodules" "-fcxx-modules")
- target_link_options("tint_lang_msl_validate" PUBLIC "-framework" "CoreGraphics")
- endif()
-endif()
-
################################################################################
# Additional fuzzer tests
################################################################################
diff --git a/src/tint/api/BUILD.cmake b/src/tint/api/BUILD.cmake
index 930df1d..0329dcd 100644
--- a/src/tint/api/BUILD.cmake
+++ b/src/tint/api/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(api/common/BUILD.cmake)
diff --git a/src/tint/api/BUILD.gn b/src/tint/api/BUILD.gn
index 55632ac..fa28e6f 100644
--- a/src/tint/api/BUILD.gn
+++ b/src/tint/api/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/api/common/BUILD.cmake b/src/tint/api/common/BUILD.cmake
index 4078b21..110ae6d 100644
--- a/src/tint/api/common/BUILD.cmake
+++ b/src/tint/api/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/api/common/BUILD.gn b/src/tint/api/common/BUILD.gn
index 4bc751d..d5701a0 100644
--- a/src/tint/api/common/BUILD.gn
+++ b/src/tint/api/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/api/options/BUILD.cmake b/src/tint/api/options/BUILD.cmake
index 8117549..bb857ab 100644
--- a/src/tint/api/options/BUILD.cmake
+++ b/src/tint/api/options/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/api/options/BUILD.gn b/src/tint/api/options/BUILD.gn
index 9608ec4..fa8c423 100644
--- a/src/tint/api/options/BUILD.gn
+++ b/src/tint/api/options/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/BUILD.cmake b/src/tint/cmd/BUILD.cmake
index cbad9b9..2315cbe 100644
--- a/src/tint/cmd/BUILD.cmake
+++ b/src/tint/cmd/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(cmd/bench/BUILD.cmake)
diff --git a/src/tint/cmd/BUILD.gn b/src/tint/cmd/BUILD.gn
index 67e46cc..a7e945f 100644
--- a/src/tint/cmd/BUILD.gn
+++ b/src/tint/cmd/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/bench/BUILD.cmake b/src/tint/cmd/bench/BUILD.cmake
index ce4e4ad..e6ec3dd 100644
--- a/src/tint/cmd/bench/BUILD.cmake
+++ b/src/tint/cmd/bench/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/bench/BUILD.gn b/src/tint/cmd/bench/BUILD.gn
index b5e4ee9..484acf7 100644
--- a/src/tint/cmd/bench/BUILD.gn
+++ b/src/tint/cmd/bench/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/common/BUILD.cmake b/src/tint/cmd/common/BUILD.cmake
index 0d6d15f..01f44f5 100644
--- a/src/tint/cmd/common/BUILD.cmake
+++ b/src/tint/cmd/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/common/BUILD.gn b/src/tint/cmd/common/BUILD.gn
index 927b10d..2b10c18 100644
--- a/src/tint/cmd/common/BUILD.gn
+++ b/src/tint/cmd/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/info/BUILD.cmake b/src/tint/cmd/info/BUILD.cmake
index b90b31e..10870a1 100644
--- a/src/tint/cmd/info/BUILD.cmake
+++ b/src/tint/cmd/info/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/info/BUILD.gn b/src/tint/cmd/info/BUILD.gn
index ab691e1..c049a44 100644
--- a/src/tint/cmd/info/BUILD.gn
+++ b/src/tint/cmd/info/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/loopy/BUILD.cmake b/src/tint/cmd/loopy/BUILD.cmake
index 44d355e..20e11d3 100644
--- a/src/tint/cmd/loopy/BUILD.cmake
+++ b/src/tint/cmd/loopy/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/loopy/BUILD.gn b/src/tint/cmd/loopy/BUILD.gn
index edceb88..844d0b8 100644
--- a/src/tint/cmd/loopy/BUILD.gn
+++ b/src/tint/cmd/loopy/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/remote_compile/BUILD.cmake b/src/tint/cmd/remote_compile/BUILD.cmake
index a92b5bd..1a71579 100644
--- a/src/tint/cmd/remote_compile/BUILD.cmake
+++ b/src/tint/cmd/remote_compile/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
@@ -36,6 +37,10 @@
tint_utils_traits
)
+tint_target_add_external_dependencies(tint_cmd_remote_compile_cmd cmd
+ "thread"
+)
+
if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_remote_compile_cmd cmd
tint_lang_msl_validate
diff --git a/src/tint/cmd/remote_compile/BUILD.gn b/src/tint/cmd/remote_compile/BUILD.gn
index 033196a..6d5be7d 100644
--- a/src/tint/cmd/remote_compile/BUILD.gn
+++ b/src/tint/cmd/remote_compile/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
@@ -28,6 +29,7 @@
output_name = "tint_remote_compile"
sources = [ "main.cc" ]
deps = [
+ "${tint_src_dir}:thread",
"${tint_src_dir}/lang/wgsl/ast",
"${tint_src_dir}/utils/macros",
"${tint_src_dir}/utils/socket",
diff --git a/src/tint/cmd/remote_compile/main.cc b/src/tint/cmd/remote_compile/main.cc
index a13870e..12f5fdb 100644
--- a/src/tint/cmd/remote_compile/main.cc
+++ b/src/tint/cmd/remote_compile/main.cc
@@ -421,7 +421,7 @@
DEBUG("%s\n", stream.error.c_str());
return;
}
-#ifdef TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+#ifdef __APPLE__
if (req.language == SourceLanguage::MSL) {
auto version = tint::msl::validate::MslVersion::kMsl_1_2;
if (req.version_major == 2 && req.version_minor == 1) {
diff --git a/src/tint/cmd/test/BUILD.cmake b/src/tint/cmd/test/BUILD.cmake
index c25a473..4bde5e7 100644
--- a/src/tint/cmd/test/BUILD.cmake
+++ b/src/tint/cmd/test/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/test/BUILD.gn b/src/tint/cmd/test/BUILD.gn
index b0e3a2b..96240b3 100644
--- a/src/tint/cmd/test/BUILD.gn
+++ b/src/tint/cmd/test/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/tint/BUILD.cmake b/src/tint/cmd/tint/BUILD.cmake
index 0b32104..d50b976 100644
--- a/src/tint/cmd/tint/BUILD.cmake
+++ b/src/tint/cmd/tint/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/cmd/tint/BUILD.gn b/src/tint/cmd/tint/BUILD.gn
index 39f43f1..75726ae 100644
--- a/src/tint/cmd/tint/BUILD.gn
+++ b/src/tint/cmd/tint/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index 57f2662..8c7d05d 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -697,7 +697,7 @@
if (options.validate && options.skip_hash.count(hash) == 0) {
tint::msl::validate::Result res;
-#ifdef TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+#ifdef __APPLE__
res = tint::msl::validate::UsingMetalAPI(result->msl, msl_version);
#else
#ifdef _WIN32
@@ -713,7 +713,7 @@
res.output = "xcrun executable not found. Cannot validate.";
res.failed = true;
}
-#endif // TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+#endif // __APPLE__
if (res.failed) {
std::cerr << res.output << std::endl;
return false;
@@ -883,6 +883,10 @@
gen_options.disable_robustness = !options.enable_robustness;
gen_options.external_texture_options.bindings_map =
tint::cmd::GenerateExternalTextureBindings(prg);
+ tint::TextureBuiltinsFromUniformOptions textureBuiltinsFromUniform;
+ constexpr uint32_t kMaxBindGroups = 4u;
+ textureBuiltinsFromUniform.ubo_binding = {kMaxBindGroups, 0u};
+ gen_options.texture_builtins_from_uniform = std::move(textureBuiltinsFromUniform);
auto result = tint::glsl::writer::Generate(prg, gen_options, entry_point_name);
if (!result) {
tint::cmd::PrintWGSL(std::cerr, *prg);
diff --git a/src/tint/externals.json b/src/tint/externals.json
new file mode 100644
index 0000000..649a650
--- /dev/null
+++ b/src/tint/externals.json
@@ -0,0 +1,64 @@
+/*
+ * This file is used by `./tools/run gen build` to map include paths to external projects.
+ * See docs/tint/gen.md for more information.
+ */
+{
+ "abseil": {
+ "IncludePatterns": [
+ "absl/**"
+ ],
+ },
+ "metal": {
+ "IncludePatterns": [
+ "Metal/Metal.h"
+ ],
+ "Condition": "is_mac",
+ },
+ "thread": {
+ "IncludePatterns": [
+ "thread"
+ ],
+ },
+ "spirv-tools": {
+ "IncludePatterns": [
+ "spirv-tools/**"
+ ],
+ "Condition": "tint_build_spv_reader || tint_build_spv_writer",
+ },
+ "spirv-headers": {
+ "IncludePatterns": [
+ "spirv/**"
+ ],
+ "Condition": "tint_build_spv_reader || tint_build_spv_writer",
+ },
+ "spirv-opt-internal": {
+ "IncludePatterns": [
+ "source/opt/**"
+ ],
+ "Condition": "tint_build_spv_reader || tint_build_spv_writer",
+ },
+ "glslang": {
+ "IncludePatterns": [
+ "glslang/Public/ShaderLang.h"
+ ],
+ "Condition": "tint_build_glsl_writer",
+ },
+ "glslang-res-limits": {
+ "IncludePatterns": [
+ "glslang/Public/ResourceLimits.h"
+ ],
+ "Condition": "tint_build_glsl_writer",
+ },
+ "gtest": {
+ "IncludePatterns": [
+ "gtest/**",
+ "gmock/**",
+ ],
+ },
+ "winsock": {
+ "IncludePatterns": [
+ "winsock2.h"
+ ],
+ "Condition": "is_win",
+ },
+}
diff --git a/src/tint/fuzzers/data_builder.h b/src/tint/fuzzers/data_builder.h
index d9e8e18..1600a98 100644
--- a/src/tint/fuzzers/data_builder.h
+++ b/src/tint/fuzzers/data_builder.h
@@ -129,7 +129,7 @@
T out{};
if constexpr (tint::HasReflection<T>) {
ForeachField(out, [&](auto& field) { b->build(field); });
- } else if constexpr (std::is_pod_v<T>) {
+ } else if constexpr (std::is_standard_layout_v<T>) {
b->build(&out, sizeof(T));
} else {
static_assert(sizeof(T) == 0, "cannot build type");
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/CMakeLists.txt b/src/tint/fuzzers/tint_ast_fuzzer/CMakeLists.txt
index 8d22901..1cb440a 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/CMakeLists.txt
+++ b/src/tint/fuzzers/tint_ast_fuzzer/CMakeLists.txt
@@ -22,6 +22,12 @@
endif()
target_compile_definitions(${NAME} PRIVATE CUSTOM_MUTATOR)
target_include_directories(${NAME} PRIVATE ${CMAKE_BINARY_DIR})
+ target_compile_options(${NAME} PRIVATE
+ -Wno-conditional-uninitialized
+ -Wno-covered-switch-default
+ -Wno-shadow-field-in-constructor
+ -Wno-shorten-64-to-32
+ -Wno-undef)
endfunction()
set(PROTOBUF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/protobufs/tint_ast_fuzzer.proto)
@@ -93,6 +99,12 @@
target_link_libraries(libtint_ast_fuzzer protobuf::libprotobuf libtint)
tint_default_compile_options(libtint_ast_fuzzer)
target_include_directories(libtint_ast_fuzzer PRIVATE ${CMAKE_BINARY_DIR})
+target_compile_options(libtint_ast_fuzzer PRIVATE
+ -Wno-conditional-uninitialized
+ -Wno-covered-switch-default
+ -Wno-shadow-field-in-constructor
+ -Wno-shorten-64-to-32
+ -Wno-undef)
set(AST_FUZZER_SOURCES
cli.cc
@@ -135,7 +147,11 @@
target_compile_options(tint_ast_fuzzer_unittests PRIVATE
-Wno-global-constructors
-Wno-weak-vtables
- -Wno-covered-switch-default)
+ -Wno-conditional-uninitialized
+ -Wno-covered-switch-default
+ -Wno-shadow-field-in-constructor
+ -Wno-shorten-64-to-32
+ -Wno-undef)
target_include_directories(tint_ast_fuzzer_unittests PRIVATE ${CMAKE_BINARY_DIR})
diff --git a/src/tint/fuzzers/tint_spirv_tools_fuzzer/CMakeLists.txt b/src/tint/fuzzers/tint_spirv_tools_fuzzer/CMakeLists.txt
index 28bb473..0e2f98f 100644
--- a/src/tint/fuzzers/tint_spirv_tools_fuzzer/CMakeLists.txt
+++ b/src/tint/fuzzers/tint_spirv_tools_fuzzer/CMakeLists.txt
@@ -54,6 +54,8 @@
)
tint_default_compile_options(${NAME})
target_compile_options(${NAME} PRIVATE
+ -Wno-conditional-uninitialized
+ -Wno-covered-switch-default
-Wno-missing-prototypes
-Wno-zero-as-null-pointer-constant
-Wno-reserved-id-macro
diff --git a/src/tint/lang/BUILD.cmake b/src/tint/lang/BUILD.cmake
index 63e16fb..d9dca4a 100644
--- a/src/tint/lang/BUILD.cmake
+++ b/src/tint/lang/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/core/BUILD.cmake)
diff --git a/src/tint/lang/BUILD.gn b/src/tint/lang/BUILD.gn
index 67e46cc..a7e945f 100644
--- a/src/tint/lang/BUILD.gn
+++ b/src/tint/lang/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/BUILD.cmake b/src/tint/lang/core/BUILD.cmake
index 734da34..6be18a3 100644
--- a/src/tint/lang/core/BUILD.cmake
+++ b/src/tint/lang/core/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/core/constant/BUILD.cmake)
diff --git a/src/tint/lang/core/BUILD.gn b/src/tint/lang/core/BUILD.gn
index fd44935..d7f838f 100644
--- a/src/tint/lang/core/BUILD.gn
+++ b/src/tint/lang/core/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/access.cc b/src/tint/lang/core/access.cc
index 866a40e..ed9aa50 100644
--- a/src/tint/lang/core/access.cc
+++ b/src/tint/lang/core/access.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/access.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/access.h"
diff --git a/src/tint/lang/core/access.h b/src/tint/lang/core/access.h
index de90083..c60dd32 100644
--- a/src/tint/lang/core/access.h
+++ b/src/tint/lang/core/access.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/access.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_ACCESS_H_
diff --git a/src/tint/lang/core/access_bench.cc b/src/tint/lang/core/access_bench.cc
index 9438ec3..5374d01 100644
--- a/src/tint/lang/core/access_bench.cc
+++ b/src/tint/lang/core/access_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/access_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/access.h"
diff --git a/src/tint/lang/core/access_test.cc b/src/tint/lang/core/access_test.cc
index b4552c8..1dcbf25 100644
--- a/src/tint/lang/core/access_test.cc
+++ b/src/tint/lang/core/access_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/access_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/access.h"
diff --git a/src/tint/lang/core/address_space.cc b/src/tint/lang/core/address_space.cc
index 4f4aaa1..efc87a6 100644
--- a/src/tint/lang/core/address_space.cc
+++ b/src/tint/lang/core/address_space.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/address_space.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/address_space.h"
diff --git a/src/tint/lang/core/address_space.h b/src/tint/lang/core/address_space.h
index 3ac09bf..d88857f 100644
--- a/src/tint/lang/core/address_space.h
+++ b/src/tint/lang/core/address_space.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/address_space.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_ADDRESS_SPACE_H_
diff --git a/src/tint/lang/core/address_space_bench.cc b/src/tint/lang/core/address_space_bench.cc
index 252089c..b2933d6 100644
--- a/src/tint/lang/core/address_space_bench.cc
+++ b/src/tint/lang/core/address_space_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/address_space_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/address_space.h"
diff --git a/src/tint/lang/core/address_space_test.cc b/src/tint/lang/core/address_space_test.cc
index 69fea4d..fa78e4c 100644
--- a/src/tint/lang/core/address_space_test.cc
+++ b/src/tint/lang/core/address_space_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/address_space_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/address_space.h"
diff --git a/src/tint/lang/core/attribute.cc b/src/tint/lang/core/attribute.cc
index c4636ae..5fa8977 100644
--- a/src/tint/lang/core/attribute.cc
+++ b/src/tint/lang/core/attribute.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/attribute.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/attribute.h"
diff --git a/src/tint/lang/core/attribute.h b/src/tint/lang/core/attribute.h
index 925f00f..2d11546 100644
--- a/src/tint/lang/core/attribute.h
+++ b/src/tint/lang/core/attribute.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/attribute.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_ATTRIBUTE_H_
diff --git a/src/tint/lang/core/attribute_bench.cc b/src/tint/lang/core/attribute_bench.cc
index 6cd6945..ee0e693 100644
--- a/src/tint/lang/core/attribute_bench.cc
+++ b/src/tint/lang/core/attribute_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/attribute_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/attribute.h"
diff --git a/src/tint/lang/core/attribute_test.cc b/src/tint/lang/core/attribute_test.cc
index 7cd8b79..bae3463 100644
--- a/src/tint/lang/core/attribute_test.cc
+++ b/src/tint/lang/core/attribute_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/attribute_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/attribute.h"
diff --git a/src/tint/lang/core/builtin.cc b/src/tint/lang/core/builtin.cc
index 36a29fc..073b70d 100644
--- a/src/tint/lang/core/builtin.cc
+++ b/src/tint/lang/core/builtin.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin.h"
diff --git a/src/tint/lang/core/builtin.h b/src/tint/lang/core/builtin.h
index 04a033f..eed8ff7 100644
--- a/src/tint/lang/core/builtin.h
+++ b/src/tint/lang/core/builtin.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_BUILTIN_H_
diff --git a/src/tint/lang/core/builtin_bench.cc b/src/tint/lang/core/builtin_bench.cc
index e872c43..d9eaccc 100644
--- a/src/tint/lang/core/builtin_bench.cc
+++ b/src/tint/lang/core/builtin_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin.h"
diff --git a/src/tint/lang/core/builtin_test.cc b/src/tint/lang/core/builtin_test.cc
index 3852d40..61a2187 100644
--- a/src/tint/lang/core/builtin_test.cc
+++ b/src/tint/lang/core/builtin_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin.h"
diff --git a/src/tint/lang/core/builtin_value.cc b/src/tint/lang/core/builtin_value.cc
index 8f7d04b..3a95999 100644
--- a/src/tint/lang/core/builtin_value.cc
+++ b/src/tint/lang/core/builtin_value.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_value.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin_value.h"
diff --git a/src/tint/lang/core/builtin_value.h b/src/tint/lang/core/builtin_value.h
index 8925bcd..ff943cf 100644
--- a/src/tint/lang/core/builtin_value.h
+++ b/src/tint/lang/core/builtin_value.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_value.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_BUILTIN_VALUE_H_
diff --git a/src/tint/lang/core/builtin_value_bench.cc b/src/tint/lang/core/builtin_value_bench.cc
index 50f6ba7..17e1aeb 100644
--- a/src/tint/lang/core/builtin_value_bench.cc
+++ b/src/tint/lang/core/builtin_value_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_value_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin_value.h"
diff --git a/src/tint/lang/core/builtin_value_test.cc b/src/tint/lang/core/builtin_value_test.cc
index ea2fc5f..06fc061 100644
--- a/src/tint/lang/core/builtin_value_test.cc
+++ b/src/tint/lang/core/builtin_value_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/builtin_value_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/builtin_value.h"
diff --git a/src/tint/lang/core/constant/BUILD.cmake b/src/tint/lang/core/constant/BUILD.cmake
index efc090b..c8a657a 100644
--- a/src/tint/lang/core/constant/BUILD.cmake
+++ b/src/tint/lang/core/constant/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/core/constant/BUILD.gn b/src/tint/lang/core/constant/BUILD.gn
index d468518..cbb4a13 100644
--- a/src/tint/lang/core/constant/BUILD.gn
+++ b/src/tint/lang/core/constant/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/constant/eval.cc b/src/tint/lang/core/constant/eval.cc
index 44b24e1..4c58f59 100644
--- a/src/tint/lang/core/constant/eval.cc
+++ b/src/tint/lang/core/constant/eval.cc
@@ -462,23 +462,22 @@
return value_stack.Pop();
}
-namespace detail {
-/// Implementation of TransformElements
+/// TransformElements constructs a new constant of type `composite_ty` by applying the
+/// transformation function `f` on each of the most deeply nested elements of 'cs'. Assumes that all
+/// input constants `cs` are of the same arity (all scalars or all vectors of the same size).
+/// If `f`'s last argument is a `size_t`, then the index of the most deeply nested element inside
+/// the most deeply nested aggregate type will be passed in.
template <typename F, typename... CONSTANTS>
-Eval::Result TransformElements(Manager& mgr,
- const core::type::Type* composite_ty,
- F&& f,
- size_t index,
- CONSTANTS&&... cs) {
+tint::traits::EnableIf<tint::traits::IsType<size_t, tint::traits::LastParameterType<F>>,
+ Eval::Result>
+TransformElements(Manager& mgr,
+ const core::type::Type* composite_ty,
+ const F& f,
+ size_t index,
+ CONSTANTS&&... cs) {
auto [el_ty, n] = First(cs...)->Type()->Elements();
if (!el_ty) {
- constexpr bool kHasIndexParam =
- tint::traits::IsType<size_t, tint::traits::LastParameterType<F>>;
- if constexpr (kHasIndexParam) {
- return f(cs..., index);
- } else {
- return f(cs...);
- }
+ return f(cs..., index);
}
auto* composite_el_ty = composite_ty->Elements(composite_ty).type;
@@ -486,8 +485,7 @@
Vector<const Value*, 8> els;
els.Reserve(n);
for (uint32_t i = 0; i < n; i++) {
- if (auto el = detail::TransformElements(mgr, composite_el_ty, std::forward<F>(f), index + i,
- cs->Index(i)...)) {
+ if (auto el = TransformElements(mgr, composite_el_ty, f, index + i, cs->Index(i)...)) {
els.Push(el.Get());
} else {
@@ -496,31 +494,78 @@
}
return mgr.Composite(composite_ty, std::move(els));
}
-} // namespace detail
-/// TransformElements constructs a new constant of type `composite_ty` by applying the
-/// transformation function `f` on each of the most deeply nested elements of 'cs'. Assumes that all
-/// input constants `cs` are of the same arity (all scalars or all vectors of the same size).
-/// If `f`'s last argument is a `size_t`, then the index of the most deeply nested element inside
-/// the most deeply nested aggregate type will be passed in.
-template <typename F, typename... CONSTANTS>
-Eval::Result TransformElements(Manager& mgr,
- const core::type::Type* composite_ty,
- F&& f,
- CONSTANTS&&... cs) {
- return detail::TransformElements(mgr, composite_ty, f, 0, cs...);
+/// Signature of a unary transformation callback
+using UnaryTransform = std::function<Eval::Result(const Value*)>;
+
+/// TransformUnaryElements constructs a new constant of type `composite_ty` by applying the
+/// transformation function 'f' on each of the most deeply nested elements of `c0`.
+Eval::Result TransformUnaryElements(Manager& mgr,
+ const core::type::Type* composite_ty,
+ const UnaryTransform& f,
+ const Value* c0) {
+ auto [el_ty, n] = c0->Type()->Elements();
+ if (!el_ty) {
+ return f(c0);
+ }
+
+ auto* composite_el_ty = composite_ty->Elements(composite_ty).type;
+
+ Vector<const Value*, 8> els;
+ els.Reserve(n);
+ for (uint32_t i = 0; i < n; i++) {
+ if (auto el = TransformUnaryElements(mgr, composite_el_ty, f, c0->Index(i))) {
+ els.Push(el.Get());
+
+ } else {
+ return el.Failure();
+ }
+ }
+ return mgr.Composite(composite_ty, std::move(els));
}
+/// Signature of a binary transformation callback.
+using BinaryTransform = std::function<Eval::Result(const Value*, const Value*)>;
+
/// TransformBinaryElements constructs a new constant of type `composite_ty` by applying the
/// transformation function 'f' on each of the most deeply nested elements of both `c0` and `c1`.
-/// Unlike TransformElements, this function handles the constants being of different arity, e.g.
-/// vector-scalar, scalar-vector.
-template <typename F>
Eval::Result TransformBinaryElements(Manager& mgr,
const core::type::Type* composite_ty,
- F&& f,
+ const BinaryTransform& f,
const Value* c0,
const Value* c1) {
+ auto [el_ty, n] = c0->Type()->Elements();
+ if (!el_ty) {
+ return f(c0, c1);
+ }
+
+ TINT_ASSERT(n == c1->Type()->Elements().count);
+
+ auto* composite_el_ty = composite_ty->Elements(composite_ty).type;
+
+ Vector<const Value*, 8> els;
+ els.Reserve(n);
+ for (uint32_t i = 0; i < n; i++) {
+ if (auto el =
+ TransformBinaryElements(mgr, composite_el_ty, f, c0->Index(i), c1->Index(i))) {
+ els.Push(el.Get());
+
+ } else {
+ return el.Failure();
+ }
+ }
+ return mgr.Composite(composite_ty, std::move(els));
+}
+
+/// TransformBinaryDifferingArityElements constructs a new constant of type `composite_ty` by
+/// applying the transformation function 'f' on each of the most deeply nested elements of both `c0`
+/// and `c1`. Unlike TransformElements, this function handles the constants being of different
+/// arity, e.g. vector-scalar, scalar-vector.
+Eval::Result TransformBinaryDifferingArityElements(Manager& mgr,
+ const core::type::Type* composite_ty,
+ const BinaryTransform& f,
+ const Value* c0,
+ const Value* c1) {
uint32_t n0 = c0->Type()->Elements(nullptr, 1).count;
uint32_t n1 = c1->Type()->Elements(nullptr, 1).count;
uint32_t max_n = std::max(n0, n1);
@@ -535,13 +580,10 @@
els.Reserve(max_n);
for (uint32_t i = 0; i < max_n; i++) {
auto nested_or_self = [&](auto* c, uint32_t num_elems) {
- if (num_elems == 1) {
- return c;
- }
- return c->Index(i);
+ return (num_elems == 1) ? c : c->Index(i);
};
- if (auto el = TransformBinaryElements(mgr, element_ty, std::forward<F>(f),
- nested_or_self(c0, n0), nested_or_self(c1, n1))) {
+ if (auto el = TransformBinaryDifferingArityElements(
+ mgr, element_ty, f, nested_or_self(c0, n0), nested_or_self(c1, n1))) {
els.Push(el.Get());
} else {
return el.Failure();
@@ -549,6 +591,39 @@
}
return mgr.Composite(composite_ty, std::move(els));
}
+
+/// Signature of a ternary transformation callback
+using TernaryTransform = std::function<Eval::Result(const Value*, const Value*, const Value*)>;
+
+/// TransformTernaryElements constructs a new constant of type `composite_ty` by applying the
+/// transformation function 'f' on each of the most deeply nested elements of both `c0`, `c1`, and
+/// `c2`.
+Eval::Result TransformTernaryElements(Manager& mgr,
+ const core::type::Type* composite_ty,
+ const TernaryTransform& f,
+ const Value* c0,
+ const Value* c1,
+ const Value* c2) {
+ auto [el_ty, n] = c0->Type()->Elements();
+ if (!el_ty) {
+ return f(c0, c1, c2);
+ }
+
+ auto* composite_el_ty = composite_ty->Elements(composite_ty).type;
+
+ Vector<const Value*, 8> els;
+ els.Reserve(n);
+ for (uint32_t i = 0; i < n; i++) {
+ if (auto el = TransformTernaryElements(mgr, composite_el_ty, f, c0->Index(i), c1->Index(i),
+ c2->Index(i))) {
+ els.Push(el.Get());
+
+ } else {
+ return el.Failure();
+ }
+ }
+ return mgr.Composite(composite_ty, std::move(els));
+}
} // namespace
Eval::Eval(Manager& manager, diag::List& diagnostics, bool use_runtime_semantics /* = false */)
@@ -1204,7 +1279,7 @@
auto transform = [&](const Value* c0, const Value* c1) {
return Dispatch_fia_fiu32_f16(MulFunc(source, c0->Type()), c0, c1);
};
- return TransformBinaryElements(mgr, ty, transform, v1, v2);
+ return TransformBinaryDifferingArityElements(mgr, ty, transform, v1, v2);
}
Eval::Result Eval::Sub(const Source& source,
@@ -1214,7 +1289,7 @@
auto transform = [&](const Value* c0, const Value* c1) {
return Dispatch_fia_fiu32_f16(SubFunc(source, c0->Type()), c0, c1);
};
- return TransformBinaryElements(mgr, ty, transform, v1, v2);
+ return TransformBinaryDifferingArityElements(mgr, ty, transform, v1, v2);
}
auto Eval::Det2Func(const Source& source, const core::type::Type* elem_ty) {
@@ -1510,7 +1585,7 @@
};
return Dispatch_ia_iu32(create, c);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::UnaryMinus(const core::type::Type* ty,
@@ -1535,7 +1610,7 @@
};
return Dispatch_fia_fi32_f16(create, c);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::Not(const core::type::Type* ty,
@@ -1545,7 +1620,7 @@
auto create = [&](auto i) { return CreateScalar(source, c->Type(), decltype(i)(!i)); };
return Dispatch_bool(create, c);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::Plus(const core::type::Type* ty,
@@ -1555,7 +1630,7 @@
return Dispatch_fia_fiu32_f16(AddFunc(source, c0->Type()), c0, c1);
};
- return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryDifferingArityElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::Minus(const core::type::Type* ty,
@@ -1742,7 +1817,7 @@
return Dispatch_fia_fiu32_f16(DivFunc(source, c0->Type()), c0, c1);
};
- return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryDifferingArityElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::Modulo(const core::type::Type* ty,
@@ -1752,7 +1827,7 @@
return Dispatch_fia_fiu32_f16(ModFunc(source, c0->Type()), c0, c1);
};
- return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryDifferingArityElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::Equal(const core::type::Type* ty,
@@ -1765,7 +1840,7 @@
return Dispatch_fia_fiu32_f16_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::NotEqual(const core::type::Type* ty,
@@ -1778,7 +1853,7 @@
return Dispatch_fia_fiu32_f16_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::LessThan(const core::type::Type* ty,
@@ -1791,7 +1866,7 @@
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::GreaterThan(const core::type::Type* ty,
@@ -1804,7 +1879,7 @@
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::LessThanEqual(const core::type::Type* ty,
@@ -1817,7 +1892,7 @@
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::GreaterThanEqual(const core::type::Type* ty,
@@ -1830,7 +1905,7 @@
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::LogicalAnd(const core::type::Type* ty,
@@ -1868,7 +1943,7 @@
return Dispatch_ia_iu32_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::Or(const core::type::Type* ty,
@@ -1888,7 +1963,7 @@
return Dispatch_ia_iu32_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::Xor(const core::type::Type* ty,
@@ -1901,7 +1976,7 @@
return Dispatch_ia_iu32(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::ShiftLeft(const core::type::Type* ty,
@@ -1998,7 +2073,7 @@
return Failure;
}
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::ShiftRight(const core::type::Type* ty,
@@ -2065,7 +2140,7 @@
return Failure;
}
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::abs(const core::type::Type* ty,
@@ -2090,7 +2165,7 @@
};
return Dispatch_fia_fiu32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::acos(const core::type::Type* ty,
@@ -2112,7 +2187,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::acosh(const core::type::Type* ty,
@@ -2134,7 +2209,7 @@
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::all(const core::type::Type* ty,
@@ -2168,7 +2243,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::asinh(const core::type::Type* ty,
@@ -2181,7 +2256,7 @@
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::atan(const core::type::Type* ty,
@@ -2193,7 +2268,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::atanh(const core::type::Type* ty,
@@ -2216,7 +2291,7 @@
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::atan2(const core::type::Type* ty,
@@ -2228,7 +2303,7 @@
};
return Dispatch_fa_f32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::ceil(const core::type::Type* ty,
@@ -2240,7 +2315,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::clamp(const core::type::Type* ty,
@@ -2249,7 +2324,7 @@
auto transform = [&](const Value* c0, const Value* c1, const Value* c2) {
return Dispatch_fia_fiu32_f16(ClampFunc(source, c0->Type()), c0, c1, c2);
};
- return TransformElements(mgr, ty, transform, args[0], args[1], args[2]);
+ return TransformTernaryElements(mgr, ty, transform, args[0], args[1], args[2]);
}
Eval::Result Eval::cos(const core::type::Type* ty,
@@ -2262,7 +2337,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::cosh(const core::type::Type* ty,
@@ -2275,7 +2350,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::countLeadingZeros(const core::type::Type* ty,
@@ -2290,7 +2365,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::countOneBits(const core::type::Type* ty,
@@ -2314,7 +2389,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::countTrailingZeros(const core::type::Type* ty,
@@ -2329,7 +2404,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::cross(const core::type::Type* ty,
@@ -2397,7 +2472,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::determinant(const core::type::Type* ty,
@@ -2485,7 +2560,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::exp2(const core::type::Type* ty,
@@ -2507,7 +2582,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::extractBits(const core::type::Type* ty,
@@ -2567,7 +2642,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::faceForward(const core::type::Type* ty,
@@ -2630,7 +2705,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::firstTrailingBit(const core::type::Type* ty,
@@ -2656,7 +2731,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::floor(const core::type::Type* ty,
@@ -2668,7 +2743,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::fma(const core::type::Type* ty,
@@ -2694,7 +2769,7 @@
};
return Dispatch_fa_f32_f16(create, c1, c2, c3);
};
- return TransformElements(mgr, ty, transform, args[0], args[1], args[2]);
+ return TransformTernaryElements(mgr, ty, transform, args[0], args[1], args[2]);
}
Eval::Result Eval::fract(const core::type::Type* ty,
@@ -2708,7 +2783,7 @@
};
return Dispatch_fa_f32_f16(create, c1);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::frexp(const core::type::Type* ty,
@@ -2834,7 +2909,7 @@
};
return Dispatch_iu32(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::inverseSqrt(const core::type::Type* ty,
@@ -2872,7 +2947,7 @@
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::ldexp(const core::type::Type* ty,
@@ -2918,7 +2993,7 @@
return Dispatch_fa_f32_f16(create, c1);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformElements(mgr, ty, transform, 0, args[0]);
}
Eval::Result Eval::length(const core::type::Type* ty,
@@ -2949,7 +3024,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::log2(const core::type::Type* ty,
@@ -2970,7 +3045,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::max(const core::type::Type* ty,
@@ -2982,7 +3057,7 @@
};
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::min(const core::type::Type* ty,
@@ -2994,7 +3069,7 @@
};
return Dispatch_fia_fiu32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::mix(const core::type::Type* ty,
@@ -3033,7 +3108,7 @@
};
return Dispatch_fa_f32_f16(create, c0, c1);
};
- auto r = TransformElements(mgr, ty, transform, args[0], args[1]);
+ auto r = TransformElements(mgr, ty, transform, 0, args[0], args[1]);
if (!r) {
AddNote("when calculating mix", source);
}
@@ -3058,13 +3133,13 @@
Vector<const Value*, 2> fields;
- if (auto fract = TransformElements(mgr, args[0]->Type(), transform_fract, args[0])) {
+ if (auto fract = TransformUnaryElements(mgr, args[0]->Type(), transform_fract, args[0])) {
fields.Push(fract.Get());
} else {
return tint::Failure;
}
- if (auto whole = TransformElements(mgr, args[0]->Type(), transform_whole, args[0])) {
+ if (auto whole = TransformUnaryElements(mgr, args[0]->Type(), transform_whole, args[0])) {
fields.Push(whole.Get());
} else {
return tint::Failure;
@@ -3216,7 +3291,7 @@
};
return Dispatch_fa_f32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::radians(const core::type::Type* ty,
@@ -3242,7 +3317,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::reflect(const core::type::Type* ty,
@@ -3410,7 +3485,7 @@
};
return Dispatch_iu32(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::round(const core::type::Type* ty,
@@ -3446,7 +3521,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::saturate(const core::type::Type* ty,
@@ -3460,7 +3535,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::select_bool(const core::type::Type* ty,
@@ -3474,7 +3549,7 @@
return Dispatch_fia_fiu32_f16_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::select_boolvec(const core::type::Type* ty,
@@ -3489,7 +3564,7 @@
return Dispatch_fia_fiu32_f16_bool(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformElements(mgr, ty, transform, 0, args[0], args[1]);
}
Eval::Result Eval::sign(const core::type::Type* ty,
@@ -3511,7 +3586,7 @@
};
return Dispatch_fia_fi32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::sin(const core::type::Type* ty,
@@ -3524,7 +3599,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::sinh(const core::type::Type* ty,
@@ -3537,7 +3612,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::smoothstep(const core::type::Type* ty,
@@ -3587,7 +3662,7 @@
};
return Dispatch_fa_f32_f16(create, c0, c1, c2);
};
- return TransformElements(mgr, ty, transform, args[0], args[1], args[2]);
+ return TransformTernaryElements(mgr, ty, transform, args[0], args[1], args[2]);
}
Eval::Result Eval::step(const core::type::Type* ty,
@@ -3601,7 +3676,7 @@
};
return Dispatch_fa_f32_f16(create, c0, c1);
};
- return TransformElements(mgr, ty, transform, args[0], args[1]);
+ return TransformBinaryElements(mgr, ty, transform, args[0], args[1]);
}
Eval::Result Eval::sqrt(const core::type::Type* ty,
@@ -3611,7 +3686,7 @@
return Dispatch_fa_f32_f16(SqrtFunc(source, c0->Type()), c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::tan(const core::type::Type* ty,
@@ -3624,7 +3699,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::tanh(const core::type::Type* ty,
@@ -3637,7 +3712,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::transpose(const core::type::Type* ty,
@@ -3669,7 +3744,7 @@
};
return Dispatch_fa_f32_f16(create, c0);
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::unpack2x16float(const core::type::Type* ty,
@@ -3794,7 +3869,7 @@
}
return CreateScalar(source, c->Type(), conv.Get());
};
- return TransformElements(mgr, ty, transform, args[0]);
+ return TransformUnaryElements(mgr, ty, transform, args[0]);
}
Eval::Result Eval::Convert(const core::type::Type* target_ty,
diff --git a/src/tint/lang/core/diagnostic_rule.cc b/src/tint/lang/core/diagnostic_rule.cc
index 2a7cbaa..b226240 100644
--- a/src/tint/lang/core/diagnostic_rule.cc
+++ b/src/tint/lang/core/diagnostic_rule.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_rule.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/diagnostic_rule.h"
diff --git a/src/tint/lang/core/diagnostic_rule.h b/src/tint/lang/core/diagnostic_rule.h
index a6b5e0a..0bc5f72 100644
--- a/src/tint/lang/core/diagnostic_rule.h
+++ b/src/tint/lang/core/diagnostic_rule.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_rule.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_DIAGNOSTIC_RULE_H_
diff --git a/src/tint/lang/core/diagnostic_rule_bench.cc b/src/tint/lang/core/diagnostic_rule_bench.cc
index ae79507..4393c23 100644
--- a/src/tint/lang/core/diagnostic_rule_bench.cc
+++ b/src/tint/lang/core/diagnostic_rule_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_rule_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/diagnostic_rule.h"
diff --git a/src/tint/lang/core/diagnostic_rule_test.cc b/src/tint/lang/core/diagnostic_rule_test.cc
index e986435..c20079c 100644
--- a/src/tint/lang/core/diagnostic_rule_test.cc
+++ b/src/tint/lang/core/diagnostic_rule_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_rule_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include <string>
diff --git a/src/tint/lang/core/diagnostic_severity.cc b/src/tint/lang/core/diagnostic_severity.cc
index 564eb74..3cde694 100644
--- a/src/tint/lang/core/diagnostic_severity.cc
+++ b/src/tint/lang/core/diagnostic_severity.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_severity.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/diagnostic_severity.h"
diff --git a/src/tint/lang/core/diagnostic_severity.h b/src/tint/lang/core/diagnostic_severity.h
index 1ff5b5f..9a7bd91 100644
--- a/src/tint/lang/core/diagnostic_severity.h
+++ b/src/tint/lang/core/diagnostic_severity.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_severity.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_DIAGNOSTIC_SEVERITY_H_
diff --git a/src/tint/lang/core/diagnostic_severity_bench.cc b/src/tint/lang/core/diagnostic_severity_bench.cc
index 14d4fa6..50a4f11 100644
--- a/src/tint/lang/core/diagnostic_severity_bench.cc
+++ b/src/tint/lang/core/diagnostic_severity_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_severity_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/diagnostic_severity.h"
diff --git a/src/tint/lang/core/diagnostic_severity_test.cc b/src/tint/lang/core/diagnostic_severity_test.cc
index d217d63..78c1d75 100644
--- a/src/tint/lang/core/diagnostic_severity_test.cc
+++ b/src/tint/lang/core/diagnostic_severity_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/diagnostic_severity_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include <string>
diff --git a/src/tint/lang/core/extension.cc b/src/tint/lang/core/extension.cc
index 4bdb16d..6d4ff48 100644
--- a/src/tint/lang/core/extension.cc
+++ b/src/tint/lang/core/extension.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/extension.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/extension.h"
diff --git a/src/tint/lang/core/extension.h b/src/tint/lang/core/extension.h
index 0aac98a..da1c9f4 100644
--- a/src/tint/lang/core/extension.h
+++ b/src/tint/lang/core/extension.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/extension.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_EXTENSION_H_
diff --git a/src/tint/lang/core/extension_bench.cc b/src/tint/lang/core/extension_bench.cc
index b6cd53b..d5e13d0 100644
--- a/src/tint/lang/core/extension_bench.cc
+++ b/src/tint/lang/core/extension_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/extension_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/extension.h"
diff --git a/src/tint/lang/core/extension_test.cc b/src/tint/lang/core/extension_test.cc
index deb8b0b..4e21e78 100644
--- a/src/tint/lang/core/extension_test.cc
+++ b/src/tint/lang/core/extension_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/extension_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/extension.h"
diff --git a/src/tint/lang/core/function.cc b/src/tint/lang/core/function.cc
index 3d34627..1e636b3 100644
--- a/src/tint/lang/core/function.cc
+++ b/src/tint/lang/core/function.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/function.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/function.h"
diff --git a/src/tint/lang/core/function.h b/src/tint/lang/core/function.h
index 8d8b23c..4347af9 100644
--- a/src/tint/lang/core/function.h
+++ b/src/tint/lang/core/function.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/function.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_FUNCTION_H_
diff --git a/src/tint/lang/core/interpolation_sampling.cc b/src/tint/lang/core/interpolation_sampling.cc
index ad657b7..ac9940a 100644
--- a/src/tint/lang/core/interpolation_sampling.cc
+++ b/src/tint/lang/core/interpolation_sampling.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_sampling.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/interpolation_sampling.h"
diff --git a/src/tint/lang/core/interpolation_sampling.h b/src/tint/lang/core/interpolation_sampling.h
index fce80f1..f3398f1 100644
--- a/src/tint/lang/core/interpolation_sampling.h
+++ b/src/tint/lang/core/interpolation_sampling.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_sampling.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_INTERPOLATION_SAMPLING_H_
diff --git a/src/tint/lang/core/interpolation_sampling_bench.cc b/src/tint/lang/core/interpolation_sampling_bench.cc
index e5ffdd1..4fea5cf 100644
--- a/src/tint/lang/core/interpolation_sampling_bench.cc
+++ b/src/tint/lang/core/interpolation_sampling_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_sampling_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include <array>
diff --git a/src/tint/lang/core/interpolation_sampling_test.cc b/src/tint/lang/core/interpolation_sampling_test.cc
index 8301cfb..f4e9776 100644
--- a/src/tint/lang/core/interpolation_sampling_test.cc
+++ b/src/tint/lang/core/interpolation_sampling_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_sampling_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/interpolation_sampling.h"
diff --git a/src/tint/lang/core/interpolation_type.cc b/src/tint/lang/core/interpolation_type.cc
index c35f6b3..3ed8e26 100644
--- a/src/tint/lang/core/interpolation_type.cc
+++ b/src/tint/lang/core/interpolation_type.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_type.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/interpolation_type.h"
diff --git a/src/tint/lang/core/interpolation_type.h b/src/tint/lang/core/interpolation_type.h
index d4732be..1161193 100644
--- a/src/tint/lang/core/interpolation_type.h
+++ b/src/tint/lang/core/interpolation_type.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_type.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_INTERPOLATION_TYPE_H_
diff --git a/src/tint/lang/core/interpolation_type_bench.cc b/src/tint/lang/core/interpolation_type_bench.cc
index 892bb6a..0f1b4fe 100644
--- a/src/tint/lang/core/interpolation_type_bench.cc
+++ b/src/tint/lang/core/interpolation_type_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_type_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/interpolation_type.h"
diff --git a/src/tint/lang/core/interpolation_type_test.cc b/src/tint/lang/core/interpolation_type_test.cc
index f1902a2..084b75d 100644
--- a/src/tint/lang/core/interpolation_type_test.cc
+++ b/src/tint/lang/core/interpolation_type_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/interpolation_type_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/interpolation_type.h"
diff --git a/src/tint/lang/core/intrinsic/BUILD.cmake b/src/tint/lang/core/intrinsic/BUILD.cmake
index faa135a..4aa2870 100644
--- a/src/tint/lang/core/intrinsic/BUILD.cmake
+++ b/src/tint/lang/core/intrinsic/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/core/intrinsic/data/BUILD.cmake)
diff --git a/src/tint/lang/core/intrinsic/BUILD.gn b/src/tint/lang/core/intrinsic/BUILD.gn
index 4e55311..c5b985b 100644
--- a/src/tint/lang/core/intrinsic/BUILD.gn
+++ b/src/tint/lang/core/intrinsic/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/intrinsic/ctor_conv.cc b/src/tint/lang/core/intrinsic/ctor_conv.cc
index 7abe148..928545e 100644
--- a/src/tint/lang/core/intrinsic/ctor_conv.cc
+++ b/src/tint/lang/core/intrinsic/ctor_conv.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/intrinsic/ctor_conv.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/intrinsic/ctor_conv.h"
diff --git a/src/tint/lang/core/intrinsic/ctor_conv.h b/src/tint/lang/core/intrinsic/ctor_conv.h
index 67ff261..fa68e8d 100644
--- a/src/tint/lang/core/intrinsic/ctor_conv.h
+++ b/src/tint/lang/core/intrinsic/ctor_conv.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/intrinsic/ctor_conv.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_INTRINSIC_CTOR_CONV_H_
diff --git a/src/tint/lang/core/intrinsic/data/BUILD.cmake b/src/tint/lang/core/intrinsic/data/BUILD.cmake
index 8990ca3..8134896 100644
--- a/src/tint/lang/core/intrinsic/data/BUILD.cmake
+++ b/src/tint/lang/core/intrinsic/data/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/core/intrinsic/data/BUILD.gn b/src/tint/lang/core/intrinsic/data/BUILD.gn
index 3673b17..4a096a5 100644
--- a/src/tint/lang/core/intrinsic/data/BUILD.gn
+++ b/src/tint/lang/core/intrinsic/data/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/intrinsic/data/data.cc b/src/tint/lang/core/intrinsic/data/data.cc
index 7248e01..fa6d930 100644
--- a/src/tint/lang/core/intrinsic/data/data.cc
+++ b/src/tint/lang/core/intrinsic/data/data.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/intrinsic/data/data.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include <limits>
diff --git a/src/tint/lang/core/ir/BUILD.cmake b/src/tint/lang/core/ir/BUILD.cmake
index 0e8aede..f9c1c07 100644
--- a/src/tint/lang/core/ir/BUILD.cmake
+++ b/src/tint/lang/core/ir/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/core/ir/transform/BUILD.cmake)
diff --git a/src/tint/lang/core/ir/BUILD.gn b/src/tint/lang/core/ir/BUILD.gn
index 146ea38..b665385 100644
--- a/src/tint/lang/core/ir/BUILD.gn
+++ b/src/tint/lang/core/ir/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/ir/transform/BUILD.cmake b/src/tint/lang/core/ir/transform/BUILD.cmake
index 5623215..6bff32a 100644
--- a/src/tint/lang/core/ir/transform/BUILD.cmake
+++ b/src/tint/lang/core/ir/transform/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_IR)
diff --git a/src/tint/lang/core/ir/transform/BUILD.gn b/src/tint/lang/core/ir/transform/BUILD.gn
index ef85e1a..b9a27f8 100644
--- a/src/tint/lang/core/ir/transform/BUILD.gn
+++ b/src/tint/lang/core/ir/transform/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/core/number_test.cc b/src/tint/lang/core/number_test.cc
index 2a1e61c..d8ecab4 100644
--- a/src/tint/lang/core/number_test.cc
+++ b/src/tint/lang/core/number_test.cc
@@ -13,6 +13,7 @@
// limitations under the License.
#include <cmath>
+#include <cstdint>
#include <tuple>
#include <variant>
#include <vector>
@@ -602,8 +603,8 @@
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4)},
{AInt(-0x4000000000000000ll), AInt(-0x1000000000000000ll), AInt(4)},
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4)},
- {AInt(-0x8000000000000000ll), AInt(0x1000000000000000ll), AInt(-8)},
- {AInt(-0x8000000000000000ll), AInt(-0x1000000000000000ll), AInt(8)},
+ {AInt(INT64_MIN), AInt(0x1000000000000000ll), AInt(-8)},
+ {AInt(INT64_MIN), AInt(-0x1000000000000000ll), AInt(8)},
{AInt(0), AInt::Highest(), AInt(0)},
{AInt(0), AInt::Lowest(), AInt(0)},
{OVERFLOW, AInt(0x1000000000000000ll), AInt(8)},
@@ -884,8 +885,8 @@
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4), AInt(0)},
{AInt(-0x4000000000000000ll), AInt(-0x1000000000000000ll), AInt(4), AInt(0)},
{AInt(-0x4000000000000000ll), AInt(0x1000000000000000ll), AInt(-4), AInt(0)},
- {AInt(-0x8000000000000000ll), AInt(0x1000000000000000ll), AInt(-8), AInt(0)},
- {AInt(-0x8000000000000000ll), AInt(-0x1000000000000000ll), AInt(8), AInt(0)},
+ {AInt(INT64_MIN), AInt(0x1000000000000000ll), AInt(-8), AInt(0)},
+ {AInt(INT64_MIN), AInt(-0x1000000000000000ll), AInt(8), AInt(0)},
{AInt::Highest(), AInt(1), AInt(1), AInt(AInt::kHighestValue - 1)},
{AInt::Lowest(), AInt(1), AInt(-1), AInt(AInt::kLowestValue + 1)},
{AInt::Highest(), AInt(1), AInt(0x7fffffff00000000ll), AInt(0x00000000ffffffffll)},
diff --git a/src/tint/lang/core/parameter_usage.cc b/src/tint/lang/core/parameter_usage.cc
index 7eb0f07..2a42c49 100644
--- a/src/tint/lang/core/parameter_usage.cc
+++ b/src/tint/lang/core/parameter_usage.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/parameter_usage.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/parameter_usage.h"
diff --git a/src/tint/lang/core/parameter_usage.h b/src/tint/lang/core/parameter_usage.h
index de60163..39e0207 100644
--- a/src/tint/lang/core/parameter_usage.h
+++ b/src/tint/lang/core/parameter_usage.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/parameter_usage.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_PARAMETER_USAGE_H_
diff --git a/src/tint/lang/core/texel_format.cc b/src/tint/lang/core/texel_format.cc
index 4be42ff..d4c82b3 100644
--- a/src/tint/lang/core/texel_format.cc
+++ b/src/tint/lang/core/texel_format.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/texel_format.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/texel_format.h"
diff --git a/src/tint/lang/core/texel_format.h b/src/tint/lang/core/texel_format.h
index 30fcd1e..59d534f 100644
--- a/src/tint/lang/core/texel_format.h
+++ b/src/tint/lang/core/texel_format.h
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/texel_format.h.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#ifndef SRC_TINT_LANG_CORE_TEXEL_FORMAT_H_
diff --git a/src/tint/lang/core/texel_format_bench.cc b/src/tint/lang/core/texel_format_bench.cc
index 55532cc..087cc21 100644
--- a/src/tint/lang/core/texel_format_bench.cc
+++ b/src/tint/lang/core/texel_format_bench.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/texel_format_bench.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/texel_format.h"
diff --git a/src/tint/lang/core/texel_format_test.cc b/src/tint/lang/core/texel_format_test.cc
index 7f7e578..96b61f7 100644
--- a/src/tint/lang/core/texel_format_test.cc
+++ b/src/tint/lang/core/texel_format_test.cc
@@ -13,11 +13,12 @@
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
+// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/texel_format_test.cc.tmpl
//
-// Do not modify this file directly
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
#include "src/tint/lang/core/texel_format.h"
diff --git a/src/tint/lang/core/type/BUILD.cmake b/src/tint/lang/core/type/BUILD.cmake
index fbf89d0..d3349e9 100644
--- a/src/tint/lang/core/type/BUILD.cmake
+++ b/src/tint/lang/core/type/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/core/type/BUILD.gn b/src/tint/lang/core/type/BUILD.gn
index 2043c2d..2da1377 100644
--- a/src/tint/lang/core/type/BUILD.gn
+++ b/src/tint/lang/core/type/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/glsl/BUILD.cmake b/src/tint/lang/glsl/BUILD.cmake
index 84d8c48..d393f94 100644
--- a/src/tint/lang/glsl/BUILD.cmake
+++ b/src/tint/lang/glsl/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/glsl/writer/BUILD.cmake)
diff --git a/src/tint/lang/glsl/BUILD.gn b/src/tint/lang/glsl/BUILD.gn
index d8cef06..b8a448e 100644
--- a/src/tint/lang/glsl/BUILD.gn
+++ b/src/tint/lang/glsl/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/glsl/writer/BUILD.cmake b/src/tint/lang/glsl/writer/BUILD.cmake
index ef38b5d..e86bde9 100644
--- a/src/tint/lang/glsl/writer/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/glsl/writer/ast_printer/BUILD.cmake)
diff --git a/src/tint/lang/glsl/writer/BUILD.gn b/src/tint/lang/glsl/writer/BUILD.gn
index 2486ed1..96d9eb7 100644
--- a/src/tint/lang/glsl/writer/BUILD.gn
+++ b/src/tint/lang/glsl/writer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake b/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
index 6f2cc8f..f8f380e 100644
--- a/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_GLSL_WRITER)
diff --git a/src/tint/lang/glsl/writer/ast_printer/BUILD.gn b/src/tint/lang/glsl/writer/ast_printer/BUILD.gn
index 83c2ba7..f07d9ca 100644
--- a/src/tint/lang/glsl/writer/ast_printer/BUILD.gn
+++ b/src/tint/lang/glsl/writer/ast_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
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 895fd56..cbb5ed4 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -1290,6 +1290,8 @@
out << "barrier()";
} else if (builtin->Type() == core::Function::kStorageBarrier) {
out << "{ barrier(); memoryBarrierBuffer(); }";
+ } else if (builtin->Type() == core::Function::kTextureBarrier) {
+ out << "{ barrier(); memoryBarrierImage(); }";
} else {
TINT_UNREACHABLE() << "unexpected barrier builtin type " << core::str(builtin->Type());
}
@@ -1485,7 +1487,11 @@
glsl_ret_width = 1;
break;
case core::Function::kTextureLoad:
- out << "texelFetch";
+ if (texture_type->Is<core::type::StorageTexture>()) {
+ out << "imageLoad";
+ } else {
+ out << "texelFetch";
+ }
break;
case core::Function::kTextureStore:
out << "imageStore";
@@ -2726,8 +2732,36 @@
out << "highp ";
- if (storage && storage->access() != core::Access::kRead) {
- out << "writeonly ";
+ if (storage) {
+ switch (storage->access()) {
+ case core::Access::kRead:
+ out << "readonly ";
+ break;
+ case core::Access::kWrite:
+ out << "writeonly ";
+ break;
+ case core::Access::kReadWrite: {
+ // ESSL 3.1 SPEC (chapter 4.9, Memory Access Qualifiers):
+ // Except for image variables qualified with the format qualifiers r32f, r32i,
+ // and r32ui, image variables must specify either memory qualifier readonly or
+ // the memory qualifier writeonly.
+ switch (storage->texel_format()) {
+ case core::TexelFormat::kR32Float:
+ case core::TexelFormat::kR32Sint:
+ case core::TexelFormat::kR32Uint:
+ break;
+ default: {
+ // TODO(dawn:1972): Fix the tests that contain read-write storage
+ // textures with illegal formats.
+ out << "writeonly ";
+ break;
+ }
+ }
+ } break;
+ default:
+ TINT_UNREACHABLE() << "unexpected storage texture access " << storage->access();
+ return;
+ }
}
auto* subtype = sampled ? sampled->type()
: storage ? storage->type()
diff --git a/src/tint/lang/glsl/writer/common/BUILD.cmake b/src/tint/lang/glsl/writer/common/BUILD.cmake
index a08de21..6d67325 100644
--- a/src/tint/lang/glsl/writer/common/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_GLSL_WRITER)
diff --git a/src/tint/lang/glsl/writer/common/BUILD.gn b/src/tint/lang/glsl/writer/common/BUILD.gn
index 356c9e5..28d33e0 100644
--- a/src/tint/lang/glsl/writer/common/BUILD.gn
+++ b/src/tint/lang/glsl/writer/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/hlsl/BUILD.cmake b/src/tint/lang/hlsl/BUILD.cmake
index 4a79af9..1259f29 100644
--- a/src/tint/lang/hlsl/BUILD.cmake
+++ b/src/tint/lang/hlsl/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/hlsl/validate/BUILD.cmake)
diff --git a/src/tint/lang/hlsl/BUILD.gn b/src/tint/lang/hlsl/BUILD.gn
index d8cef06..b8a448e 100644
--- a/src/tint/lang/hlsl/BUILD.gn
+++ b/src/tint/lang/hlsl/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/hlsl/validate/BUILD.cmake b/src/tint/lang/hlsl/validate/BUILD.cmake
index b4fd065..a05662b 100644
--- a/src/tint/lang/hlsl/validate/BUILD.cmake
+++ b/src/tint/lang/hlsl/validate/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_HLSL_WRITER)
diff --git a/src/tint/lang/hlsl/validate/BUILD.gn b/src/tint/lang/hlsl/validate/BUILD.gn
index 5ef229d..0516419 100644
--- a/src/tint/lang/hlsl/validate/BUILD.gn
+++ b/src/tint/lang/hlsl/validate/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/hlsl/validate/hlsl.cc b/src/tint/lang/hlsl/validate/hlsl.cc
index 323885d..bbcde35 100644
--- a/src/tint/lang/hlsl/validate/hlsl.cc
+++ b/src/tint/lang/hlsl/validate/hlsl.cc
@@ -74,6 +74,7 @@
// and dawn_native\d3d12\ShaderModuleD3D12.cpp (GetDXCArguments)
auto res = dxc(
"-T " + std::string(stage_prefix) + "_" + std::string(shader_model_version), // Profile
+ "-HV 2018 ", // Use HLSL 2018
"-E " + ep.first, // Entry point
"/Zpr", // D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
"/Gis", // D3DCOMPILE_IEEE_STRICTNESS
diff --git a/src/tint/lang/hlsl/writer/BUILD.cmake b/src/tint/lang/hlsl/writer/BUILD.cmake
index 613fba2..f82c2ea 100644
--- a/src/tint/lang/hlsl/writer/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/hlsl/writer/ast_printer/BUILD.cmake)
diff --git a/src/tint/lang/hlsl/writer/BUILD.gn b/src/tint/lang/hlsl/writer/BUILD.gn
index 2da7ed1..c0435f6 100644
--- a/src/tint/lang/hlsl/writer/BUILD.gn
+++ b/src/tint/lang/hlsl/writer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake b/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
index 4a3b466..8a43885 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_HLSL_WRITER)
diff --git a/src/tint/lang/hlsl/writer/ast_printer/BUILD.gn b/src/tint/lang/hlsl/writer/ast_printer/BUILD.gn
index 2cff88b..88e7e42 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/BUILD.gn
+++ b/src/tint/lang/hlsl/writer/ast_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
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 defc4e9..1bd104c 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -2819,6 +2819,36 @@
return emit_vector_appended_with_i32_zero(vector);
};
+ auto emit_arg_expression = [&](const ast::Expression* arg_expr) -> bool {
+ // TODO(crbug.com/tint/1976): Workaround DXC bug that fails to compile texture loads with
+ // splatted constants. DXC fails to convert the coord arg, for e.g. `0.xxx`, from a vector
+ // of 64-bit ints to a vector of 32-bit ints to match the texture load parameter type. We
+ // work around this for now by explicitly casting the splatted constant to the right type,
+ // for e.g. `int3(0.xxx)`.
+ bool emitted_cast = false;
+ if (auto* sem = builder_.Sem().GetVal(arg_expr)) {
+ if (auto* constant = sem->ConstantValue()) {
+ if (auto* splat = constant->As<core::constant::Splat>()) {
+ if (splat->Type()->is_signed_integer_vector()) {
+ if (!EmitType(out, constant->Type(), core::AddressSpace::kUndefined,
+ core::Access::kUndefined, "")) {
+ return false;
+ }
+ out << "(";
+ emitted_cast = true;
+ }
+ }
+ }
+ }
+ if (!EmitExpression(out, arg_expr)) {
+ return false;
+ }
+ if (emitted_cast) {
+ out << ")";
+ }
+ return true;
+ };
+
if (auto* array_index = arg(Usage::kArrayIndex)) {
// Array index needs to be appended to the coordinates.
auto* packed = tint::writer::AppendVector(&builder_, param_coords, array_index);
@@ -2837,10 +2867,13 @@
if (!emit_vector_appended_with_level(param_coords)) {
return false;
}
- } else {
+ } else if (builtin->Type() == core::Function::kTextureStore) {
+ // param_coords is an index expression, not a function arg
if (!EmitExpression(out, param_coords)) {
return false;
}
+ } else if (!emit_arg_expression(param_coords)) {
+ return false;
}
for (auto usage : {Usage::kDepthRef, Usage::kBias, Usage::kLevel, Usage::kDdx, Usage::kDdy,
@@ -2850,7 +2883,7 @@
}
if (auto* e = arg(usage)) {
out << ", ";
- if (!EmitExpression(out, e)) {
+ if (!emit_arg_expression(e)) {
return false;
}
}
diff --git a/src/tint/lang/hlsl/writer/ast_printer/builtin_texture_test.cc b/src/tint/lang/hlsl/writer/ast_printer/builtin_texture_test.cc
index af53bac..a0999ae 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/builtin_texture_test.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/builtin_texture_test.cc
@@ -285,7 +285,7 @@
case ValidTextureOverload::kSampleGrad2dF32:
return R"(tint_symbol.SampleGrad(tint_symbol_1, float2(1.0f, 2.0f), float2(3.0f, 4.0f), float2(5.0f, 6.0f));)";
case ValidTextureOverload::kSampleGrad2dOffsetF32:
- return R"(tint_symbol.SampleGrad(tint_symbol_1, float2(1.0f, 2.0f), float2(3.0f, 4.0f), float2(5.0f, 6.0f), (7).xx);)";
+ return R"(tint_symbol.SampleGrad(tint_symbol_1, float2(1.0f, 2.0f), float2(3.0f, 4.0f), float2(5.0f, 6.0f), int2((7).xx));)";
case ValidTextureOverload::kSampleGrad2dArrayF32:
return R"(tint_symbol.SampleGrad(tint_symbol_1, float3(1.0f, 2.0f, float(3)), float2(4.0f, 5.0f), float2(6.0f, 7.0f));)";
case ValidTextureOverload::kSampleGrad2dArrayOffsetF32:
diff --git a/src/tint/lang/hlsl/writer/common/BUILD.cmake b/src/tint/lang/hlsl/writer/common/BUILD.cmake
index 5304c77..57fa469 100644
--- a/src/tint/lang/hlsl/writer/common/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/hlsl/writer/common/BUILD.gn b/src/tint/lang/hlsl/writer/common/BUILD.gn
index 6be0ae4..6aacb42 100644
--- a/src/tint/lang/hlsl/writer/common/BUILD.gn
+++ b/src/tint/lang/hlsl/writer/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/msl/BUILD.cmake b/src/tint/lang/msl/BUILD.cmake
index b08b8ee..2191380 100644
--- a/src/tint/lang/msl/BUILD.cmake
+++ b/src/tint/lang/msl/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/msl/validate/BUILD.cmake)
diff --git a/src/tint/lang/msl/BUILD.gn b/src/tint/lang/msl/BUILD.gn
index d8cef06..b8a448e 100644
--- a/src/tint/lang/msl/BUILD.gn
+++ b/src/tint/lang/msl/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/msl/validate/BUILD.cmake b/src/tint/lang/msl/validate/BUILD.cmake
index 29924ff..9f3c0a5 100644
--- a/src/tint/lang/msl/validate/BUILD.cmake
+++ b/src/tint/lang/msl/validate/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_MSL_WRITER)
@@ -54,4 +55,13 @@
tint_utils_traits
)
+if(IS_MAC)
+ tint_target_add_sources(tint_lang_msl_validate lib
+ "lang/msl/validate/msl_metal.mm"
+ )
+ tint_target_add_external_dependencies(tint_lang_msl_validate lib
+ "metal"
+ )
+endif(IS_MAC)
+
endif(TINT_BUILD_MSL_WRITER)
\ No newline at end of file
diff --git a/src/tint/lang/msl/validate/BUILD.gn b/src/tint/lang/msl/validate/BUILD.gn
index aea9b68..6408a5f 100644
--- a/src/tint/lang/msl/validate/BUILD.gn
+++ b/src/tint/lang/msl/validate/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
@@ -51,5 +52,10 @@
"${tint_src_dir}/utils/text",
"${tint_src_dir}/utils/traits",
]
+
+ if (is_mac) {
+ sources += [ "msl_metal.mm" ]
+ deps += [ "${tint_src_dir}:metal" ]
+ }
}
}
diff --git a/src/tint/lang/msl/validate/msl_metal.mm b/src/tint/lang/msl/validate/msl_metal.mm
index 9999f2a..8fd3ee9 100644
--- a/src/tint/lang/msl/validate/msl_metal.mm
+++ b/src/tint/lang/msl/validate/msl_metal.mm
@@ -12,15 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifdef TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+// GEN_BUILD:CONDITION(is_mac)
-@import Metal;
+#import <Metal/Metal.h>
-// Disable: error: treating #include as an import of module 'std.string'
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wauto-import"
#include "src/tint/lang/msl/validate/val.h"
-#pragma clang diagnostic pop
namespace tint::msl::validate {
@@ -62,5 +58,3 @@
}
} // namespace tint::msl::validate
-
-#endif // TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
diff --git a/src/tint/lang/msl/validate/val.h b/src/tint/lang/msl/validate/val.h
index 78096dc..ca32763 100644
--- a/src/tint/lang/msl/validate/val.h
+++ b/src/tint/lang/msl/validate/val.h
@@ -52,14 +52,14 @@
/// @return the result of the compile
Result Msl(const std::string& xcrun_path, const std::string& source, MslVersion version);
-#ifdef TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+#ifdef __APPLE__
/// Msl attempts to compile the shader with the runtime Metal Shader Compiler
/// API, verifying that the shader compiles successfully.
/// @param source the generated MSL source
/// @param version the version of MSL to validate against
/// @return the result of the compile
Result UsingMetalAPI(const std::string& source, MslVersion version);
-#endif // TINT_ENABLE_MSL_VALIDATION_USING_METAL_API
+#endif // __APPLE__
} // namespace tint::msl::validate
diff --git a/src/tint/lang/msl/writer/BUILD.cmake b/src/tint/lang/msl/writer/BUILD.cmake
index f7cd382..6ddd2cb 100644
--- a/src/tint/lang/msl/writer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/msl/writer/ast_printer/BUILD.cmake)
diff --git a/src/tint/lang/msl/writer/BUILD.gn b/src/tint/lang/msl/writer/BUILD.gn
index adb5332..f05d114 100644
--- a/src/tint/lang/msl/writer/BUILD.gn
+++ b/src/tint/lang/msl/writer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/msl/writer/ast_printer/BUILD.cmake b/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
index 42b6ab1..afce85a 100644
--- a/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_MSL_WRITER)
diff --git a/src/tint/lang/msl/writer/ast_printer/BUILD.gn b/src/tint/lang/msl/writer/ast_printer/BUILD.gn
index 5c6fba3..dfa139a 100644
--- a/src/tint/lang/msl/writer/ast_printer/BUILD.gn
+++ b/src/tint/lang/msl/writer/ast_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
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 9be715b..3e6588c 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
@@ -255,6 +255,7 @@
core::Extension::kChromiumInternalRelaxedUniformLayout,
core::Extension::kF16,
core::Extension::kChromiumInternalDualSourceBlending,
+ core::Extension::kChromiumExperimentalDp4A,
})) {
return false;
}
@@ -678,6 +679,10 @@
return EmitDegreesCall(out, expr, builtin);
case core::Function::kRadians:
return EmitRadiansCall(out, expr, builtin);
+ case core::Function::kDot4I8Packed:
+ return EmitDot4I8PackedCall(out, expr, builtin);
+ case core::Function::kDot4U8Packed:
+ return EmitDot4U8PackedCall(out, expr, builtin);
case core::Function::kPack2X16Float:
case core::Function::kUnpack2X16Float: {
@@ -1335,6 +1340,32 @@
return true;
}
+bool ASTPrinter::EmitDot4I8PackedCall(StringStream& out,
+ const ast::CallExpression* expr,
+ const sem::Builtin* builtin) {
+ return CallBuiltinHelper(
+ out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
+ Line(b) << "packed_char4 vec1 = as_type<packed_char4>(" << params[0] << ");";
+ Line(b) << "packed_char4 vec2 = as_type<packed_char4>(" << params[1] << ");";
+ Line(b) << "return vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2] + vec1[3] "
+ "* vec2[3];";
+ return true;
+ });
+}
+
+bool ASTPrinter::EmitDot4U8PackedCall(StringStream& out,
+ const ast::CallExpression* expr,
+ const sem::Builtin* builtin) {
+ return CallBuiltinHelper(
+ out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
+ Line(b) << "packed_uchar4 vec1 = as_type<packed_uchar4>(" << params[0] << ");";
+ Line(b) << "packed_uchar4 vec2 = as_type<packed_uchar4>(" << params[1] << ");";
+ Line(b) << "return vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2] + vec1[3] "
+ "* vec2[3];";
+ return true;
+ });
+}
+
bool ASTPrinter::EmitModfCall(StringStream& out,
const ast::CallExpression* expr,
const sem::Builtin* builtin) {
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.h b/src/tint/lang/msl/writer/ast_printer/ast_printer.h
index 31ef50b..47f1ef7 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.h
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.h
@@ -348,6 +348,22 @@
/// @param type the type to emit the value for
/// @returns true if the zero value was successfully emitted.
bool EmitZeroValue(StringStream& out, const core::type::Type* type);
+ /// Handles generating a call to the `dot4I8Packed()` builtin
+ /// @param out the output of the expression stream
+ /// @param expr the call expression
+ /// @param builtin the semantic information for the builtin
+ /// @returns true if the call expression is emitted
+ bool EmitDot4I8PackedCall(StringStream& out,
+ const ast::CallExpression* expr,
+ const sem::Builtin* builtin);
+ /// Handles generating a call to the `dot4U8Packed()` builtin
+ /// @param out the output of the expression stream
+ /// @param expr the call expression
+ /// @param builtin the semantic information for the builtin
+ /// @returns true if the call expression is emitted
+ bool EmitDot4U8PackedCall(StringStream& out,
+ const ast::CallExpression* expr,
+ const sem::Builtin* builtin);
/// Handles generating a builtin name
/// @param builtin the semantic info for the builtin
diff --git a/src/tint/lang/msl/writer/common/BUILD.cmake b/src/tint/lang/msl/writer/common/BUILD.cmake
index 32ab82b..bb02f73 100644
--- a/src/tint/lang/msl/writer/common/BUILD.cmake
+++ b/src/tint/lang/msl/writer/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_MSL_WRITER)
diff --git a/src/tint/lang/msl/writer/common/BUILD.gn b/src/tint/lang/msl/writer/common/BUILD.gn
index b441649..8e834d8 100644
--- a/src/tint/lang/msl/writer/common/BUILD.gn
+++ b/src/tint/lang/msl/writer/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/msl/writer/printer/BUILD.cmake b/src/tint/lang/msl/writer/printer/BUILD.cmake
index c899f13..1999e2a 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
diff --git a/src/tint/lang/msl/writer/printer/BUILD.gn b/src/tint/lang/msl/writer/printer/BUILD.gn
index 94851ad..79e66b4 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.gn
+++ b/src/tint/lang/msl/writer/printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/msl/writer/raise/BUILD.cmake b/src/tint/lang/msl/writer/raise/BUILD.cmake
index 080c14e..86f9826 100644
--- a/src/tint/lang/msl/writer/raise/BUILD.cmake
+++ b/src/tint/lang/msl/writer/raise/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/msl/writer/raise/BUILD.gn b/src/tint/lang/msl/writer/raise/BUILD.gn
index 1108f3e..c2bcce9 100644
--- a/src/tint/lang/msl/writer/raise/BUILD.gn
+++ b/src/tint/lang/msl/writer/raise/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/BUILD.cmake b/src/tint/lang/spirv/BUILD.cmake
index 0b8158e..24b83a3 100644
--- a/src/tint/lang/spirv/BUILD.cmake
+++ b/src/tint/lang/spirv/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/spirv/reader/BUILD.cmake)
diff --git a/src/tint/lang/spirv/BUILD.gn b/src/tint/lang/spirv/BUILD.gn
index d8cef06..b8a448e 100644
--- a/src/tint/lang/spirv/BUILD.gn
+++ b/src/tint/lang/spirv/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/reader/BUILD.cmake b/src/tint/lang/spirv/reader/BUILD.cmake
index 0e4ab13..0ac253d 100644
--- a/src/tint/lang/spirv/reader/BUILD.cmake
+++ b/src/tint/lang/spirv/reader/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/spirv/reader/ast_parser/BUILD.cmake)
diff --git a/src/tint/lang/spirv/reader/BUILD.gn b/src/tint/lang/spirv/reader/BUILD.gn
index e8bca89..eeb5258 100644
--- a/src/tint/lang/spirv/reader/BUILD.gn
+++ b/src/tint/lang/spirv/reader/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake b/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
index e8d9c3f..ae9cb5e 100644
--- a/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
+++ b/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_SPV_READER)
diff --git a/src/tint/lang/spirv/reader/ast_parser/BUILD.gn b/src/tint/lang/spirv/reader/ast_parser/BUILD.gn
index ea640f2..54163d6 100644
--- a/src/tint/lang/spirv/reader/ast_parser/BUILD.gn
+++ b/src/tint/lang/spirv/reader/ast_parser/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/reader/ast_parser/ast_parser.cc b/src/tint/lang/spirv/reader/ast_parser/ast_parser.cc
index 69995f6..ae45f74 100644
--- a/src/tint/lang/spirv/reader/ast_parser/ast_parser.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/ast_parser.cc
@@ -2553,7 +2553,7 @@
// usage as well. That is, it's valid for a Vulkan shader to use an
// OpImage variable with an OpImage*Dref* instruction. In WGSL we must
// treat that as a depth texture.
- if (image_type->depth() || usage.IsDepthTexture()) {
+ if (image_type->depth() == 1 || usage.IsDepthTexture()) {
if (image_type->is_multisampled()) {
ast_handle_type = ty_.DepthMultisampledTexture(dim);
} else {
diff --git a/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc b/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
index bc4da28..66247db 100644
--- a/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/barrier_test.cc
@@ -142,6 +142,63 @@
EXPECT_EQ(builtin->Type(), core::Function::kTextureBarrier);
}
+TEST_F(SpirvASTParserTest, WorkgroupAndTextureAndStorageBarrier) {
+ // Check that we emit multiple adjacent barrier calls when the flags
+ // are combined.
+ auto program = ParseAndBuild(R"(
+ OpName %helper "helper"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_x948 = OpConstant %uint 0x948
+ %helper = OpFunction %void None %1
+ %4 = OpLabel
+ OpControlBarrier %uint_2 %uint_2 %uint_x948
+ OpReturn
+ OpFunctionEnd
+ %main = OpFunction %void None %1
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )");
+ ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
+ auto* helper = program.AST().Functions().Find(program.Symbols().Get("helper"));
+ ASSERT_NE(helper, nullptr);
+ ASSERT_GT(helper->body->statements.Length(), 2u);
+
+ {
+ auto* call = helper->body->statements[0]->As<ast::CallStatement>();
+ ASSERT_NE(call, nullptr);
+ EXPECT_EQ(call->expr->args.Length(), 0u);
+ auto* sem_call = program.Sem().Get<sem::Call>(call->expr);
+ ASSERT_NE(sem_call, nullptr);
+ auto* builtin = sem_call->Target()->As<sem::Builtin>();
+ ASSERT_NE(builtin, nullptr);
+ EXPECT_EQ(builtin->Type(), core::Function::kWorkgroupBarrier);
+ }
+ {
+ auto* call = helper->body->statements[1]->As<ast::CallStatement>();
+ ASSERT_NE(call, nullptr);
+ EXPECT_EQ(call->expr->args.Length(), 0u);
+ auto* sem_call = program.Sem().Get<sem::Call>(call->expr);
+ ASSERT_NE(sem_call, nullptr);
+ auto* builtin = sem_call->Target()->As<sem::Builtin>();
+ ASSERT_NE(builtin, nullptr);
+ EXPECT_EQ(builtin->Type(), core::Function::kStorageBarrier);
+ }
+ {
+ auto* call = helper->body->statements[2]->As<ast::CallStatement>();
+ ASSERT_NE(call, nullptr);
+ EXPECT_EQ(call->expr->args.Length(), 0u);
+ auto* sem_call = program.Sem().Get<sem::Call>(call->expr);
+ ASSERT_NE(sem_call, nullptr);
+ auto* builtin = sem_call->Target()->As<sem::Builtin>();
+ ASSERT_NE(builtin, nullptr);
+ EXPECT_EQ(builtin->Type(), core::Function::kTextureBarrier);
+ }
+}
+
TEST_F(SpirvASTParserTest, ErrBarrierInvalidExecution) {
auto program = ParseAndBuild(R"(
%void = OpTypeVoid
diff --git a/src/tint/lang/spirv/reader/ast_parser/function.cc b/src/tint/lang/spirv/reader/ast_parser/function.cc
index cf41b48..8097840 100644
--- a/src/tint/lang/spirv/reader/ast_parser/function.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/function.cc
@@ -230,6 +230,7 @@
return core::BinaryOp::kDivide;
case spv::Op::OpUMod:
case spv::Op::OpSMod:
+ case spv::Op::OpSRem:
case spv::Op::OpFRem:
return core::BinaryOp::kModulo;
case spv::Op::OpLogicalEqual:
diff --git a/src/tint/lang/spirv/reader/ast_parser/function_arithmetic_test.cc b/src/tint/lang/spirv/reader/ast_parser/function_arithmetic_test.cc
index 3540752..8a2410d 100644
--- a/src/tint/lang/spirv/reader/ast_parser/function_arithmetic_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/function_arithmetic_test.cc
@@ -588,9 +588,15 @@
BinaryData{"v2uint", "v2uint_10_20", "OpUMod", "v2uint_20_10", "vec2u",
AstFor("v2uint_10_20"), "%", AstFor("v2uint_20_10")}));
-// Currently WGSL is missing a mapping for OpSRem
-// https://github.com/gpuweb/gpuweb/issues/702
+// For non-exceptional cases SPIR-V says:
+// Sign of result of OpSRem matches the sign of the *first* operand.
+// This is like WGSL % operator.
+// Sign of result of OpSMod matches the sign of the *second* operand.
+//
+// But then Vulkan says behaviour is undefined if either operand is negative.
+// You may as well use OpUMod.
+// Test OpSMod
INSTANTIATE_TEST_SUITE_P(SpirvASTParserTest_SMod,
SpvBinaryArithTest,
::testing::Values(
@@ -657,6 +663,73 @@
HasSubstr(R"(let x_1 = bitcast<vec2u>((vec2i(30i, 40i) % vec2i(40i, 30i)));)"));
}
+// Test OpSRem
+INSTANTIATE_TEST_SUITE_P(SpirvASTParserTest_SRem,
+ SpvBinaryArithTest,
+ ::testing::Values(
+ // Both int
+ BinaryData{"int", "int_30", "OpSRem", "int_40", "i32", "30i", "%",
+ "40i"}, // Both v2int
+ BinaryData{"v2int", "v2int_30_40", "OpSRem", "v2int_40_30", "vec2i",
+ AstFor("v2int_30_40"), "%", AstFor("v2int_40_30")}));
+
+INSTANTIATE_TEST_SUITE_P(
+ SpirvASTParserTest_SRem_MixedSignednessOperands,
+ SpvBinaryArithTest,
+ ::testing::Values(
+ // Mixed, returning int, second arg uint
+ BinaryData{"int", "int_30", "OpSRem", "uint_10", "i32", "30i", "%", "bitcast<i32>(10u)"},
+ // Mixed, returning int, first arg uint
+ BinaryData{"int", "uint_10", "OpSRem", "int_30", "i32", "bitcast<i32>(10u)", "%",
+ "30i"}, // Mixed, returning v2int, first arg v2uint
+ BinaryData{"v2int", "v2uint_10_20", "OpSRem", "v2int_30_40", "vec2i",
+ AstFor("cast_int_v2uint_10_20"), "%", AstFor("v2int_30_40")},
+ // Mixed, returning v2int, second arg v2uint
+ BinaryData{"v2int", "v2int_30_40", "OpSRem", "v2uint_10_20", "vec2i", AstFor("v2int_30_40"),
+ "%", AstFor("cast_int_v2uint_10_20")}));
+
+TEST_F(SpvBinaryArithTestBasic, SRem_Scalar_UnsignedResult) {
+ // The WGSL signed modulus operator expects both operands to be signed
+ // and the result is signed as well.
+ // In this test SPIR-V demands an unsigned result, so we have to
+ // wrap the result with an as-cast.
+ const auto assembly = Preamble() + R"(
+ %100 = OpFunction %void None %voidfn
+ %entry = OpLabel
+ %1 = OpSRem %uint %int_30 %int_40
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto p = parser(test::Assemble(assembly));
+ ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error() << "\n" << assembly;
+ auto fe = p->function_emitter(100);
+ EXPECT_TRUE(fe.EmitBody()) << p->error();
+ auto ast_body = fe.ast_body();
+ EXPECT_THAT(test::ToString(p->program(), ast_body),
+ HasSubstr("let x_1 = bitcast<u32>((30i % 40i));"));
+}
+
+TEST_F(SpvBinaryArithTestBasic, SRem_Vector_UnsignedResult) {
+ // The WGSL signed modulus operator expects both operands to be signed
+ // and the result is signed as well.
+ // In this test SPIR-V demands an unsigned result, so we have to
+ // wrap the result with an as-cast.
+ const auto assembly = Preamble() + R"(
+ %100 = OpFunction %void None %voidfn
+ %entry = OpLabel
+ %1 = OpSRem %v2uint %v2int_30_40 %v2int_40_30
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto p = parser(test::Assemble(assembly));
+ ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error() << "\n" << assembly;
+ auto fe = p->function_emitter(100);
+ EXPECT_TRUE(fe.EmitBody()) << p->error();
+ auto ast_body = fe.ast_body();
+ EXPECT_THAT(test::ToString(p->program(), ast_body),
+ HasSubstr(R"(let x_1 = bitcast<vec2u>((vec2i(30i, 40i) % vec2i(40i, 30i)));)"));
+}
+
INSTANTIATE_TEST_SUITE_P(SpirvASTParserTest_FRem,
SpvBinaryArithTest,
::testing::Values(
diff --git a/src/tint/lang/spirv/reader/ast_parser/handle_test.cc b/src/tint/lang/spirv/reader/ast_parser/handle_test.cc
index fcc1ca8..4366d57 100644
--- a/src/tint/lang/spirv/reader/ast_parser/handle_test.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/handle_test.cc
@@ -4340,5 +4340,110 @@
EXPECT_EQ(p->error(), "invalid handle object passed as function parameter");
}
+TEST_F(SpvParserHandleTest, Image_UnknownDepth_NonDepthUse) {
+ const auto assembly = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %1 "main"
+ OpExecutionMode %1 OriginUpperLeft
+ OpDecorate %7 DescriptorSet 0
+ OpDecorate %7 Binding 0
+ OpDecorate %8 DescriptorSet 0
+ OpDecorate %8 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %4 = OpTypeImage %float 2D 2 0 0 1 Unknown
+ %5 = OpTypeSampler
+ %v2float = OpTypeVector %float 2
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %6 = OpTypeSampledImage %4
+%_ptr_UniformConstant_4 = OpTypePointer UniformConstant %4
+ %7 = OpVariable %_ptr_UniformConstant_4 UniformConstant
+%_ptr_UniformConstant_5 = OpTypePointer UniformConstant %5
+ %8 = OpVariable %_ptr_UniformConstant_5 UniformConstant
+ %const = OpConstantNull %v2float
+ %1 = OpFunction %void None %15
+ %18 = OpLabel
+ %20 = OpLoad %4 %7
+ %21 = OpLoad %5 %8
+ %22 = OpSampledImage %6 %20 %21
+ %23 = OpImageSampleImplicitLod %v4float %22 %const None
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto p = parser(test::Assemble(assembly));
+ EXPECT_TRUE(p->BuildAndParseInternalModule());
+ const auto got = test::ToString(p->program());
+ auto* expect = R"(@group(0) @binding(0) var x_7 : texture_2d<f32>;
+
+@group(0) @binding(1) var x_8 : sampler;
+
+fn main_1() {
+ let x_23 = textureSample(x_7, x_8, vec2f());
+ return;
+}
+
+@fragment
+fn main() {
+ main_1();
+}
+)";
+ ASSERT_EQ(expect, got);
+}
+
+TEST_F(SpvParserHandleTest, Image_UnknownDepth_DepthUse) {
+ const auto assembly = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %1 "main"
+ OpExecutionMode %1 OriginUpperLeft
+ OpDecorate %7 DescriptorSet 0
+ OpDecorate %7 Binding 0
+ OpDecorate %8 DescriptorSet 0
+ OpDecorate %8 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %4 = OpTypeImage %float 2D 2 0 0 1 Unknown
+ %5 = OpTypeSampler
+ %v2float = OpTypeVector %float 2
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %6 = OpTypeSampledImage %4
+%_ptr_UniformConstant_4 = OpTypePointer UniformConstant %4
+ %7 = OpVariable %_ptr_UniformConstant_4 UniformConstant
+%_ptr_UniformConstant_5 = OpTypePointer UniformConstant %5
+ %8 = OpVariable %_ptr_UniformConstant_5 UniformConstant
+ %const = OpConstantNull %v2float
+ %float_0 = OpConstantNull %float
+ %1 = OpFunction %void None %15
+ %18 = OpLabel
+ %20 = OpLoad %4 %7
+ %21 = OpLoad %5 %8
+ %22 = OpSampledImage %6 %20 %21
+ %23 = OpImageSampleDrefImplicitLod %v4float %22 %const %float_0 None
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto p = parser(test::Assemble(assembly));
+ EXPECT_TRUE(p->BuildAndParseInternalModule());
+ const auto got = test::ToString(p->program());
+ auto* expect = R"(@group(0) @binding(0) var x_7 : texture_depth_2d;
+
+@group(0) @binding(1) var x_8 : sampler_comparison;
+
+fn main_1() {
+ let x_23 = textureSampleCompare(x_7, x_8, vec2f(), 0.0f);
+ return;
+}
+
+@fragment
+fn main() {
+ main_1();
+}
+)";
+ ASSERT_EQ(expect, got);
+}
+
} // namespace
} // namespace tint::spirv::reader::ast_parser
diff --git a/src/tint/lang/spirv/reader/common/BUILD.cmake b/src/tint/lang/spirv/reader/common/BUILD.cmake
index 6d8e6c0..2d11c17 100644
--- a/src/tint/lang/spirv/reader/common/BUILD.cmake
+++ b/src/tint/lang/spirv/reader/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/spirv/reader/common/BUILD.gn b/src/tint/lang/spirv/reader/common/BUILD.gn
index 2f2b528..26c1566 100644
--- a/src/tint/lang/spirv/reader/common/BUILD.gn
+++ b/src/tint/lang/spirv/reader/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/BUILD.cmake b/src/tint/lang/spirv/writer/BUILD.cmake
index 3bd4ed8..26d0fec 100644
--- a/src/tint/lang/spirv/writer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/spirv/writer/ast_printer/BUILD.cmake)
diff --git a/src/tint/lang/spirv/writer/BUILD.gn b/src/tint/lang/spirv/writer/BUILD.gn
index 1e1a21a..b280bc0 100644
--- a/src/tint/lang/spirv/writer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake b/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
index 8c116ed..acaaf78 100644
--- a/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_SPV_WRITER)
diff --git a/src/tint/lang/spirv/writer/ast_printer/BUILD.gn b/src/tint/lang/spirv/writer/ast_printer/BUILD.gn
index fa5fd93..1243e2b 100644
--- a/src/tint/lang/spirv/writer/ast_printer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/ast_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/common/BUILD.cmake b/src/tint/lang/spirv/writer/common/BUILD.cmake
index c92ed15..de89ec2 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/common/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_SPV_WRITER)
diff --git a/src/tint/lang/spirv/writer/common/BUILD.gn b/src/tint/lang/spirv/writer/common/BUILD.gn
index 2dd5122..0d00bd5 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.gn
+++ b/src/tint/lang/spirv/writer/common/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.cmake b/src/tint/lang/spirv/writer/printer/BUILD.cmake
index 72ab825..fc7ac77 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.gn b/src/tint/lang/spirv/writer/printer/BUILD.gn
index c6e95b9..d7f4df9 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.gn
+++ b/src/tint/lang/spirv/writer/printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.cmake b/src/tint/lang/spirv/writer/raise/BUILD.cmake
index a7052a1..f5d7856 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/raise/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.gn b/src/tint/lang/spirv/writer/raise/BUILD.gn
index c47822e..1e3296d 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.gn
+++ b/src/tint/lang/spirv/writer/raise/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
index 7c321a8..6824dda 100644
--- a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
+++ b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic.cc
@@ -72,7 +72,7 @@
};
// Helper to replace the instruction with a column-wise operation.
- auto column_wise = [&](enum core::ir::Binary::Kind op) {
+ auto column_wise = [&](auto op) {
auto* mat = ty->As<core::type::Matrix>();
Vector<core::ir::Value*, 4> args;
for (uint32_t col = 0; col < mat->columns(); col++) {
diff --git a/src/tint/lang/wgsl/BUILD.cmake b/src/tint/lang/wgsl/BUILD.cmake
index e7d0dc1..90ce7f7 100644
--- a/src/tint/lang/wgsl/BUILD.cmake
+++ b/src/tint/lang/wgsl/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/wgsl/ast/BUILD.cmake)
diff --git a/src/tint/lang/wgsl/BUILD.gn b/src/tint/lang/wgsl/BUILD.gn
index 48b3c7a..922f8e8 100644
--- a/src/tint/lang/wgsl/BUILD.gn
+++ b/src/tint/lang/wgsl/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/ast/BUILD.cmake b/src/tint/lang/wgsl/ast/BUILD.cmake
index f44a041..3a06809 100644
--- a/src/tint/lang/wgsl/ast/BUILD.cmake
+++ b/src/tint/lang/wgsl/ast/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/wgsl/ast/transform/BUILD.cmake)
diff --git a/src/tint/lang/wgsl/ast/BUILD.gn b/src/tint/lang/wgsl/ast/BUILD.gn
index 47ee72f..d74d107 100644
--- a/src/tint/lang/wgsl/ast/BUILD.gn
+++ b/src/tint/lang/wgsl/ast/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/ast/transform/BUILD.cmake b/src/tint/lang/wgsl/ast/transform/BUILD.cmake
index d91332e..21e7fa31 100644
--- a/src/tint/lang/wgsl/ast/transform/BUILD.cmake
+++ b/src/tint/lang/wgsl/ast/transform/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/ast/transform/BUILD.gn b/src/tint/lang/wgsl/ast/transform/BUILD.gn
index c55205d..3f325ce 100644
--- a/src/tint/lang/wgsl/ast/transform/BUILD.gn
+++ b/src/tint/lang/wgsl/ast/transform/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/helpers/BUILD.cmake b/src/tint/lang/wgsl/helpers/BUILD.cmake
index 048427b..0c6b82f 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.cmake
+++ b/src/tint/lang/wgsl/helpers/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/helpers/BUILD.gn b/src/tint/lang/wgsl/helpers/BUILD.gn
index 9836e13..0ebfb1f 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.gn
+++ b/src/tint/lang/wgsl/helpers/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/inspector/BUILD.cmake b/src/tint/lang/wgsl/inspector/BUILD.cmake
index 2e4ea3d..e5b36a0 100644
--- a/src/tint/lang/wgsl/inspector/BUILD.cmake
+++ b/src/tint/lang/wgsl/inspector/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/inspector/BUILD.gn b/src/tint/lang/wgsl/inspector/BUILD.gn
index 472f757..5fea9d0 100644
--- a/src/tint/lang/wgsl/inspector/BUILD.gn
+++ b/src/tint/lang/wgsl/inspector/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/program/BUILD.cmake b/src/tint/lang/wgsl/program/BUILD.cmake
index eac1123..bae5dda 100644
--- a/src/tint/lang/wgsl/program/BUILD.cmake
+++ b/src/tint/lang/wgsl/program/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/program/BUILD.gn b/src/tint/lang/wgsl/program/BUILD.gn
index 550397b..784b43c 100644
--- a/src/tint/lang/wgsl/program/BUILD.gn
+++ b/src/tint/lang/wgsl/program/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/reader/BUILD.cmake b/src/tint/lang/wgsl/reader/BUILD.cmake
index 02401cf..2c84e0b 100644
--- a/src/tint/lang/wgsl/reader/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/wgsl/reader/parser/BUILD.cmake)
diff --git a/src/tint/lang/wgsl/reader/BUILD.gn b/src/tint/lang/wgsl/reader/BUILD.gn
index 1de5c0d..e26cd97 100644
--- a/src/tint/lang/wgsl/reader/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/reader/parser/BUILD.cmake b/src/tint/lang/wgsl/reader/parser/BUILD.cmake
index d201571..e53c99c 100644
--- a/src/tint/lang/wgsl/reader/parser/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/parser/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/reader/parser/BUILD.gn b/src/tint/lang/wgsl/reader/parser/BUILD.gn
index b7a6ca9..36c9f43 100644
--- a/src/tint/lang/wgsl/reader/parser/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/parser/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
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 38e81e1..28e5889 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_IR)
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 54696df..f4eb7f4 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/resolver/BUILD.cmake b/src/tint/lang/wgsl/resolver/BUILD.cmake
index 1e09e9f..6f0a3d3 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.cmake
+++ b/src/tint/lang/wgsl/resolver/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/resolver/BUILD.gn b/src/tint/lang/wgsl/resolver/BUILD.gn
index 01da15a..2e40118 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.gn
+++ b/src/tint/lang/wgsl/resolver/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index de69282..1219e92 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -151,16 +151,13 @@
return false;
}
- // Check before std::move()'ing enabled_extensions_
- const bool disable_uniformity_analysis =
- enabled_extensions_.Contains(core::Extension::kChromiumDisableUniformityAnalysis);
-
- // Create the semantic module.
- auto* mod = builder_->create<sem::Module>(std::move(dependencies_.ordered_globals),
- std::move(enabled_extensions_));
+ // Create the semantic module. Don't be tempted to std::move() these, they're used below.
+ auto* mod = builder_->create<sem::Module>(dependencies_.ordered_globals, enabled_extensions_);
ApplyDiagnosticSeverities(mod);
builder_->Sem().SetModule(mod);
+ const bool disable_uniformity_analysis =
+ enabled_extensions_.Contains(core::Extension::kChromiumDisableUniformityAnalysis);
if (result && !disable_uniformity_analysis) {
// Run the uniformity analysis, which requires a complete semantic module.
if (!AnalyzeUniformity(builder_, dependencies_)) {
diff --git a/src/tint/lang/wgsl/sem/BUILD.cmake b/src/tint/lang/wgsl/sem/BUILD.cmake
index ecd7e85..11238c5 100644
--- a/src/tint/lang/wgsl/sem/BUILD.cmake
+++ b/src/tint/lang/wgsl/sem/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/sem/BUILD.gn b/src/tint/lang/wgsl/sem/BUILD.gn
index 7d8d66b..ae039c1 100644
--- a/src/tint/lang/wgsl/sem/BUILD.gn
+++ b/src/tint/lang/wgsl/sem/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/writer/BUILD.cmake b/src/tint/lang/wgsl/writer/BUILD.cmake
index 53ee652..0fdab06 100644
--- a/src/tint/lang/wgsl/writer/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(lang/wgsl/writer/ast_printer/BUILD.cmake)
diff --git a/src/tint/lang/wgsl/writer/BUILD.gn b/src/tint/lang/wgsl/writer/BUILD.gn
index 230167b..cb47dbc 100644
--- a/src/tint/lang/wgsl/writer/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/writer/ast_printer/BUILD.cmake b/src/tint/lang/wgsl/writer/ast_printer/BUILD.cmake
index fd4338f..8004d94 100644
--- a/src/tint/lang/wgsl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/ast_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/writer/ast_printer/BUILD.gn b/src/tint/lang/wgsl/writer/ast_printer/BUILD.gn
index 62341ae..7e2c123 100644
--- a/src/tint/lang/wgsl/writer/ast_printer/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/ast_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
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 426214e..ef8b494 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
if(TINT_BUILD_IR)
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 04785fc..e19abe9 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake
index 44ec253..0a46c6e 100644
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn
index f391618..0b604d8 100644
--- a/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/syntax_tree_printer/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/BUILD.cmake b/src/tint/utils/BUILD.cmake
index 0f7a6a9..5f173eb 100644
--- a/src/tint/utils/BUILD.cmake
+++ b/src/tint/utils/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
include(utils/cli/BUILD.cmake)
diff --git a/src/tint/utils/BUILD.gn b/src/tint/utils/BUILD.gn
index 67e46cc..a7e945f 100644
--- a/src/tint/utils/BUILD.gn
+++ b/src/tint/utils/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/cli/BUILD.cmake b/src/tint/utils/cli/BUILD.cmake
index f0a0c88..7be4d1b 100644
--- a/src/tint/utils/cli/BUILD.cmake
+++ b/src/tint/utils/cli/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/cli/BUILD.gn b/src/tint/utils/cli/BUILD.gn
index c857776..12f567c 100644
--- a/src/tint/utils/cli/BUILD.gn
+++ b/src/tint/utils/cli/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/command/BUILD.cmake b/src/tint/utils/command/BUILD.cmake
index ce450a3..a95aa77 100644
--- a/src/tint/utils/command/BUILD.cmake
+++ b/src/tint/utils/command/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/command/BUILD.gn b/src/tint/utils/command/BUILD.gn
index 53f5b9e..c9b9d86 100644
--- a/src/tint/utils/command/BUILD.gn
+++ b/src/tint/utils/command/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/containers/BUILD.cmake b/src/tint/utils/containers/BUILD.cmake
index 3b677a4..2cb4ff8 100644
--- a/src/tint/utils/containers/BUILD.cmake
+++ b/src/tint/utils/containers/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/containers/BUILD.gn b/src/tint/utils/containers/BUILD.gn
index 34a30d1..a912cce 100644
--- a/src/tint/utils/containers/BUILD.gn
+++ b/src/tint/utils/containers/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/debug/BUILD.cmake b/src/tint/utils/debug/BUILD.cmake
index 930b205..a8cc012 100644
--- a/src/tint/utils/debug/BUILD.cmake
+++ b/src/tint/utils/debug/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/debug/BUILD.gn b/src/tint/utils/debug/BUILD.gn
index 975d4d0..743214b 100644
--- a/src/tint/utils/debug/BUILD.gn
+++ b/src/tint/utils/debug/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/diagnostic/BUILD.cmake b/src/tint/utils/diagnostic/BUILD.cmake
index ec63e21..dc7251c 100644
--- a/src/tint/utils/diagnostic/BUILD.cmake
+++ b/src/tint/utils/diagnostic/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/diagnostic/BUILD.gn b/src/tint/utils/diagnostic/BUILD.gn
index 1ac3aca..e99d811 100644
--- a/src/tint/utils/diagnostic/BUILD.gn
+++ b/src/tint/utils/diagnostic/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/file/BUILD.cmake b/src/tint/utils/file/BUILD.cmake
index 2a88c4b..77f7f1d 100644
--- a/src/tint/utils/file/BUILD.cmake
+++ b/src/tint/utils/file/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/file/BUILD.gn b/src/tint/utils/file/BUILD.gn
index 8c99d8a..cfca680 100644
--- a/src/tint/utils/file/BUILD.gn
+++ b/src/tint/utils/file/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/generator/BUILD.cmake b/src/tint/utils/generator/BUILD.cmake
index c91c3a7..b05cf02 100644
--- a/src/tint/utils/generator/BUILD.cmake
+++ b/src/tint/utils/generator/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/generator/BUILD.gn b/src/tint/utils/generator/BUILD.gn
index 08c5b7d..e1d134c 100644
--- a/src/tint/utils/generator/BUILD.gn
+++ b/src/tint/utils/generator/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/ice/BUILD.cmake b/src/tint/utils/ice/BUILD.cmake
index a135b18..4e30499 100644
--- a/src/tint/utils/ice/BUILD.cmake
+++ b/src/tint/utils/ice/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/ice/BUILD.gn b/src/tint/utils/ice/BUILD.gn
index c6ea665..d151d2f 100644
--- a/src/tint/utils/ice/BUILD.gn
+++ b/src/tint/utils/ice/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/id/BUILD.cmake b/src/tint/utils/id/BUILD.cmake
index 2b1bca6..c0f47f8 100644
--- a/src/tint/utils/id/BUILD.cmake
+++ b/src/tint/utils/id/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/id/BUILD.gn b/src/tint/utils/id/BUILD.gn
index 448ba22..178f9fe 100644
--- a/src/tint/utils/id/BUILD.gn
+++ b/src/tint/utils/id/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/macros/BUILD.cmake b/src/tint/utils/macros/BUILD.cmake
index 64ea187..39242f1 100644
--- a/src/tint/utils/macros/BUILD.cmake
+++ b/src/tint/utils/macros/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/macros/BUILD.gn b/src/tint/utils/macros/BUILD.gn
index 3ac9b9d..7b85feb 100644
--- a/src/tint/utils/macros/BUILD.gn
+++ b/src/tint/utils/macros/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/macros/compiler.h b/src/tint/utils/macros/compiler.h
index 6d31ca8..c279f53 100644
--- a/src/tint/utils/macros/compiler.h
+++ b/src/tint/utils/macros/compiler.h
@@ -32,6 +32,7 @@
#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
#define TINT_DISABLE_WARNING_DEPRECATED __pragma(warning(disable : 4996))
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER /* currently no-op */
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
@@ -59,6 +60,8 @@
#define TINT_DISABLE_WARNING_WEAK_VTABLES _Pragma("clang diagnostic ignored \"-Wweak-vtables\"")
#define TINT_DISABLE_WARNING_FLOAT_EQUAL _Pragma("clang diagnostic ignored \"-Wfloat-equal\"")
#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER \
+ _Pragma("clang diagnostic ignored \"-Wreserved-identifier\"")
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
@@ -79,13 +82,14 @@
#define TINT_DISABLE_WARNING_CONSTANT_OVERFLOW /* currently no-op */
#define TINT_DISABLE_WARNING_MAYBE_UNINITIALIZED \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-#define TINT_DISABLE_WARNING_NEWLINE_EOF /* currently no-op */
-#define TINT_DISABLE_WARNING_OLD_STYLE_CAST /* currently no-op */
-#define TINT_DISABLE_WARNING_SIGN_CONVERSION /* currently no-op */
-#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */
-#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
-#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
-#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_NEWLINE_EOF /* currently no-op */
+#define TINT_DISABLE_WARNING_OLD_STYLE_CAST /* currently no-op */
+#define TINT_DISABLE_WARNING_SIGN_CONVERSION /* currently no-op */
+#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */
+#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
+#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
+#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER /* currently no-op */
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
diff --git a/src/tint/utils/math/BUILD.cmake b/src/tint/utils/math/BUILD.cmake
index 8f869c3..879cddf 100644
--- a/src/tint/utils/math/BUILD.cmake
+++ b/src/tint/utils/math/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/math/BUILD.gn b/src/tint/utils/math/BUILD.gn
index 02609be..2498c65 100644
--- a/src/tint/utils/math/BUILD.gn
+++ b/src/tint/utils/math/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/memory/BUILD.cmake b/src/tint/utils/memory/BUILD.cmake
index 82dd843..a29c41c 100644
--- a/src/tint/utils/memory/BUILD.cmake
+++ b/src/tint/utils/memory/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/memory/BUILD.gn b/src/tint/utils/memory/BUILD.gn
index cc0ba0a..36728c7 100644
--- a/src/tint/utils/memory/BUILD.gn
+++ b/src/tint/utils/memory/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/reflection/BUILD.cmake b/src/tint/utils/reflection/BUILD.cmake
index 25c714a..b1a4079 100644
--- a/src/tint/utils/reflection/BUILD.cmake
+++ b/src/tint/utils/reflection/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/reflection/BUILD.gn b/src/tint/utils/reflection/BUILD.gn
index 10e6be9..86c94c2 100644
--- a/src/tint/utils/reflection/BUILD.gn
+++ b/src/tint/utils/reflection/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/result/BUILD.cmake b/src/tint/utils/result/BUILD.cmake
index 7ec5422..13ab5a3 100644
--- a/src/tint/utils/result/BUILD.cmake
+++ b/src/tint/utils/result/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/result/BUILD.gn b/src/tint/utils/result/BUILD.gn
index 6d8a21f..4baa0ea 100644
--- a/src/tint/utils/result/BUILD.gn
+++ b/src/tint/utils/result/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/rtti/BUILD.cmake b/src/tint/utils/rtti/BUILD.cmake
index a4e4af0..9b256ff 100644
--- a/src/tint/utils/rtti/BUILD.cmake
+++ b/src/tint/utils/rtti/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/rtti/BUILD.gn b/src/tint/utils/rtti/BUILD.gn
index bc9e1b4..cd23285 100644
--- a/src/tint/utils/rtti/BUILD.gn
+++ b/src/tint/utils/rtti/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/socket/BUILD.cmake b/src/tint/utils/socket/BUILD.cmake
index 84577fa..ce6f11b 100644
--- a/src/tint/utils/socket/BUILD.cmake
+++ b/src/tint/utils/socket/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
@@ -30,6 +31,10 @@
utils/socket/socket.h
)
+tint_target_add_dependencies(tint_utils_socket lib
+ tint_utils_macros
+)
+
if(IS_WIN)
tint_target_add_external_dependencies(tint_utils_socket lib
"winsock"
diff --git a/src/tint/utils/socket/BUILD.gn b/src/tint/utils/socket/BUILD.gn
index 7f0bba4..6f5c84e 100644
--- a/src/tint/utils/socket/BUILD.gn
+++ b/src/tint/utils/socket/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
@@ -30,7 +31,7 @@
"socket.cc",
"socket.h",
]
- deps = []
+ deps = [ "${tint_src_dir}/utils/macros" ]
if (is_win) {
deps += [ "${tint_src_dir}:winsock" ]
diff --git a/src/tint/utils/socket/socket.cc b/src/tint/utils/socket/socket.cc
index 54cb462..d11624c 100644
--- a/src/tint/utils/socket/socket.cc
+++ b/src/tint/utils/socket/socket.cc
@@ -14,6 +14,7 @@
#include "src/tint/utils/socket/socket.h"
+#include "src/tint/utils/macros/compiler.h"
#include "src/tint/utils/socket/rwmutex.h"
#if defined(_WIN32)
@@ -295,9 +296,12 @@
} else {
const auto timeout_us = timeout_ms * 1000;
+ // Note: These macros introduce identifiers that start with `__`.
+ TINT_BEGIN_DISABLE_WARNING(RESERVED_IDENTIFIER);
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(socket, &fdset);
+ TINT_END_DISABLE_WARNING(RESERVED_IDENTIFIER);
timeval tv;
tv.tv_sec = timeout_us / 1000000;
diff --git a/src/tint/utils/strconv/BUILD.cmake b/src/tint/utils/strconv/BUILD.cmake
index e85e5e4..abb1139 100644
--- a/src/tint/utils/strconv/BUILD.cmake
+++ b/src/tint/utils/strconv/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/strconv/BUILD.gn b/src/tint/utils/strconv/BUILD.gn
index c8a7638..11b33f6 100644
--- a/src/tint/utils/strconv/BUILD.gn
+++ b/src/tint/utils/strconv/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/symbol/BUILD.cmake b/src/tint/utils/symbol/BUILD.cmake
index 85799d7..49d5103 100644
--- a/src/tint/utils/symbol/BUILD.cmake
+++ b/src/tint/utils/symbol/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/symbol/BUILD.gn b/src/tint/utils/symbol/BUILD.gn
index a9ad6d6..4eec052 100644
--- a/src/tint/utils/symbol/BUILD.gn
+++ b/src/tint/utils/symbol/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/text/BUILD.cmake b/src/tint/utils/text/BUILD.cmake
index 379569e..e9fe32d 100644
--- a/src/tint/utils/text/BUILD.cmake
+++ b/src/tint/utils/text/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/text/BUILD.gn b/src/tint/utils/text/BUILD.gn
index ed245cd..6c0b1a1 100644
--- a/src/tint/utils/text/BUILD.gn
+++ b/src/tint/utils/text/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")
diff --git a/src/tint/utils/traits/BUILD.cmake b/src/tint/utils/traits/BUILD.cmake
index e8452a6..803ab24 100644
--- a/src/tint/utils/traits/BUILD.cmake
+++ b/src/tint/utils/traits/BUILD.cmake
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.cmake.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
################################################################################
diff --git a/src/tint/utils/traits/BUILD.gn b/src/tint/utils/traits/BUILD.gn
index 969d570..215b58e 100644
--- a/src/tint/utils/traits/BUILD.gn
+++ b/src/tint/utils/traits/BUILD.gn
@@ -13,11 +13,12 @@
# limitations under the License.
################################################################################
-# File generated by tools/src/cmd/gen
-# using the template:
+# File generated by 'tools/src/cmd/gen' using the template:
# tools/src/cmd/gen/build/BUILD.gn.tmpl
#
-# Do not modify this file directly
+# To regenerate run: './tools/run gen'
+#
+# Do not modify this file directly
################################################################################
import("../../../../scripts/tint_overrides_with_defaults.gni")