tint: const eval of dot builtin

Bug: tint:1581
Change-Id: Ie7768f8bf254509c1795207de0a1d8b07a317555
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110984
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Antonio Maiorano
2022-11-22 15:02:55 +00:00
committed by Dawn LUCI CQ
parent b2e6b7b865
commit d6d30f4256
112 changed files with 2297 additions and 506 deletions

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<4, fa>, vec<4, fa>) -> fa
fn dot_08eb56() {
var res = dot(vec4(1.), vec4(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_08eb56();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_08eb56();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_08eb56();
}

View File

@@ -0,0 +1,30 @@
void dot_08eb56() {
float res = 4.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_08eb56();
return (0.0f).xxxx;
}
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() {
dot_08eb56();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_08eb56();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_08eb56() {
float res = 4.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_08eb56();
return (0.0f).xxxx;
}
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() {
dot_08eb56();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_08eb56();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_08eb56() {
float res = 4.0f;
}
vec4 vertex_main() {
dot_08eb56();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_08eb56() {
float res = 4.0f;
}
void fragment_main() {
dot_08eb56();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_08eb56() {
float res = 4.0f;
}
void compute_main() {
dot_08eb56();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_08eb56() {
float res = 4.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_08eb56();
return float4(0.0f);
}
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() {
dot_08eb56();
return;
}
kernel void compute_main() {
dot_08eb56();
return;
}

View File

@@ -0,0 +1,64 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
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 %dot_08eb56 "dot_08eb56"
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_4 = OpConstant %float 4
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_08eb56 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_4
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_08eb56
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %void %dot_08eb56
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %dot_08eb56
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_08eb56() {
var res = dot(vec4(1.0), vec4(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_08eb56();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_08eb56();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_08eb56();
}

View File

@@ -1,5 +1,5 @@
void dot_0c577b() {
float res = dot((1.0f).xxxx, (1.0f).xxxx);
float res = 4.0f;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_0c577b() {
float res = dot((1.0f).xxxx, (1.0f).xxxx);
float res = 4.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
#version 310 es
void dot_0c577b() {
float res = dot(vec4(1.0f), vec4(1.0f));
float res = 4.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@ void main() {
precision mediump float;
void dot_0c577b() {
float res = dot(vec4(1.0f), vec4(1.0f));
float res = 4.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@ void main() {
#version 310 es
void dot_0c577b() {
float res = dot(vec4(1.0f), vec4(1.0f));
float res = 4.0f;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_0c577b() {
float res = dot(float4(1.0f), float4(1.0f));
float res = 4.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,36 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%float_4 = OpConstant %float 4
%_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %v4float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_0c577b = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%13 = OpDot %float %15 %15
OpStore %res %13
OpStore %res %float_4
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_0c577b
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_0c577b
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%23 = OpLabel
%24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %24
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %void %dot_0c577b
%25 = OpLabel
%26 = OpFunctionCall %void %dot_0c577b
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %dot_0c577b
%28 = OpLabel
%29 = OpFunctionCall %void %dot_0c577b
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<2, fa>, vec<2, fa>) -> fa
fn dot_0d2c2e() {
var res = dot(vec2(1.), vec2(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_0d2c2e();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_0d2c2e();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_0d2c2e();
}

View File

@@ -0,0 +1,30 @@
void dot_0d2c2e() {
float res = 2.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_0d2c2e();
return (0.0f).xxxx;
}
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() {
dot_0d2c2e();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_0d2c2e();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_0d2c2e() {
float res = 2.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_0d2c2e();
return (0.0f).xxxx;
}
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() {
dot_0d2c2e();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_0d2c2e();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_0d2c2e() {
float res = 2.0f;
}
vec4 vertex_main() {
dot_0d2c2e();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_0d2c2e() {
float res = 2.0f;
}
void fragment_main() {
dot_0d2c2e();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_0d2c2e() {
float res = 2.0f;
}
void compute_main() {
dot_0d2c2e();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_0d2c2e() {
float res = 2.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_0d2c2e();
return float4(0.0f);
}
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() {
dot_0d2c2e();
return;
}
kernel void compute_main() {
dot_0d2c2e();
return;
}

View File

@@ -0,0 +1,64 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
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 %dot_0d2c2e "dot_0d2c2e"
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_2 = OpConstant %float 2
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_0d2c2e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_0d2c2e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %void %dot_0d2c2e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %dot_0d2c2e
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_0d2c2e() {
var res = dot(vec2(1.0), vec2(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_0d2c2e();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_0d2c2e();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_0d2c2e();
}

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<2, ia>, vec<2, ia>) -> ia
fn dot_14bc63() {
var res = dot(vec2(1), vec2(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_14bc63();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_14bc63();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_14bc63();
}

View File

@@ -0,0 +1,30 @@
void dot_14bc63() {
int res = 2;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_14bc63();
return (0.0f).xxxx;
}
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() {
dot_14bc63();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_14bc63();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_14bc63() {
int res = 2;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_14bc63();
return (0.0f).xxxx;
}
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() {
dot_14bc63();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_14bc63();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_14bc63() {
int res = 2;
}
vec4 vertex_main() {
dot_14bc63();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_14bc63() {
int res = 2;
}
void fragment_main() {
dot_14bc63();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_14bc63() {
int res = 2;
}
void compute_main() {
dot_14bc63();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_14bc63() {
int res = 2;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_14bc63();
return float4(0.0f);
}
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() {
dot_14bc63();
return;
}
kernel void compute_main() {
dot_14bc63();
return;
}

View File

@@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
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 %dot_14bc63 "dot_14bc63"
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
%int = OpTypeInt 32 1
%int_2 = OpConstant %int 2
%_ptr_Function_int = OpTypePointer Function %int
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_14bc63 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_14bc63
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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_14bc63
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_14bc63
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_14bc63() {
var res = dot(vec2(1), vec2(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_14bc63();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_14bc63();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_14bc63();
}

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<3, fa>, vec<3, fa>) -> fa
fn dot_5a4c8f() {
var res = dot(vec3(1.), vec3(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_5a4c8f();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_5a4c8f();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_5a4c8f();
}

View File

@@ -0,0 +1,30 @@
void dot_5a4c8f() {
float res = 3.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_5a4c8f();
return (0.0f).xxxx;
}
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() {
dot_5a4c8f();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_5a4c8f();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_5a4c8f() {
float res = 3.0f;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_5a4c8f();
return (0.0f).xxxx;
}
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() {
dot_5a4c8f();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_5a4c8f();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_5a4c8f() {
float res = 3.0f;
}
vec4 vertex_main() {
dot_5a4c8f();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_5a4c8f() {
float res = 3.0f;
}
void fragment_main() {
dot_5a4c8f();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_5a4c8f() {
float res = 3.0f;
}
void compute_main() {
dot_5a4c8f();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_5a4c8f() {
float res = 3.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_5a4c8f();
return float4(0.0f);
}
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() {
dot_5a4c8f();
return;
}
kernel void compute_main() {
dot_5a4c8f();
return;
}

View File

@@ -0,0 +1,64 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
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 %dot_5a4c8f "dot_5a4c8f"
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_3 = OpConstant %float 3
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_5a4c8f = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_3
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_5a4c8f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %void %dot_5a4c8f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %dot_5a4c8f
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_5a4c8f() {
var res = dot(vec3(1.0), vec3(1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_5a4c8f();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_5a4c8f();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_5a4c8f();
}

View File

@@ -1,5 +1,5 @@
void dot_7548a0() {
uint res = dot((1u).xxx, (1u).xxx);
uint res = 3u;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_7548a0() {
uint res = dot((1u).xxx, (1u).xxx);
uint res = 3u;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
uint tint_int_dot(uvec3 a, uvec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_7548a0() {
uint res = tint_int_dot(uvec3(1u), uvec3(1u));
uint res = 3u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
uint tint_int_dot(uvec3 a, uvec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_7548a0() {
uint res = tint_int_dot(uvec3(1u), uvec3(1u));
uint res = 3u;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
uint tint_int_dot(uvec3 a, uvec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_7548a0() {
uint res = tint_int_dot(uvec3(1u), uvec3(1u));
uint res = 3u;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot3(vec<T,3> a, vec<T,3> b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_7548a0() {
uint res = tint_dot3(uint3(1u), uint3(1u));
uint res = 3u;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 45
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,49 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%uint_1 = OpConstant %uint 1
%17 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
%uint_3 = OpConstant %uint 3
%_ptr_Function_uint = OpTypePointer Function %uint
%30 = OpConstantNull %uint
%31 = OpTypeFunction %v4float
%17 = OpConstantNull %uint
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_7548a0 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %30
%18 = OpCompositeExtract %uint %17 0
%19 = OpCompositeExtract %uint %17 0
%20 = OpIMul %uint %18 %19
%21 = OpCompositeExtract %uint %17 1
%22 = OpCompositeExtract %uint %17 1
%23 = OpIMul %uint %21 %22
%24 = OpIAdd %uint %20 %23
%25 = OpCompositeExtract %uint %17 2
%26 = OpCompositeExtract %uint %17 2
%27 = OpIMul %uint %25 %26
%13 = OpIAdd %uint %24 %27
OpStore %res %13
%res = OpVariable %_ptr_Function_uint Function %17
OpStore %res %uint_3
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %31
%33 = OpLabel
%34 = OpFunctionCall %void %dot_7548a0
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_7548a0
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %37
%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
%40 = OpLabel
%41 = OpFunctionCall %void %dot_7548a0
%27 = OpLabel
%28 = OpFunctionCall %void %dot_7548a0
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%43 = OpLabel
%44 = OpFunctionCall %void %dot_7548a0
%30 = OpLabel
%31 = OpFunctionCall %void %dot_7548a0
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_883f0e() {
float res = dot((1.0f).xx, (1.0f).xx);
float res = 2.0f;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_883f0e() {
float res = dot((1.0f).xx, (1.0f).xx);
float res = 2.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
#version 310 es
void dot_883f0e() {
float res = dot(vec2(1.0f), vec2(1.0f));
float res = 2.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@ void main() {
precision mediump float;
void dot_883f0e() {
float res = dot(vec2(1.0f), vec2(1.0f));
float res = 2.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@ void main() {
#version 310 es
void dot_883f0e() {
float res = dot(vec2(1.0f), vec2(1.0f));
float res = 2.0f;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_883f0e() {
float res = dot(float2(1.0f), float2(1.0f));
float res = 2.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,37 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v2float %float_1 %float_1
%float_2 = OpConstant %float 2
%_ptr_Function_float = OpTypePointer Function %float
%19 = OpTypeFunction %v4float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_883f0e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%13 = OpDot %float %16 %16
OpStore %res %13
OpStore %res %float_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %dot_883f0e
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_883f0e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %dot_883f0e
%25 = OpLabel
%26 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_883f0e
%28 = OpLabel
%29 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_8e40f1() {
float16_t res = dot((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
float16_t res = float16_t(3.0h);
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_8e40f1() {
float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
float16_t res = 3.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@ void main() {
precision mediump float;
void dot_8e40f1() {
float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
float16_t res = 3.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void dot_8e40f1() {
float16_t res = dot(f16vec3(1.0hf), f16vec3(1.0hf));
float16_t res = 3.0hf;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_8e40f1() {
half res = dot(half3(1.0h), half3(1.0h));
half res = 3.0h;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v3half = OpTypeVector %half 3
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
%_ptr_Function_half = OpTypePointer Function %half
%20 = OpConstantNull %half
%21 = OpTypeFunction %v4float
%17 = OpConstantNull %half
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_8e40f1 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %20
%13 = OpDot %half %17 %17
OpStore %res %13
%res = OpVariable %_ptr_Function_half Function %17
OpStore %res %half_0x1_8p_1
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %dot_8e40f1
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_8e40f1
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_8e40f1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_8e40f1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %dot_8e40f1
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_97c7ee() {
uint res = dot((1u).xx, (1u).xx);
uint res = 2u;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_97c7ee() {
uint res = dot((1u).xx, (1u).xx);
uint res = 2u;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
uint tint_int_dot(uvec2 a, uvec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_97c7ee() {
uint res = tint_int_dot(uvec2(1u), uvec2(1u));
uint res = 2u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
uint tint_int_dot(uvec2 a, uvec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_97c7ee() {
uint res = tint_int_dot(uvec2(1u), uvec2(1u));
uint res = 2u;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
uint tint_int_dot(uvec2 a, uvec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_97c7ee() {
uint res = tint_int_dot(uvec2(1u), uvec2(1u));
uint res = 2u;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot2(vec<T,2> a, vec<T,2> b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_97c7ee() {
uint res = tint_dot2(uint2(1u), uint2(1u));
uint res = 2u;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 41
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,45 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
%uint_1 = OpConstant %uint 1
%17 = OpConstantComposite %v2uint %uint_1 %uint_1
%uint_2 = OpConstant %uint 2
%_ptr_Function_uint = OpTypePointer Function %uint
%26 = OpConstantNull %uint
%27 = OpTypeFunction %v4float
%17 = OpConstantNull %uint
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_97c7ee = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %26
%18 = OpCompositeExtract %uint %17 0
%19 = OpCompositeExtract %uint %17 0
%20 = OpIMul %uint %18 %19
%21 = OpCompositeExtract %uint %17 1
%22 = OpCompositeExtract %uint %17 1
%23 = OpIMul %uint %21 %22
%13 = OpIAdd %uint %20 %23
OpStore %res %13
%res = OpVariable %_ptr_Function_uint Function %17
OpStore %res %uint_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27
%29 = OpLabel
%30 = OpFunctionCall %void %dot_97c7ee
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_97c7ee
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33
%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
%36 = OpLabel
%37 = OpFunctionCall %void %dot_97c7ee
%27 = OpLabel
%28 = OpFunctionCall %void %dot_97c7ee
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%39 = OpLabel
%40 = OpFunctionCall %void %dot_97c7ee
%30 = OpLabel
%31 = OpFunctionCall %void %dot_97c7ee
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_ba4246() {
float res = dot((1.0f).xxx, (1.0f).xxx);
float res = 3.0f;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_ba4246() {
float res = dot((1.0f).xxx, (1.0f).xxx);
float res = 3.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
#version 310 es
void dot_ba4246() {
float res = dot(vec3(1.0f), vec3(1.0f));
float res = 3.0f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@ void main() {
precision mediump float;
void dot_ba4246() {
float res = dot(vec3(1.0f), vec3(1.0f));
float res = 3.0f;
}
void fragment_main() {
@@ -35,7 +35,7 @@ void main() {
#version 310 es
void dot_ba4246() {
float res = dot(vec3(1.0f), vec3(1.0f));
float res = 3.0f;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_ba4246() {
float res = dot(float3(1.0f), float3(1.0f));
float res = 3.0f;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -30,37 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%float_3 = OpConstant %float 3
%_ptr_Function_float = OpTypePointer Function %float
%19 = OpTypeFunction %v4float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_ba4246 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%13 = OpDot %float %16 %16
OpStore %res %13
OpStore %res %float_3
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %dot_ba4246
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %dot_ba4246
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %dot_ba4246
%25 = OpLabel
%26 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_ba4246
%28 = OpLabel
%29 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<3, ia>, vec<3, ia>) -> ia
fn dot_c11efe() {
var res = dot(vec3(1), vec3(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_c11efe();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_c11efe();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_c11efe();
}

View File

@@ -0,0 +1,30 @@
void dot_c11efe() {
int res = 3;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_c11efe();
return (0.0f).xxxx;
}
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() {
dot_c11efe();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_c11efe();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_c11efe() {
int res = 3;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_c11efe();
return (0.0f).xxxx;
}
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() {
dot_c11efe();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_c11efe();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_c11efe() {
int res = 3;
}
vec4 vertex_main() {
dot_c11efe();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_c11efe() {
int res = 3;
}
void fragment_main() {
dot_c11efe();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_c11efe() {
int res = 3;
}
void compute_main() {
dot_c11efe();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_c11efe() {
int res = 3;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_c11efe();
return float4(0.0f);
}
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() {
dot_c11efe();
return;
}
kernel void compute_main() {
dot_c11efe();
return;
}

View File

@@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
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 %dot_c11efe "dot_c11efe"
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
%int = OpTypeInt 32 1
%int_3 = OpConstant %int 3
%_ptr_Function_int = OpTypePointer Function %int
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_c11efe = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_3
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_c11efe
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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_c11efe
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_c11efe
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_c11efe() {
var res = dot(vec3(1), vec3(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_c11efe();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_c11efe();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_c11efe();
}

View File

@@ -1,5 +1,5 @@
void dot_cd5a04() {
float16_t res = dot((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
float16_t res = float16_t(2.0h);
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_cd5a04() {
float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
float16_t res = 2.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@ void main() {
precision mediump float;
void dot_cd5a04() {
float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
float16_t res = 2.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void dot_cd5a04() {
float16_t res = dot(f16vec2(1.0hf), f16vec2(1.0hf));
float16_t res = 2.0hf;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_cd5a04() {
half res = dot(half2(1.0h), half2(1.0h));
half res = 2.0h;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v2half = OpTypeVector %half 2
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%half_0x1p_1 = OpConstant %half 0x1p+1
%_ptr_Function_half = OpTypePointer Function %half
%20 = OpConstantNull %half
%21 = OpTypeFunction %v4float
%17 = OpConstantNull %half
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_cd5a04 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %20
%13 = OpDot %half %17 %17
OpStore %res %13
%res = OpVariable %_ptr_Function_half Function %17
OpStore %res %half_0x1p_1
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %dot_cd5a04
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_cd5a04
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_cd5a04
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_cd5a04
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %dot_cd5a04
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_d0d179() {
float16_t res = dot((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
float16_t res = float16_t(4.0h);
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void dot_d0d179() {
float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
float16_t res = 4.0hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@ void main() {
precision mediump float;
void dot_d0d179() {
float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
float16_t res = 4.0hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void dot_d0d179() {
float16_t res = dot(f16vec4(1.0hf), f16vec4(1.0hf));
float16_t res = 4.0hf;
}
void compute_main() {

View File

@@ -2,7 +2,7 @@
using namespace metal;
void dot_d0d179() {
half res = dot(half4(1.0h), half4(1.0h));
half res = 4.0h;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -35,39 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%half_0x1p_2 = OpConstant %half 0x1p+2
%_ptr_Function_half = OpTypePointer Function %half
%20 = OpConstantNull %half
%21 = OpTypeFunction %v4float
%17 = OpConstantNull %half
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_d0d179 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %20
%13 = OpDot %half %17 %17
OpStore %res %13
%res = OpVariable %_ptr_Function_half Function %17
OpStore %res %half_0x1p_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %dot_d0d179
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_d0d179
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
%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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_d0d179
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_d0d179
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %dot_d0d179
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_e994c7() {
uint res = dot((1u).xxxx, (1u).xxxx);
uint res = 4u;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_e994c7() {
uint res = dot((1u).xxxx, (1u).xxxx);
uint res = 4u;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
uint tint_int_dot(uvec4 a, uvec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_e994c7() {
uint res = tint_int_dot(uvec4(1u), uvec4(1u));
uint res = 4u;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
uint tint_int_dot(uvec4 a, uvec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_e994c7() {
uint res = tint_int_dot(uvec4(1u), uvec4(1u));
uint res = 4u;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
uint tint_int_dot(uvec4 a, uvec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_e994c7() {
uint res = tint_int_dot(uvec4(1u), uvec4(1u));
uint res = 4u;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot4(vec<T,4> a, vec<T,4> b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_e994c7() {
uint res = tint_dot4(uint4(1u), uint4(1u));
uint res = 4u;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 49
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,53 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%uint_1 = OpConstant %uint 1
%17 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
%uint_4 = OpConstant %uint 4
%_ptr_Function_uint = OpTypePointer Function %uint
%34 = OpConstantNull %uint
%35 = OpTypeFunction %v4float
%17 = OpConstantNull %uint
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_e994c7 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %34
%18 = OpCompositeExtract %uint %17 0
%19 = OpCompositeExtract %uint %17 0
%20 = OpIMul %uint %18 %19
%21 = OpCompositeExtract %uint %17 1
%22 = OpCompositeExtract %uint %17 1
%23 = OpIMul %uint %21 %22
%24 = OpIAdd %uint %20 %23
%25 = OpCompositeExtract %uint %17 2
%26 = OpCompositeExtract %uint %17 2
%27 = OpIMul %uint %25 %26
%28 = OpIAdd %uint %24 %27
%29 = OpCompositeExtract %uint %17 3
%30 = OpCompositeExtract %uint %17 3
%31 = OpIMul %uint %29 %30
%13 = OpIAdd %uint %28 %31
OpStore %res %13
%res = OpVariable %_ptr_Function_uint Function %17
OpStore %res %uint_4
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %35
%37 = OpLabel
%38 = OpFunctionCall %void %dot_e994c7
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_e994c7
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%40 = OpLabel
%41 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %41
%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
%44 = OpLabel
%45 = OpFunctionCall %void %dot_e994c7
%27 = OpLabel
%28 = OpFunctionCall %void %dot_e994c7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%47 = OpLabel
%48 = OpFunctionCall %void %dot_e994c7
%30 = OpLabel
%31 = OpFunctionCall %void %dot_e994c7
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<4, ia>, vec<4, ia>) -> ia
fn dot_eb9fbf() {
var res = dot(vec4(1), vec4(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_eb9fbf();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_eb9fbf();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_eb9fbf();
}

View File

@@ -0,0 +1,30 @@
void dot_eb9fbf() {
int res = 4;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_eb9fbf();
return (0.0f).xxxx;
}
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() {
dot_eb9fbf();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_eb9fbf();
return;
}

View File

@@ -0,0 +1,30 @@
void dot_eb9fbf() {
int res = 4;
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
dot_eb9fbf();
return (0.0f).xxxx;
}
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() {
dot_eb9fbf();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
dot_eb9fbf();
return;
}

View File

@@ -0,0 +1,49 @@
#version 310 es
void dot_eb9fbf() {
int res = 4;
}
vec4 vertex_main() {
dot_eb9fbf();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
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 dot_eb9fbf() {
int res = 4;
}
void fragment_main() {
dot_eb9fbf();
}
void main() {
fragment_main();
return;
}
#version 310 es
void dot_eb9fbf() {
int res = 4;
}
void compute_main() {
dot_eb9fbf();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void dot_eb9fbf() {
int res = 4;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
dot_eb9fbf();
return float4(0.0f);
}
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() {
dot_eb9fbf();
return;
}
kernel void compute_main() {
dot_eb9fbf();
return;
}

View File

@@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
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 %dot_eb9fbf "dot_eb9fbf"
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
%int = OpTypeInt 32 1
%int_4 = OpConstant %int 4
%_ptr_Function_int = OpTypePointer Function %int
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_eb9fbf = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_4
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_eb9fbf
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
%27 = OpLabel
%28 = OpFunctionCall %void %dot_eb9fbf
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %dot_eb9fbf
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,19 @@
fn dot_eb9fbf() {
var res = dot(vec4(1), vec4(1));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_eb9fbf();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_eb9fbf();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_eb9fbf();
}

View File

@@ -1,5 +1,5 @@
void dot_ef6b1d() {
int res = dot((1).xxxx, (1).xxxx);
int res = 4;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_ef6b1d() {
int res = dot((1).xxxx, (1).xxxx);
int res = 4;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
int tint_int_dot(ivec4 a, ivec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_ef6b1d() {
int res = tint_int_dot(ivec4(1), ivec4(1));
int res = 4;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
int tint_int_dot(ivec4 a, ivec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_ef6b1d() {
int res = tint_int_dot(ivec4(1), ivec4(1));
int res = 4;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
int tint_int_dot(ivec4 a, ivec4 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_ef6b1d() {
int res = tint_int_dot(ivec4(1), ivec4(1));
int res = 4;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot4(vec<T,4> a, vec<T,4> b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
}
void dot_ef6b1d() {
int res = tint_dot4(int4(1), int4(1));
int res = 4;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 49
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,53 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%17 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%int_4 = OpConstant %int 4
%_ptr_Function_int = OpTypePointer Function %int
%34 = OpConstantNull %int
%35 = OpTypeFunction %v4float
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_ef6b1d = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %34
%18 = OpCompositeExtract %int %17 0
%19 = OpCompositeExtract %int %17 0
%20 = OpIMul %int %18 %19
%21 = OpCompositeExtract %int %17 1
%22 = OpCompositeExtract %int %17 1
%23 = OpIMul %int %21 %22
%24 = OpIAdd %int %20 %23
%25 = OpCompositeExtract %int %17 2
%26 = OpCompositeExtract %int %17 2
%27 = OpIMul %int %25 %26
%28 = OpIAdd %int %24 %27
%29 = OpCompositeExtract %int %17 3
%30 = OpCompositeExtract %int %17 3
%31 = OpIMul %int %29 %30
%13 = OpIAdd %int %28 %31
OpStore %res %13
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_4
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %35
%37 = OpLabel
%38 = OpFunctionCall %void %dot_ef6b1d
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_ef6b1d
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%40 = OpLabel
%41 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %41
%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
%44 = OpLabel
%45 = OpFunctionCall %void %dot_ef6b1d
%27 = OpLabel
%28 = OpFunctionCall %void %dot_ef6b1d
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%47 = OpLabel
%48 = OpFunctionCall %void %dot_ef6b1d
%30 = OpLabel
%31 = OpFunctionCall %void %dot_ef6b1d
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_f1312c() {
int res = dot((1).xxx, (1).xxx);
int res = 3;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_f1312c() {
int res = dot((1).xxx, (1).xxx);
int res = 3;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
int tint_int_dot(ivec3 a, ivec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_f1312c() {
int res = tint_int_dot(ivec3(1), ivec3(1));
int res = 3;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
int tint_int_dot(ivec3 a, ivec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_f1312c() {
int res = tint_int_dot(ivec3(1), ivec3(1));
int res = 3;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
int tint_int_dot(ivec3 a, ivec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_f1312c() {
int res = tint_int_dot(ivec3(1), ivec3(1));
int res = 3;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot3(vec<T,3> a, vec<T,3> b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
void dot_f1312c() {
int res = tint_dot3(int3(1), int3(1));
int res = 3;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 45
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,49 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%17 = OpConstantComposite %v3int %int_1 %int_1 %int_1
%int_3 = OpConstant %int 3
%_ptr_Function_int = OpTypePointer Function %int
%30 = OpConstantNull %int
%31 = OpTypeFunction %v4float
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_f1312c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %30
%18 = OpCompositeExtract %int %17 0
%19 = OpCompositeExtract %int %17 0
%20 = OpIMul %int %18 %19
%21 = OpCompositeExtract %int %17 1
%22 = OpCompositeExtract %int %17 1
%23 = OpIMul %int %21 %22
%24 = OpIAdd %int %20 %23
%25 = OpCompositeExtract %int %17 2
%26 = OpCompositeExtract %int %17 2
%27 = OpIMul %int %25 %26
%13 = OpIAdd %int %24 %27
OpStore %res %13
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_3
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %31
%33 = OpLabel
%34 = OpFunctionCall %void %dot_f1312c
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_f1312c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %37
%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
%40 = OpLabel
%41 = OpFunctionCall %void %dot_f1312c
%27 = OpLabel
%28 = OpFunctionCall %void %dot_f1312c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%43 = OpLabel
%44 = OpFunctionCall %void %dot_f1312c
%30 = OpLabel
%31 = OpFunctionCall %void %dot_f1312c
OpReturn
OpFunctionEnd

View File

@@ -1,5 +1,5 @@
void dot_fc5f7c() {
int res = dot((1).xx, (1).xx);
int res = 2;
}
struct tint_symbol {

View File

@@ -1,5 +1,5 @@
void dot_fc5f7c() {
int res = dot((1).xx, (1).xx);
int res = 2;
}
struct tint_symbol {

View File

@@ -1,11 +1,7 @@
#version 310 es
int tint_int_dot(ivec2 a, ivec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_fc5f7c() {
int res = tint_int_dot(ivec2(1), ivec2(1));
int res = 2;
}
vec4 vertex_main() {
@@ -24,12 +20,8 @@ void main() {
#version 310 es
precision mediump float;
int tint_int_dot(ivec2 a, ivec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_fc5f7c() {
int res = tint_int_dot(ivec2(1), ivec2(1));
int res = 2;
}
void fragment_main() {
@@ -42,12 +34,8 @@ void main() {
}
#version 310 es
int tint_int_dot(ivec2 a, ivec2 b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_fc5f7c() {
int res = tint_int_dot(ivec2(1), ivec2(1));
int res = 2;
}
void compute_main() {

View File

@@ -1,13 +1,8 @@
#include <metal_stdlib>
using namespace metal;
template<typename T>
T tint_dot2(vec<T,2> a, vec<T,2> b) {
return a[0]*b[0] + a[1]*b[1];
}
void dot_fc5f7c() {
int res = tint_dot2(int2(1), int2(1));
int res = 2;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 41
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -31,45 +31,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%17 = OpConstantComposite %v2int %int_1 %int_1
%int_2 = OpConstant %int 2
%_ptr_Function_int = OpTypePointer Function %int
%26 = OpConstantNull %int
%27 = OpTypeFunction %v4float
%17 = OpConstantNull %int
%18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%dot_fc5f7c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_int Function %26
%18 = OpCompositeExtract %int %17 0
%19 = OpCompositeExtract %int %17 0
%20 = OpIMul %int %18 %19
%21 = OpCompositeExtract %int %17 1
%22 = OpCompositeExtract %int %17 1
%23 = OpIMul %int %21 %22
%13 = OpIAdd %int %20 %23
OpStore %res %13
%res = OpVariable %_ptr_Function_int Function %17
OpStore %res %int_2
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27
%29 = OpLabel
%30 = OpFunctionCall %void %dot_fc5f7c
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %dot_fc5f7c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33
%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
%36 = OpLabel
%37 = OpFunctionCall %void %dot_fc5f7c
%27 = OpLabel
%28 = OpFunctionCall %void %dot_fc5f7c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%39 = OpLabel
%40 = OpFunctionCall %void %dot_fc5f7c
%30 = OpLabel
%31 = OpFunctionCall %void %dot_fc5f7c
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,45 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn dot(vec<4, fa>, vec<4, fa>) -> fa
fn dot_08eb56() {
const arg_0 = vec4(1.);
const arg_1 = vec4(1.);
var res = dot(arg_0, arg_1);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
dot_08eb56();
return vec4<f32>();
}
@fragment
fn fragment_main() {
dot_08eb56();
}
@compute @workgroup_size(1)
fn compute_main() {
dot_08eb56();
}

Some files were not shown because too many files have changed in this diff Show More