builtins: Add smoothstep, deprecate smoothStep
Bug: tint:1483
Change-Id: I8702933312a7e46f82745f232214910433485fe5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85261
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl b/test/tint/builtins/gen/smoothstep/392c19.wgsl
new file mode 100644
index 0000000..a8a780a
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothstep(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
+fn smoothstep_392c19() {
+ var res: vec2<f32> = smoothstep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_392c19();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_392c19();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_392c19();
+}
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.glsl
new file mode 100644
index 0000000..ce02027
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.glsl
@@ -0,0 +1,48 @@
+#version 310 es
+
+void smoothstep_392c19() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothstep_392c19();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothstep_392c19() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothstep_392c19();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothstep_392c19() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothstep_392c19();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.hlsl
new file mode 100644
index 0000000..97fec4e
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.hlsl
@@ -0,0 +1,30 @@
+void smoothstep_392c19() {
+ float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothstep_392c19();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothstep_392c19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothstep_392c19();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.msl
new file mode 100644
index 0000000..0c55698
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothstep_392c19() {
+ float2 res = smoothstep(float2(), float2(), float2());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothstep_392c19();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothstep_392c19();
+ return;
+}
+
+kernel void compute_main() {
+ smoothstep_392c19();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.spvasm
new file mode 100644
index 0000000..14299d9
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ %15 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothstep_392c19 "smoothstep_392c19"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %16 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothstep_392c19 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %smoothstep_392c19
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %smoothstep_392c19
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %smoothstep_392c19
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.wgsl
new file mode 100644
index 0000000..7d1d3ff
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/392c19.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn smoothstep_392c19() {
+ var res : vec2<f32> = smoothstep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_392c19();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_392c19();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_392c19();
+}
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl b/test/tint/builtins/gen/smoothstep/40864c.wgsl
new file mode 100644
index 0000000..1b188aa
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothstep(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
+fn smoothstep_40864c() {
+ var res: vec4<f32> = smoothstep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_40864c();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_40864c();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_40864c();
+}
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.glsl
new file mode 100644
index 0000000..0e08d36
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.glsl
@@ -0,0 +1,48 @@
+#version 310 es
+
+void smoothstep_40864c() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothstep_40864c();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothstep_40864c() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothstep_40864c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothstep_40864c() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothstep_40864c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.hlsl
new file mode 100644
index 0000000..e85c394
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.hlsl
@@ -0,0 +1,30 @@
+void smoothstep_40864c() {
+ float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothstep_40864c();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothstep_40864c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothstep_40864c();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.msl
new file mode 100644
index 0000000..55fb975
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothstep_40864c() {
+ float4 res = smoothstep(float4(), float4(), float4());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothstep_40864c();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothstep_40864c();
+ return;
+}
+
+kernel void compute_main() {
+ smoothstep_40864c();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.spvasm
new file mode 100644
index 0000000..8a1dda2
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothstep_40864c "smoothstep_40864c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothstep_40864c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %13 = OpExtInst %v4float %14 SmoothStep %5 %5 %5
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %smoothstep_40864c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %smoothstep_40864c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothstep_40864c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.wgsl
new file mode 100644
index 0000000..0d4cd26
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/40864c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn smoothstep_40864c() {
+ var res : vec4<f32> = smoothstep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_40864c();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_40864c();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_40864c();
+}
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl b/test/tint/builtins/gen/smoothstep/5f615b.wgsl
new file mode 100644
index 0000000..565e625
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothStep(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
+fn smoothStep_5f615b() {
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_5f615b();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_5f615b();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_5f615b();
+}
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.glsl
new file mode 100644
index 0000000..7abeaef
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+ ^^^^^^^^^^
+
+#version 310 es
+
+void smoothStep_5f615b() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothStep_5f615b();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothStep_5f615b() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothStep_5f615b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothStep_5f615b() {
+ vec4 res = smoothstep(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothStep_5f615b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.hlsl
new file mode 100644
index 0000000..ca36423
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.hlsl
@@ -0,0 +1,34 @@
+builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+ ^^^^^^^^^^
+
+void smoothStep_5f615b() {
+ float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothStep_5f615b();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_5f615b();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.msl
new file mode 100644
index 0000000..27f5ab6
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.msl
@@ -0,0 +1,37 @@
+builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+ ^^^^^^^^^^
+
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_5f615b() {
+ float4 res = smoothstep(float4(), float4(), float4());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothStep_5f615b();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_5f615b();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.spvasm
new file mode 100644
index 0000000..3e78282
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+ ^^^^^^^^^^
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothStep_5f615b "smoothStep_5f615b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothStep_5f615b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %13 = OpExtInst %v4float %14 SmoothStep %5 %5 %5
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.wgsl
new file mode 100644
index 0000000..89cc7bf
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/5f615b.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+ ^^^^^^^^^^
+
+fn smoothStep_5f615b() {
+ var res : vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_5f615b();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_5f615b();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_5f615b();
+}
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl b/test/tint/builtins/gen/smoothstep/658be3.wgsl
new file mode 100644
index 0000000..bd29528
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothStep(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
+fn smoothStep_658be3() {
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_658be3();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_658be3();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_658be3();
+}
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.glsl
new file mode 100644
index 0000000..a56a681
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+ ^^^^^^^^^^
+
+#version 310 es
+
+void smoothStep_658be3() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothStep_658be3();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothStep_658be3() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothStep_658be3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothStep_658be3() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothStep_658be3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.hlsl
new file mode 100644
index 0000000..89a8c38
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.hlsl
@@ -0,0 +1,34 @@
+builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+ ^^^^^^^^^^
+
+void smoothStep_658be3() {
+ float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothStep_658be3();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothStep_658be3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_658be3();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.msl
new file mode 100644
index 0000000..4d8342e
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.msl
@@ -0,0 +1,37 @@
+builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+ ^^^^^^^^^^
+
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_658be3() {
+ float3 res = smoothstep(float3(), float3(), float3());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothStep_658be3();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothStep_658be3();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_658be3();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.spvasm
new file mode 100644
index 0000000..032e30d
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+ ^^^^^^^^^^
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ %15 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothStep_658be3 "smoothStep_658be3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %16 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothStep_658be3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %smoothStep_658be3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %smoothStep_658be3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %smoothStep_658be3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.wgsl
new file mode 100644
index 0000000..7e3aa5c
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/658be3.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+ ^^^^^^^^^^
+
+fn smoothStep_658be3() {
+ var res : vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_658be3();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_658be3();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_658be3();
+}
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl b/test/tint/builtins/gen/smoothstep/6c4975.wgsl
new file mode 100644
index 0000000..977093d
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothstep(f32, f32, f32) -> f32
+fn smoothstep_6c4975() {
+ var res: f32 = smoothstep(1.0, 1.0, 1.0);
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_6c4975();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_6c4975();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_6c4975();
+}
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.glsl
new file mode 100644
index 0000000..1b21912
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.glsl
@@ -0,0 +1,48 @@
+#version 310 es
+
+void smoothstep_6c4975() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+vec4 vertex_main() {
+ smoothstep_6c4975();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothstep_6c4975() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+void fragment_main() {
+ smoothstep_6c4975();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothstep_6c4975() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+void compute_main() {
+ smoothstep_6c4975();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.hlsl
new file mode 100644
index 0000000..a2411cd
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.hlsl
@@ -0,0 +1,30 @@
+void smoothstep_6c4975() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothstep_6c4975();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothstep_6c4975();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothstep_6c4975();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.msl
new file mode 100644
index 0000000..5fbf343
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothstep_6c4975() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothstep_6c4975();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothstep_6c4975();
+ return;
+}
+
+kernel void compute_main() {
+ smoothstep_6c4975();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc22ed4
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothstep_6c4975 "smoothstep_6c4975"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %18 = OpTypeFunction %v4float
+%smoothstep_6c4975 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %13 = OpExtInst %float %14 SmoothStep %float_1 %float_1 %float_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %smoothstep_6c4975
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %smoothstep_6c4975
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothstep_6c4975
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.wgsl
new file mode 100644
index 0000000..30982a3
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/6c4975.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn smoothstep_6c4975() {
+ var res : f32 = smoothstep(1.0, 1.0, 1.0);
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_6c4975();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_6c4975();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_6c4975();
+}
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl b/test/tint/builtins/gen/smoothstep/aad1db.wgsl
new file mode 100644
index 0000000..f4fea62
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothstep(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
+fn smoothstep_aad1db() {
+ var res: vec3<f32> = smoothstep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_aad1db();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_aad1db();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_aad1db();
+}
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.glsl
new file mode 100644
index 0000000..2fe94a4
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.glsl
@@ -0,0 +1,48 @@
+#version 310 es
+
+void smoothstep_aad1db() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothstep_aad1db();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothstep_aad1db() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothstep_aad1db();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothstep_aad1db() {
+ vec3 res = smoothstep(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothstep_aad1db();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.hlsl
new file mode 100644
index 0000000..641ca58
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.hlsl
@@ -0,0 +1,30 @@
+void smoothstep_aad1db() {
+ float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothstep_aad1db();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothstep_aad1db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothstep_aad1db();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.msl
new file mode 100644
index 0000000..19ef68f
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothstep_aad1db() {
+ float3 res = smoothstep(float3(), float3(), float3());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothstep_aad1db();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothstep_aad1db();
+ return;
+}
+
+kernel void compute_main() {
+ smoothstep_aad1db();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5b2f08
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ %15 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothstep_aad1db "smoothstep_aad1db"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %16 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothstep_aad1db = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %smoothstep_aad1db
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %smoothstep_aad1db
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %smoothstep_aad1db
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c83439
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/aad1db.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn smoothstep_aad1db() {
+ var res : vec3<f32> = smoothstep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothstep_aad1db();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothstep_aad1db();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothstep_aad1db();
+}
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl b/test/tint/builtins/gen/smoothstep/c11eef.wgsl
new file mode 100644
index 0000000..518847a
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothStep(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
+fn smoothStep_c11eef() {
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_c11eef();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_c11eef();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_c11eef();
+}
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.glsl
new file mode 100644
index 0000000..6296a92
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+ ^^^^^^^^^^
+
+#version 310 es
+
+void smoothStep_c11eef() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+vec4 vertex_main() {
+ smoothStep_c11eef();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothStep_c11eef() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ smoothStep_c11eef();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothStep_c11eef() {
+ vec2 res = smoothstep(vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
+}
+
+void compute_main() {
+ smoothStep_c11eef();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.hlsl
new file mode 100644
index 0000000..93dfd41
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.hlsl
@@ -0,0 +1,34 @@
+builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+ ^^^^^^^^^^
+
+void smoothStep_c11eef() {
+ float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothStep_c11eef();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_c11eef();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.msl
new file mode 100644
index 0000000..1ba5904
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.msl
@@ -0,0 +1,37 @@
+builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+ ^^^^^^^^^^
+
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_c11eef() {
+ float2 res = smoothstep(float2(), float2(), float2());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothStep_c11eef();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_c11eef();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.spvasm
new file mode 100644
index 0000000..3bdb215
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+ ^^^^^^^^^^
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ %15 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothStep_c11eef "smoothStep_c11eef"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %16 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%smoothStep_c11eef = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.wgsl
new file mode 100644
index 0000000..c390acb
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/c11eef.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+ ^^^^^^^^^^
+
+fn smoothStep_c11eef() {
+ var res : vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_c11eef();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_c11eef();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_c11eef();
+}
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl
new file mode 100644
index 0000000..a30a304
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2021 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/builtin-gen
+// using the template:
+// test/tint/builtins/builtins.wgsl.tmpl
+// and the builtin defintion file:
+// src/tint/builtins.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn smoothStep(f32, f32, f32) -> f32
+fn smoothStep_cb0bfb() {
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_cb0bfb();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_cb0bfb();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_cb0bfb();
+}
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.glsl b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.glsl
new file mode 100644
index 0000000..6f8265d
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+ ^^^^^^^^^^
+
+#version 310 es
+
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+vec4 vertex_main() {
+ smoothStep_cb0bfb();
+ return vec4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void main() {
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+void fragment_main() {
+ smoothStep_cb0bfb();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+void compute_main() {
+ smoothStep_cb0bfb();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.hlsl b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.hlsl
new file mode 100644
index 0000000..9f33894
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.hlsl
@@ -0,0 +1,34 @@
+builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+ ^^^^^^^^^^
+
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ smoothStep_cb0bfb();
+ return float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_cb0bfb();
+ return;
+}
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.msl b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.msl
new file mode 100644
index 0000000..34e5b3a
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.msl
@@ -0,0 +1,37 @@
+builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+ ^^^^^^^^^^
+
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ smoothStep_cb0bfb();
+ return float4();
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.spvasm b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.spvasm
new file mode 100644
index 0000000..6286bc5
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+ ^^^^^^^^^^
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %smoothStep_cb0bfb "smoothStep_cb0bfb"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %18 = OpTypeFunction %v4float
+%smoothStep_cb0bfb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %13 = OpExtInst %float %14 SmoothStep %float_1 %float_1 %float_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.wgsl b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.wgsl
new file mode 100644
index 0000000..d75d5f3
--- /dev/null
+++ b/test/tint/builtins/gen/smoothstep/cb0bfb.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+ ^^^^^^^^^^
+
+fn smoothStep_cb0bfb() {
+ var res : f32 = smoothStep(1.0, 1.0, 1.0);
+}
+
+@stage(vertex)
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ smoothStep_cb0bfb();
+ return vec4<f32>();
+}
+
+@stage(fragment)
+fn fragment_main() {
+ smoothStep_cb0bfb();
+}
+
+@stage(compute) @workgroup_size(1)
+fn compute_main() {
+ smoothStep_cb0bfb();
+}