mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
intrinsics: Add degrees() and radians()
Fixed: tint:1329 Change-Id: I5fb927268fc9cb8047a2b365d26e813a8546605a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/75423 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
4beeaea9da
commit
5c99ed046a
@@ -1,11 +1,16 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
b = (a * 57.295780182f);
|
||||
b = tint_degrees(a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
b = (a * 57.295780182f);
|
||||
b = tint_degrees(a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
float const x_11 = a;
|
||||
b = (x_11 * 57.295780182f);
|
||||
b = tint_degrees(x_11);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
; Bound: 17
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%13 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
@@ -17,15 +18,14 @@
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%8 = OpConstantNull %float
|
||||
%float_42 = OpConstant %float 42
|
||||
%float_57_2957802 = OpConstant %float 57.2957802
|
||||
%main_1 = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_float Function %8
|
||||
%b = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %a %float_42
|
||||
%11 = OpLoad %float %a
|
||||
%13 = OpFMul %float %11 %float_57_2957802
|
||||
OpStore %b %13
|
||||
%12 = OpExtInst %float %13 Degrees %11
|
||||
OpStore %b %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %1
|
||||
|
||||
@@ -3,7 +3,7 @@ fn main_1() {
|
||||
var b : f32;
|
||||
a = 42.0;
|
||||
let x_11 : f32 = a;
|
||||
b = (x_11 * 57.295780182);
|
||||
b = degrees(x_11);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
45
test/intrinsics/gen/degrees/0d170c.wgsl
Normal file
45
test/intrinsics/gen/degrees/0d170c.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn degrees(vec<4, f32>) -> vec<4, f32>
|
||||
fn degrees_0d170c() {
|
||||
var res: vec4<f32> = degrees(vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_0d170c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_0d170c();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_0d170c();
|
||||
}
|
||||
86
test/intrinsics/gen/degrees/0d170c.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/degrees/0d170c.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_degrees(vec4 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_0d170c() {
|
||||
vec4 res = tint_degrees(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
degrees_0d170c();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_degrees(vec4 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_0d170c() {
|
||||
vec4 res = tint_degrees(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_degrees(vec4 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_0d170c() {
|
||||
vec4 res = tint_degrees(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/degrees/0d170c.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/degrees/0d170c.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float4 tint_degrees(float4 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void degrees_0d170c() {
|
||||
float4 res = tint_degrees(float4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_0d170c();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/degrees/0d170c.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/degrees/0d170c.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float4 tint_degrees(float4 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void degrees_0d170c() {
|
||||
float4 res = tint_degrees(float4());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_0d170c();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
degrees_0d170c();
|
||||
return;
|
||||
}
|
||||
|
||||
65
test/intrinsics/gen/degrees/0d170c.wgsl.expected.spvasm
Normal file
65
test/intrinsics/gen/degrees/0d170c.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,65 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %degrees_0d170c "degrees_0d170c"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%degrees_0d170c = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%13 = OpExtInst %v4float %14 Degrees %5
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %degrees_0d170c
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %degrees_0d170c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %degrees_0d170c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/degrees/0d170c.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/degrees/0d170c.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn degrees_0d170c() {
|
||||
var res : vec4<f32> = degrees(vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_0d170c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_0d170c();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_0d170c();
|
||||
}
|
||||
45
test/intrinsics/gen/degrees/1ad5df.wgsl
Normal file
45
test/intrinsics/gen/degrees/1ad5df.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn degrees(vec<2, f32>) -> vec<2, f32>
|
||||
fn degrees_1ad5df() {
|
||||
var res: vec2<f32> = degrees(vec2<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_1ad5df();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_1ad5df();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_1ad5df();
|
||||
}
|
||||
86
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_degrees(vec2 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_1ad5df() {
|
||||
vec2 res = tint_degrees(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
degrees_1ad5df();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_degrees(vec2 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_1ad5df() {
|
||||
vec2 res = tint_degrees(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_degrees(vec2 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_1ad5df() {
|
||||
vec2 res = tint_degrees(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float2 tint_degrees(float2 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void degrees_1ad5df() {
|
||||
float2 res = tint_degrees(float2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_1ad5df();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float2 tint_degrees(float2 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void degrees_1ad5df() {
|
||||
float2 res = tint_degrees(float2());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_1ad5df();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
degrees_1ad5df();
|
||||
return;
|
||||
}
|
||||
|
||||
67
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.spvasm
Normal file
67
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,67 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %degrees_1ad5df "degrees_1ad5df"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%16 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%degrees_1ad5df = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %16
|
||||
%13 = OpExtInst %v2float %15 Degrees %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %degrees_1ad5df
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %degrees_1ad5df
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %degrees_1ad5df
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/degrees/1ad5df.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn degrees_1ad5df() {
|
||||
var res : vec2<f32> = degrees(vec2<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_1ad5df();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_1ad5df();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_1ad5df();
|
||||
}
|
||||
45
test/intrinsics/gen/degrees/2af623.wgsl
Normal file
45
test/intrinsics/gen/degrees/2af623.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn degrees(vec<3, f32>) -> vec<3, f32>
|
||||
fn degrees_2af623() {
|
||||
var res: vec3<f32> = degrees(vec3<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_2af623();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_2af623();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_2af623();
|
||||
}
|
||||
86
test/intrinsics/gen/degrees/2af623.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/degrees/2af623.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_degrees(vec3 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_2af623() {
|
||||
vec3 res = tint_degrees(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
degrees_2af623();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_degrees(vec3 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_2af623() {
|
||||
vec3 res = tint_degrees(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_degrees(vec3 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_2af623() {
|
||||
vec3 res = tint_degrees(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/degrees/2af623.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/degrees/2af623.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float3 tint_degrees(float3 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void degrees_2af623() {
|
||||
float3 res = tint_degrees(float3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_2af623();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/degrees/2af623.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/degrees/2af623.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float3 tint_degrees(float3 param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void degrees_2af623() {
|
||||
float3 res = tint_degrees(float3());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_2af623();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
degrees_2af623();
|
||||
return;
|
||||
}
|
||||
|
||||
67
test/intrinsics/gen/degrees/2af623.wgsl.expected.spvasm
Normal file
67
test/intrinsics/gen/degrees/2af623.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,67 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %degrees_2af623 "degrees_2af623"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%16 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%degrees_2af623 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %16
|
||||
%13 = OpExtInst %v3float %15 Degrees %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %degrees_2af623
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %degrees_2af623
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %degrees_2af623
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/degrees/2af623.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/degrees/2af623.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn degrees_2af623() {
|
||||
var res : vec3<f32> = degrees(vec3<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_2af623();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_2af623();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_2af623();
|
||||
}
|
||||
45
test/intrinsics/gen/degrees/51f705.wgsl
Normal file
45
test/intrinsics/gen/degrees/51f705.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn degrees(f32) -> f32
|
||||
fn degrees_51f705() {
|
||||
var res: f32 = degrees(1.0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_51f705();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_51f705();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_51f705();
|
||||
}
|
||||
86
test/intrinsics/gen/degrees/51f705.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/degrees/51f705.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_51f705() {
|
||||
float res = tint_degrees(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
degrees_51f705();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_51f705() {
|
||||
float res = tint_degrees(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
|
||||
void degrees_51f705() {
|
||||
float res = tint_degrees(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/degrees/51f705.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/degrees/51f705.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
void degrees_51f705() {
|
||||
float res = tint_degrees(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_51f705();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/degrees/51f705.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/degrees/51f705.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float tint_degrees(float param_0) {
|
||||
return param_0 * 57.295779513082322865;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void degrees_51f705() {
|
||||
float res = tint_degrees(1.0f);
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
degrees_51f705();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
degrees_51f705();
|
||||
return;
|
||||
}
|
||||
|
||||
65
test/intrinsics/gen/degrees/51f705.wgsl.expected.spvasm
Normal file
65
test/intrinsics/gen/degrees/51f705.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,65 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %degrees_51f705 "degrees_51f705"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%degrees_51f705 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 Degrees %float_1
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %degrees_51f705
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %degrees_51f705
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %degrees_51f705
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/degrees/51f705.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/degrees/51f705.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn degrees_51f705() {
|
||||
var res : f32 = degrees(1.0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
degrees_51f705();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
degrees_51f705();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
degrees_51f705();
|
||||
}
|
||||
45
test/intrinsics/gen/radians/09b7fc.wgsl
Normal file
45
test/intrinsics/gen/radians/09b7fc.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn radians(vec<4, f32>) -> vec<4, f32>
|
||||
fn radians_09b7fc() {
|
||||
var res: vec4<f32> = radians(vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_09b7fc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_09b7fc();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_09b7fc();
|
||||
}
|
||||
86
test/intrinsics/gen/radians/09b7fc.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/radians/09b7fc.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_radians(vec4 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_09b7fc() {
|
||||
vec4 res = tint_radians(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
radians_09b7fc();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_radians(vec4 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_09b7fc() {
|
||||
vec4 res = tint_radians(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec4 tint_radians(vec4 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_09b7fc() {
|
||||
vec4 res = tint_radians(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/radians/09b7fc.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/radians/09b7fc.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float4 tint_radians(float4 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void radians_09b7fc() {
|
||||
float4 res = tint_radians(float4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_09b7fc();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/radians/09b7fc.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/radians/09b7fc.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float4 tint_radians(float4 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void radians_09b7fc() {
|
||||
float4 res = tint_radians(float4());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_09b7fc();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
radians_09b7fc();
|
||||
return;
|
||||
}
|
||||
|
||||
65
test/intrinsics/gen/radians/09b7fc.wgsl.expected.spvasm
Normal file
65
test/intrinsics/gen/radians/09b7fc.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,65 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %radians_09b7fc "radians_09b7fc"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%radians_09b7fc = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%13 = OpExtInst %v4float %14 Radians %5
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %radians_09b7fc
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %radians_09b7fc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %radians_09b7fc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/radians/09b7fc.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/radians/09b7fc.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn radians_09b7fc() {
|
||||
var res : vec4<f32> = radians(vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_09b7fc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_09b7fc();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_09b7fc();
|
||||
}
|
||||
45
test/intrinsics/gen/radians/61687a.wgsl
Normal file
45
test/intrinsics/gen/radians/61687a.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn radians(vec<2, f32>) -> vec<2, f32>
|
||||
fn radians_61687a() {
|
||||
var res: vec2<f32> = radians(vec2<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_61687a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_61687a();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_61687a();
|
||||
}
|
||||
86
test/intrinsics/gen/radians/61687a.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/radians/61687a.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_radians(vec2 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_61687a() {
|
||||
vec2 res = tint_radians(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
radians_61687a();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_radians(vec2 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_61687a() {
|
||||
vec2 res = tint_radians(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec2 tint_radians(vec2 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_61687a() {
|
||||
vec2 res = tint_radians(vec2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/radians/61687a.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/radians/61687a.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float2 tint_radians(float2 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void radians_61687a() {
|
||||
float2 res = tint_radians(float2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_61687a();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/radians/61687a.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/radians/61687a.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float2 tint_radians(float2 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void radians_61687a() {
|
||||
float2 res = tint_radians(float2());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_61687a();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
radians_61687a();
|
||||
return;
|
||||
}
|
||||
|
||||
67
test/intrinsics/gen/radians/61687a.wgsl.expected.spvasm
Normal file
67
test/intrinsics/gen/radians/61687a.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,67 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %radians_61687a "radians_61687a"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%16 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%radians_61687a = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %16
|
||||
%13 = OpExtInst %v2float %15 Radians %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %radians_61687a
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %radians_61687a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %radians_61687a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/radians/61687a.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/radians/61687a.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn radians_61687a() {
|
||||
var res : vec2<f32> = radians(vec2<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_61687a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_61687a();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_61687a();
|
||||
}
|
||||
45
test/intrinsics/gen/radians/6b0ff2.wgsl
Normal file
45
test/intrinsics/gen/radians/6b0ff2.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn radians(f32) -> f32
|
||||
fn radians_6b0ff2() {
|
||||
var res: f32 = radians(1.0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_6b0ff2();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_6b0ff2();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_6b0ff2();
|
||||
}
|
||||
86
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_6b0ff2() {
|
||||
float res = tint_radians(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
radians_6b0ff2();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_6b0ff2() {
|
||||
float res = tint_radians(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_6b0ff2() {
|
||||
float res = tint_radians(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void radians_6b0ff2() {
|
||||
float res = tint_radians(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_6b0ff2();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void radians_6b0ff2() {
|
||||
float res = tint_radians(1.0f);
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_6b0ff2();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
radians_6b0ff2();
|
||||
return;
|
||||
}
|
||||
|
||||
65
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.spvasm
Normal file
65
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,65 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %radians_6b0ff2 "radians_6b0ff2"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%radians_6b0ff2 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 Radians %float_1
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %radians_6b0ff2
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %radians_6b0ff2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %radians_6b0ff2
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/radians/6b0ff2.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn radians_6b0ff2() {
|
||||
var res : f32 = radians(1.0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_6b0ff2();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_6b0ff2();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_6b0ff2();
|
||||
}
|
||||
45
test/intrinsics/gen/radians/f96258.wgsl
Normal file
45
test/intrinsics/gen/radians/f96258.wgsl
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn radians(vec<3, f32>) -> vec<3, f32>
|
||||
fn radians_f96258() {
|
||||
var res: vec3<f32> = radians(vec3<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_f96258();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_f96258();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_f96258();
|
||||
}
|
||||
86
test/intrinsics/gen/radians/f96258.wgsl.expected.glsl
Normal file
86
test/intrinsics/gen/radians/f96258.wgsl.expected.glsl
Normal file
@@ -0,0 +1,86 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_radians(vec3 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_f96258() {
|
||||
vec3 res = tint_radians(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 vertex_main_inner() {
|
||||
radians_f96258();
|
||||
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
vec4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
void main() {
|
||||
tint_symbol outputs;
|
||||
outputs = vertex_main();
|
||||
gl_Position = outputs.value;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_radians(vec3 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_f96258() {
|
||||
vec3 res = tint_radians(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
void fragment_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
fragment_main();
|
||||
}
|
||||
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
vec3 tint_radians(vec3 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void radians_f96258() {
|
||||
vec3 res = tint_radians(vec3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void compute_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
void main() {
|
||||
compute_main();
|
||||
}
|
||||
|
||||
|
||||
34
test/intrinsics/gen/radians/f96258.wgsl.expected.hlsl
Normal file
34
test/intrinsics/gen/radians/f96258.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,34 @@
|
||||
float3 tint_radians(float3 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void radians_f96258() {
|
||||
float3 res = tint_radians(float3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_f96258();
|
||||
return float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
const float4 inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
38
test/intrinsics/gen/radians/f96258.wgsl.expected.msl
Normal file
38
test/intrinsics/gen/radians/f96258.wgsl.expected.msl
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float3 tint_radians(float3 param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void radians_f96258() {
|
||||
float3 res = tint_radians(float3());
|
||||
}
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
radians_f96258();
|
||||
return float4();
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
float4 const inner_result = vertex_main_inner();
|
||||
tint_symbol wrapper_result = {};
|
||||
wrapper_result.value = inner_result;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
radians_f96258();
|
||||
return;
|
||||
}
|
||||
|
||||
67
test/intrinsics/gen/radians/f96258.wgsl.expected.spvasm
Normal file
67
test/intrinsics/gen/radians/f96258.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,67 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %radians_f96258 "radians_f96258"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%16 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%radians_f96258 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %16
|
||||
%13 = OpExtInst %v3float %15 Radians %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %radians_f96258
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %radians_f96258
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %radians_f96258
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
19
test/intrinsics/gen/radians/f96258.wgsl.expected.wgsl
Normal file
19
test/intrinsics/gen/radians/f96258.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,19 @@
|
||||
fn radians_f96258() {
|
||||
var res : vec3<f32> = radians(vec3<f32>());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
radians_f96258();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
radians_f96258();
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn compute_main() {
|
||||
radians_f96258();
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
b = (a * 0.017453292f);
|
||||
b = tint_radians(a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
b = (a * 0.017453292f);
|
||||
b = tint_radians(a);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
float tint_radians(float param_0) {
|
||||
return param_0 * 0.017453292519943295474;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
float a = 0.0f;
|
||||
float b = 0.0f;
|
||||
a = 42.0f;
|
||||
float const x_11 = a;
|
||||
b = (x_11 * 0.017453292f);
|
||||
b = tint_radians(x_11);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
; Bound: 17
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%13 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
@@ -17,15 +18,14 @@
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%8 = OpConstantNull %float
|
||||
%float_42 = OpConstant %float 42
|
||||
%float_0_0174532924 = OpConstant %float 0.0174532924
|
||||
%main_1 = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_float Function %8
|
||||
%b = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %a %float_42
|
||||
%11 = OpLoad %float %a
|
||||
%13 = OpFMul %float %11 %float_0_0174532924
|
||||
OpStore %b %13
|
||||
%12 = OpExtInst %float %13 Radians %11
|
||||
OpStore %b %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %1
|
||||
|
||||
@@ -3,7 +3,7 @@ fn main_1() {
|
||||
var b : f32;
|
||||
a = 42.0;
|
||||
let x_11 : f32 = a;
|
||||
b = (x_11 * 0.017453292);
|
||||
b = radians(x_11);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user