mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
tint: Implement signed-int overloads of sign()
Bug: tint:1581 Fixed: tint:1782 Change-Id: Ia029bf9d1ce1d978c5cabc3016cb8ad1b4bac06a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113243 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
8e56c8baa7
commit
7017ec264c
43
test/tint/builtins/gen/literal/sign/3233fa.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/3233fa.wgsl
Normal 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 sign(i32) -> i32
|
||||
fn sign_3233fa() {
|
||||
var res: i32 = sign(1i);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3233fa();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3233fa();
|
||||
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 sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_3233fa() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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 %sign_3233fa "sign_3233fa"
|
||||
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_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%17 = OpConstantNull %int
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3233fa = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_int Function %17
|
||||
OpStore %res %int_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %sign_3233fa
|
||||
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 %sign_3233fa
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %sign_3233fa
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_3233fa() {
|
||||
var res : i32 = sign(1i);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3233fa();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/3a39ac.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/3a39ac.wgsl
Normal 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 sign(ia) -> ia
|
||||
fn sign_3a39ac() {
|
||||
var res = sign(1);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3a39ac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3a39ac();
|
||||
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 sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/3a39ac.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/3a39ac.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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 %sign_3a39ac "sign_3a39ac"
|
||||
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_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%17 = OpConstantNull %int
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3a39ac = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_int Function %17
|
||||
OpStore %res %int_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %sign_3a39ac
|
||||
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 %sign_3a39ac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %sign_3a39ac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_3a39ac() {
|
||||
var res = sign(1);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3a39ac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/3bdab6.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/3bdab6.wgsl
Normal 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 sign(vec<4, ia>) -> vec<4, ia>
|
||||
fn sign_3bdab6() {
|
||||
var res = sign(vec4(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3bdab6();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3bdab6() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3bdab6() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3bdab6();
|
||||
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 sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/3bdab6.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/3bdab6.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_3bdab6() {
|
||||
int4 res = int4(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_3bdab6 "sign_3bdab6"
|
||||
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
|
||||
%v4int = OpTypeVector %int 4
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%19 = OpConstantNull %v4int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3bdab6 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_3bdab6() {
|
||||
var res = sign(vec4(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3bdab6();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/55339e.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/55339e.wgsl
Normal 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 sign(vec<3, ia>) -> vec<3, ia>
|
||||
fn sign_55339e() {
|
||||
var res = sign(vec3(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_55339e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_55339e() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_55339e() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_55339e();
|
||||
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 sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/55339e.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/55339e.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_55339e() {
|
||||
int3 res = int3(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_55339e "sign_55339e"
|
||||
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
|
||||
%v3int = OpTypeVector %int 3
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%19 = OpConstantNull %v3int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_55339e = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_55339e
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_55339e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_55339e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_55339e() {
|
||||
var res = sign(vec3(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_55339e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/58d779.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/58d779.wgsl
Normal 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 sign(vec<4, i32>) -> vec<4, i32>
|
||||
fn sign_58d779() {
|
||||
var res: vec4<i32> = sign(vec4<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_58d779();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_58d779() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_58d779() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_58d779() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_58d779();
|
||||
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 sign_58d779() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_58d779() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_58d779() {
|
||||
int4 res = int4(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_58d779 "sign_58d779"
|
||||
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
|
||||
%v4int = OpTypeVector %int 4
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%19 = OpConstantNull %v4int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_58d779 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_58d779
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_58d779
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_58d779
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_58d779() {
|
||||
var res : vec4<i32> = sign(vec4<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_58d779();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/926015.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/926015.wgsl
Normal 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 sign(vec<2, i32>) -> vec<2, i32>
|
||||
fn sign_926015() {
|
||||
var res: vec2<i32> = sign(vec2<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_926015();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_926015() {
|
||||
int2 res = (1).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_926015() {
|
||||
int2 res = (1).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_926015() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_926015();
|
||||
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 sign_926015() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_926015() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_926015() {
|
||||
int2 res = int2(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_926015 "sign_926015"
|
||||
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
|
||||
%v2int = OpTypeVector %int 2
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v2int %int_1 %int_1
|
||||
%_ptr_Function_v2int = OpTypePointer Function %v2int
|
||||
%19 = OpConstantNull %v2int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_926015 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_926015
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_926015
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_926015
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_926015() {
|
||||
var res : vec2<i32> = sign(vec2<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_926015();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/943b2e.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/943b2e.wgsl
Normal 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 sign(vec<2, ia>) -> vec<2, ia>
|
||||
fn sign_943b2e() {
|
||||
var res = sign(vec2(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_943b2e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_943b2e() {
|
||||
int2 res = (1).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_943b2e();
|
||||
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() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_943b2e() {
|
||||
int2 res = (1).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_943b2e();
|
||||
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() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_943b2e() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_943b2e();
|
||||
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 sign_943b2e() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_943b2e() {
|
||||
ivec2 res = ivec2(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/943b2e.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/943b2e.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_943b2e() {
|
||||
int2 res = int2(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_943b2e();
|
||||
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() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_943b2e "sign_943b2e"
|
||||
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
|
||||
%v2int = OpTypeVector %int 2
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v2int %int_1 %int_1
|
||||
%_ptr_Function_v2int = OpTypePointer Function %v2int
|
||||
%19 = OpConstantNull %v2int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_943b2e = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_943b2e
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_943b2e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_943b2e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_943b2e() {
|
||||
var res = sign(vec2(1));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_943b2e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
43
test/tint/builtins/gen/literal/sign/9603b1.wgsl
Normal file
43
test/tint/builtins/gen/literal/sign/9603b1.wgsl
Normal 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 sign(vec<3, i32>) -> vec<3, i32>
|
||||
fn sign_9603b1() {
|
||||
var res: vec3<i32> = sign(vec3<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_9603b1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_9603b1() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_9603b1();
|
||||
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() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_9603b1() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_9603b1();
|
||||
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() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_9603b1() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_9603b1();
|
||||
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 sign_9603b1() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_9603b1() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_9603b1() {
|
||||
int3 res = int3(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_9603b1();
|
||||
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() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_9603b1();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_9603b1 "sign_9603b1"
|
||||
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
|
||||
%v3int = OpTypeVector %int 3
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%19 = OpConstantNull %v3int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_9603b1 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_9603b1
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_9603b1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_9603b1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,19 @@
|
||||
fn sign_9603b1() {
|
||||
var res : vec3<i32> = sign(vec3<i32>(1i));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_9603b1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_9603b1();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/3233fa.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/3233fa.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(i32) -> i32
|
||||
fn sign_3233fa() {
|
||||
var arg_0 = 1i;
|
||||
var res: i32 = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3233fa();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
52
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl
Normal file
52
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl
Normal file
@@ -0,0 +1,52 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = sign(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3233fa();
|
||||
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 sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = sign(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = sign(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
38
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl
Normal file
38
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
int tint_sign(int v) {
|
||||
return select(select(-1, 1, (v > 0)), 0, (v == 0));
|
||||
}
|
||||
|
||||
void sign_3233fa() {
|
||||
int arg_0 = 1;
|
||||
int res = tint_sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3233fa();
|
||||
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() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3233fa();
|
||||
return;
|
||||
}
|
||||
|
||||
72
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm
Normal file
72
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,72 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%19 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %sign_3233fa "sign_3233fa"
|
||||
OpName %arg_0 "arg_0"
|
||||
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_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%17 = OpConstantNull %int
|
||||
%22 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3233fa = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%arg_0 = OpVariable %_ptr_Function_int Function %17
|
||||
%res = OpVariable %_ptr_Function_int Function %17
|
||||
OpStore %arg_0 %int_1
|
||||
%20 = OpLoad %int %arg_0
|
||||
%18 = OpExtInst %int %19 SSign %20
|
||||
OpStore %res %18
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %sign_3233fa
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %sign_3233fa
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %sign_3233fa
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_3233fa() {
|
||||
var arg_0 = 1i;
|
||||
var res : i32 = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3233fa();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3233fa();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/3a39ac.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/3a39ac.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(ia) -> ia
|
||||
fn sign_3a39ac() {
|
||||
const arg_0 = 1;
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3a39ac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
49
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.glsl
Normal file
49
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.glsl
Normal file
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3a39ac();
|
||||
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 sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_3a39ac() {
|
||||
int res = 1;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3a39ac();
|
||||
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() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3a39ac();
|
||||
return;
|
||||
}
|
||||
|
||||
66
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.spvasm
Normal file
66
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.spvasm
Normal 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 %sign_3a39ac "sign_3a39ac"
|
||||
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_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%17 = OpConstantNull %int
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3a39ac = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_int Function %17
|
||||
OpStore %res %int_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %sign_3a39ac
|
||||
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 %sign_3a39ac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %sign_3a39ac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/3a39ac.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_3a39ac() {
|
||||
const arg_0 = 1;
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3a39ac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3a39ac();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/3bdab6.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/3bdab6.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(vec<4, ia>) -> vec<4, ia>
|
||||
fn sign_3bdab6() {
|
||||
const arg_0 = vec4(1);
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3bdab6();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3bdab6() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_3bdab6() {
|
||||
int4 res = (1).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
49
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.glsl
Normal file
49
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.glsl
Normal file
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_3bdab6();
|
||||
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 sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_3bdab6() {
|
||||
ivec4 res = ivec4(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_3bdab6() {
|
||||
int4 res = int4(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_3bdab6();
|
||||
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() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_3bdab6();
|
||||
return;
|
||||
}
|
||||
|
||||
68
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.spvasm
Normal file
68
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_3bdab6 "sign_3bdab6"
|
||||
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
|
||||
%v4int = OpTypeVector %int 4
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%19 = OpConstantNull %v4int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_3bdab6 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_3bdab6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/3bdab6.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_3bdab6() {
|
||||
const arg_0 = vec4(1);
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_3bdab6();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_3bdab6();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/55339e.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/55339e.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(vec<3, ia>) -> vec<3, ia>
|
||||
fn sign_55339e() {
|
||||
const arg_0 = vec3(1);
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_55339e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_55339e() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_55339e() {
|
||||
int3 res = (1).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
49
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.glsl
Normal file
49
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.glsl
Normal file
@@ -0,0 +1,49 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_55339e();
|
||||
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 sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_55339e() {
|
||||
ivec3 res = ivec3(1);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
33
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.msl
Normal file
33
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.msl
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void sign_55339e() {
|
||||
int3 res = int3(1);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_55339e();
|
||||
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() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_55339e();
|
||||
return;
|
||||
}
|
||||
|
||||
68
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.spvasm
Normal file
68
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,68 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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 %sign_55339e "sign_55339e"
|
||||
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
|
||||
%v3int = OpTypeVector %int 3
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%19 = OpConstantNull %v3int
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_55339e = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3int Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %sign_55339e
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %sign_55339e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %sign_55339e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/55339e.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_55339e() {
|
||||
const arg_0 = vec3(1);
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_55339e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_55339e();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/58d779.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/58d779.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(vec<4, i32>) -> vec<4, i32>
|
||||
fn sign_58d779() {
|
||||
var arg_0 = vec4<i32>(1i);
|
||||
var res: vec4<i32> = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_58d779();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_58d779() {
|
||||
int4 arg_0 = (1).xxxx;
|
||||
int4 res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_58d779() {
|
||||
int4 arg_0 = (1).xxxx;
|
||||
int4 res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
52
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl
Normal file
52
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl
Normal file
@@ -0,0 +1,52 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_58d779() {
|
||||
ivec4 arg_0 = ivec4(1);
|
||||
ivec4 res = sign(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_58d779();
|
||||
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 sign_58d779() {
|
||||
ivec4 arg_0 = ivec4(1);
|
||||
ivec4 res = sign(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_58d779() {
|
||||
ivec4 arg_0 = ivec4(1);
|
||||
ivec4 res = sign(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
38
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl
Normal file
38
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
int4 tint_sign(int4 v) {
|
||||
return select(select(int4(-1), int4(1), (v > int4(0))), int4(0), (v == int4(0)));
|
||||
}
|
||||
|
||||
void sign_58d779() {
|
||||
int4 arg_0 = int4(1);
|
||||
int4 res = tint_sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_58d779();
|
||||
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() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_58d779();
|
||||
return;
|
||||
}
|
||||
|
||||
74
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm
Normal file
74
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,74 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 38
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%21 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %sign_58d779 "sign_58d779"
|
||||
OpName %arg_0 "arg_0"
|
||||
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
|
||||
%v4int = OpTypeVector %int 4
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%19 = OpConstantNull %v4int
|
||||
%24 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_58d779 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%arg_0 = OpVariable %_ptr_Function_v4int Function %19
|
||||
%res = OpVariable %_ptr_Function_v4int Function %19
|
||||
OpStore %arg_0 %16
|
||||
%22 = OpLoad %v4int %arg_0
|
||||
%20 = OpExtInst %v4int %21 SSign %22
|
||||
OpStore %res %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %24
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %sign_58d779
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %30
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %sign_58d779
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %sign_58d779
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_58d779() {
|
||||
var arg_0 = vec4<i32>(1i);
|
||||
var res : vec4<i32> = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_58d779();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_58d779();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/926015.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/926015.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(vec<2, i32>) -> vec<2, i32>
|
||||
fn sign_926015() {
|
||||
var arg_0 = vec2<i32>(1i);
|
||||
var res: vec2<i32> = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_926015();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_926015() {
|
||||
int2 arg_0 = (1).xx;
|
||||
int2 res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
void sign_926015() {
|
||||
int2 arg_0 = (1).xx;
|
||||
int2 res = sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
52
test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl
Normal file
52
test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl
Normal file
@@ -0,0 +1,52 @@
|
||||
#version 310 es
|
||||
|
||||
void sign_926015() {
|
||||
ivec2 arg_0 = ivec2(1);
|
||||
ivec2 res = sign(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
sign_926015();
|
||||
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 sign_926015() {
|
||||
ivec2 arg_0 = ivec2(1);
|
||||
ivec2 res = sign(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void sign_926015() {
|
||||
ivec2 arg_0 = ivec2(1);
|
||||
ivec2 res = sign(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
||||
38
test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl
Normal file
38
test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
int2 tint_sign(int2 v) {
|
||||
return select(select(int2(-1), int2(1), (v > int2(0))), int2(0), (v == int2(0)));
|
||||
}
|
||||
|
||||
void sign_926015() {
|
||||
int2 arg_0 = int2(1);
|
||||
int2 res = tint_sign(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_926015();
|
||||
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() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
sign_926015();
|
||||
return;
|
||||
}
|
||||
|
||||
74
test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm
Normal file
74
test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,74 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 38
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%21 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %sign_926015 "sign_926015"
|
||||
OpName %arg_0 "arg_0"
|
||||
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
|
||||
%v2int = OpTypeVector %int 2
|
||||
%int_1 = OpConstant %int 1
|
||||
%16 = OpConstantComposite %v2int %int_1 %int_1
|
||||
%_ptr_Function_v2int = OpTypePointer Function %v2int
|
||||
%19 = OpConstantNull %v2int
|
||||
%24 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%sign_926015 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%arg_0 = OpVariable %_ptr_Function_v2int Function %19
|
||||
%res = OpVariable %_ptr_Function_v2int Function %19
|
||||
OpStore %arg_0 %16
|
||||
%22 = OpLoad %v2int %arg_0
|
||||
%20 = OpExtInst %v2int %21 SSign %22
|
||||
OpStore %res %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %24
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %sign_926015
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %30
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %sign_926015
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %sign_926015
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
20
test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl
Normal file
20
test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
fn sign_926015() {
|
||||
var arg_0 = vec2<i32>(1i);
|
||||
var res : vec2<i32> = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_926015();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_926015();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_926015();
|
||||
}
|
||||
44
test/tint/builtins/gen/var/sign/943b2e.wgsl
Normal file
44
test/tint/builtins/gen/var/sign/943b2e.wgsl
Normal file
@@ -0,0 +1,44 @@
|
||||
// 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 sign(vec<2, ia>) -> vec<2, ia>
|
||||
fn sign_943b2e() {
|
||||
const arg_0 = vec2(1);
|
||||
var res = sign(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
sign_943b2e();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
sign_943b2e();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
void sign_943b2e() {
|
||||
int2 res = (1).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
sign_943b2e();
|
||||
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() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
sign_943b2e();
|
||||
return;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user