test/tint/builtins: Generate abstract numeric tests
Change-Id: I2da181af0694f73ec4be07ed40e4e70d49b53583
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97140
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl
index debeaf2..ede228c 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
fn mix_0c8c33() {
- var arg_0 = vec3<f32>();
- var arg_1 = vec3<f32>();
- var arg_2 = vec3<f32>();
+ var arg_0 = vec3<f32>(1.f);
+ var arg_1 = vec3<f32>(1.f);
+ var arg_2 = vec3<f32>(1.f);
var res: vec3<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
index ff0238b..575d95d 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
@@ -1,7 +1,7 @@
void mix_0c8c33() {
- float3 arg_0 = (0.0f).xxx;
- float3 arg_1 = (0.0f).xxx;
- float3 arg_2 = (0.0f).xxx;
+ float3 arg_0 = (1.0f).xxx;
+ float3 arg_1 = (1.0f).xxx;
+ float3 arg_2 = (1.0f).xxx;
float3 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
index ff0238b..575d95d 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
@@ -1,7 +1,7 @@
void mix_0c8c33() {
- float3 arg_0 = (0.0f).xxx;
- float3 arg_1 = (0.0f).xxx;
- float3 arg_2 = (0.0f).xxx;
+ float3 arg_0 = (1.0f).xxx;
+ float3 arg_1 = (1.0f).xxx;
+ float3 arg_2 = (1.0f).xxx;
float3 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
index 46331a8..b6a83cf 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
@@ -1,9 +1,9 @@
#version 310 es
void mix_0c8c33() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
- vec3 arg_2 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
+ vec3 arg_2 = vec3(1.0f);
vec3 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,9 +24,9 @@
precision mediump float;
void mix_0c8c33() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
- vec3 arg_2 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
+ vec3 arg_2 = vec3(1.0f);
vec3 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,9 +41,9 @@
#version 310 es
void mix_0c8c33() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
- vec3 arg_2 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
+ vec3 arg_2 = vec3(1.0f);
vec3 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
index 0fe7746..fb8ce73 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
@@ -2,9 +2,9 @@
using namespace metal;
void mix_0c8c33() {
- float3 arg_0 = float3(0.0f);
- float3 arg_1 = float3(0.0f);
- float3 arg_2 = float3(0.0f);
+ float3 arg_0 = float3(1.0f);
+ float3 arg_1 = float3(1.0f);
+ float3 arg_2 = float3(1.0f);
float3 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
index d741ebd..945a11f 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 40
; Schema: 0
OpCapability Shader
- %20 = OpExtInstImport "GLSL.std.450"
+ %22 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -35,45 +35,46 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %14 = OpConstantNull %v3float
-%_ptr_Function_v3float = OpTypePointer Function %v3float
- %25 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
+ %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
+ %27 = OpTypeFunction %v4float
%mix_0c8c33 = OpFunction %void None %9
%12 = OpLabel
- %arg_0 = OpVariable %_ptr_Function_v3float Function %14
- %arg_1 = OpVariable %_ptr_Function_v3float Function %14
- %arg_2 = OpVariable %_ptr_Function_v3float Function %14
- %res = OpVariable %_ptr_Function_v3float Function %14
- OpStore %arg_0 %14
- OpStore %arg_1 %14
- OpStore %arg_2 %14
- %21 = OpLoad %v3float %arg_0
- %22 = OpLoad %v3float %arg_1
- %23 = OpLoad %v3float %arg_2
- %19 = OpExtInst %v3float %20 FMix %21 %22 %23
- OpStore %res %19
+ %arg_0 = OpVariable %_ptr_Function_v3float Function %18
+ %arg_1 = OpVariable %_ptr_Function_v3float Function %18
+ %arg_2 = OpVariable %_ptr_Function_v3float Function %18
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %arg_0 %15
+ OpStore %arg_1 %15
+ OpStore %arg_2 %15
+ %23 = OpLoad %v3float %arg_0
+ %24 = OpLoad %v3float %arg_1
+ %25 = OpLoad %v3float %arg_2
+ %21 = OpExtInst %v3float %22 FMix %23 %24 %25
+ OpStore %res %21
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %mix_0c8c33
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %mix_0c8c33
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %mix_0c8c33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %mix_0c8c33
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %37 = OpLabel
- %38 = OpFunctionCall %void %mix_0c8c33
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %mix_0c8c33
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
index 09f0497..5cac533 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_0c8c33() {
- var arg_0 = vec3<f32>();
- var arg_1 = vec3<f32>();
- var arg_2 = vec3<f32>();
+ var arg_0 = vec3<f32>(1.0f);
+ var arg_1 = vec3<f32>(1.0f);
+ var arg_2 = vec3<f32>(1.0f);
var res : vec3<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl
index 111a571..d86d25a 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<4, f32>, vec<4, f32>, f32) -> vec<4, f32>
fn mix_1faeb1() {
- var arg_0 = vec4<f32>();
- var arg_1 = vec4<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec4<f32>(1.f);
+ var arg_1 = vec4<f32>(1.f);
+ var arg_2 = 1.f;
var res: vec4<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
index 8be22c5..849c498 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,6 @@
void mix_1faeb1() {
- float4 arg_0 = (0.0f).xxxx;
- float4 arg_1 = (0.0f).xxxx;
+ float4 arg_0 = (1.0f).xxxx;
+ float4 arg_1 = (1.0f).xxxx;
float arg_2 = 1.0f;
float4 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
index 8be22c5..849c498 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,6 @@
void mix_1faeb1() {
- float4 arg_0 = (0.0f).xxxx;
- float4 arg_1 = (0.0f).xxxx;
+ float4 arg_0 = (1.0f).xxxx;
+ float4 arg_1 = (1.0f).xxxx;
float arg_2 = 1.0f;
float4 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
index 1d79c6a..7fbecbb 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
@@ -1,8 +1,8 @@
#version 310 es
void mix_1faeb1() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
float arg_2 = 1.0f;
vec4 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,8 +24,8 @@
precision mediump float;
void mix_1faeb1() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
float arg_2 = 1.0f;
vec4 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,8 +41,8 @@
#version 310 es
void mix_1faeb1() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
float arg_2 = 1.0f;
vec4 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
index a2eb9ba..1707059 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
@@ -2,8 +2,8 @@
using namespace metal;
void mix_1faeb1() {
- float4 arg_0 = float4(0.0f);
- float4 arg_1 = float4(0.0f);
+ float4 arg_0 = float4(1.0f);
+ float4 arg_1 = float4(1.0f);
float arg_2 = 1.0f;
float4 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
index 5cfd296..787c9a8 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 41
; Schema: 0
OpCapability Shader
- %20 = OpExtInstImport "GLSL.std.450"
+ %21 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -34,47 +34,48 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
-%_ptr_Function_v4float = OpTypePointer Function %v4float
%float_1 = OpConstant %float 1
+ %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
- %27 = OpTypeFunction %v4float
+ %28 = OpTypeFunction %v4float
%mix_1faeb1 = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v4float Function %5
%arg_1 = OpVariable %_ptr_Function_v4float Function %5
%arg_2 = OpVariable %_ptr_Function_float Function %8
- %24 = OpVariable %_ptr_Function_v4float Function %5
+ %25 = OpVariable %_ptr_Function_v4float Function %5
%res = OpVariable %_ptr_Function_v4float Function %5
- OpStore %arg_0 %5
- OpStore %arg_1 %5
+ OpStore %arg_0 %14
+ OpStore %arg_1 %14
OpStore %arg_2 %float_1
- %21 = OpLoad %v4float %arg_0
- %22 = OpLoad %v4float %arg_1
- %23 = OpLoad %float %arg_2
- %25 = OpCompositeConstruct %v4float %23 %23 %23 %23
- %19 = OpExtInst %v4float %20 FMix %21 %22 %25
- OpStore %res %19
+ %22 = OpLoad %v4float %arg_0
+ %23 = OpLoad %v4float %arg_1
+ %24 = OpLoad %float %arg_2
+ %26 = OpCompositeConstruct %v4float %24 %24 %24 %24
+ %20 = OpExtInst %v4float %21 FMix %22 %23 %26
+ OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %mix_1faeb1
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %mix_1faeb1
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %35 = OpLabel
- %36 = OpFunctionCall %void %mix_1faeb1
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %mix_1faeb1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %38 = OpLabel
- %39 = OpFunctionCall %void %mix_1faeb1
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %mix_1faeb1
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
index 4253d4a..0bd8c68 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_1faeb1() {
- var arg_0 = vec4<f32>();
- var arg_1 = vec4<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec4<f32>(1.0f);
+ var arg_1 = vec4<f32>(1.0f);
+ var arg_2 = 1.0f;
var res : vec4<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl
index e8c3593..d36e793 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<2, f32>, vec<2, f32>, f32) -> vec<2, f32>
fn mix_2fadab() {
- var arg_0 = vec2<f32>();
- var arg_1 = vec2<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec2<f32>(1.f);
+ var arg_1 = vec2<f32>(1.f);
+ var arg_2 = 1.f;
var res: vec2<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
index ae442e0..f46a543 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
@@ -1,6 +1,6 @@
void mix_2fadab() {
- float2 arg_0 = (0.0f).xx;
- float2 arg_1 = (0.0f).xx;
+ float2 arg_0 = (1.0f).xx;
+ float2 arg_1 = (1.0f).xx;
float arg_2 = 1.0f;
float2 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
index ae442e0..f46a543 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
@@ -1,6 +1,6 @@
void mix_2fadab() {
- float2 arg_0 = (0.0f).xx;
- float2 arg_1 = (0.0f).xx;
+ float2 arg_0 = (1.0f).xx;
+ float2 arg_1 = (1.0f).xx;
float arg_2 = 1.0f;
float2 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
index 7e580ed..cb94e51 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
@@ -1,8 +1,8 @@
#version 310 es
void mix_2fadab() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
float arg_2 = 1.0f;
vec2 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,8 +24,8 @@
precision mediump float;
void mix_2fadab() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
float arg_2 = 1.0f;
vec2 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,8 +41,8 @@
#version 310 es
void mix_2fadab() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
float arg_2 = 1.0f;
vec2 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
index 8f55a01..ad998d7 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
@@ -2,8 +2,8 @@
using namespace metal;
void mix_2fadab() {
- float2 arg_0 = float2(0.0f);
- float2 arg_1 = float2(0.0f);
+ float2 arg_0 = float2(1.0f);
+ float2 arg_1 = float2(1.0f);
float arg_2 = 1.0f;
float2 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
index f5cb0c6..4e77aa1 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 43
; Schema: 0
OpCapability Shader
- %22 = OpExtInstImport "GLSL.std.450"
+ %23 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -35,48 +35,49 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %14 = OpConstantNull %v2float
-%_ptr_Function_v2float = OpTypePointer Function %v2float
%float_1 = OpConstant %float 1
+ %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
%_ptr_Function_float = OpTypePointer Function %float
- %29 = OpTypeFunction %v4float
+ %30 = OpTypeFunction %v4float
%mix_2fadab = OpFunction %void None %9
%12 = OpLabel
- %arg_0 = OpVariable %_ptr_Function_v2float Function %14
- %arg_1 = OpVariable %_ptr_Function_v2float Function %14
+ %arg_0 = OpVariable %_ptr_Function_v2float Function %18
+ %arg_1 = OpVariable %_ptr_Function_v2float Function %18
%arg_2 = OpVariable %_ptr_Function_float Function %8
- %26 = OpVariable %_ptr_Function_v2float Function %14
- %res = OpVariable %_ptr_Function_v2float Function %14
- OpStore %arg_0 %14
- OpStore %arg_1 %14
+ %27 = OpVariable %_ptr_Function_v2float Function %18
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %arg_0 %15
+ OpStore %arg_1 %15
OpStore %arg_2 %float_1
- %23 = OpLoad %v2float %arg_0
- %24 = OpLoad %v2float %arg_1
- %25 = OpLoad %float %arg_2
- %27 = OpCompositeConstruct %v2float %25 %25
- %21 = OpExtInst %v2float %22 FMix %23 %24 %27
- OpStore %res %21
+ %24 = OpLoad %v2float %arg_0
+ %25 = OpLoad %v2float %arg_1
+ %26 = OpLoad %float %arg_2
+ %28 = OpCompositeConstruct %v2float %26 %26
+ %22 = OpExtInst %v2float %23 FMix %24 %25 %28
+ OpStore %res %22
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %mix_2fadab
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %mix_2fadab
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %37 = OpLabel
- %38 = OpFunctionCall %void %mix_2fadab
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %mix_2fadab
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %void %mix_2fadab
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %mix_2fadab
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
index 615c3eb..82845ab 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_2fadab() {
- var arg_0 = vec2<f32>();
- var arg_1 = vec2<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec2<f32>(1.0f);
+ var arg_1 = vec2<f32>(1.0f);
+ var arg_2 = 1.0f;
var res : vec2<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl b/test/tint/builtins/gen/var/mix/315264.wgsl
index 90865bb..17604fc 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<3, f32>, vec<3, f32>, f32) -> vec<3, f32>
fn mix_315264() {
- var arg_0 = vec3<f32>();
- var arg_1 = vec3<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec3<f32>(1.f);
+ var arg_1 = vec3<f32>(1.f);
+ var arg_2 = 1.f;
var res: vec3<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
index d9674f4..64aa63f 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
@@ -1,6 +1,6 @@
void mix_315264() {
- float3 arg_0 = (0.0f).xxx;
- float3 arg_1 = (0.0f).xxx;
+ float3 arg_0 = (1.0f).xxx;
+ float3 arg_1 = (1.0f).xxx;
float arg_2 = 1.0f;
float3 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
index d9674f4..64aa63f 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
@@ -1,6 +1,6 @@
void mix_315264() {
- float3 arg_0 = (0.0f).xxx;
- float3 arg_1 = (0.0f).xxx;
+ float3 arg_0 = (1.0f).xxx;
+ float3 arg_1 = (1.0f).xxx;
float arg_2 = 1.0f;
float3 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
index 5e3fea1..ee1b5a7 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
@@ -1,8 +1,8 @@
#version 310 es
void mix_315264() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
float arg_2 = 1.0f;
vec3 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,8 +24,8 @@
precision mediump float;
void mix_315264() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
float arg_2 = 1.0f;
vec3 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,8 +41,8 @@
#version 310 es
void mix_315264() {
- vec3 arg_0 = vec3(0.0f);
- vec3 arg_1 = vec3(0.0f);
+ vec3 arg_0 = vec3(1.0f);
+ vec3 arg_1 = vec3(1.0f);
float arg_2 = 1.0f;
vec3 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
index 59819cc..0b75b92 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
@@ -2,8 +2,8 @@
using namespace metal;
void mix_315264() {
- float3 arg_0 = float3(0.0f);
- float3 arg_1 = float3(0.0f);
+ float3 arg_0 = float3(1.0f);
+ float3 arg_1 = float3(1.0f);
float arg_2 = 1.0f;
float3 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
index d5f96ce..c3dcf62 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 43
; Schema: 0
OpCapability Shader
- %22 = OpExtInstImport "GLSL.std.450"
+ %23 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -35,48 +35,49 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %14 = OpConstantNull %v3float
-%_ptr_Function_v3float = OpTypePointer Function %v3float
%float_1 = OpConstant %float 1
+ %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
%_ptr_Function_float = OpTypePointer Function %float
- %29 = OpTypeFunction %v4float
+ %30 = OpTypeFunction %v4float
%mix_315264 = OpFunction %void None %9
%12 = OpLabel
- %arg_0 = OpVariable %_ptr_Function_v3float Function %14
- %arg_1 = OpVariable %_ptr_Function_v3float Function %14
+ %arg_0 = OpVariable %_ptr_Function_v3float Function %18
+ %arg_1 = OpVariable %_ptr_Function_v3float Function %18
%arg_2 = OpVariable %_ptr_Function_float Function %8
- %26 = OpVariable %_ptr_Function_v3float Function %14
- %res = OpVariable %_ptr_Function_v3float Function %14
- OpStore %arg_0 %14
- OpStore %arg_1 %14
+ %27 = OpVariable %_ptr_Function_v3float Function %18
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %arg_0 %15
+ OpStore %arg_1 %15
OpStore %arg_2 %float_1
- %23 = OpLoad %v3float %arg_0
- %24 = OpLoad %v3float %arg_1
- %25 = OpLoad %float %arg_2
- %27 = OpCompositeConstruct %v3float %25 %25 %25
- %21 = OpExtInst %v3float %22 FMix %23 %24 %27
- OpStore %res %21
+ %24 = OpLoad %v3float %arg_0
+ %25 = OpLoad %v3float %arg_1
+ %26 = OpLoad %float %arg_2
+ %28 = OpCompositeConstruct %v3float %26 %26 %26
+ %22 = OpExtInst %v3float %23 FMix %24 %25 %28
+ OpStore %res %22
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %mix_315264
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %mix_315264
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %37 = OpLabel
- %38 = OpFunctionCall %void %mix_315264
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %mix_315264
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %40 = OpLabel
- %41 = OpFunctionCall %void %mix_315264
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %mix_315264
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
index ee53b30..209ecad 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_315264() {
- var arg_0 = vec3<f32>();
- var arg_1 = vec3<f32>();
- var arg_2 = 1.0;
+ var arg_0 = vec3<f32>(1.0f);
+ var arg_1 = vec3<f32>(1.0f);
+ var arg_2 = 1.0f;
var res : vec3<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
index f308892..cb858b7 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
@@ -25,9 +25,9 @@
// fn mix(f32, f32, f32) -> f32
fn mix_4f0b5e() {
- var arg_0 = 1.0;
- var arg_1 = 1.0;
- var arg_2 = 1.0;
+ var arg_0 = 1.f;
+ var arg_1 = 1.f;
+ var arg_2 = 1.f;
var res: f32 = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
index e597146..3543079 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_4f0b5e() {
- var arg_0 = 1.0;
- var arg_1 = 1.0;
- var arg_2 = 1.0;
+ var arg_0 = 1.0f;
+ var arg_1 = 1.0f;
+ var arg_2 = 1.0f;
var res : f32 = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl
index c1efe6b..c83a5c7 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
fn mix_6f8adc() {
- var arg_0 = vec2<f32>();
- var arg_1 = vec2<f32>();
- var arg_2 = vec2<f32>();
+ var arg_0 = vec2<f32>(1.f);
+ var arg_1 = vec2<f32>(1.f);
+ var arg_2 = vec2<f32>(1.f);
var res: vec2<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
index cdfac7b..78b6a37 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,7 @@
void mix_6f8adc() {
- float2 arg_0 = (0.0f).xx;
- float2 arg_1 = (0.0f).xx;
- float2 arg_2 = (0.0f).xx;
+ float2 arg_0 = (1.0f).xx;
+ float2 arg_1 = (1.0f).xx;
+ float2 arg_2 = (1.0f).xx;
float2 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
index cdfac7b..78b6a37 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,7 @@
void mix_6f8adc() {
- float2 arg_0 = (0.0f).xx;
- float2 arg_1 = (0.0f).xx;
- float2 arg_2 = (0.0f).xx;
+ float2 arg_0 = (1.0f).xx;
+ float2 arg_1 = (1.0f).xx;
+ float2 arg_2 = (1.0f).xx;
float2 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
index a9e601d..d1d9e5a 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
@@ -1,9 +1,9 @@
#version 310 es
void mix_6f8adc() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
- vec2 arg_2 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
+ vec2 arg_2 = vec2(1.0f);
vec2 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,9 +24,9 @@
precision mediump float;
void mix_6f8adc() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
- vec2 arg_2 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
+ vec2 arg_2 = vec2(1.0f);
vec2 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,9 +41,9 @@
#version 310 es
void mix_6f8adc() {
- vec2 arg_0 = vec2(0.0f);
- vec2 arg_1 = vec2(0.0f);
- vec2 arg_2 = vec2(0.0f);
+ vec2 arg_0 = vec2(1.0f);
+ vec2 arg_1 = vec2(1.0f);
+ vec2 arg_2 = vec2(1.0f);
vec2 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
index 8f3cf6f..d81240b 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
@@ -2,9 +2,9 @@
using namespace metal;
void mix_6f8adc() {
- float2 arg_0 = float2(0.0f);
- float2 arg_1 = float2(0.0f);
- float2 arg_2 = float2(0.0f);
+ float2 arg_0 = float2(1.0f);
+ float2 arg_1 = float2(1.0f);
+ float2 arg_2 = float2(1.0f);
float2 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
index 2d989aa..d201897 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 40
; Schema: 0
OpCapability Shader
- %20 = OpExtInstImport "GLSL.std.450"
+ %22 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -35,45 +35,46 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %14 = OpConstantNull %v2float
-%_ptr_Function_v2float = OpTypePointer Function %v2float
- %25 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
+ %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
+ %27 = OpTypeFunction %v4float
%mix_6f8adc = OpFunction %void None %9
%12 = OpLabel
- %arg_0 = OpVariable %_ptr_Function_v2float Function %14
- %arg_1 = OpVariable %_ptr_Function_v2float Function %14
- %arg_2 = OpVariable %_ptr_Function_v2float Function %14
- %res = OpVariable %_ptr_Function_v2float Function %14
- OpStore %arg_0 %14
- OpStore %arg_1 %14
- OpStore %arg_2 %14
- %21 = OpLoad %v2float %arg_0
- %22 = OpLoad %v2float %arg_1
- %23 = OpLoad %v2float %arg_2
- %19 = OpExtInst %v2float %20 FMix %21 %22 %23
- OpStore %res %19
+ %arg_0 = OpVariable %_ptr_Function_v2float Function %18
+ %arg_1 = OpVariable %_ptr_Function_v2float Function %18
+ %arg_2 = OpVariable %_ptr_Function_v2float Function %18
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %arg_0 %15
+ OpStore %arg_1 %15
+ OpStore %arg_2 %15
+ %23 = OpLoad %v2float %arg_0
+ %24 = OpLoad %v2float %arg_1
+ %25 = OpLoad %v2float %arg_2
+ %21 = OpExtInst %v2float %22 FMix %23 %24 %25
+ OpStore %res %21
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %mix_6f8adc
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %mix_6f8adc
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %mix_6f8adc
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %mix_6f8adc
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %37 = OpLabel
- %38 = OpFunctionCall %void %mix_6f8adc
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %mix_6f8adc
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
index fad88d5..5d5ab3c 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_6f8adc() {
- var arg_0 = vec2<f32>();
- var arg_1 = vec2<f32>();
- var arg_2 = vec2<f32>();
+ var arg_0 = vec2<f32>(1.0f);
+ var arg_1 = vec2<f32>(1.0f);
+ var arg_2 = vec2<f32>(1.0f);
var res : vec2<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl
index 3463524..593ac77 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl
@@ -25,9 +25,9 @@
// fn mix(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
fn mix_c37ede() {
- var arg_0 = vec4<f32>();
- var arg_1 = vec4<f32>();
- var arg_2 = vec4<f32>();
+ var arg_0 = vec4<f32>(1.f);
+ var arg_1 = vec4<f32>(1.f);
+ var arg_2 = vec4<f32>(1.f);
var res: vec4<f32> = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
index 2ec722c..202b6a5 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
@@ -1,7 +1,7 @@
void mix_c37ede() {
- float4 arg_0 = (0.0f).xxxx;
- float4 arg_1 = (0.0f).xxxx;
- float4 arg_2 = (0.0f).xxxx;
+ float4 arg_0 = (1.0f).xxxx;
+ float4 arg_1 = (1.0f).xxxx;
+ float4 arg_2 = (1.0f).xxxx;
float4 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
index 2ec722c..202b6a5 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
@@ -1,7 +1,7 @@
void mix_c37ede() {
- float4 arg_0 = (0.0f).xxxx;
- float4 arg_1 = (0.0f).xxxx;
- float4 arg_2 = (0.0f).xxxx;
+ float4 arg_0 = (1.0f).xxxx;
+ float4 arg_1 = (1.0f).xxxx;
+ float4 arg_2 = (1.0f).xxxx;
float4 res = lerp(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
index eee9b05..2642b1c 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
@@ -1,9 +1,9 @@
#version 310 es
void mix_c37ede() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
- vec4 arg_2 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
+ vec4 arg_2 = vec4(1.0f);
vec4 res = mix(arg_0, arg_1, arg_2);
}
@@ -24,9 +24,9 @@
precision mediump float;
void mix_c37ede() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
- vec4 arg_2 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
+ vec4 arg_2 = vec4(1.0f);
vec4 res = mix(arg_0, arg_1, arg_2);
}
@@ -41,9 +41,9 @@
#version 310 es
void mix_c37ede() {
- vec4 arg_0 = vec4(0.0f);
- vec4 arg_1 = vec4(0.0f);
- vec4 arg_2 = vec4(0.0f);
+ vec4 arg_0 = vec4(1.0f);
+ vec4 arg_1 = vec4(1.0f);
+ vec4 arg_2 = vec4(1.0f);
vec4 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
index 6ee771e..58c02b5 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
@@ -2,9 +2,9 @@
using namespace metal;
void mix_c37ede() {
- float4 arg_0 = float4(0.0f);
- float4 arg_1 = float4(0.0f);
- float4 arg_2 = float4(0.0f);
+ float4 arg_0 = float4(1.0f);
+ float4 arg_1 = float4(1.0f);
+ float4 arg_2 = float4(1.0f);
float4 res = mix(arg_0, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
index cca18b4..548ba53 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 38
; Schema: 0
OpCapability Shader
- %18 = OpExtInstImport "GLSL.std.450"
+ %20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -34,44 +34,45 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
-%_ptr_Function_v4float = OpTypePointer Function %v4float
- %23 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
+ %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
%mix_c37ede = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v4float Function %5
%arg_1 = OpVariable %_ptr_Function_v4float Function %5
%arg_2 = OpVariable %_ptr_Function_v4float Function %5
%res = OpVariable %_ptr_Function_v4float Function %5
- OpStore %arg_0 %5
- OpStore %arg_1 %5
- OpStore %arg_2 %5
- %19 = OpLoad %v4float %arg_0
- %20 = OpLoad %v4float %arg_1
- %21 = OpLoad %v4float %arg_2
- %17 = OpExtInst %v4float %18 FMix %19 %20 %21
- OpStore %res %17
+ OpStore %arg_0 %14
+ OpStore %arg_1 %14
+ OpStore %arg_2 %14
+ %21 = OpLoad %v4float %arg_0
+ %22 = OpLoad %v4float %arg_1
+ %23 = OpLoad %v4float %arg_2
+ %19 = OpExtInst %v4float %20 FMix %21 %22 %23
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %mix_c37ede
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %mix_c37ede
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %mix_c37ede
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %mix_c37ede
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %35 = OpLabel
- %36 = OpFunctionCall %void %mix_c37ede
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %mix_c37ede
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
index 7a073a3d..6fb66e2 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
fn mix_c37ede() {
- var arg_0 = vec4<f32>();
- var arg_1 = vec4<f32>();
- var arg_2 = vec4<f32>();
+ var arg_0 = vec4<f32>(1.0f);
+ var arg_1 = vec4<f32>(1.0f);
+ var arg_2 = vec4<f32>(1.0f);
var res : vec4<f32> = mix(arg_0, arg_1, arg_2);
}