tint: const eval of pow builtin

Bug: tint:1581
Change-Id: I11999f0adbd4b12d362e8f47772ac0a625b8fa68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113821
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Antonio Maiorano 2022-12-13 16:29:06 +00:00
parent 7f5b9d0b6f
commit be96967778
98 changed files with 2419 additions and 194 deletions

View File

@ -531,8 +531,8 @@ fn ldexp<N: num, T: f32_f16>(vec<N, T>, vec<N, i32>) -> vec<N, T>
@const fn pack2x16unorm(vec2<f32>) -> u32
@const fn pack4x8snorm(vec4<f32>) -> u32
@const fn pack4x8unorm(vec4<f32>) -> u32
fn pow<T: f32_f16>(T, T) -> T
fn pow<N: num, T: f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
@const fn pow<T: fa_f32_f16>(T, T) -> T
@const fn pow<N: num, T: fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
@const fn quantizeToF16(f32) -> f32
@const fn quantizeToF16<N: num>(vec<N, f32>) -> vec<N, f32>
@const fn radians<T: fa_f32_f16>(T) -> T

View File

@ -204,10 +204,10 @@ std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
}
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT value) {
std::string OverflowExpErrorMessage(std::string_view base, NumberT exp) {
std::stringstream ss;
ss << std::setprecision(20);
ss << base << "^" << value << " cannot be represented as "
ss << base << "^" << exp << " cannot be represented as "
<< "'" << FriendlyName<NumberT>() << "'";
return ss.str();
}
@ -463,6 +463,7 @@ struct Composite : ImplConstant {
/// CreateElement constructs and returns an Element<T>.
template <typename T>
ImplResult CreateElement(ProgramBuilder& builder, const Source& source, const type::Type* t, T v) {
static_assert(IsNumber<T> || std::is_same_v<T, bool>, "T must be a Number or bool");
TINT_ASSERT(Resolver, t->is_scalar());
if constexpr (IsFloatingPoint<T>) {
@ -3075,6 +3076,23 @@ ConstEval::Result ConstEval::pack4x8unorm(const type::Type* ty,
return CreateElement(builder, source, ty, ret);
}
ConstEval::Result ConstEval::pow(const type::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {
auto transform = [&](const sem::Constant* c0, const sem::Constant* c1) {
auto create = [&](auto e1, auto e2) -> ImplResult {
auto r = CheckedPow(e1, e2);
if (!r) {
AddError(OverflowErrorMessage(e1, "^", e2), source);
return utils::Failure;
}
return CreateElement(builder, source, c0->Type(), *r);
};
return Dispatch_fa_f32_f16(create, c0, c1);
};
return TransformElements(builder, ty, transform, args[0], args[1]);
}
ConstEval::Result ConstEval::radians(const type::Type* ty,
utils::VectorRef<const constant::Constant*> args,
const Source& source) {

View File

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

View File

@ -1971,6 +1971,54 @@ INSTANTIATE_TEST_SUITE_P( //
testing::Combine(testing::Values(sem::BuiltinType::kPack2X16Unorm),
testing::ValuesIn(Pack2x16unormCases())));
template <typename T>
std::vector<Case> PowCases() {
auto error_msg = [](auto base, auto exp) {
return "12:34 error: " + OverflowErrorMessage(base, "^", exp);
};
return {
C({T(0), T(1)}, T(0)), //
C({T(0), T::Highest()}, T(0)), //
C({T(1), T(1)}, T(1)), //
C({T(1), T::Lowest()}, T(1)), //
C({T(2), T(2)}, T(4)), //
C({T(2), T(3)}, T(8)), //
// Positive base, negative exponent
C({T(1), T::Highest()}, T(1)), //
C({T(1), -T(1)}, T(1)), //
C({T(2), -T(2)}, T(0.25)), //
C({T(2), -T(3)}, T(0.125)), //
// Decimal values
C({T(2.5), T(3)}, T(15.625)), //
C({T(2), T(3.5)}, T(11.313708498)).FloatComp(), //
C({T(2.5), T(3.5)}, T(24.705294220)).FloatComp(), //
C({T(2), -T(3.5)}, T(0.0883883476)).FloatComp(), //
// Vector tests
C({Vec(T(0), T(1), T(2)), Vec(T(2), T(2), T(2))}, Vec(T(0), T(1), T(4))),
C({Vec(T(2), T(2), T(2)), Vec(T(2), T(3), T(4))}, Vec(T(4), T(8), T(16))),
// Error if base < 0
E({-T(1), T(1)}, error_msg(-T(1), T(1))),
E({-T(1), T::Highest()}, error_msg(-T(1), T::Highest())),
E({T::Lowest(), T(1)}, error_msg(T::Lowest(), T(1))),
E({T::Lowest(), T::Highest()}, error_msg(T::Lowest(), T::Highest())),
E({T::Lowest(), T::Lowest()}, error_msg(T::Lowest(), T::Lowest())),
// Error if base == 0 and exp <= 0
E({T(0), T(0)}, error_msg(T(0), T(0))),
E({T(0), -T(1)}, error_msg(T(0), -T(1))),
E({T(0), T::Lowest()}, error_msg(T(0), T::Lowest())),
};
}
INSTANTIATE_TEST_SUITE_P( //
Pow,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kPow),
testing::ValuesIn(Concat(PowCases<AFloat>(), //
PowCases<f32>(), //
PowCases<f16>()))));
template <typename T>
std::vector<Case> ReverseBitsCases() {
using B = BitValues<T>;

View File

@ -238,10 +238,10 @@ std::string OverflowErrorMessage(VALUE_TY value, std::string_view target_ty) {
/// Returns the overflow error message for exponentiation
template <typename NumberT>
std::string OverflowExpErrorMessage(std::string_view base, NumberT value) {
std::string OverflowExpErrorMessage(std::string_view base, NumberT exp) {
std::stringstream ss;
ss << std::setprecision(20);
ss << base << "^" << value << " cannot be represented as "
ss << base << "^" << exp << " cannot be represented as "
<< "'" << FriendlyName<NumberT>() << "'";
return ss.str();
}

View File

@ -12797,24 +12797,24 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 0,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[622],
/* return matcher indices */ &kMatcherIndices[3],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::pow,
},
{
/* [376] */
/* num parameters */ 2,
/* num template types */ 1,
/* num template numbers */ 1,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[4],
/* parameters */ &kParameters[624],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::pow,
},
{
/* [377] */
@ -14345,8 +14345,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
},
{
/* [60] */
/* 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<T : fa_f32_f16>(T, T) -> T */
/* fn pow<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[375],
},

View File

@ -1,5 +1,5 @@
void pow_04a908() {
float4 res = pow((1.0f).xxxx, (1.0f).xxxx);
float4 res = (1.0f).xxxx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void pow_04a908() {
float4 res = pow((1.0f).xxxx, (1.0f).xxxx);
float4 res = (1.0f).xxxx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_04a908() {
float4 res = pow(float4(1.0f), float4(1.0f));
float4 res = float4(1.0f);
}
struct tint_symbol {

View File

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

View File

@ -1,5 +1,5 @@
void pow_46e029() {
float res = pow(1.0f, 1.0f);
float res = 1.0f;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void pow_46e029() {
float res = pow(1.0f, 1.0f);
float res = 1.0f;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_46e029() {
float res = pow(1.0f, 1.0f);
float res = 1.0f;
}
struct tint_symbol {

View File

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

View File

@ -1,5 +1,5 @@
void pow_4a46c9() {
float3 res = pow((1.0f).xxx, (1.0f).xxx);
float3 res = (1.0f).xxx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void pow_4a46c9() {
float3 res = pow((1.0f).xxx, (1.0f).xxx);
float3 res = (1.0f).xxx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_4a46c9() {
float3 res = pow(float3(1.0f), float3(1.0f));
float3 res = float3(1.0f);
}
struct tint_symbol {

View File

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

View File

@ -1,5 +1,5 @@
void pow_4f33b2() {
vector<float16_t, 4> res = pow((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_4f33b2() {
half4 res = pow(half4(1.0h), half4(1.0h));
half4 res = half4(1.0h);
}
struct tint_symbol {

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_749c42() {
float res = 1.0f;
}
vec4 vertex_main() {
pow_749c42();
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 pow_749c42() {
float res = 1.0f;
}
void fragment_main() {
pow_749c42();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_749c42() {
float res = 1.0f;
}
void compute_main() {
pow_749c42();
}
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 pow_749c42() {
float res = 1.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_749c42();
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() {
pow_749c42();
return;
}
kernel void compute_main() {
pow_749c42();
return;
}

View File

@ -0,0 +1,63 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 29
; 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 %pow_749c42 "pow_749c42"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%pow_749c42 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_1
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %pow_749c42
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
%24 = OpLabel
%25 = OpFunctionCall %void %pow_749c42
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %pow_749c42
OpReturn
OpFunctionEnd

View File

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

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 pow(vec<4, fa>, vec<4, fa>) -> vec<4, fa>
fn pow_a8f6b2() {
var res = pow(vec4(1.), vec4(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_a8f6b2();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_a8f6b2();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_a8f6b2();
}

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
vec4 vertex_main() {
pow_a8f6b2();
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 pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
void fragment_main() {
pow_a8f6b2();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
void compute_main() {
pow_a8f6b2();
}
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 pow_a8f6b2() {
float4 res = float4(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_a8f6b2();
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() {
pow_a8f6b2();
return;
}
kernel void compute_main() {
pow_a8f6b2();
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 %pow_a8f6b2 "pow_a8f6b2"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
%17 = OpTypeFunction %v4float
%pow_a8f6b2 = 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 %pow_a8f6b2
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
%25 = OpLabel
%26 = OpFunctionCall %void %pow_a8f6b2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %pow_a8f6b2
OpReturn
OpFunctionEnd

View File

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

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 pow(vec<2, fa>, vec<2, fa>) -> vec<2, fa>
fn pow_bc91ed() {
var res = pow(vec2(1.), vec2(1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_bc91ed();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_bc91ed();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_bc91ed();
}

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_bc91ed() {
vec2 res = vec2(1.0f);
}
vec4 vertex_main() {
pow_bc91ed();
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 pow_bc91ed() {
vec2 res = vec2(1.0f);
}
void fragment_main() {
pow_bc91ed();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_bc91ed() {
vec2 res = vec2(1.0f);
}
void compute_main() {
pow_bc91ed();
}
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 pow_bc91ed() {
float2 res = float2(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_bc91ed();
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() {
pow_bc91ed();
return;
}
kernel void compute_main() {
pow_bc91ed();
return;
}

View File

@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %pow_bc91ed "pow_bc91ed"
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_1 = OpConstant %float 1
%15 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%pow_bc91ed = 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 %pow_bc91ed
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
%27 = OpLabel
%28 = OpFunctionCall %void %pow_bc91ed
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %pow_bc91ed
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,5 +1,5 @@
void pow_ce9ef5() {
float16_t res = pow(float16_t(1.0h), float16_t(1.0h));
float16_t res = float16_t(1.0h);
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_ce9ef5() {
half res = pow(1.0h, 1.0h);
half res = 1.0h;
}
struct tint_symbol {

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_e42f20() {
vec3 res = vec3(1.0f);
}
vec4 vertex_main() {
pow_e42f20();
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 pow_e42f20() {
vec3 res = vec3(1.0f);
}
void fragment_main() {
pow_e42f20();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_e42f20() {
vec3 res = vec3(1.0f);
}
void compute_main() {
pow_e42f20();
}
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 pow_e42f20() {
float3 res = float3(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_e42f20();
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() {
pow_e42f20();
return;
}
kernel void compute_main() {
pow_e42f20();
return;
}

View File

@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %pow_e42f20 "pow_e42f20"
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_1 = OpConstant %float 1
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%pow_e42f20 = 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 %pow_e42f20
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
%27 = OpLabel
%28 = OpFunctionCall %void %pow_e42f20
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %pow_e42f20
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,5 +1,5 @@
void pow_e60ea5() {
float2 res = pow((1.0f).xx, (1.0f).xx);
float2 res = (1.0f).xx;
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void pow_e60ea5() {
float2 res = pow((1.0f).xx, (1.0f).xx);
float2 res = (1.0f).xx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_e60ea5() {
float2 res = pow(float2(1.0f), float2(1.0f));
float2 res = float2(1.0f);
}
struct tint_symbol {

View File

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

View File

@ -1,5 +1,5 @@
void pow_f37b25() {
vector<float16_t, 2> res = pow((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
vector<float16_t, 2> res = (float16_t(1.0h)).xx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_f37b25() {
half2 res = pow(half2(1.0h), half2(1.0h));
half2 res = half2(1.0h);
}
struct tint_symbol {

View File

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

View File

@ -1,5 +1,5 @@
void pow_fa5429() {
vector<float16_t, 3> res = pow((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
}
struct tint_symbol {

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void pow_fa5429() {
half3 res = pow(half3(1.0h), half3(1.0h));
half3 res = half3(1.0h);
}
struct tint_symbol {

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_749c42() {
float res = 1.0f;
}
vec4 vertex_main() {
pow_749c42();
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 pow_749c42() {
float res = 1.0f;
}
void fragment_main() {
pow_749c42();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_749c42() {
float res = 1.0f;
}
void compute_main() {
pow_749c42();
}
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 pow_749c42() {
float res = 1.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_749c42();
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() {
pow_749c42();
return;
}
kernel void compute_main() {
pow_749c42();
return;
}

View File

@ -0,0 +1,63 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 29
; 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 %pow_749c42 "pow_749c42"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
%16 = OpTypeFunction %v4float
%pow_749c42 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
OpStore %res %float_1
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %16
%18 = OpLabel
%19 = OpFunctionCall %void %pow_749c42
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
%24 = OpLabel
%25 = OpFunctionCall %void %pow_749c42
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %pow_749c42
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,21 @@
fn pow_749c42() {
const arg_0 = 1.0;
const arg_1 = 1.0;
var res = pow(arg_0, arg_1);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_749c42();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_749c42();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_749c42();
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
vec4 vertex_main() {
pow_a8f6b2();
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 pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
void fragment_main() {
pow_a8f6b2();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_a8f6b2() {
vec4 res = vec4(1.0f);
}
void compute_main() {
pow_a8f6b2();
}
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 pow_a8f6b2() {
float4 res = float4(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_a8f6b2();
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() {
pow_a8f6b2();
return;
}
kernel void compute_main() {
pow_a8f6b2();
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 %pow_a8f6b2 "pow_a8f6b2"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
%17 = OpTypeFunction %v4float
%pow_a8f6b2 = 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 %pow_a8f6b2
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
%25 = OpLabel
%26 = OpFunctionCall %void %pow_a8f6b2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %pow_a8f6b2
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,21 @@
fn pow_a8f6b2() {
const arg_0 = vec4(1.0);
const arg_1 = vec4(1.0);
var res = pow(arg_0, arg_1);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_a8f6b2();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_a8f6b2();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_a8f6b2();
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_bc91ed() {
vec2 res = vec2(1.0f);
}
vec4 vertex_main() {
pow_bc91ed();
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 pow_bc91ed() {
vec2 res = vec2(1.0f);
}
void fragment_main() {
pow_bc91ed();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_bc91ed() {
vec2 res = vec2(1.0f);
}
void compute_main() {
pow_bc91ed();
}
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 pow_bc91ed() {
float2 res = float2(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_bc91ed();
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() {
pow_bc91ed();
return;
}
kernel void compute_main() {
pow_bc91ed();
return;
}

View File

@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %pow_bc91ed "pow_bc91ed"
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_1 = OpConstant %float 1
%15 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%18 = OpConstantNull %v2float
%19 = OpTypeFunction %v4float
%pow_bc91ed = 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 %pow_bc91ed
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
%27 = OpLabel
%28 = OpFunctionCall %void %pow_bc91ed
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %pow_bc91ed
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,21 @@
fn pow_bc91ed() {
const arg_0 = vec2(1.0);
const arg_1 = vec2(1.0);
var res = pow(arg_0, arg_1);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_bc91ed();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_bc91ed();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_bc91ed();
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void pow_e42f20() {
vec3 res = vec3(1.0f);
}
vec4 vertex_main() {
pow_e42f20();
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 pow_e42f20() {
vec3 res = vec3(1.0f);
}
void fragment_main() {
pow_e42f20();
}
void main() {
fragment_main();
return;
}
#version 310 es
void pow_e42f20() {
vec3 res = vec3(1.0f);
}
void compute_main() {
pow_e42f20();
}
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 pow_e42f20() {
float3 res = float3(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
pow_e42f20();
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() {
pow_e42f20();
return;
}
kernel void compute_main() {
pow_e42f20();
return;
}

View File

@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %pow_e42f20 "pow_e42f20"
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_1 = OpConstant %float 1
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%_ptr_Function_v3float = OpTypePointer Function %v3float
%18 = OpConstantNull %v3float
%19 = OpTypeFunction %v4float
%pow_e42f20 = 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 %pow_e42f20
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
%27 = OpLabel
%28 = OpFunctionCall %void %pow_e42f20
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %pow_e42f20
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,21 @@
fn pow_e42f20() {
const arg_0 = vec3(1.0);
const arg_1 = vec3(1.0);
var res = pow(arg_0, arg_1);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
pow_e42f20();
return vec4<f32>();
}
@fragment
fn fragment_main() {
pow_e42f20();
}
@compute @workgroup_size(1)
fn compute_main() {
pow_e42f20();
}