Add const-eval for `degrees` and `radians`

This CL adds const-eval for `degrees` and `radians`.

Bug: tint:1581
Change-Id: I7f00e2b1e5ab7c8e895680a6b75b9531dac31f5a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110601
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
dan sinclair 2022-11-21 18:00:01 +00:00 committed by Dawn LUCI CQ
parent d114055e4e
commit efe9c49819
198 changed files with 5029 additions and 909 deletions

View File

@ -440,8 +440,8 @@ fn arrayLength<T, A: access>(ptr<storage, array<T>, A>) -> u32
@const fn countTrailingZeros<T: iu32>(T) -> T @const fn countTrailingZeros<T: iu32>(T) -> T
@const fn countTrailingZeros<N: num, T: iu32>(vec<N, T>) -> vec<N, T> @const fn countTrailingZeros<N: num, T: iu32>(vec<N, T>) -> vec<N, T>
@const fn cross<T: fa_f32_f16>(vec3<T>, vec3<T>) -> vec3<T> @const fn cross<T: fa_f32_f16>(vec3<T>, vec3<T>) -> vec3<T>
fn degrees<T: f32_f16>(T) -> T @const fn degrees<T: fa_f32_f16>(T) -> T
fn degrees<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T> @const fn degrees<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
fn determinant<N: num, T: f32_f16>(mat<N, N, T>) -> T fn determinant<N: num, T: f32_f16>(mat<N, N, T>) -> T
fn distance<T: f32_f16>(T, T) -> T fn distance<T: f32_f16>(T, T) -> T
fn distance<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> T fn distance<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> T
@ -516,8 +516,8 @@ fn pow<T: f32_f16>(T, T) -> T
fn pow<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> fn pow<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
@const fn quantizeToF16(f32) -> f32 @const fn quantizeToF16(f32) -> f32
@const fn quantizeToF16<N: num>(vec<N, f32>) -> vec<N, f32> @const fn quantizeToF16<N: num>(vec<N, f32>) -> vec<N, f32>
fn radians<T: f32_f16>(T) -> T @const fn radians<T: fa_f32_f16>(T) -> T
fn radians<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T> @const fn radians<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
fn reflect<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> fn reflect<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
fn refract<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T> fn refract<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
@const fn reverseBits<T: iu32>(T) -> T @const fn reverseBits<T: iu32>(T) -> T

View File

@ -274,6 +274,9 @@ using f32 = Number<float>;
/// However since C++ don't have native binary16 type, the value is stored as float. /// However since C++ don't have native binary16 type, the value is stored as float.
using f16 = Number<detail::NumberKindF16>; using f16 = Number<detail::NumberKindF16>;
template <typename T, traits::EnableIf<IsFloatingPoint<T>>* = nullptr>
inline const auto kPi = T(UnwrapNumber<T>(3.14159265358979323846));
/// True iff T is an abstract number type /// True iff T is an abstract number type
template <typename T> template <typename T>
constexpr bool IsAbstract = std::is_same_v<T, AInt> || std::is_same_v<T, AFloat>; constexpr bool IsAbstract = std::is_same_v<T, AInt> || std::is_same_v<T, AFloat>;

View File

@ -1954,6 +1954,32 @@ ConstEval::Result ConstEval::cross(const sem::Type* ty,
utils::Vector<const sem::Constant*, 3>{x.Get(), y.Get(), z.Get()}); utils::Vector<const sem::Constant*, 3>{x.Get(), y.Get(), z.Get()});
} }
ConstEval::Result ConstEval::degrees(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
auto transform = [&](const sem::Constant* c0) {
auto create = [&](auto e) -> ImplResult {
using NumberT = decltype(e);
using T = UnwrapNumber<NumberT>;
auto pi = kPi<T>;
auto scale = Div(source, NumberT(180), NumberT(pi));
if (!scale) {
AddNote("when calculating degrees", source);
return utils::Failure;
}
auto result = Mul(source, e, scale.Get());
if (!result) {
AddNote("when calculating degrees", source);
return utils::Failure;
}
return CreateElement(builder, source, c0->Type(), result.Get());
};
return Dispatch_fa_f32_f16(create, c0);
};
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::extractBits(const sem::Type* ty, ConstEval::Result ConstEval::extractBits(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args, utils::VectorRef<const sem::Constant*> args,
const Source& source) { const Source& source) {
@ -2267,6 +2293,32 @@ ConstEval::Result ConstEval::pack4x8unorm(const sem::Type* ty,
return CreateElement(builder, source, ty, ret); return CreateElement(builder, source, ty, ret);
} }
ConstEval::Result ConstEval::radians(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
auto transform = [&](const sem::Constant* c0) {
auto create = [&](auto e) -> ImplResult {
using NumberT = decltype(e);
using T = UnwrapNumber<NumberT>;
auto pi = kPi<T>;
auto scale = Div(source, NumberT(pi), NumberT(180));
if (!scale) {
AddNote("when calculating radians", source);
return utils::Failure;
}
auto result = Mul(source, e, scale.Get());
if (!result) {
AddNote("when calculating radians", source);
return utils::Failure;
}
return CreateElement(builder, source, c0->Type(), result.Get());
};
return Dispatch_fa_f32_f16(create, c0);
};
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::reverseBits(const sem::Type* ty, ConstEval::Result ConstEval::reverseBits(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args, utils::VectorRef<const sem::Constant*> args,
const Source& source) { const Source& source) {

View File

@ -539,6 +539,15 @@ class ConstEval {
utils::VectorRef<const sem::Constant*> args, utils::VectorRef<const sem::Constant*> args,
const Source& source); const Source& source);
/// degrees builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location of the conversion
/// @return the result value, or null if the value cannot be calculated
Result degrees(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// extractBits builtin /// extractBits builtin
/// @param ty the expression type /// @param ty the expression type
/// @param args the input arguments /// @param args the input arguments
@ -647,6 +656,15 @@ class ConstEval {
utils::VectorRef<const sem::Constant*> args, utils::VectorRef<const sem::Constant*> args,
const Source& source); const Source& source);
/// radians builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location of the conversion
/// @return the result value, or null if the value cannot be calculated
Result radians(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// reverseBits builtin /// reverseBits builtin
/// @param ty the expression type /// @param ty the expression type
/// @param args the input arguments /// @param args the input arguments

View File

@ -993,6 +993,57 @@ INSTANTIATE_TEST_SUITE_P( //
testing::ValuesIn(Concat(InsertBitsCases<i32>(), // testing::ValuesIn(Concat(InsertBitsCases<i32>(), //
InsertBitsCases<u32>())))); InsertBitsCases<u32>()))));
template <typename T>
std::vector<Case> DegreesAFloatCases() {
return std::vector<Case>{
C({T(0)}, T(0)), //
C({-T(0)}, -T(0)), //
C({T(0.698132)}, T(40)).FloatComp(), //
C({-T(1.5708)}, -T(90.000214)).FloatComp(), //
C({T(1.5708)}, T(90.000214)).FloatComp(), //
C({T(6.28319)}, T(360.00027)).FloatComp(),
};
}
INSTANTIATE_TEST_SUITE_P( //
DegreesAFloat,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kDegrees),
testing::ValuesIn(DegreesAFloatCases<AFloat>())));
template <typename T>
std::vector<Case> DegreesF32Cases() {
return std::vector<Case>{
C({T(0)}, T(0)), //
C({-T(0)}, -T(0)), //
C({T(0.698132)}, T(40)).FloatComp(), //
C({-T(1.5708)}, -T(90.000206)).FloatComp(), //
C({T(1.5708)}, T(90.000206)).FloatComp(), //
C({T(6.28319)}, T(360.00024)).FloatComp(),
};
}
INSTANTIATE_TEST_SUITE_P( //
DegreesF32,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kDegrees),
testing::ValuesIn(DegreesF32Cases<f32>())));
template <typename T>
std::vector<Case> DegreesF16Cases() {
return std::vector<Case>{
C({T(0)}, T(0)), //
C({-T(0)}, -T(0)), //
C({T(0.698132)}, T(39.96875)).FloatComp(), //
C({-T(1.5708)}, -T(89.9375)).FloatComp(), //
C({T(1.5708)}, T(89.9375)).FloatComp(), //
C({T(6.28319)}, T(359.75)).FloatComp(),
};
}
INSTANTIATE_TEST_SUITE_P( //
DegreesF16,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kDegrees),
testing::ValuesIn(DegreesF16Cases<f16>())));
template <typename T> template <typename T>
std::vector<Case> ExtractBitsCases() { std::vector<Case> ExtractBitsCases() {
using UT = Number<std::make_unsigned_t<UnwrapNumber<T>>>; using UT = Number<std::make_unsigned_t<UnwrapNumber<T>>>;
@ -1275,6 +1326,41 @@ INSTANTIATE_TEST_SUITE_P( //
testing::ValuesIn(Concat(ReverseBitsCases<i32>(), // testing::ValuesIn(Concat(ReverseBitsCases<i32>(), //
ReverseBitsCases<u32>())))); ReverseBitsCases<u32>()))));
template <typename T>
std::vector<Case> RadiansCases() {
return std::vector<Case>{
C({T(0)}, T(0)), //
C({-T(0)}, -T(0)), //
C({T(40)}, T(0.69813168)).FloatComp(), //
C({-T(90)}, -T(1.5707964)).FloatComp(), //
C({T(90)}, T(1.5707964)).FloatComp(), //
C({T(360)}, T(6.2831855)).FloatComp(),
};
}
INSTANTIATE_TEST_SUITE_P( //
Radians,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kRadians),
testing::ValuesIn(Concat(RadiansCases<AFloat>(), //
RadiansCases<f32>()))));
template <typename T>
std::vector<Case> RadiansF16Cases() {
return std::vector<Case>{
C({T(0)}, T(0)), //
C({-T(0)}, -T(0)), //
C({T(40)}, T(0.69726562)).FloatComp(), //
C({-T(90)}, -T(1.5693359)).FloatComp(), //
C({T(90)}, T(1.5693359)).FloatComp(), //
C({T(360)}, T(6.2773438)).FloatComp(),
};
}
INSTANTIATE_TEST_SUITE_P( //
RadiansF16,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kRadians),
testing::ValuesIn(RadiansF16Cases<f16>())));
template <typename T> template <typename T>
std::vector<Case> RoundCases() { std::vector<Case> RoundCases() {
std::vector<Case> cases = { std::vector<Case> cases = {

View File

@ -26,9 +26,6 @@
namespace tint::resolver { namespace tint::resolver {
template <typename T>
inline const auto kPi = T(UnwrapNumber<T>(3.14159265358979323846));
template <typename T> template <typename T>
inline const auto kPiOver2 = T(UnwrapNumber<T>(1.57079632679489661923)); inline const auto kPiOver2 = T(UnwrapNumber<T>(1.57079632679489661923));

View File

@ -12174,24 +12174,24 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 1, /* num parameters */ 1,
/* num template types */ 1, /* num template types */ 1,
/* num template numbers */ 0, /* num template numbers */ 0,
/* template types */ &kTemplateTypes[26], /* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[10], /* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[835], /* parameters */ &kParameters[835],
/* return matcher indices */ &kMatcherIndices[3], /* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr, /* const eval */ &ConstEval::degrees,
}, },
{ {
/* [322] */ /* [322] */
/* num parameters */ 1, /* num parameters */ 1,
/* num template types */ 1, /* num template types */ 1,
/* num template numbers */ 1, /* num template numbers */ 1,
/* template types */ &kTemplateTypes[26], /* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[4], /* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[836], /* parameters */ &kParameters[836],
/* return matcher indices */ &kMatcherIndices[30], /* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr, /* const eval */ &ConstEval::degrees,
}, },
{ {
/* [323] */ /* [323] */
@ -12918,24 +12918,24 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 1, /* num parameters */ 1,
/* num template types */ 1, /* num template types */ 1,
/* num template numbers */ 0, /* num template numbers */ 0,
/* template types */ &kTemplateTypes[26], /* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[10], /* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[888], /* parameters */ &kParameters[888],
/* return matcher indices */ &kMatcherIndices[3], /* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr, /* const eval */ &ConstEval::radians,
}, },
{ {
/* [384] */ /* [384] */
/* num parameters */ 1, /* num parameters */ 1,
/* num template types */ 1, /* num template types */ 1,
/* num template numbers */ 1, /* num template numbers */ 1,
/* template types */ &kTemplateTypes[26], /* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[4], /* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[889], /* parameters */ &kParameters[889],
/* return matcher indices */ &kMatcherIndices[30], /* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr, /* const eval */ &ConstEval::radians,
}, },
{ {
/* [385] */ /* [385] */
@ -14117,8 +14117,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
}, },
{ {
/* [19] */ /* [19] */
/* fn degrees<T : f32_f16>(T) -> T */ /* fn degrees<T : fa_f32_f16>(T) -> T */
/* fn degrees<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */ /* fn degrees<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2, /* num overloads */ 2,
/* overloads */ &kOverloads[321], /* overloads */ &kOverloads[321],
}, },
@ -14408,8 +14408,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
}, },
{ {
/* [62] */ /* [62] */
/* fn radians<T : f32_f16>(T) -> T */ /* fn radians<T : fa_f32_f16>(T) -> T */
/* fn radians<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */ /* fn radians<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2, /* num overloads */ 2,
/* overloads */ &kOverloads[383], /* overloads */ &kOverloads[383],
}, },

View File

@ -1,9 +1,5 @@
float4 tint_degrees(float4 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_0d170c() { void degrees_0d170c() {
float4 res = tint_degrees((1.0f).xxxx); float4 res = (57.295776367f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float4 tint_degrees(float4 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_0d170c() { void degrees_0d170c() {
float4 res = tint_degrees((1.0f).xxxx); float4 res = (57.295776367f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,7 @@
#version 310 es #version 310 es
vec4 tint_degrees(vec4 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_0d170c() { void degrees_0d170c() {
vec4 res = tint_degrees(vec4(1.0f)); vec4 res = vec4(57.295776367f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -25,13 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec4 tint_degrees(vec4 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_0d170c() { void degrees_0d170c() {
vec4 res = tint_degrees(vec4(1.0f)); vec4 res = vec4(57.295776367f);
} }
void fragment_main() { void fragment_main() {
@ -44,13 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec4 tint_degrees(vec4 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_0d170c() { void degrees_0d170c() {
vec4 res = tint_degrees(vec4(1.0f)); vec4 res = vec4(57.295776367f);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float4 tint_degrees(float4 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_0d170c() { void degrees_0d170c() {
float4 res = tint_degrees(float4(1.0f)); float4 res = float4(57.295776367f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 32 ; Bound: 31
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -31,36 +30,36 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1 %float_57_2957764 = OpConstant %float 57.2957764
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 %14 = OpConstantComposite %v4float %float_57_2957764 %float_57_2957764 %float_57_2957764 %float_57_2957764
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%19 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_0d170c = OpFunction %void None %9 %degrees_0d170c = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%13 = OpExtInst %v4float %14 Degrees %16 OpStore %res %14
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19 %vertex_main_inner = OpFunction %v4float None %17
%21 = OpLabel %19 = OpLabel
%22 = OpFunctionCall %void %degrees_0d170c %20 = OpFunctionCall %void %degrees_0d170c
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%27 = OpLabel %26 = OpLabel
%28 = OpFunctionCall %void %degrees_0d170c %27 = OpFunctionCall %void %degrees_0d170c
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%30 = OpLabel %29 = OpLabel
%31 = OpFunctionCall %void %degrees_0d170c %30 = OpFunctionCall %void %degrees_0d170c
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float2 tint_degrees(float2 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_1ad5df() { void degrees_1ad5df() {
float2 res = tint_degrees((1.0f).xx); float2 res = (57.295776367f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float2 tint_degrees(float2 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_1ad5df() { void degrees_1ad5df() {
float2 res = tint_degrees((1.0f).xx); float2 res = (57.295776367f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,7 @@
#version 310 es #version 310 es
vec2 tint_degrees(vec2 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_1ad5df() { void degrees_1ad5df() {
vec2 res = tint_degrees(vec2(1.0f)); vec2 res = vec2(57.295776367f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -25,13 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec2 tint_degrees(vec2 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_1ad5df() { void degrees_1ad5df() {
vec2 res = tint_degrees(vec2(1.0f)); vec2 res = vec2(57.295776367f);
} }
void fragment_main() { void fragment_main() {
@ -44,13 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec2 tint_degrees(vec2 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_1ad5df() { void degrees_1ad5df() {
vec2 res = tint_degrees(vec2(1.0f)); vec2 res = vec2(57.295776367f);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float2 tint_degrees(float2 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_1ad5df() { void degrees_1ad5df() {
float2 res = tint_degrees(float2(1.0f)); float2 res = float2(57.295776367f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 34 ; Bound: 33
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -32,37 +31,37 @@
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2 %v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1 %float_57_2957764 = OpConstant %float 57.2957764
%17 = OpConstantComposite %v2float %float_1 %float_1 %15 = OpConstantComposite %v2float %float_57_2957764 %float_57_2957764
%_ptr_Function_v2float = OpTypePointer Function %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float
%20 = OpConstantNull %v2float %18 = OpConstantNull %v2float
%21 = OpTypeFunction %v4float %19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_1ad5df = OpFunction %void None %9 %degrees_1ad5df = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %20 %res = OpVariable %_ptr_Function_v2float Function %18
%13 = OpExtInst %v2float %15 Degrees %17 OpStore %res %15
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21 %vertex_main_inner = OpFunction %v4float None %19
%23 = OpLabel %21 = OpLabel
%24 = OpFunctionCall %void %degrees_1ad5df %22 = OpFunctionCall %void %degrees_1ad5df
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%26 = OpLabel %24 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%29 = OpLabel %28 = OpLabel
%30 = OpFunctionCall %void %degrees_1ad5df %29 = OpFunctionCall %void %degrees_1ad5df
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%32 = OpLabel %31 = OpLabel
%33 = OpFunctionCall %void %degrees_1ad5df %32 = OpFunctionCall %void %degrees_1ad5df
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float3 tint_degrees(float3 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_2af623() { void degrees_2af623() {
float3 res = tint_degrees((1.0f).xxx); float3 res = (57.295776367f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float3 tint_degrees(float3 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_2af623() { void degrees_2af623() {
float3 res = tint_degrees((1.0f).xxx); float3 res = (57.295776367f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,7 @@
#version 310 es #version 310 es
vec3 tint_degrees(vec3 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_2af623() { void degrees_2af623() {
vec3 res = tint_degrees(vec3(1.0f)); vec3 res = vec3(57.295776367f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -25,13 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec3 tint_degrees(vec3 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_2af623() { void degrees_2af623() {
vec3 res = tint_degrees(vec3(1.0f)); vec3 res = vec3(57.295776367f);
} }
void fragment_main() { void fragment_main() {
@ -44,13 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec3 tint_degrees(vec3 param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_2af623() { void degrees_2af623() {
vec3 res = tint_degrees(vec3(1.0f)); vec3 res = vec3(57.295776367f);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float3 tint_degrees(float3 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_2af623() { void degrees_2af623() {
float3 res = tint_degrees(float3(1.0f)); float3 res = float3(57.295776367f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 34 ; Bound: 33
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -32,37 +31,37 @@
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3 %v3float = OpTypeVector %float 3
%float_1 = OpConstant %float 1 %float_57_2957764 = OpConstant %float 57.2957764
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1 %15 = OpConstantComposite %v3float %float_57_2957764 %float_57_2957764 %float_57_2957764
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%20 = OpConstantNull %v3float %18 = OpConstantNull %v3float
%21 = OpTypeFunction %v4float %19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_2af623 = OpFunction %void None %9 %degrees_2af623 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %20 %res = OpVariable %_ptr_Function_v3float Function %18
%13 = OpExtInst %v3float %15 Degrees %17 OpStore %res %15
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21 %vertex_main_inner = OpFunction %v4float None %19
%23 = OpLabel %21 = OpLabel
%24 = OpFunctionCall %void %degrees_2af623 %22 = OpFunctionCall %void %degrees_2af623
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%26 = OpLabel %24 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%29 = OpLabel %28 = OpLabel
%30 = OpFunctionCall %void %degrees_2af623 %29 = OpFunctionCall %void %degrees_2af623
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%32 = OpLabel %31 = OpLabel
%33 = OpFunctionCall %void %degrees_2af623 %32 = OpFunctionCall %void %degrees_2af623
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
vector<float16_t, 4> tint_degrees(vector<float16_t, 4> param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_3055d3() { void degrees_3055d3() {
vector<float16_t, 4> res = tint_degrees((float16_t(1.0h)).xxxx); vector<float16_t, 4> res = (float16_t(57.3125h)).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_degrees(f16vec4 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_3055d3() { void degrees_3055d3() {
f16vec4 res = tint_degrees(f16vec4(1.0hf)); f16vec4 res = f16vec4(57.3125hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec4 tint_degrees(f16vec4 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_3055d3() { void degrees_3055d3() {
f16vec4 res = tint_degrees(f16vec4(1.0hf)); f16vec4 res = f16vec4(57.3125hf);
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_degrees(f16vec4 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_3055d3() { void degrees_3055d3() {
f16vec4 res = tint_degrees(f16vec4(1.0hf)); f16vec4 res = f16vec4(57.3125hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half4 tint_degrees(half4 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_3055d3() { void degrees_3055d3() {
half4 res = tint_degrees(half4(1.0h)); half4 res = half4(57.3125h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 36 ; Bound: 34
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v4half = OpTypeVector %half 4 %v4half = OpTypeVector %half 4
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %16 = OpConstantComposite %v4half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
%_ptr_Function_v4half = OpTypePointer Function %v4half %_ptr_Function_v4half = OpTypePointer Function %v4half
%21 = OpConstantNull %v4half %19 = OpConstantNull %v4half
%22 = OpTypeFunction %v4float %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%degrees_3055d3 = OpFunction %void None %9 %degrees_3055d3 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v4half Function %21 %res = OpVariable %_ptr_Function_v4half Function %19
%13 = OpExtInst %v4half %16 Degrees %18 OpStore %res %16
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22 %vertex_main_inner = OpFunction %v4float None %20
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %void %degrees_3055d3 %23 = OpFunctionCall %void %degrees_3055d3
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%27 = OpLabel %25 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner %26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28 OpStore %value %26
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%31 = OpLabel %29 = OpLabel
%32 = OpFunctionCall %void %degrees_3055d3 %30 = OpFunctionCall %void %degrees_3055d3
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%34 = OpLabel %32 = OpLabel
%35 = OpFunctionCall %void %degrees_3055d3 %33 = OpFunctionCall %void %degrees_3055d3
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,7 @@
#version 310 es #version 310 es
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -25,13 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
void fragment_main() { void fragment_main() {
@ -44,13 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865f;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float tint_degrees(float param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_51f705() { void degrees_51f705() {
float res = tint_degrees(1.0f); float res = 57.295776367f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 31 ; Bound: 30
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -31,35 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1 %float_57_2957764 = OpConstant %float 57.2957764
%_ptr_Function_float = OpTypePointer Function %float %_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %v4float %16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_51f705 = OpFunction %void None %9 %degrees_51f705 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8 %res = OpVariable %_ptr_Function_float Function %8
%13 = OpExtInst %float %14 Degrees %float_1 OpStore %res %float_57_2957764
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18 %vertex_main_inner = OpFunction %v4float None %16
%20 = OpLabel %18 = OpLabel
%21 = OpFunctionCall %void %degrees_51f705 %19 = OpFunctionCall %void %degrees_51f705
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%23 = OpLabel %21 = OpLabel
%24 = OpFunctionCall %v4float %vertex_main_inner %22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %24 OpStore %value %22
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%26 = OpLabel %25 = OpLabel
%27 = OpFunctionCall %void %degrees_51f705 %26 = OpFunctionCall %void %degrees_51f705
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%29 = OpLabel %28 = OpLabel
%30 = OpFunctionCall %void %degrees_51f705 %29 = OpFunctionCall %void %degrees_51f705
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float16_t tint_degrees(float16_t param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_5e9805() { void degrees_5e9805() {
float16_t res = tint_degrees(float16_t(1.0h)); float16_t res = float16_t(57.3125h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_degrees(float16_t param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_5e9805() { void degrees_5e9805() {
float16_t res = tint_degrees(1.0hf); float16_t res = 57.3125hf;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
float16_t tint_degrees(float16_t param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_5e9805() { void degrees_5e9805() {
float16_t res = tint_degrees(1.0hf); float16_t res = 57.3125hf;
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_degrees(float16_t param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_5e9805() { void degrees_5e9805() {
float16_t res = tint_degrees(1.0hf); float16_t res = 57.3125hf;
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half tint_degrees(half param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_5e9805() { void degrees_5e9805() {
half res = tint_degrees(1.0h); half res = 57.3125h;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 34 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -36,37 +35,36 @@
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
%_ptr_Function_half = OpTypePointer Function %half %_ptr_Function_half = OpTypePointer Function %half
%19 = OpConstantNull %half %17 = OpConstantNull %half
%20 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%degrees_5e9805 = OpFunction %void None %9 %degrees_5e9805 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %19 %res = OpVariable %_ptr_Function_half Function %17
%13 = OpExtInst %half %15 Degrees %half_0x1p_0 OpStore %res %half_0x1_ca8p_5
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20 %vertex_main_inner = OpFunction %v4float None %18
%22 = OpLabel %20 = OpLabel
%23 = OpFunctionCall %void %degrees_5e9805 %21 = OpFunctionCall %void %degrees_5e9805
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%25 = OpLabel %23 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%29 = OpLabel %27 = OpLabel
%30 = OpFunctionCall %void %degrees_5e9805 %28 = OpFunctionCall %void %degrees_5e9805
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%32 = OpLabel %30 = OpLabel
%33 = OpFunctionCall %void %degrees_5e9805 %31 = OpFunctionCall %void %degrees_5e9805
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; 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 %degrees_810467 "degrees_810467"
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
%float_57_2957802 = OpConstant %float 57.2957802
%15 = OpConstantComposite %v2float %float_57_2957802 %float_57_2957802
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_810467 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %degrees_810467
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_810467
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %degrees_810467
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; 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 %degrees_c0880c "degrees_c0880c"
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
%float_57_2957802 = OpConstant %float 57.2957802
%15 = OpConstantComposite %v3float %float_57_2957802 %float_57_2957802 %float_57_2957802
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_c0880c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %degrees_c0880c
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_c0880c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %degrees_c0880c
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,65 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; 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 %degrees_d43a49 "degrees_d43a49"
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_57_2957802 = OpConstant %float 57.2957802
%14 = OpConstantComposite %v4float %float_57_2957802 %float_57_2957802 %float_57_2957802 %float_57_2957802
%_ptr_Function_v4float = OpTypePointer Function %v4float
%17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_d43a49 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
OpStore %res %14
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %17
%19 = OpLabel
%20 = OpFunctionCall %void %degrees_d43a49
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_d43a49
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %degrees_d43a49
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,9 +1,5 @@
vector<float16_t, 3> tint_degrees(vector<float16_t, 3> param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_dfe8f4() { void degrees_dfe8f4() {
vector<float16_t, 3> res = tint_degrees((float16_t(1.0h)).xxx); vector<float16_t, 3> res = (float16_t(57.3125h)).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_degrees(f16vec3 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_dfe8f4() { void degrees_dfe8f4() {
f16vec3 res = tint_degrees(f16vec3(1.0hf)); f16vec3 res = f16vec3(57.3125hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec3 tint_degrees(f16vec3 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_dfe8f4() { void degrees_dfe8f4() {
f16vec3 res = tint_degrees(f16vec3(1.0hf)); f16vec3 res = f16vec3(57.3125hf);
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_degrees(f16vec3 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_dfe8f4() { void degrees_dfe8f4() {
f16vec3 res = tint_degrees(f16vec3(1.0hf)); f16vec3 res = f16vec3(57.3125hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half3 tint_degrees(half3 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_dfe8f4() { void degrees_dfe8f4() {
half3 res = tint_degrees(half3(1.0h)); half3 res = half3(57.3125h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 36 ; Bound: 34
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v3half = OpTypeVector %half 3 %v3half = OpTypeVector %half 3
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %16 = OpConstantComposite %v3half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
%_ptr_Function_v3half = OpTypePointer Function %v3half %_ptr_Function_v3half = OpTypePointer Function %v3half
%21 = OpConstantNull %v3half %19 = OpConstantNull %v3half
%22 = OpTypeFunction %v4float %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%degrees_dfe8f4 = OpFunction %void None %9 %degrees_dfe8f4 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v3half Function %21 %res = OpVariable %_ptr_Function_v3half Function %19
%13 = OpExtInst %v3half %16 Degrees %18 OpStore %res %16
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22 %vertex_main_inner = OpFunction %v4float None %20
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %void %degrees_dfe8f4 %23 = OpFunctionCall %void %degrees_dfe8f4
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%27 = OpLabel %25 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner %26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28 OpStore %value %26
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%31 = OpLabel %29 = OpLabel
%32 = OpFunctionCall %void %degrees_dfe8f4 %30 = OpFunctionCall %void %degrees_dfe8f4
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%34 = OpLabel %32 = OpLabel
%35 = OpFunctionCall %void %degrees_dfe8f4 %33 = OpFunctionCall %void %degrees_dfe8f4
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
vector<float16_t, 2> tint_degrees(vector<float16_t, 2> param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_f59715() { void degrees_f59715() {
vector<float16_t, 2> res = tint_degrees((float16_t(1.0h)).xx); vector<float16_t, 2> res = (float16_t(57.3125h)).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_degrees(f16vec2 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_f59715() { void degrees_f59715() {
f16vec2 res = tint_degrees(f16vec2(1.0hf)); f16vec2 res = f16vec2(57.3125hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec2 tint_degrees(f16vec2 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_f59715() { void degrees_f59715() {
f16vec2 res = tint_degrees(f16vec2(1.0hf)); f16vec2 res = f16vec2(57.3125hf);
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_degrees(f16vec2 param_0) {
return param_0 * 57.295779513082322865hf;
}
void degrees_f59715() { void degrees_f59715() {
f16vec2 res = tint_degrees(f16vec2(1.0hf)); f16vec2 res = f16vec2(57.3125hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half2 tint_degrees(half2 param_0) {
return param_0 * 57.295779513082322865;
}
void degrees_f59715() { void degrees_f59715() {
half2 res = tint_degrees(half2(1.0h)); half2 res = half2(57.3125h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 36 ; Bound: 34
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v2half = OpTypeVector %half 2 %v2half = OpTypeVector %half 2
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0 %16 = OpConstantComposite %v2half %half_0x1_ca8p_5 %half_0x1_ca8p_5
%_ptr_Function_v2half = OpTypePointer Function %v2half %_ptr_Function_v2half = OpTypePointer Function %v2half
%21 = OpConstantNull %v2half %19 = OpConstantNull %v2half
%22 = OpTypeFunction %v4float %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%degrees_f59715 = OpFunction %void None %9 %degrees_f59715 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v2half Function %21 %res = OpVariable %_ptr_Function_v2half Function %19
%13 = OpExtInst %v2half %16 Degrees %18 OpStore %res %16
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22 %vertex_main_inner = OpFunction %v4float None %20
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %void %degrees_f59715 %23 = OpFunctionCall %void %degrees_f59715
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%27 = OpLabel %25 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner %26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28 OpStore %value %26
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%31 = OpLabel %29 = OpLabel
%32 = OpFunctionCall %void %degrees_f59715 %30 = OpFunctionCall %void %degrees_f59715
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%34 = OpLabel %32 = OpLabel
%35 = OpFunctionCall %void %degrees_f59715 %33 = OpFunctionCall %void %degrees_f59715
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,64 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %degrees_fafa7e "degrees_fafa7e"
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_57_2957802 = OpConstant %float 57.2957802
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%degrees_fafa7e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_57_2957802
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %degrees_fafa7e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%21 = OpLabel
%22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %void %degrees_fafa7e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %degrees_fafa7e
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,9 +1,5 @@
float4 tint_radians(float4 param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_09b7fc() { void radians_09b7fc() {
float4 res = tint_radians((1.0f).xxxx); float4 res = (0.017453292f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float4 tint_radians(float4 param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_09b7fc() { void radians_09b7fc() {
float4 res = tint_radians((1.0f).xxxx); float4 res = (0.017453292f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,7 @@
#version 310 es #version 310 es
vec4 tint_radians(vec4 param_0) {
return param_0 * 0.017453292519943295474f;
}
void radians_09b7fc() { void radians_09b7fc() {
vec4 res = tint_radians(vec4(1.0f)); vec4 res = vec4(0.017453292f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -25,13 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec4 tint_radians(vec4 param_0) {
return param_0 * 0.017453292519943295474f;
}
void radians_09b7fc() { void radians_09b7fc() {
vec4 res = tint_radians(vec4(1.0f)); vec4 res = vec4(0.017453292f);
} }
void fragment_main() { void fragment_main() {
@ -44,13 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec4 tint_radians(vec4 param_0) {
return param_0 * 0.017453292519943295474f;
}
void radians_09b7fc() { void radians_09b7fc() {
vec4 res = tint_radians(vec4(1.0f)); vec4 res = vec4(0.017453292f);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float4 tint_radians(float4 param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_09b7fc() { void radians_09b7fc() {
float4 res = tint_radians(float4(1.0f)); float4 res = float4(0.017453292f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 32 ; Bound: 31
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -31,36 +30,36 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1 %float_0_0174532924 = OpConstant %float 0.0174532924
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 %14 = OpConstantComposite %v4float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%19 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%radians_09b7fc = OpFunction %void None %9 %radians_09b7fc = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%13 = OpExtInst %v4float %14 Radians %16 OpStore %res %14
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19 %vertex_main_inner = OpFunction %v4float None %17
%21 = OpLabel %19 = OpLabel
%22 = OpFunctionCall %void %radians_09b7fc %20 = OpFunctionCall %void %radians_09b7fc
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%27 = OpLabel %26 = OpLabel
%28 = OpFunctionCall %void %radians_09b7fc %27 = OpFunctionCall %void %radians_09b7fc
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%30 = OpLabel %29 = OpLabel
%31 = OpFunctionCall %void %radians_09b7fc %30 = OpFunctionCall %void %radians_09b7fc
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float16_t tint_radians(float16_t param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_208fd9() { void radians_208fd9() {
float16_t res = tint_radians(float16_t(1.0h)); float16_t res = float16_t(0.017440796h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_radians(float16_t param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_208fd9() { void radians_208fd9() {
float16_t res = tint_radians(1.0hf); float16_t res = 0.017440796hf;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
float16_t tint_radians(float16_t param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_208fd9() { void radians_208fd9() {
float16_t res = tint_radians(1.0hf); float16_t res = 0.017440796hf;
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_radians(float16_t param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_208fd9() { void radians_208fd9() {
float16_t res = tint_radians(1.0hf); float16_t res = 0.017440796hf;
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half tint_radians(half param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_208fd9() { void radians_208fd9() {
half res = tint_radians(1.0h); half res = 0.017440796h;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 34 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -36,37 +35,36 @@
%void = OpTypeVoid %void = OpTypeVoid
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
%_ptr_Function_half = OpTypePointer Function %half %_ptr_Function_half = OpTypePointer Function %half
%19 = OpConstantNull %half %17 = OpConstantNull %half
%20 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%radians_208fd9 = OpFunction %void None %9 %radians_208fd9 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_half Function %19 %res = OpVariable %_ptr_Function_half Function %17
%13 = OpExtInst %half %15 Radians %half_0x1p_0 OpStore %res %half_0x1_1dcpn6
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20 %vertex_main_inner = OpFunction %v4float None %18
%22 = OpLabel %20 = OpLabel
%23 = OpFunctionCall %void %radians_208fd9 %21 = OpFunctionCall %void %radians_208fd9
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%25 = OpLabel %23 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%29 = OpLabel %27 = OpLabel
%30 = OpFunctionCall %void %radians_208fd9 %28 = OpFunctionCall %void %radians_208fd9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%32 = OpLabel %30 = OpLabel
%33 = OpFunctionCall %void %radians_208fd9 %31 = OpFunctionCall %void %radians_208fd9
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; 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 %radians_379214 "radians_379214"
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
%float_0_0174532924 = OpConstant %float 0.0174532924
%15 = OpConstantComposite %v3float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%radians_379214 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %radians_379214
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_379214
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %radians_379214
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; 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 %radians_44a9f8 "radians_44a9f8"
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
%float_0_0174532924 = OpConstant %float 0.0174532924
%15 = OpConstantComposite %v2float %float_0_0174532924 %float_0_0174532924
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%radians_44a9f8 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %18
OpStore %res %15
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %radians_44a9f8
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_44a9f8
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %radians_44a9f8
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,9 +1,5 @@
vector<float16_t, 4> tint_radians(vector<float16_t, 4> param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_44f20b() { void radians_44f20b() {
vector<float16_t, 4> res = tint_radians((float16_t(1.0h)).xxxx); vector<float16_t, 4> res = (float16_t(0.017440796h)).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,13 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_radians(f16vec4 param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_44f20b() { void radians_44f20b() {
f16vec4 res = tint_radians(f16vec4(1.0hf)); f16vec4 res = f16vec4(0.017440796hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -27,13 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec4 tint_radians(f16vec4 param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_44f20b() { void radians_44f20b() {
f16vec4 res = tint_radians(f16vec4(1.0hf)); f16vec4 res = f16vec4(0.017440796hf);
} }
void fragment_main() { void fragment_main() {
@ -47,13 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_radians(f16vec4 param_0) {
return param_0 * 0.017453292519943295474hf;
}
void radians_44f20b() { void radians_44f20b() {
f16vec4 res = tint_radians(f16vec4(1.0hf)); f16vec4 res = f16vec4(0.017440796hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,13 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half4 tint_radians(half4 param_0) {
return param_0 * 0.017453292519943295474;
}
void radians_44f20b() { void radians_44f20b() {
half4 res = tint_radians(half4(1.0h)); half4 res = half4(0.017440796h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 36 ; Bound: 34
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -37,38 +36,37 @@
%9 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v4half = OpTypeVector %half 4 %v4half = OpTypeVector %half 4
%half_0x1p_0 = OpConstant %half 0x1p+0 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %16 = OpConstantComposite %v4half %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6
%_ptr_Function_v4half = OpTypePointer Function %v4half %_ptr_Function_v4half = OpTypePointer Function %v4half
%21 = OpConstantNull %v4half %19 = OpConstantNull %v4half
%22 = OpTypeFunction %v4float %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%radians_44f20b = OpFunction %void None %9 %radians_44f20b = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%res = OpVariable %_ptr_Function_v4half Function %21 %res = OpVariable %_ptr_Function_v4half Function %19
%13 = OpExtInst %v4half %16 Radians %18 OpStore %res %16
OpStore %res %13
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22 %vertex_main_inner = OpFunction %v4float None %20
%24 = OpLabel %22 = OpLabel
%25 = OpFunctionCall %void %radians_44f20b %23 = OpFunctionCall %void %radians_44f20b
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %9 %vertex_main = OpFunction %void None %9
%27 = OpLabel %25 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner %26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28 OpStore %value %26
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %9 %fragment_main = OpFunction %void None %9
%31 = OpLabel %29 = OpLabel
%32 = OpFunctionCall %void %radians_44f20b %30 = OpFunctionCall %void %radians_44f20b
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %9 %compute_main = OpFunction %void None %9
%34 = OpLabel %32 = OpLabel
%35 = OpFunctionCall %void %radians_44f20b %33 = OpFunctionCall %void %radians_44f20b
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

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

View File

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

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