[glsl][ir] Split uniform texture code from texture polyfill.
This CL breaks the texture polyfill into two pieces. The
`TextureBuiltinsFromUniform` and `TexturePolyfill`. This is due to Dawn
sending pre-remapping data for the texture uniform bindings and post
mapping data for the combined samplers transform. In order to avoid
changing Dawn at this state, we're splitting the transform.
Bug: 42251044
Change-Id: I35220d3bd2faff03ab3f3ec3c165084057ffeac5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/209034
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/lang/glsl/writer/raise/BUILD.bazel b/src/tint/lang/glsl/writer/raise/BUILD.bazel
index aa88cef..19351da 100644
--- a/src/tint/lang/glsl/writer/raise/BUILD.bazel
+++ b/src/tint/lang/glsl/writer/raise/BUILD.bazel
@@ -44,6 +44,7 @@
"builtin_polyfill.cc",
"raise.cc",
"shader_io.cc",
+ "texture_builtins_from_uniform.cc",
"texture_polyfill.cc",
],
hdrs = [
@@ -52,6 +53,7 @@
"builtin_polyfill.h",
"raise.h",
"shader_io.h",
+ "texture_builtins_from_uniform.h",
"texture_polyfill.h",
],
deps = [
@@ -102,6 +104,7 @@
"bitcast_polyfill_test.cc",
"builtin_polyfill_test.cc",
"shader_io_test.cc",
+ "texture_builtins_from_uniform_test.cc",
"texture_polyfill_test.cc",
],
deps = [
diff --git a/src/tint/lang/glsl/writer/raise/BUILD.cmake b/src/tint/lang/glsl/writer/raise/BUILD.cmake
index cd6bc40..b1b1a71 100644
--- a/src/tint/lang/glsl/writer/raise/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/raise/BUILD.cmake
@@ -51,6 +51,8 @@
lang/glsl/writer/raise/raise.h
lang/glsl/writer/raise/shader_io.cc
lang/glsl/writer/raise/shader_io.h
+ lang/glsl/writer/raise/texture_builtins_from_uniform.cc
+ lang/glsl/writer/raise/texture_builtins_from_uniform.h
lang/glsl/writer/raise/texture_polyfill.cc
lang/glsl/writer/raise/texture_polyfill.h
)
@@ -109,6 +111,7 @@
lang/glsl/writer/raise/bitcast_polyfill_test.cc
lang/glsl/writer/raise/builtin_polyfill_test.cc
lang/glsl/writer/raise/shader_io_test.cc
+ lang/glsl/writer/raise/texture_builtins_from_uniform_test.cc
lang/glsl/writer/raise/texture_polyfill_test.cc
)
diff --git a/src/tint/lang/glsl/writer/raise/BUILD.gn b/src/tint/lang/glsl/writer/raise/BUILD.gn
index b5dc097..51b4f74 100644
--- a/src/tint/lang/glsl/writer/raise/BUILD.gn
+++ b/src/tint/lang/glsl/writer/raise/BUILD.gn
@@ -55,6 +55,8 @@
"raise.h",
"shader_io.cc",
"shader_io.h",
+ "texture_builtins_from_uniform.cc",
+ "texture_builtins_from_uniform.h",
"texture_polyfill.cc",
"texture_polyfill.h",
]
@@ -104,6 +106,7 @@
"bitcast_polyfill_test.cc",
"builtin_polyfill_test.cc",
"shader_io_test.cc",
+ "texture_builtins_from_uniform_test.cc",
"texture_polyfill_test.cc",
]
deps = [
diff --git a/src/tint/lang/glsl/writer/raise/raise.cc b/src/tint/lang/glsl/writer/raise/raise.cc
index 014a9b2..64a74c8 100644
--- a/src/tint/lang/glsl/writer/raise/raise.cc
+++ b/src/tint/lang/glsl/writer/raise/raise.cc
@@ -52,6 +52,7 @@
#include "src/tint/lang/glsl/writer/raise/bitcast_polyfill.h"
#include "src/tint/lang/glsl/writer/raise/builtin_polyfill.h"
#include "src/tint/lang/glsl/writer/raise/shader_io.h"
+#include "src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h"
#include "src/tint/lang/glsl/writer/raise/texture_polyfill.h"
namespace tint::glsl::writer {
@@ -65,6 +66,11 @@
} \
} while (false)
+ // Note, this comes before binding remapper as Dawn inserts _pre-remapping_ binding information.
+ // So, in order to move this later we'd need to update Dawn to send the _post-remapping_ data.
+ RUN_TRANSFORM(raise::TextureBuiltinsFromUniform, module,
+ options.bindings.texture_builtins_from_uniform);
+
tint::transform::multiplanar::BindingsMap multiplanar_map{};
RemapperData remapper_data{};
PopulateBindingInfo(options, remapper_data, multiplanar_map);
diff --git a/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.cc b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.cc
new file mode 100644
index 0000000..3ba665b
--- /dev/null
+++ b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.cc
@@ -0,0 +1,214 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h"
+
+#include <utility>
+
+#include "src/tint/lang/core/fluent_types.h" // IWYU pragma: export
+#include "src/tint/lang/core/ir/builder.h"
+#include "src/tint/lang/core/ir/module.h"
+#include "src/tint/lang/core/ir/validator.h"
+
+namespace tint::glsl::writer::raise {
+namespace {
+
+using namespace tint::core::fluent_types; // NOLINT
+
+/// PIMPL state for the transform.
+struct State {
+ /// The IR module.
+ core::ir::Module& ir;
+
+ /// The configuration
+ const TextureBuiltinsFromUniformOptions cfg;
+
+ /// The IR builder.
+ core::ir::Builder b{ir};
+
+ /// The type manager.
+ core::type::Manager& ty{ir.Types()};
+
+ /// The global var for texture uniform information
+ core::ir::Var* texture_uniform_data_ = nullptr;
+
+ /// Map from binding point to index into uniform structure
+ Hashmap<BindingPoint, uint32_t, 2> binding_point_to_uniform_idx_{};
+
+ /// Maps from a function parameter to the replacement function parameter for texture uniform
+ /// data
+ Hashmap<core::ir::FunctionParam*, core::ir::FunctionParam*, 2> texture_param_replacement_{};
+
+ /// Process the module.
+ void Process() {
+ Vector<core::ir::CoreBuiltinCall*, 4> call_worklist;
+ for (auto* inst : ir.Instructions()) {
+ if (auto* call = inst->As<core::ir::CoreBuiltinCall>()) {
+ switch (call->Func()) {
+ case core::BuiltinFn::kTextureNumLevels:
+ case core::BuiltinFn::kTextureNumSamples:
+ call_worklist.Push(call);
+ break;
+ default:
+ break;
+ }
+ continue;
+ }
+ }
+
+ // Replace the builtin calls that we found
+ for (auto* call : call_worklist) {
+ switch (call->Func()) {
+ case core::BuiltinFn::kTextureNumLevels:
+ case core::BuiltinFn::kTextureNumSamples:
+ TextureFromUniform(call);
+ break;
+ default:
+ TINT_UNREACHABLE();
+ }
+ }
+ }
+
+ void MakeTextureUniformStructure() {
+ if (texture_uniform_data_ != nullptr) {
+ return;
+ }
+
+ auto count = cfg.ubo_bindingpoint_ordering.size();
+
+ Vector<core::type::Manager::StructMemberDesc, 2> members;
+ members.Reserve(count);
+ for (uint32_t i = 0; i < count; ++i) {
+ members.Push({ir.symbols.New("tint_builtin_value_" + std::to_string(i)), ty.u32()});
+ binding_point_to_uniform_idx_.Add(cfg.ubo_bindingpoint_ordering[i], i);
+ }
+
+ auto* strct =
+ ir.Types().Struct(ir.symbols.New("TintTextureUniformData"), std::move(members));
+
+ b.Append(ir.root_block, [&] {
+ texture_uniform_data_ = b.Var(ty.ptr(uniform, strct, read));
+ texture_uniform_data_->SetBindingPoint(cfg.ubo_binding.group, cfg.ubo_binding.binding);
+ });
+ }
+
+ // Note, assumes is called inside an insert block
+ core::ir::Access* GetUniformValue(const BindingPoint& binding) {
+ TINT_ASSERT(binding_point_to_uniform_idx_.Contains(binding));
+
+ uint32_t idx = *binding_point_to_uniform_idx_.Get(binding);
+ return b.Access(ty.ptr<uniform, u32, read>(), texture_uniform_data_, u32(idx));
+ }
+
+ core::ir::Value* FindSource(core::ir::Value* tex) {
+ core::ir::Value* res = nullptr;
+ while (res == nullptr) {
+ tint::Switch(
+ tex,
+ [&](core::ir::InstructionResult* r) {
+ tint::Switch(
+ r->Instruction(), //
+ [&](core::ir::Var* v) { res = v->Result(0); }, //
+ [&](core::ir::Load* l) { tex = l->From(); }, //
+ TINT_ICE_ON_NO_MATCH);
+ },
+ [&](core::ir::FunctionParam* fp) { res = fp; },
+
+ TINT_ICE_ON_NO_MATCH);
+ }
+ return res;
+ }
+
+ core::ir::Value* GetAccessFromUniform(core::ir::Value* arg) {
+ auto* src = FindSource(arg);
+ return tint::Switch(
+ src,
+ [&](core::ir::InstructionResult* r) -> core::ir::Value* {
+ if (auto* v = r->Instruction()->As<core::ir::Var>()) {
+ auto* access = GetUniformValue(v->BindingPoint().value());
+ return b.Load(access)->Result(0);
+
+ } else {
+ TINT_UNREACHABLE() << "invalid instruction type";
+ }
+ },
+ [&](core::ir::FunctionParam* fp) { return AppendFunctionParam(fp); },
+ TINT_ICE_ON_NO_MATCH);
+ }
+
+ core::ir::Value* AppendFunctionParam(core::ir::FunctionParam* fp) {
+ return texture_param_replacement_.GetOrAdd(fp, [&] {
+ auto* new_param = b.FunctionParam("tint_tex_value", ty.u32());
+ fp->Function()->AppendParam(new_param);
+ texture_param_replacement_.Add(fp, new_param);
+
+ AddUniformArgToCallSites(fp->Function(), fp->Index());
+ return new_param;
+ });
+ }
+
+ void AddUniformArgToCallSites(core::ir::Function* func, uint32_t tex_idx) {
+ for (auto usage : func->UsagesUnsorted()) {
+ auto* call = usage->instruction->As<core::ir::UserCall>();
+ if (!call) {
+ continue;
+ }
+
+ b.InsertBefore(call, [&] {
+ auto* val = GetAccessFromUniform(call->Args()[tex_idx]);
+ call->AppendArg(val);
+ });
+ }
+ }
+
+ void TextureFromUniform(core::ir::BuiltinCall* call) {
+ MakeTextureUniformStructure();
+
+ b.InsertBefore(call, [&] {
+ auto* val = GetAccessFromUniform(call->Args()[0]);
+ call->Result(0)->ReplaceAllUsesWith(val);
+ });
+
+ call->Destroy();
+ }
+};
+
+} // namespace
+
+Result<SuccessType> TextureBuiltinsFromUniform(core::ir::Module& ir,
+ const TextureBuiltinsFromUniformOptions& cfg) {
+ auto result = ValidateAndDumpIfNeeded(ir, "glsl.TextureBuiltinsFromUniform transform");
+ if (result != Success) {
+ return result.Failure();
+ }
+
+ State{ir, cfg}.Process();
+
+ return Success;
+}
+
+} // namespace tint::glsl::writer::raise
diff --git a/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h
new file mode 100644
index 0000000..15c2c3a
--- /dev/null
+++ b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h
@@ -0,0 +1,53 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SRC_TINT_LANG_GLSL_WRITER_RAISE_TEXTURE_BUILTINS_FROM_UNIFORM_H_
+#define SRC_TINT_LANG_GLSL_WRITER_RAISE_TEXTURE_BUILTINS_FROM_UNIFORM_H_
+
+#include "src/tint/lang/glsl/writer/common/options.h"
+#include "src/tint/utils/result/result.h"
+
+// Forward declarations.
+namespace tint::core::ir {
+class Module;
+} // namespace tint::core::ir
+
+namespace tint::glsl::writer::raise {
+
+/// TextureBuiltinsFromUniform is a transform that replaces texture builtin function
+/// `textureNumLevels` and `textureNumSamples` which do not have GLSL equivalents with
+/// values read from a uniform.
+///
+/// @param module the module to transform
+/// @param cfg the configuration
+/// @returns success or failure
+Result<SuccessType> TextureBuiltinsFromUniform(core::ir::Module& module,
+ const TextureBuiltinsFromUniformOptions& cfg);
+
+} // namespace tint::glsl::writer::raise
+
+#endif // SRC_TINT_LANG_GLSL_WRITER_RAISE_TEXTURE_BUILTINS_FROM_UNIFORM_H_
diff --git a/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform_test.cc b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform_test.cc
new file mode 100644
index 0000000..bb69268
--- /dev/null
+++ b/src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform_test.cc
@@ -0,0 +1,866 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/glsl/writer/raise/texture_builtins_from_uniform.h"
+
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "src/tint/lang/core/fluent_types.h"
+#include "src/tint/lang/core/ir/transform/helper_test.h"
+#include "src/tint/lang/core/number.h"
+#include "src/tint/lang/core/type/depth_multisampled_texture.h"
+#include "src/tint/lang/core/type/depth_texture.h"
+#include "src/tint/lang/core/type/multisampled_texture.h"
+#include "src/tint/lang/core/type/sampled_texture.h"
+#include "src/tint/lang/core/type/storage_texture.h"
+#include "src/tint/lang/glsl/writer/common/options.h"
+
+using namespace tint::core::fluent_types; // NOLINT
+using namespace tint::core::number_suffixes; // NOLINT
+
+namespace tint::glsl::writer::raise {
+namespace {
+
+using GlslWriter_TextureBuiltinsFromUniformTest = core::ir::transform::TransformTest;
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureNumLevels) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %3:texture_2d<f32> = load %1
+ %4:u32 = textureNumLevels %3
+ %len:u32 = let %4
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %4:texture_2d<f32> = load %1
+ %5:ptr<uniform, u32, read> = access %2, 0u
+ %6:u32 = load %5
+ %len:u32 = let %6
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureNumSamples) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %3:texture_depth_multisampled_2d = load %1
+ %4:u32 = textureNumSamples %3
+ %len:u32 = let %4
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %4:texture_depth_multisampled_2d = load %1
+ %5:ptr<uniform, u32, read> = access %2, 0u
+ %6:u32 = load %5
+ %len:u32 = let %6
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, SameBuiltinCalledMultipleTimesTextureNumLevels) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
+ b.Let("len2", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %3:texture_2d<f32> = load %1
+ %4:u32 = textureNumLevels %3
+ %len:u32 = let %4
+ %6:u32 = textureNumLevels %3
+ %len2:u32 = let %6
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %4:texture_2d<f32> = load %1
+ %5:ptr<uniform, u32, read> = access %2, 0u
+ %6:u32 = load %5
+ %len:u32 = let %6
+ %8:ptr<uniform, u32, read> = access %2, 0u
+ %9:u32 = load %8
+ %len2:u32 = let %9
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, SameBuiltinCalledMultipleTimesTextureNumSamples) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
+ b.Let("len2", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %3:texture_depth_multisampled_2d = load %1
+ %4:u32 = textureNumSamples %3
+ %len:u32 = let %4
+ %6:u32 = textureNumSamples %3
+ %len2:u32 = let %6
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B2: {
+ %4:texture_depth_multisampled_2d = load %1
+ %5:ptr<uniform, u32, read> = access %2, 0u
+ %6:u32 = load %5
+ %len:u32 = let %6
+ %8:ptr<uniform, u32, read> = access %2, 0u
+ %9:u32 = load %8
+ %len2:u32 = let %9
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureAsFunctionParameter) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* p = b.FunctionParam(
+ "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f = b.Function("f", ty.u32());
+ f->SetParams({p});
+ b.Append(f->Block(),
+ [&] { b.Return(f, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p)); });
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), f, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%f = func(%t:texture_2d<f32>):u32 {
+ $B2: {
+ %4:u32 = textureNumLevels %t
+ ret %4
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %6:texture_2d<f32> = load %1
+ %7:u32 = call %f, %6
+ %len:u32 = let %7
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%f = func(%t:texture_2d<f32>, %tint_tex_value:u32):u32 {
+ $B2: {
+ ret %tint_tex_value
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %7:texture_2d<f32> = load %1
+ %8:ptr<uniform, u32, read> = access %2, 0u
+ %9:u32 = load %8
+ %10:u32 = call %f, %7, %9
+ %len:u32 = let %10
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureAsFunctionParameterUsedTwice) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* p = b.FunctionParam(
+ "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f = b.Function("f", ty.u32());
+ f->SetParams({p});
+ b.Append(f->Block(), [&] {
+ auto* val = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p)->Result(0);
+ val = b.Add(ty.u32(), val, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p))
+ ->Result(0);
+ b.Return(f, val);
+ });
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), f, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%f = func(%t:texture_2d<f32>):u32 {
+ $B2: {
+ %4:u32 = textureNumLevels %t
+ %5:u32 = textureNumLevels %t
+ %6:u32 = add %4, %5
+ ret %6
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %8:texture_2d<f32> = load %1
+ %9:u32 = call %f, %8
+ %len:u32 = let %9
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%f = func(%t:texture_2d<f32>, %tint_tex_value:u32):u32 {
+ $B2: {
+ %6:u32 = add %tint_tex_value, %tint_tex_value
+ ret %6
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %8:texture_2d<f32> = load %1
+ %9:ptr<uniform, u32, read> = access %2, 0u
+ %10:u32 = load %9
+ %11:u32 = call %f, %8, %10
+ %len:u32 = let %11
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureAsFunctionParameterMultipleParameters) {
+ auto* t1 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t1->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t1);
+
+ auto* t2 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t2->SetBindingPoint(0, 1);
+ b.ir.root_block->Append(t2);
+
+ auto* t3 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t3->SetBindingPoint(0, 2);
+ b.ir.root_block->Append(t3);
+
+ auto* p1 = b.FunctionParam(
+ "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* p2 = b.FunctionParam(
+ "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* p3 = b.FunctionParam(
+ "t3", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f = b.Function("f", ty.u32());
+ f->SetParams({p1, p2, p3});
+ b.Append(f->Block(), [&] {
+ auto* v1 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p1)->Result(0);
+ auto* v2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p2)->Result(0);
+ auto* v3 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p3)->Result(0);
+
+ auto* val = b.Add(ty.u32(), v1, v2);
+ val = b.Add(ty.u32(), val, v3);
+ b.Return(f, val);
+ });
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex1 = b.Load(t1);
+ auto* tex2 = b.Load(t2);
+ auto* tex3 = b.Load(t3);
+ b.Let("len", b.Call(ty.u32(), f, tex1, tex2, tex3));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
+ %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
+}
+
+%f = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %t3:texture_2d<f32>):u32 {
+ $B2: {
+ %8:u32 = textureNumLevels %t1
+ %9:u32 = textureNumLevels %t2
+ %10:u32 = textureNumLevels %t3
+ %11:u32 = add %8, %9
+ %12:u32 = add %11, %10
+ ret %12
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %14:texture_2d<f32> = load %1
+ %15:texture_2d<f32> = load %2
+ %16:texture_2d<f32> = load %3
+ %17:u32 = call %f, %14, %15, %16
+ %len:u32 = let %17
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+ tint_builtin_value_1:u32 @offset(4)
+ tint_builtin_value_2:u32 @offset(8)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
+ %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
+ %4:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%f = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %t3:texture_2d<f32>, %tint_tex_value:u32, %tint_tex_value_1:u32, %tint_tex_value_2:u32):u32 { # %tint_tex_value_1: 'tint_tex_value', %tint_tex_value_2: 'tint_tex_value'
+ $B2: {
+ %12:u32 = add %tint_tex_value, %tint_tex_value_1
+ %13:u32 = add %12, %tint_tex_value_2
+ ret %13
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B3: {
+ %15:texture_2d<f32> = load %1
+ %16:texture_2d<f32> = load %2
+ %17:texture_2d<f32> = load %3
+ %18:ptr<uniform, u32, read> = access %4, 0u
+ %19:u32 = load %18
+ %20:ptr<uniform, u32, read> = access %4, 1u
+ %21:u32 = load %20
+ %22:ptr<uniform, u32, read> = access %4, 2u
+ %23:u32 = load %22
+ %24:u32 = call %f, %15, %16, %17, %19, %21, %23
+ %len:u32 = let %24
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u},
+ std::vector<BindingPoint>{{0, 0}, {0, 1}, {0, 2}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureAsFunctionParameterNested) {
+ auto* t = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t);
+
+ auto* p2 = b.FunctionParam(
+ "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f2 = b.Function("f2", ty.u32());
+ f2->SetParams({p2});
+ b.Append(f2->Block(),
+ [&] { b.Return(f2, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p2)); });
+
+ auto* p1 = b.FunctionParam(
+ "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f1 = b.Function("f1", ty.u32());
+ f1->SetParams({p1});
+ b.Append(f1->Block(), [&] { b.Return(f1, b.Call(ty.u32(), f2, p1)); });
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex = b.Load(t);
+ b.Let("len", b.Call(ty.u32(), f1, tex));
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+}
+
+%f2 = func(%t2:texture_2d<f32>):u32 {
+ $B2: {
+ %4:u32 = textureNumLevels %t2
+ ret %4
+ }
+}
+%f1 = func(%t1:texture_2d<f32>):u32 {
+ $B3: {
+ %7:u32 = call %f2, %t1
+ ret %7
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B4: {
+ %9:texture_2d<f32> = load %1
+ %10:u32 = call %f1, %9
+ %len:u32 = let %10
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%f2 = func(%t2:texture_2d<f32>, %tint_tex_value:u32):u32 {
+ $B2: {
+ ret %tint_tex_value
+ }
+}
+%f1 = func(%t1:texture_2d<f32>, %tint_tex_value_1:u32):u32 { # %tint_tex_value_1: 'tint_tex_value'
+ $B3: {
+ %9:u32 = call %f2, %t1, %tint_tex_value_1
+ ret %9
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B4: {
+ %11:texture_2d<f32> = load %1
+ %12:ptr<uniform, u32, read> = access %2, 0u
+ %13:u32 = load %12
+ %14:u32 = call %f1, %11, %13
+ %len:u32 = let %14
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+TEST_F(GlslWriter_TextureBuiltinsFromUniformTest, TextureAsFunctionParameterMixed) {
+ auto* t1 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t1->SetBindingPoint(0, 0);
+ b.ir.root_block->Append(t1);
+ auto* t2 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t2->SetBindingPoint(0, 1);
+ b.ir.root_block->Append(t2);
+ auto* t3 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t3->SetBindingPoint(0, 2);
+ b.ir.root_block->Append(t3);
+ auto* t4 = b.Var(ty.ptr(
+ handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
+ read_write));
+ t4->SetBindingPoint(0, 3);
+ b.ir.root_block->Append(t4);
+ auto* t5 = b.Var(
+ ty.ptr(handle,
+ ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2dArray, ty.f32()),
+ read_write));
+ t5->SetBindingPoint(0, 4);
+ b.ir.root_block->Append(t5);
+
+ auto* p_nested1 = b.FunctionParam(
+ "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* p_nested2 = b.FunctionParam(
+ "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f_nested = b.Function("f_nested", ty.u32());
+ f_nested->SetParams({p_nested1, p_nested2});
+ b.Append(f_nested->Block(), [&] {
+ auto* v1 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p_nested1);
+ auto* v2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p_nested2);
+ b.Return(f_nested, b.Add(ty.u32(), v1, v2));
+ });
+
+ auto* a = b.FunctionParam("a", ty.u32());
+ auto* t = b.FunctionParam(
+ "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+ auto* f1 = b.Function("f1", ty.u32());
+ f1->SetParams({a, t});
+ b.Append(f1->Block(), [&] {
+ auto* val1 = b.Call(ty.u32(), f_nested, t, b.Load(t1));
+ auto* val2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, b.Load(t3));
+ auto* add = b.Add(ty.u32(), a, val1);
+ b.Return(f1, b.Add(ty.u32(), add, val2));
+ });
+
+ auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
+ func->SetWorkgroupSize(1, 1, 1);
+ b.Append(func->Block(), [&] {
+ auto* tex5 = b.Load(t5);
+ b.Let("m", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLayers, tex5));
+
+ auto* tex1 = b.Load(t1);
+ b.Let("n", b.Call(ty.u32(), f1, 9_u, tex1));
+
+ auto* tex2 = b.Load(t2);
+ b.Let("o", b.Call(ty.u32(), f_nested, tex2, tex2));
+
+ auto* tex4 = b.Load(t4);
+ b.Let("p", b.Call(ty.u32(), f_nested, tex1, tex4));
+
+ b.Return(func);
+ });
+
+ auto* src = R"(
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
+ %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
+ %4:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 3)
+ %5:ptr<handle, texture_2d_array<f32>, read_write> = var @binding_point(0, 4)
+}
+
+%f_nested = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>):u32 {
+ $B2: {
+ %9:u32 = textureNumLevels %t1
+ %10:u32 = textureNumLevels %t2
+ %11:u32 = add %9, %10
+ ret %11
+ }
+}
+%f1 = func(%a:u32, %t:texture_2d<f32>):u32 {
+ $B3: {
+ %15:texture_2d<f32> = load %1
+ %16:u32 = call %f_nested, %t, %15
+ %17:texture_2d<f32> = load %3
+ %18:u32 = textureNumLevels %17
+ %19:u32 = add %a, %16
+ %20:u32 = add %19, %18
+ ret %20
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B4: {
+ %22:texture_2d_array<f32> = load %5
+ %23:u32 = textureNumLayers %22
+ %m:u32 = let %23
+ %25:texture_2d<f32> = load %1
+ %26:u32 = call %f1, 9u, %25
+ %n:u32 = let %26
+ %28:texture_2d<f32> = load %2
+ %29:u32 = call %f_nested, %28, %28
+ %o:u32 = let %29
+ %31:texture_2d<f32> = load %4
+ %32:u32 = call %f_nested, %25, %31
+ %p:u32 = let %32
+ ret
+ }
+}
+)";
+
+ ASSERT_EQ(src, str());
+
+ auto* expect = R"(
+TintTextureUniformData = struct @align(4) {
+ tint_builtin_value_0:u32 @offset(0)
+ tint_builtin_value_1:u32 @offset(4)
+ tint_builtin_value_2:u32 @offset(8)
+ tint_builtin_value_3:u32 @offset(12)
+}
+
+$B1: { # root
+ %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
+ %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
+ %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
+ %4:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 3)
+ %5:ptr<handle, texture_2d_array<f32>, read_write> = var @binding_point(0, 4)
+ %6:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
+}
+
+%f_nested = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %tint_tex_value:u32, %tint_tex_value_1:u32):u32 { # %tint_tex_value_1: 'tint_tex_value'
+ $B2: {
+ %12:u32 = add %tint_tex_value, %tint_tex_value_1
+ ret %12
+ }
+}
+%f1 = func(%a:u32, %t:texture_2d<f32>, %tint_tex_value_2:u32):u32 { # %tint_tex_value_2: 'tint_tex_value'
+ $B3: {
+ %17:texture_2d<f32> = load %1
+ %18:ptr<uniform, u32, read> = access %6, 2u
+ %19:u32 = load %18
+ %20:u32 = call %f_nested, %t, %17, %tint_tex_value_2, %19
+ %21:texture_2d<f32> = load %3
+ %22:ptr<uniform, u32, read> = access %6, 3u
+ %23:u32 = load %22
+ %24:u32 = add %a, %20
+ %25:u32 = add %24, %23
+ ret %25
+ }
+}
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B4: {
+ %27:texture_2d_array<f32> = load %5
+ %28:u32 = textureNumLayers %27
+ %m:u32 = let %28
+ %30:texture_2d<f32> = load %1
+ %31:ptr<uniform, u32, read> = access %6, 2u
+ %32:u32 = load %31
+ %33:u32 = call %f1, 9u, %30, %32
+ %n:u32 = let %33
+ %35:texture_2d<f32> = load %2
+ %36:ptr<uniform, u32, read> = access %6, 0u
+ %37:u32 = load %36
+ %38:ptr<uniform, u32, read> = access %6, 0u
+ %39:u32 = load %38
+ %40:u32 = call %f_nested, %35, %35, %37, %39
+ %o:u32 = let %40
+ %42:texture_2d<f32> = load %4
+ %43:ptr<uniform, u32, read> = access %6, 2u
+ %44:u32 = load %43
+ %45:ptr<uniform, u32, read> = access %6, 1u
+ %46:u32 = load %45
+ %47:u32 = call %f_nested, %30, %42, %44, %46
+ %p:u32 = let %47
+ ret
+ }
+}
+)";
+
+ TextureBuiltinsFromUniformOptions cfg = {
+ {0, 30u}, std::vector<BindingPoint>{{0, 1}, {0, 3}, {0, 0}, {0, 2}}};
+ Run(TextureBuiltinsFromUniform, cfg);
+ EXPECT_EQ(expect, str());
+}
+
+} // namespace
+} // namespace tint::glsl::writer::raise
diff --git a/src/tint/lang/glsl/writer/raise/texture_polyfill.cc b/src/tint/lang/glsl/writer/raise/texture_polyfill.cc
index 1e838a9..94f3483 100644
--- a/src/tint/lang/glsl/writer/raise/texture_polyfill.cc
+++ b/src/tint/lang/glsl/writer/raise/texture_polyfill.cc
@@ -61,16 +61,6 @@
/// The type manager.
core::type::Manager& ty{ir.Types()};
- /// The global var for texture uniform information
- core::ir::Var* texture_uniform_data_ = nullptr;
-
- /// Map from binding point to index into uniform structure
- Hashmap<BindingPoint, uint32_t, 2> binding_point_to_uniform_idx_{};
-
- /// Maps from a function parameter to the replacement function parameter for texture uniform
- /// data
- Hashmap<core::ir::FunctionParam*, core::ir::FunctionParam*, 2> texture_param_replacement_{};
-
/// Process the module.
void Process() {
/// Converts all 1D texture types and accesses to 2D. This is required for GLSL ES, which
@@ -86,8 +76,6 @@
case core::BuiltinFn::kTextureDimensions:
case core::BuiltinFn::kTextureLoad:
case core::BuiltinFn::kTextureNumLayers:
- case core::BuiltinFn::kTextureNumLevels:
- case core::BuiltinFn::kTextureNumSamples:
case core::BuiltinFn::kTextureStore:
call_worklist.Push(call);
break;
@@ -110,10 +98,6 @@
case core::BuiltinFn::kTextureNumLayers:
TextureNumLayers(call);
break;
- case core::BuiltinFn::kTextureNumLevels:
- case core::BuiltinFn::kTextureNumSamples:
- TextureFromUniform(call);
- break;
case core::BuiltinFn::kTextureStore:
TextureStore(call);
break;
@@ -237,112 +221,6 @@
ld->Result(0)->SetType(new_type.value());
}
- void MakeTextureUniformStructure() {
- if (texture_uniform_data_ != nullptr) {
- return;
- }
-
- auto count = cfg.texture_builtins_from_uniform.ubo_bindingpoint_ordering.size();
-
- Vector<core::type::Manager::StructMemberDesc, 2> members;
- members.Reserve(count);
- for (uint32_t i = 0; i < count; ++i) {
- members.Push({ir.symbols.New("tint_builtin_value_" + std::to_string(i)), ty.u32()});
- binding_point_to_uniform_idx_.Add(
- cfg.texture_builtins_from_uniform.ubo_bindingpoint_ordering[i], i);
- }
-
- auto* strct =
- ir.Types().Struct(ir.symbols.New("TintTextureUniformData"), std::move(members));
-
- b.Append(ir.root_block, [&] {
- texture_uniform_data_ = b.Var(ty.ptr(uniform, strct, read));
- texture_uniform_data_->SetBindingPoint(
- cfg.texture_builtins_from_uniform.ubo_binding.group,
- cfg.texture_builtins_from_uniform.ubo_binding.binding);
- });
- }
-
- // Note, assumes is called inside an insert block
- core::ir::Access* GetUniformValue(const BindingPoint& binding) {
- TINT_ASSERT(binding_point_to_uniform_idx_.Contains(binding));
-
- uint32_t idx = *binding_point_to_uniform_idx_.Get(binding);
- return b.Access(ty.ptr<uniform, u32, read>(), texture_uniform_data_, u32(idx));
- }
-
- core::ir::Value* FindSource(core::ir::Value* tex) {
- core::ir::Value* res = nullptr;
- while (res == nullptr) {
- tint::Switch(
- tex,
- [&](core::ir::InstructionResult* r) {
- tint::Switch(
- r->Instruction(), //
- [&](core::ir::Var* v) { res = v->Result(0); }, //
- [&](core::ir::Load* l) { tex = l->From(); }, //
- TINT_ICE_ON_NO_MATCH);
- },
- [&](core::ir::FunctionParam* fp) { res = fp; },
-
- TINT_ICE_ON_NO_MATCH);
- }
- return res;
- }
-
- core::ir::Value* GetAccessFromUniform(core::ir::Value* arg) {
- auto* src = FindSource(arg);
- return tint::Switch(
- src,
- [&](core::ir::InstructionResult* r) -> core::ir::Value* {
- if (auto* v = r->Instruction()->As<core::ir::Var>()) {
- auto* access = GetUniformValue(v->BindingPoint().value());
- return b.Load(access)->Result(0);
-
- } else {
- TINT_UNREACHABLE() << "invalid instruction type";
- }
- },
- [&](core::ir::FunctionParam* fp) { return AppendFunctionParam(fp); },
- TINT_ICE_ON_NO_MATCH);
- }
-
- core::ir::Value* AppendFunctionParam(core::ir::FunctionParam* fp) {
- return texture_param_replacement_.GetOrAdd(fp, [&] {
- auto* new_param = b.FunctionParam("tint_tex_value", ty.u32());
- fp->Function()->AppendParam(new_param);
- texture_param_replacement_.Add(fp, new_param);
-
- AddUniformArgToCallSites(fp->Function(), fp->Index());
- return new_param;
- });
- }
-
- void AddUniformArgToCallSites(core::ir::Function* func, uint32_t tex_idx) {
- for (auto usage : func->UsagesUnsorted()) {
- auto* call = usage->instruction->As<core::ir::UserCall>();
- if (!call) {
- continue;
- }
-
- b.InsertBefore(call, [&] {
- auto* val = GetAccessFromUniform(call->Args()[tex_idx]);
- call->AppendArg(val);
- });
- }
- }
-
- void TextureFromUniform(core::ir::BuiltinCall* call) {
- MakeTextureUniformStructure();
-
- b.InsertBefore(call, [&] {
- auto* val = GetAccessFromUniform(call->Args()[0]);
- call->Result(0)->ReplaceAllUsesWith(val);
- });
-
- call->Destroy();
- }
-
// `textureDimensions` returns an unsigned scalar / vector in WGSL. `textureSize` and
// `imageSize` return a signed scalar / vector in GLSL. So, we need to cast the result to
// the needed WGSL type.
diff --git a/src/tint/lang/glsl/writer/raise/texture_polyfill_test.cc b/src/tint/lang/glsl/writer/raise/texture_polyfill_test.cc
index 949128d..901617e 100644
--- a/src/tint/lang/glsl/writer/raise/texture_polyfill_test.cc
+++ b/src/tint/lang/glsl/writer/raise/texture_polyfill_test.cc
@@ -870,830 +870,5 @@
EXPECT_EQ(expect, str());
}
-TEST_F(GlslWriter_TexturePolyfillTest, TextureNumLevels) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %3:texture_2d<f32> = load %1
- %4:u32 = textureNumLevels %3
- %len:u32 = let %4
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %4:texture_2d<f32> = load %1
- %5:ptr<uniform, u32, read> = access %2, 0u
- %6:u32 = load %5
- %len:u32 = let %6
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureNumSamples) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %3:texture_depth_multisampled_2d = load %1
- %4:u32 = textureNumSamples %3
- %len:u32 = let %4
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %4:texture_depth_multisampled_2d = load %1
- %5:ptr<uniform, u32, read> = access %2, 0u
- %6:u32 = load %5
- %len:u32 = let %6
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, SameBuiltinCalledMultipleTimesTextureNumLevels) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
- b.Let("len2", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %3:texture_2d<f32> = load %1
- %4:u32 = textureNumLevels %3
- %len:u32 = let %4
- %6:u32 = textureNumLevels %3
- %len2:u32 = let %6
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %4:texture_2d<f32> = load %1
- %5:ptr<uniform, u32, read> = access %2, 0u
- %6:u32 = load %5
- %len:u32 = let %6
- %8:ptr<uniform, u32, read> = access %2, 0u
- %9:u32 = load %8
- %len2:u32 = let %9
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, SameBuiltinCalledMultipleTimesTextureNumSamples) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::DepthMultisampledTexture>(core::type::TextureDimension::k2d),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
- b.Let("len2", b.Call(ty.u32(), core::BuiltinFn::kTextureNumSamples, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %3:texture_depth_multisampled_2d = load %1
- %4:u32 = textureNumSamples %3
- %len:u32 = let %4
- %6:u32 = textureNumSamples %3
- %len2:u32 = let %6
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_depth_multisampled_2d, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B2: {
- %4:texture_depth_multisampled_2d = load %1
- %5:ptr<uniform, u32, read> = access %2, 0u
- %6:u32 = load %5
- %len:u32 = let %6
- %8:ptr<uniform, u32, read> = access %2, 0u
- %9:u32 = load %8
- %len2:u32 = let %9
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureAsFunctionParameter) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* p = b.FunctionParam(
- "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f = b.Function("f", ty.u32());
- f->SetParams({p});
- b.Append(f->Block(),
- [&] { b.Return(f, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p)); });
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), f, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
-}
-
-%f = func(%t:texture_2d<f32>):u32 {
- $B2: {
- %4:u32 = textureNumLevels %t
- ret %4
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %6:texture_2d<f32> = load %1
- %7:u32 = call %f, %6
- %len:u32 = let %7
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%f = func(%t:texture_2d<f32>, %tint_tex_value:u32):u32 {
- $B2: {
- ret %tint_tex_value
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %7:texture_2d<f32> = load %1
- %8:ptr<uniform, u32, read> = access %2, 0u
- %9:u32 = load %8
- %10:u32 = call %f, %7, %9
- %len:u32 = let %10
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureAsFunctionParameterUsedTwice) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* p = b.FunctionParam(
- "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f = b.Function("f", ty.u32());
- f->SetParams({p});
- b.Append(f->Block(), [&] {
- auto* val = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p)->Result(0);
- val = b.Add(ty.u32(), val, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p))
- ->Result(0);
- b.Return(f, val);
- });
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), f, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
-}
-
-%f = func(%t:texture_2d<f32>):u32 {
- $B2: {
- %4:u32 = textureNumLevels %t
- %5:u32 = textureNumLevels %t
- %6:u32 = add %4, %5
- ret %6
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %8:texture_2d<f32> = load %1
- %9:u32 = call %f, %8
- %len:u32 = let %9
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%f = func(%t:texture_2d<f32>, %tint_tex_value:u32):u32 {
- $B2: {
- %6:u32 = add %tint_tex_value, %tint_tex_value
- ret %6
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %8:texture_2d<f32> = load %1
- %9:ptr<uniform, u32, read> = access %2, 0u
- %10:u32 = load %9
- %11:u32 = call %f, %8, %10
- %len:u32 = let %11
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureAsFunctionParameterMultipleParameters) {
- auto* t1 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t1->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t1);
-
- auto* t2 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t2->SetBindingPoint(0, 1);
- b.ir.root_block->Append(t2);
-
- auto* t3 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t3->SetBindingPoint(0, 2);
- b.ir.root_block->Append(t3);
-
- auto* p1 = b.FunctionParam(
- "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* p2 = b.FunctionParam(
- "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* p3 = b.FunctionParam(
- "t3", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f = b.Function("f", ty.u32());
- f->SetParams({p1, p2, p3});
- b.Append(f->Block(), [&] {
- auto* v1 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p1)->Result(0);
- auto* v2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p2)->Result(0);
- auto* v3 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p3)->Result(0);
-
- auto* val = b.Add(ty.u32(), v1, v2);
- val = b.Add(ty.u32(), val, v3);
- b.Return(f, val);
- });
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex1 = b.Load(t1);
- auto* tex2 = b.Load(t2);
- auto* tex3 = b.Load(t3);
- b.Let("len", b.Call(ty.u32(), f, tex1, tex2, tex3));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
- %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
-}
-
-%f = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %t3:texture_2d<f32>):u32 {
- $B2: {
- %8:u32 = textureNumLevels %t1
- %9:u32 = textureNumLevels %t2
- %10:u32 = textureNumLevels %t3
- %11:u32 = add %8, %9
- %12:u32 = add %11, %10
- ret %12
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %14:texture_2d<f32> = load %1
- %15:texture_2d<f32> = load %2
- %16:texture_2d<f32> = load %3
- %17:u32 = call %f, %14, %15, %16
- %len:u32 = let %17
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
- tint_builtin_value_1:u32 @offset(4)
- tint_builtin_value_2:u32 @offset(8)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
- %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
- %4:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%f = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %t3:texture_2d<f32>, %tint_tex_value:u32, %tint_tex_value_1:u32, %tint_tex_value_2:u32):u32 { # %tint_tex_value_1: 'tint_tex_value', %tint_tex_value_2: 'tint_tex_value'
- $B2: {
- %12:u32 = add %tint_tex_value, %tint_tex_value_1
- %13:u32 = add %12, %tint_tex_value_2
- ret %13
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B3: {
- %15:texture_2d<f32> = load %1
- %16:texture_2d<f32> = load %2
- %17:texture_2d<f32> = load %3
- %18:ptr<uniform, u32, read> = access %4, 0u
- %19:u32 = load %18
- %20:ptr<uniform, u32, read> = access %4, 1u
- %21:u32 = load %20
- %22:ptr<uniform, u32, read> = access %4, 2u
- %23:u32 = load %22
- %24:u32 = call %f, %15, %16, %17, %19, %21, %23
- %len:u32 = let %24
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u},
- std::vector<BindingPoint>{{0, 0}, {0, 1}, {0, 2}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureAsFunctionParameterNested) {
- auto* t = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t);
-
- auto* p2 = b.FunctionParam(
- "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f2 = b.Function("f2", ty.u32());
- f2->SetParams({p2});
- b.Append(f2->Block(),
- [&] { b.Return(f2, b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p2)); });
-
- auto* p1 = b.FunctionParam(
- "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f1 = b.Function("f1", ty.u32());
- f1->SetParams({p1});
- b.Append(f1->Block(), [&] { b.Return(f1, b.Call(ty.u32(), f2, p1)); });
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex = b.Load(t);
- b.Let("len", b.Call(ty.u32(), f1, tex));
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
-}
-
-%f2 = func(%t2:texture_2d<f32>):u32 {
- $B2: {
- %4:u32 = textureNumLevels %t2
- ret %4
- }
-}
-%f1 = func(%t1:texture_2d<f32>):u32 {
- $B3: {
- %7:u32 = call %f2, %t1
- ret %7
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B4: {
- %9:texture_2d<f32> = load %1
- %10:u32 = call %f1, %9
- %len:u32 = let %10
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%f2 = func(%t2:texture_2d<f32>, %tint_tex_value:u32):u32 {
- $B2: {
- ret %tint_tex_value
- }
-}
-%f1 = func(%t1:texture_2d<f32>, %tint_tex_value_1:u32):u32 { # %tint_tex_value_1: 'tint_tex_value'
- $B3: {
- %9:u32 = call %f2, %t1, %tint_tex_value_1
- ret %9
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B4: {
- %11:texture_2d<f32> = load %1
- %12:ptr<uniform, u32, read> = access %2, 0u
- %13:u32 = load %12
- %14:u32 = call %f1, %11, %13
- %len:u32 = let %14
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u}, std::vector<BindingPoint>{{0, 0}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
-TEST_F(GlslWriter_TexturePolyfillTest, TextureAsFunctionParameterMixed) {
- auto* t1 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t1->SetBindingPoint(0, 0);
- b.ir.root_block->Append(t1);
- auto* t2 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t2->SetBindingPoint(0, 1);
- b.ir.root_block->Append(t2);
- auto* t3 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t3->SetBindingPoint(0, 2);
- b.ir.root_block->Append(t3);
- auto* t4 = b.Var(ty.ptr(
- handle, ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()),
- read_write));
- t4->SetBindingPoint(0, 3);
- b.ir.root_block->Append(t4);
- auto* t5 = b.Var(
- ty.ptr(handle,
- ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2dArray, ty.f32()),
- read_write));
- t5->SetBindingPoint(0, 4);
- b.ir.root_block->Append(t5);
-
- auto* p_nested1 = b.FunctionParam(
- "t1", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* p_nested2 = b.FunctionParam(
- "t2", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f_nested = b.Function("f_nested", ty.u32());
- f_nested->SetParams({p_nested1, p_nested2});
- b.Append(f_nested->Block(), [&] {
- auto* v1 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p_nested1);
- auto* v2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, p_nested2);
- b.Return(f_nested, b.Add(ty.u32(), v1, v2));
- });
-
- auto* a = b.FunctionParam("a", ty.u32());
- auto* t = b.FunctionParam(
- "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
- auto* f1 = b.Function("f1", ty.u32());
- f1->SetParams({a, t});
- b.Append(f1->Block(), [&] {
- auto* val1 = b.Call(ty.u32(), f_nested, t, b.Load(t1));
- auto* val2 = b.Call(ty.u32(), core::BuiltinFn::kTextureNumLevels, b.Load(t3));
- auto* add = b.Add(ty.u32(), a, val1);
- b.Return(f1, b.Add(ty.u32(), add, val2));
- });
-
- auto* func = b.Function("main", ty.void_(), core::ir::Function::PipelineStage::kCompute);
- func->SetWorkgroupSize(1, 1, 1);
- b.Append(func->Block(), [&] {
- auto* tex5 = b.Load(t5);
- b.Let("m", b.Call(ty.u32(), core::BuiltinFn::kTextureNumLayers, tex5));
-
- auto* tex1 = b.Load(t1);
- b.Let("n", b.Call(ty.u32(), f1, 9_u, tex1));
-
- auto* tex2 = b.Load(t2);
- b.Let("o", b.Call(ty.u32(), f_nested, tex2, tex2));
-
- auto* tex4 = b.Load(t4);
- b.Let("p", b.Call(ty.u32(), f_nested, tex1, tex4));
-
- b.Return(func);
- });
-
- auto* src = R"(
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
- %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
- %4:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 3)
- %5:ptr<handle, texture_2d_array<f32>, read_write> = var @binding_point(0, 4)
-}
-
-%f_nested = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>):u32 {
- $B2: {
- %9:u32 = textureNumLevels %t1
- %10:u32 = textureNumLevels %t2
- %11:u32 = add %9, %10
- ret %11
- }
-}
-%f1 = func(%a:u32, %t:texture_2d<f32>):u32 {
- $B3: {
- %15:texture_2d<f32> = load %1
- %16:u32 = call %f_nested, %t, %15
- %17:texture_2d<f32> = load %3
- %18:u32 = textureNumLevels %17
- %19:u32 = add %a, %16
- %20:u32 = add %19, %18
- ret %20
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B4: {
- %22:texture_2d_array<f32> = load %5
- %23:u32 = textureNumLayers %22
- %m:u32 = let %23
- %25:texture_2d<f32> = load %1
- %26:u32 = call %f1, 9u, %25
- %n:u32 = let %26
- %28:texture_2d<f32> = load %2
- %29:u32 = call %f_nested, %28, %28
- %o:u32 = let %29
- %31:texture_2d<f32> = load %4
- %32:u32 = call %f_nested, %25, %31
- %p:u32 = let %32
- ret
- }
-}
-)";
-
- ASSERT_EQ(src, str());
-
- auto* expect = R"(
-TintTextureUniformData = struct @align(4) {
- tint_builtin_value_0:u32 @offset(0)
- tint_builtin_value_1:u32 @offset(4)
- tint_builtin_value_2:u32 @offset(8)
- tint_builtin_value_3:u32 @offset(12)
-}
-
-$B1: { # root
- %1:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 0)
- %2:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 1)
- %3:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 2)
- %4:ptr<handle, texture_2d<f32>, read_write> = var @binding_point(0, 3)
- %5:ptr<handle, texture_2d_array<f32>, read_write> = var @binding_point(0, 4)
- %6:ptr<uniform, TintTextureUniformData, read> = var @binding_point(0, 30)
-}
-
-%f_nested = func(%t1:texture_2d<f32>, %t2:texture_2d<f32>, %tint_tex_value:u32, %tint_tex_value_1:u32):u32 { # %tint_tex_value_1: 'tint_tex_value'
- $B2: {
- %12:u32 = add %tint_tex_value, %tint_tex_value_1
- ret %12
- }
-}
-%f1 = func(%a:u32, %t:texture_2d<f32>, %tint_tex_value_2:u32):u32 { # %tint_tex_value_2: 'tint_tex_value'
- $B3: {
- %17:texture_2d<f32> = load %1
- %18:ptr<uniform, u32, read> = access %6, 2u
- %19:u32 = load %18
- %20:u32 = call %f_nested, %t, %17, %tint_tex_value_2, %19
- %21:texture_2d<f32> = load %3
- %22:ptr<uniform, u32, read> = access %6, 3u
- %23:u32 = load %22
- %24:u32 = add %a, %20
- %25:u32 = add %24, %23
- ret %25
- }
-}
-%main = @compute @workgroup_size(1, 1, 1) func():void {
- $B4: {
- %27:texture_2d_array<f32> = load %5
- %28:vec3<i32> = glsl.textureSize %27, 0i
- %29:i32 = swizzle %28, z
- %30:u32 = bitcast %29
- %m:u32 = let %30
- %32:texture_2d<f32> = load %1
- %33:ptr<uniform, u32, read> = access %6, 2u
- %34:u32 = load %33
- %35:u32 = call %f1, 9u, %32, %34
- %n:u32 = let %35
- %37:texture_2d<f32> = load %2
- %38:ptr<uniform, u32, read> = access %6, 0u
- %39:u32 = load %38
- %40:ptr<uniform, u32, read> = access %6, 0u
- %41:u32 = load %40
- %42:u32 = call %f_nested, %37, %37, %39, %41
- %o:u32 = let %42
- %44:texture_2d<f32> = load %4
- %45:ptr<uniform, u32, read> = access %6, 2u
- %46:u32 = load %45
- %47:ptr<uniform, u32, read> = access %6, 1u
- %48:u32 = load %47
- %49:u32 = call %f_nested, %32, %44, %46, %48
- %p:u32 = let %49
- ret
- }
-}
-)";
-
- TexturePolyfillConfig cfg;
- cfg.texture_builtins_from_uniform = {{0, 30u},
- std::vector<BindingPoint>{{0, 1}, {0, 3}, {0, 0}, {0, 2}}};
- Run(TexturePolyfill, cfg);
- EXPECT_EQ(expect, str());
-}
-
} // namespace
} // namespace tint::glsl::writer::raise
diff --git a/test/tint/bug/tint/349291130.wgsl.expected.ir.glsl b/test/tint/bug/tint/349291130.wgsl.expected.ir.glsl
index 0a4aa1d..d722527 100644
--- a/test/tint/bug/tint/349291130.wgsl.expected.ir.glsl
+++ b/test/tint/bug/tint/349291130.wgsl.expected.ir.glsl
@@ -1,14 +1,19 @@
#version 310 es
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
uniform highp sampler2D tint_symbol;
layout(binding = 0, std140)
-uniform TintTextureUniformData_1_ubo {
- uint tint_builtin_value_0;
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
} v;
layout(local_size_x = 6, local_size_y = 1, local_size_z = 1) in;
void main() {
{
- uint level = v.tint_builtin_value_0;
+ uint level = v.tint_symbol_1.tint_builtin_value_0;
while(true) {
if ((level > 0u)) {
} else {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.ir.glsl
index 7eca8f7..ba7f7fc 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_181090() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_181090();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_181090() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_181090();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_181090() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_181090();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
index 7eca8f7..18a93c8 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a3fa9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_1a3fa9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a3fa9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_1a3fa9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_1a3fa9() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_1a3fa9();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
index 7eca8f7..c341536 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a7fc3() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_1a7fc3();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a7fc3() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_1a7fc3();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_1a7fc3() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_1a7fc3();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.ir.glsl
index 7eca8f7..07ccb47 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2267d8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2267d8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2267d8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2267d8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2267d8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2267d8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
index 7eca8f7..a168b73 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_24b2c6() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_24b2c6();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_24b2c6() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_24b2c6();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_24b2c6() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_24b2c6();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
index 7eca8f7..ac6075a 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2bea6c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2bea6c();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2bea6c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2bea6c();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2bea6c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2bea6c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
index 7eca8f7..d9dd698 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2df1ab() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2df1ab();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2df1ab() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2df1ab();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2df1ab() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2df1ab();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
index 7eca8f7..697df42 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_46dbd8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_46dbd8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_46dbd8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_46dbd8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_46dbd8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_46dbd8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
index 7eca8f7..46d1b30 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_60d9b8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_60d9b8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_60d9b8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_60d9b8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_60d9b8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_60d9b8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.ir.glsl
index 7eca8f7..402254f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_903920() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_903920();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_903920() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_903920();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_903920() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_903920();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
index 7eca8f7..f390f30 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_9a1a65() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_9a1a65();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_9a1a65() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_9a1a65();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_9a1a65() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_9a1a65();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.ir.glsl
index 7eca8f7..f0fa95a 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_adc783() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_adc783();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_adc783() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_adc783();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_adc783() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_adc783();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.ir.glsl
index 7eca8f7..6b66948 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ae911c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_ae911c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ae911c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_ae911c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_ae911c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_ae911c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.ir.glsl
index 7eca8f7..4cbabce 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c386c8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c386c8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c386c8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c386c8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c386c8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c386c8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.ir.glsl
index 7eca8f7..73f2d39 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c399f9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c399f9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c399f9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c399f9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c399f9() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c399f9();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
index 7eca8f7..efe4217 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c8c25c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c8c25c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c8c25c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c8c25c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c8c25c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c8c25c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.ir.glsl
index 7eca8f7..3a0985d 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d63126() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_d63126();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d63126() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_d63126();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_d63126() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_d63126();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
index 7eca8f7..e759bec 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d8f73b() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_d8f73b();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d8f73b() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_d8f73b();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_d8f73b() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_d8f73b();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.ir.glsl
index 7eca8f7..ecbf3c1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ef7944() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_ef7944();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ef7944() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_ef7944();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_ef7944() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_ef7944();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.ir.glsl
index 7eca8f7..08e1b57 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_efd6df() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_efd6df();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_efd6df() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_efd6df();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_efd6df() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_efd6df();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.ir.glsl
index 7eca8f7..8d622eb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_f742c0() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_f742c0();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_f742c0() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_f742c0();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_f742c0() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_f742c0();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.ir.glsl
index 7eca8f7..32ce9dd 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_fe2171() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_fe2171();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_fe2171() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_fe2171();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_fe2171() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_fe2171();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.ir.glsl
index f86bf54..bdfd01f 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_50f399() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_50f399();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_50f399() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_50f399();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_50f399() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_50f399();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.ir.glsl
index f86bf54..ca8965d 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_c1a777() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_c1a777();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_c1a777() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_c1a777();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_c1a777() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_c1a777();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.ir.glsl
index f86bf54..f10cc20 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_dbb799() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_dbb799();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_dbb799() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_dbb799();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_dbb799() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_dbb799();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.ir.glsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.ir.glsl
index f86bf54..5adcfcf 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_ecd321() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_ecd321();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_ecd321() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_ecd321();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_ecd321() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_ecd321();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.ir.glsl
index 7eca8f7..ba7f7fc 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_181090() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_181090();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_181090() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_181090();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_181090() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_181090();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
index 7eca8f7..18a93c8 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a3fa9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_1a3fa9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a3fa9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_1a3fa9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_1a3fa9() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_1a3fa9();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
index 7eca8f7..c341536 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a7fc3() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_1a7fc3();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_1a7fc3() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_1a7fc3();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_1a7fc3() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_1a7fc3();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.ir.glsl
index 7eca8f7..07ccb47 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2267d8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2267d8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2267d8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2267d8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2267d8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2267d8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
index 7eca8f7..a168b73 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_24b2c6() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_24b2c6();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_24b2c6() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_24b2c6();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_24b2c6() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_24b2c6();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
index 7eca8f7..ac6075a 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2bea6c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2bea6c();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2bea6c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2bea6c();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2bea6c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2bea6c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
index 7eca8f7..d9dd698 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2df1ab() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_2df1ab();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_2df1ab() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_2df1ab();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_2df1ab() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_2df1ab();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
index 7eca8f7..697df42 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_46dbd8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_46dbd8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_46dbd8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_46dbd8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_46dbd8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_46dbd8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
index 7eca8f7..46d1b30 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_60d9b8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_60d9b8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_60d9b8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_60d9b8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_60d9b8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_60d9b8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.ir.glsl
index 7eca8f7..402254f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_903920() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_903920();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_903920() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_903920();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_903920() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_903920();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
index 7eca8f7..f390f30 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_9a1a65() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_9a1a65();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_9a1a65() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_9a1a65();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_9a1a65() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_9a1a65();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.ir.glsl
index 7eca8f7..f0fa95a 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_adc783() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_adc783();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_adc783() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_adc783();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2DArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_adc783() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_adc783();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.ir.glsl
index 7eca8f7..6b66948 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ae911c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_ae911c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ae911c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_ae911c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DArrayShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_ae911c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_ae911c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.ir.glsl
index 7eca8f7..4cbabce 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c386c8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c386c8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c386c8() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c386c8();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usamplerCube arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c386c8() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c386c8();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.ir.glsl
index 7eca8f7..73f2d39 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c399f9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c399f9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c399f9() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c399f9();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c399f9() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c399f9();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
index 7eca8f7..efe4217 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c8c25c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_c8c25c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_c8c25c() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_c8c25c();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_c8c25c() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_c8c25c();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.ir.glsl
index 7eca8f7..3a0985d 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d63126() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_d63126();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d63126() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_d63126();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DShadow arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_d63126() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_d63126();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
index 7eca8f7..e759bec 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d8f73b() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_d8f73b();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_d8f73b() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_d8f73b();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp samplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_d8f73b() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_d8f73b();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.ir.glsl
index 7eca8f7..ecbf3c1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ef7944() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_ef7944();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_ef7944() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_ef7944();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler3D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_ef7944() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_ef7944();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.ir.glsl
index 7eca8f7..08e1b57 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_efd6df() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_efd6df();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_efd6df() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_efd6df();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_efd6df() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_efd6df();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.ir.glsl
index 7eca8f7..8d622eb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_f742c0() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_f742c0();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_f742c0() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_f742c0();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2D arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_f742c0() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_f742c0();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.ir.glsl
index 7eca8f7..32ce9dd 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 460
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_fe2171() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumLevels_fe2171();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumLevels_fe2171() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumLevels_fe2171();
+}
+#version 460
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usamplerCubeArray arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumLevels_fe2171() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumLevels_fe2171();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.ir.glsl
index f86bf54..bdfd01f 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_50f399() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_50f399();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_50f399() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_50f399();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp usampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_50f399() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_50f399();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.ir.glsl
index f86bf54..ca8965d 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_c1a777() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_c1a777();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_c1a777() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_c1a777();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp isampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_c1a777() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_c1a777();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.ir.glsl
index f86bf54..f10cc20 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_dbb799() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_dbb799();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_dbb799() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_dbb799();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_dbb799() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_dbb799();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.ir.glsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.ir.glsl
index f86bf54..5adcfcf 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.ir.glsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
+precision highp float;
+precision highp int;
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_ecd321() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+void main() {
+ v.tint_symbol = textureNumSamples_ecd321();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+layout(binding = 0, std430)
+buffer tint_symbol_1_1_ssbo {
+ uint tint_symbol;
+} v;
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_3_1_ubo {
+ TintTextureUniformData tint_symbol_2;
+} v_1;
+uint textureNumSamples_ecd321() {
+ uint res = v_1.tint_symbol_2.tint_builtin_value_0;
+ return res;
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ v.tint_symbol = textureNumSamples_ecd321();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct VertexOutput {
+ vec4 pos;
+ uint prevent_dce;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_2_1_ubo {
+ TintTextureUniformData tint_symbol_1;
+} v;
+layout(location = 0) flat out uint vertex_main_loc0_Output;
+uint textureNumSamples_ecd321() {
+ uint res = v.tint_symbol_1.tint_builtin_value_0;
+ return res;
+}
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f), 0u);
+ tint_symbol.pos = vec4(0.0f);
+ tint_symbol.prevent_dce = textureNumSamples_ecd321();
+ return tint_symbol;
+}
+void main() {
+ VertexOutput v_1 = vertex_main_inner();
+ gl_Position = v_1.pos;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ vertex_main_loc0_Output = v_1.prevent_dce;
+ gl_PointSize = 1.0f;
+}
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.ir.glsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.ir.glsl
index f86bf54..28eff88 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.ir.glsl
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.ir.glsl
@@ -1,11 +1,85 @@
-SKIP: FAILED
+#version 310 es
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-tint executable returned error: signal: trace/BPT trap
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+struct vertex_main_out {
+ vec4 tint_symbol_1_1;
+};
+
+uniform highp sampler2DMS arg_0;
+vec4 tint_symbol_1 = vec4(0.0f);
+layout(binding = 0, std140)
+uniform tint_symbol_4_1_ubo {
+ TintTextureUniformData tint_symbol_3;
+} v;
+void textureNumSamples_a3c8a0() {
+ int res = 0;
+ res = int(v.tint_symbol_3.tint_builtin_value_0);
+}
+void tint_symbol_2(vec4 tint_symbol) {
+ tint_symbol_1 = tint_symbol;
+}
+void vertex_main_1() {
+ textureNumSamples_a3c8a0();
+ tint_symbol_2(vec4(0.0f));
+}
+vertex_main_out vertex_main_inner() {
+ vertex_main_1();
+ return vertex_main_out(tint_symbol_1);
+}
+void main() {
+ gl_Position = vertex_main_inner().tint_symbol_1_1;
+ gl_Position[1u] = -(gl_Position.y);
+ gl_Position[2u] = ((2.0f * gl_Position.z) - gl_Position.w);
+ gl_PointSize = 1.0f;
+}
+#version 310 es
+precision highp float;
+precision highp int;
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_1_1_ubo {
+ TintTextureUniformData tint_symbol;
+} v;
+void textureNumSamples_a3c8a0() {
+ int res = 0;
+ res = int(v.tint_symbol.tint_builtin_value_0);
+}
+void fragment_main_1() {
+ textureNumSamples_a3c8a0();
+}
+void main() {
+ fragment_main_1();
+}
+#version 310 es
+
+
+struct TintTextureUniformData {
+ uint tint_builtin_value_0;
+};
+
+uniform highp sampler2DMS arg_0;
+layout(binding = 0, std140)
+uniform tint_symbol_1_1_ubo {
+ TintTextureUniformData tint_symbol;
+} v;
+void textureNumSamples_a3c8a0() {
+ int res = 0;
+ res = int(v.tint_symbol.tint_builtin_value_0);
+}
+void compute_main_1() {
+ textureNumSamples_a3c8a0();
+}
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main_1();
+}
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
deleted file mode 100644
index 7eca8f7..0000000
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumLevels
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
deleted file mode 100644
index f86bf54..0000000
--- a/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/ImageQuerySamples_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/ImageQuerySamples_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
deleted file mode 100644
index f86bf54..0000000
--- a/test/tint/unittest/reader/spirv/ImageQuerySamples_UnsignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap
diff --git a/test/tint/unittest/reader/spirv/Multisampled_Only2DNonArrayedIsValid_SpvParserHandleTest_ImageDeclTest_DeclareAndUseHandle_2.spvasm.expected.ir.glsl b/test/tint/unittest/reader/spirv/Multisampled_Only2DNonArrayedIsValid_SpvParserHandleTest_ImageDeclTest_DeclareAndUseHandle_2.spvasm.expected.ir.glsl
deleted file mode 100644
index f86bf54..0000000
--- a/test/tint/unittest/reader/spirv/Multisampled_Only2DNonArrayedIsValid_SpvParserHandleTest_ImageDeclTest_DeclareAndUseHandle_2.spvasm.expected.ir.glsl
+++ /dev/null
@@ -1,11 +0,0 @@
-SKIP: FAILED
-
-<dawn>/src/tint/lang/glsl/writer/printer/printer.cc:1468 internal compiler error: TINT_UNREACHABLE unhandled core builtin: textureNumSamples
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
-
-tint executable returned error: signal: trace/BPT trap