Add const-eval for `saturate`.

This CL adds const-eval for the `saturate` builtin.

Bug: tint:1581
Change-Id: I3729ea5b381b04b73bbe1bc8e03e5ce65c27e082
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107362
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-10-27 16:41:44 +00:00 committed by Dawn LUCI CQ
parent c98ad87368
commit 91ed6f7289
126 changed files with 2416 additions and 240 deletions

View File

@ -522,8 +522,8 @@ fn reverseBits<T: iu32>(T) -> T
fn reverseBits<N: num, T: iu32>(vec<N, T>) -> vec<N, T>
fn round<T: f32_f16>(T) -> T
fn round<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
fn saturate<T: f32_f16>(T) -> T
fn saturate<T: f32_f16, N: num>(vec<N, T>) -> vec<N, T>
@const fn saturate<T: fa_f32_f16>(@test_value(2) T) -> T
@const fn saturate<T: fa_f32_f16, N: num>(@test_value(2) vec<N, T>) -> vec<N, T>
@const("select_bool") fn select<T: scalar>(T, T, bool) -> T
@const("select_bool") fn select<T: scalar, N: num>(vec<N, T>, vec<N, T>, bool) -> vec<N, T>
@const("select_boolvec") fn select<N: num, T: scalar>(vec<N, T>, vec<N, T>, vec<N, bool>) -> vec<N, T>

View File

@ -1616,6 +1616,20 @@ ConstEval::Result ConstEval::clamp(const sem::Type* ty,
return TransformElements(builder, ty, transform, args[0], args[1], args[2]);
}
ConstEval::Result ConstEval::saturate(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source&) {
auto transform = [&](const sem::Constant* c0) {
auto create = [&](auto e) {
using NumberT = decltype(e);
return CreateElement(builder, c0->Type(),
NumberT(std::min(std::max(e, NumberT(0.0)), NumberT(1.0))));
};
return Dispatch_fia_fiu32_f16(create, c0);
};
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::select_bool(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source&) {

View File

@ -431,6 +431,15 @@ class ConstEval {
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// saturate 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 saturate(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// select builtin with single bool third arg
/// @param ty the expression type
/// @param args the input arguments

View File

@ -460,6 +460,31 @@ INSTANTIATE_TEST_SUITE_P( //
ClampCases<f32>(),
ClampCases<f16>()))));
template <typename T>
std::vector<Case> SaturateCases() {
return {
C({T(0)}, T(0)),
C({T(1)}, T(1)),
C({T::Lowest()}, T(0)),
C({T::Highest()}, T(1)),
// Vector tests
C({Vec(T(0), T(0))}, //
Vec(T(0), T(0))), //
C({Vec(T(1), T(1))}, //
Vec(T(1), T(1))), //
C({Vec(T::Lowest(), T(0), T::Highest())}, //
Vec(T(0), T(0), T(1))),
};
}
INSTANTIATE_TEST_SUITE_P( //
Saturate,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kSaturate),
testing::ValuesIn(Concat(SaturateCases<AFloat>(), //
SaturateCases<f32>(),
SaturateCases<f16>()))));
template <typename T>
std::vector<Case> SelectCases() {
return {

View File

@ -12407,24 +12407,24 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
/* template types */ &kTemplateTypes[25],
/* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[902],
/* return matcher indices */ &kMatcherIndices[1],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::saturate,
},
{
/* [341] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
/* template types */ &kTemplateTypes[25],
/* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[5],
/* parameters */ &kParameters[903],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::saturate,
},
{
/* [342] */
@ -14427,8 +14427,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
},
{
/* [66] */
/* fn saturate<T : f32_f16>(T) -> T */
/* fn saturate<T : f32_f16, N : num>(vec<N, T>) -> vec<N, T> */
/* fn saturate<T : fa_f32_f16>(@test_value(2) T) -> T */
/* fn saturate<T : fa_f32_f16, N : num>(@test_value(2) vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[340],
},

View File

@ -1435,28 +1435,6 @@ fn f() {
EXPECT_EQ(expect, str(got));
}
TEST_F(BuiltinPolyfillTest, Saturate_f32_from_abstract_float) {
auto* src = R"(
fn f() {
let r : f32 = saturate(0.5);
}
)";
auto* expect = R"(
fn tint_saturate(v : f32) -> f32 {
return clamp(v, f32(0), f32(1));
}
fn f() {
let r : f32 = tint_saturate(0.5);
}
)";
auto got = Run<BuiltinPolyfill>(src, polyfillSaturate());
EXPECT_EQ(expect, str(got));
}
TEST_F(BuiltinPolyfillTest, Saturate_f16) {
auto* src = R"(
enable f16;
@ -1505,28 +1483,6 @@ fn f() {
EXPECT_EQ(expect, str(got));
}
TEST_F(BuiltinPolyfillTest, Saturate_vec3_f32_from_abstract_float) {
auto* src = R"(
fn f() {
let r : vec3<f32> = saturate(vec3(0.5));
}
)";
auto* expect = R"(
fn tint_saturate(v : vec3<f32>) -> vec3<f32> {
return clamp(v, vec3<f32>(0), vec3<f32>(1));
}
fn f() {
let r : vec3<f32> = tint_saturate(vec3(0.5));
}
)";
auto got = Run<BuiltinPolyfill>(src, polyfillSaturate());
EXPECT_EQ(expect, str(got));
}
TEST_F(BuiltinPolyfillTest, Saturate_vec3_f16) {
auto* src = R"(
enable f16;

View File

@ -23,7 +23,7 @@
// fn saturate(f32) -> f32
fn saturate_270da5() {
var res: f32 = saturate(1.f);
var res: f32 = saturate(2.f);
}
@vertex

View File

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

View File

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

View File

@ -5,7 +5,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float res = tint_saturate(1.0f);
float res = tint_saturate(2.0f);
}
vec4 vertex_main() {
@ -29,7 +29,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float res = tint_saturate(1.0f);
float res = tint_saturate(2.0f);
}
void fragment_main() {
@ -47,7 +47,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float res = tint_saturate(1.0f);
float res = tint_saturate(2.0f);
}
void compute_main() {

View File

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

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 37
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
@ -35,8 +35,9 @@
%float_1 = OpConstant %float 1
%void = OpTypeVoid
%16 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%_ptr_Function_float = OpTypePointer Function %float
%23 = OpTypeFunction %v4float
%24 = OpTypeFunction %v4float
%tint_saturate = OpFunction %float None %9
%v = OpFunctionParameter %float
%12 = OpLabel
@ -46,29 +47,29 @@
%saturate_270da5 = OpFunction %void None %16
%19 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%20 = OpFunctionCall %float %tint_saturate %float_1
%20 = OpFunctionCall %float %tint_saturate %float_2
OpStore %res %20
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %saturate_270da5
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %saturate_270da5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%29 = OpLabel
%30 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %30
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
%31 = OpLabel
%32 = OpFunctionCall %void %saturate_270da5
%32 = OpLabel
%33 = OpFunctionCall %void %saturate_270da5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
%34 = OpLabel
%35 = OpFunctionCall %void %saturate_270da5
%35 = OpLabel
%36 = OpFunctionCall %void %saturate_270da5
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_270da5() {
var res : f32 = saturate(1.0f);
var res : f32 = saturate(2.0f);
}
@vertex

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_462535() {
half3 res = saturate(half3(0.0h));
half3 res = half3(0.0h);
}
struct tint_symbol {

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
vec4 vertex_main() {
saturate_4ed8d7();
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 saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
void fragment_main() {
saturate_4ed8d7();
}
void main() {
fragment_main();
return;
}
#version 310 es
void saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
void compute_main() {
saturate_4ed8d7();
}
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 saturate_4ed8d7() {
float4 res = float4(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
saturate_4ed8d7();
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() {
saturate_4ed8d7();
return;
}
kernel void compute_main() {
saturate_4ed8d7();
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 %saturate_4ed8d7 "saturate_4ed8d7"
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
%saturate_4ed8d7 = 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 %saturate_4ed8d7
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 %saturate_4ed8d7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_4ed8d7
OpReturn
OpFunctionEnd

View File

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

View File

@ -23,7 +23,7 @@
// fn saturate(vec<2, f32>) -> vec<2, f32>
fn saturate_51567f() {
var res: vec2<f32> = saturate(vec2<f32>(1.f));
var res: vec2<f32> = saturate(vec2<f32>(2.f));
}
@vertex

View File

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

View File

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

View File

@ -5,7 +5,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 res = tint_saturate(vec2(1.0f));
vec2 res = tint_saturate(vec2(2.0f));
}
vec4 vertex_main() {
@ -29,7 +29,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 res = tint_saturate(vec2(1.0f));
vec2 res = tint_saturate(vec2(2.0f));
}
void fragment_main() {
@ -47,7 +47,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 res = tint_saturate(vec2(1.0f));
vec2 res = tint_saturate(vec2(2.0f));
}
void compute_main() {

View File

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

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Bound: 41
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
@ -38,8 +38,10 @@
%18 = OpConstantComposite %v2float %float_1 %float_1
%void = OpTypeVoid
%19 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%25 = OpConstantComposite %v2float %float_2 %float_2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%26 = OpTypeFunction %v4float
%28 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v2float None %9
%v = OpFunctionParameter %v2float
%13 = OpLabel
@ -49,29 +51,29 @@
%saturate_51567f = OpFunction %void None %19
%22 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %16
%23 = OpFunctionCall %v2float %tint_saturate %18
%23 = OpFunctionCall %v2float %tint_saturate %25
OpStore %res %23
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %26
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_51567f
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_51567f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %19
%31 = OpLabel
%32 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %32
%33 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %19
%34 = OpLabel
%35 = OpFunctionCall %void %saturate_51567f
%36 = OpLabel
%37 = OpFunctionCall %void %saturate_51567f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %19
%37 = OpLabel
%38 = OpFunctionCall %void %saturate_51567f
%39 = OpLabel
%40 = OpFunctionCall %void %saturate_51567f
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_51567f() {
var res : vec2<f32> = saturate(vec2<f32>(1.0f));
var res : vec2<f32> = saturate(vec2<f32>(2.0f));
}
@vertex

View File

@ -23,7 +23,7 @@
// fn saturate(vec<3, f32>) -> vec<3, f32>
fn saturate_6bcddf() {
var res: vec3<f32> = saturate(vec3<f32>(1.f));
var res: vec3<f32> = saturate(vec3<f32>(2.f));
}
@vertex

View File

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

View File

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

View File

@ -5,7 +5,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(1.0f));
vec3 res = tint_saturate(vec3(2.0f));
}
vec4 vertex_main() {
@ -29,7 +29,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(1.0f));
vec3 res = tint_saturate(vec3(2.0f));
}
void fragment_main() {
@ -47,7 +47,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(1.0f));
vec3 res = tint_saturate(vec3(2.0f));
}
void compute_main() {

View File

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

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Bound: 41
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
@ -38,8 +38,10 @@
%18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%void = OpTypeVoid
%19 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%25 = OpConstantComposite %v3float %float_2 %float_2 %float_2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%26 = OpTypeFunction %v4float
%28 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v3float None %9
%v = OpFunctionParameter %v3float
%13 = OpLabel
@ -49,29 +51,29 @@
%saturate_6bcddf = OpFunction %void None %19
%22 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %16
%23 = OpFunctionCall %v3float %tint_saturate %18
%23 = OpFunctionCall %v3float %tint_saturate %25
OpStore %res %23
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %26
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_6bcddf
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_6bcddf
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %19
%31 = OpLabel
%32 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %32
%33 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %19
%34 = OpLabel
%35 = OpFunctionCall %void %saturate_6bcddf
%36 = OpLabel
%37 = OpFunctionCall %void %saturate_6bcddf
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %19
%37 = OpLabel
%38 = OpFunctionCall %void %saturate_6bcddf
%39 = OpLabel
%40 = OpFunctionCall %void %saturate_6bcddf
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_6bcddf() {
var res : vec3<f32> = saturate(vec3<f32>(1.0f));
var res : vec3<f32> = saturate(vec3<f32>(2.0f));
}
@vertex

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void saturate_78b37c() {
float res = 1.0f;
}
vec4 vertex_main() {
saturate_78b37c();
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 saturate_78b37c() {
float res = 1.0f;
}
void fragment_main() {
saturate_78b37c();
}
void main() {
fragment_main();
return;
}
#version 310 es
void saturate_78b37c() {
float res = 1.0f;
}
void compute_main() {
saturate_78b37c();
}
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 saturate_78b37c() {
float res = 1.0f;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
saturate_78b37c();
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() {
saturate_78b37c();
return;
}
kernel void compute_main() {
saturate_78b37c();
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 %saturate_78b37c "saturate_78b37c"
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
%saturate_78b37c = 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 %saturate_78b37c
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 %saturate_78b37c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %void %saturate_78b37c
OpReturn
OpFunctionEnd

View File

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

View File

@ -23,7 +23,7 @@
// fn saturate(vec<4, f32>) -> vec<4, f32>
fn saturate_a5b571() {
var res: vec4<f32> = saturate(vec4<f32>(1.f));
var res: vec4<f32> = saturate(vec4<f32>(2.f));
}
@vertex

View File

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

View File

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

View File

@ -5,7 +5,7 @@ vec4 tint_saturate(vec4 v) {
}
void saturate_a5b571() {
vec4 res = tint_saturate(vec4(1.0f));
vec4 res = tint_saturate(vec4(2.0f));
}
vec4 vertex_main() {
@ -29,7 +29,7 @@ vec4 tint_saturate(vec4 v) {
}
void saturate_a5b571() {
vec4 res = tint_saturate(vec4(1.0f));
vec4 res = tint_saturate(vec4(2.0f));
}
void fragment_main() {
@ -47,7 +47,7 @@ vec4 tint_saturate(vec4 v) {
}
void saturate_a5b571() {
vec4 res = tint_saturate(vec4(1.0f));
vec4 res = tint_saturate(vec4(2.0f));
}
void compute_main() {

View File

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

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 39
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
@ -36,8 +36,10 @@
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%23 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
%_ptr_Function_v4float = OpTypePointer Function %v4float
%24 = OpTypeFunction %v4float
%26 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v4float None %9
%v = OpFunctionParameter %v4float
%12 = OpLabel
@ -47,29 +49,29 @@
%saturate_a5b571 = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
%21 = OpFunctionCall %v4float %tint_saturate %16
%21 = OpFunctionCall %v4float %tint_saturate %23
OpStore %res %21
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %saturate_a5b571
%vertex_main_inner = OpFunction %v4float None %26
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_a5b571
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %17
%29 = OpLabel
%30 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %30
%31 = OpLabel
%32 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %32
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %17
%32 = OpLabel
%33 = OpFunctionCall %void %saturate_a5b571
%34 = OpLabel
%35 = OpFunctionCall %void %saturate_a5b571
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %17
%35 = OpLabel
%36 = OpFunctionCall %void %saturate_a5b571
%37 = OpLabel
%38 = OpFunctionCall %void %saturate_a5b571
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_a5b571() {
var res : vec4<f32> = saturate(vec4<f32>(1.0f));
var res : vec4<f32> = saturate(vec4<f32>(2.0f));
}
@vertex

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_cd2028() {
half2 res = saturate(half2(0.0h));
half2 res = half2(0.0h);
}
struct tint_symbol {

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void saturate_d55822() {
vec3 res = vec3(1.0f);
}
vec4 vertex_main() {
saturate_d55822();
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 saturate_d55822() {
vec3 res = vec3(1.0f);
}
void fragment_main() {
saturate_d55822();
}
void main() {
fragment_main();
return;
}
#version 310 es
void saturate_d55822() {
vec3 res = vec3(1.0f);
}
void compute_main() {
saturate_d55822();
}
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 saturate_d55822() {
float3 res = float3(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
saturate_d55822();
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() {
saturate_d55822();
return;
}
kernel void compute_main() {
saturate_d55822();
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 %saturate_d55822 "saturate_d55822"
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
%saturate_d55822 = 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 %saturate_d55822
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 %saturate_d55822
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_d55822
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_dcde71() {
half4 res = saturate(half4(0.0h));
half4 res = half4(0.0h);
}
struct tint_symbol {

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void saturate_e40fb6() {
vec2 res = vec2(1.0f);
}
vec4 vertex_main() {
saturate_e40fb6();
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 saturate_e40fb6() {
vec2 res = vec2(1.0f);
}
void fragment_main() {
saturate_e40fb6();
}
void main() {
fragment_main();
return;
}
#version 310 es
void saturate_e40fb6() {
vec2 res = vec2(1.0f);
}
void compute_main() {
saturate_e40fb6();
}
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 saturate_e40fb6() {
float2 res = float2(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
saturate_e40fb6();
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() {
saturate_e40fb6();
return;
}
kernel void compute_main() {
saturate_e40fb6();
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 %saturate_e40fb6 "saturate_e40fb6"
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
%saturate_e40fb6 = 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 %saturate_e40fb6
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 %saturate_e40fb6
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_e40fb6
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,5 +1,5 @@
void saturate_e8df56() {
float16_t res = saturate(float16_t(0.0h));
float16_t res = float16_t(0.0h);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_e8df56() {
half res = saturate(0.0h);
half res = 0.0h;
}
struct tint_symbol {

View File

@ -23,7 +23,7 @@
// fn saturate(f32) -> f32
fn saturate_270da5() {
var arg_0 = 1.f;
var arg_0 = 2.f;
var res: f32 = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = saturate(arg_0);
}

View File

@ -5,7 +5,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = tint_saturate(arg_0);
}
@ -30,7 +30,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = tint_saturate(arg_0);
}
@ -49,7 +49,7 @@ float tint_saturate(float v) {
}
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = tint_saturate(arg_0);
}

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_270da5() {
float arg_0 = 1.0f;
float arg_0 = 2.0f;
float res = saturate(arg_0);
}

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 38
; Bound: 39
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
@ -36,8 +36,9 @@
%float_1 = OpConstant %float 1
%void = OpTypeVoid
%16 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%_ptr_Function_float = OpTypePointer Function %float
%25 = OpTypeFunction %v4float
%26 = OpTypeFunction %v4float
%tint_saturate = OpFunction %float None %9
%v = OpFunctionParameter %float
%12 = OpLabel
@ -48,31 +49,31 @@
%19 = OpLabel
%arg_0 = OpVariable %_ptr_Function_float Function %8
%res = OpVariable %_ptr_Function_float Function %8
OpStore %arg_0 %float_1
%23 = OpLoad %float %arg_0
%22 = OpFunctionCall %float %tint_saturate %23
OpStore %res %22
OpStore %arg_0 %float_2
%24 = OpLoad %float %arg_0
%23 = OpFunctionCall %float %tint_saturate %24
OpStore %res %23
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %25
%27 = OpLabel
%28 = OpFunctionCall %void %saturate_270da5
%vertex_main_inner = OpFunction %v4float None %26
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_270da5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
%30 = OpLabel
%31 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %31
%31 = OpLabel
%32 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %32
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
%33 = OpLabel
%34 = OpFunctionCall %void %saturate_270da5
%34 = OpLabel
%35 = OpFunctionCall %void %saturate_270da5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
%36 = OpLabel
%37 = OpFunctionCall %void %saturate_270da5
%37 = OpLabel
%38 = OpFunctionCall %void %saturate_270da5
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_270da5() {
var arg_0 = 1.0f;
var arg_0 = 2.0f;
var res : f32 = saturate(arg_0);
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,49 @@
#version 310 es
void saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
vec4 vertex_main() {
saturate_4ed8d7();
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 saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
void fragment_main() {
saturate_4ed8d7();
}
void main() {
fragment_main();
return;
}
#version 310 es
void saturate_4ed8d7() {
vec4 res = vec4(1.0f);
}
void compute_main() {
saturate_4ed8d7();
}
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 saturate_4ed8d7() {
float4 res = float4(1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
saturate_4ed8d7();
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() {
saturate_4ed8d7();
return;
}
kernel void compute_main() {
saturate_4ed8d7();
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 %saturate_4ed8d7 "saturate_4ed8d7"
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
%saturate_4ed8d7 = 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 %saturate_4ed8d7
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 %saturate_4ed8d7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %saturate_4ed8d7
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,20 @@
fn saturate_4ed8d7() {
const arg_0 = vec4(2);
var res = saturate(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
saturate_4ed8d7();
return vec4<f32>();
}
@fragment
fn fragment_main() {
saturate_4ed8d7();
}
@compute @workgroup_size(1)
fn compute_main() {
saturate_4ed8d7();
}

View File

@ -23,7 +23,7 @@
// fn saturate(vec<2, f32>) -> vec<2, f32>
fn saturate_51567f() {
var arg_0 = vec2<f32>(1.f);
var arg_0 = vec2<f32>(2.f);
var res: vec2<f32> = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_51567f() {
float2 arg_0 = (1.0f).xx;
float2 arg_0 = (2.0f).xx;
float2 res = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_51567f() {
float2 arg_0 = (1.0f).xx;
float2 arg_0 = (2.0f).xx;
float2 res = saturate(arg_0);
}

View File

@ -5,7 +5,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 arg_0 = vec2(1.0f);
vec2 arg_0 = vec2(2.0f);
vec2 res = tint_saturate(arg_0);
}
@ -30,7 +30,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 arg_0 = vec2(1.0f);
vec2 arg_0 = vec2(2.0f);
vec2 res = tint_saturate(arg_0);
}
@ -49,7 +49,7 @@ vec2 tint_saturate(vec2 v) {
}
void saturate_51567f() {
vec2 arg_0 = vec2(1.0f);
vec2 arg_0 = vec2(2.0f);
vec2 res = tint_saturate(arg_0);
}

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_51567f() {
float2 arg_0 = float2(1.0f);
float2 arg_0 = float2(2.0f);
float2 res = saturate(arg_0);
}

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 41
; Bound: 43
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
@ -39,8 +39,10 @@
%18 = OpConstantComposite %v2float %float_1 %float_1
%void = OpTypeVoid
%19 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%24 = OpConstantComposite %v2float %float_2 %float_2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%28 = OpTypeFunction %v4float
%30 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v2float None %9
%v = OpFunctionParameter %v2float
%13 = OpLabel
@ -51,31 +53,31 @@
%22 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v2float Function %16
%res = OpVariable %_ptr_Function_v2float Function %16
OpStore %arg_0 %18
%26 = OpLoad %v2float %arg_0
%25 = OpFunctionCall %v2float %tint_saturate %26
OpStore %res %25
OpStore %arg_0 %24
%28 = OpLoad %v2float %arg_0
%27 = OpFunctionCall %v2float %tint_saturate %28
OpStore %res %27
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_51567f
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %saturate_51567f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %19
%33 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %19
%36 = OpLabel
%37 = OpFunctionCall %void %saturate_51567f
%38 = OpLabel
%39 = OpFunctionCall %void %saturate_51567f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %19
%39 = OpLabel
%40 = OpFunctionCall %void %saturate_51567f
%41 = OpLabel
%42 = OpFunctionCall %void %saturate_51567f
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_51567f() {
var arg_0 = vec2<f32>(1.0f);
var arg_0 = vec2<f32>(2.0f);
var res : vec2<f32> = saturate(arg_0);
}

View File

@ -23,7 +23,7 @@
// fn saturate(vec<3, f32>) -> vec<3, f32>
fn saturate_6bcddf() {
var arg_0 = vec3<f32>(1.f);
var arg_0 = vec3<f32>(2.f);
var res: vec3<f32> = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_6bcddf() {
float3 arg_0 = (1.0f).xxx;
float3 arg_0 = (2.0f).xxx;
float3 res = saturate(arg_0);
}

View File

@ -1,5 +1,5 @@
void saturate_6bcddf() {
float3 arg_0 = (1.0f).xxx;
float3 arg_0 = (2.0f).xxx;
float3 res = saturate(arg_0);
}

View File

@ -5,7 +5,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 arg_0 = vec3(1.0f);
vec3 arg_0 = vec3(2.0f);
vec3 res = tint_saturate(arg_0);
}
@ -30,7 +30,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 arg_0 = vec3(1.0f);
vec3 arg_0 = vec3(2.0f);
vec3 res = tint_saturate(arg_0);
}
@ -49,7 +49,7 @@ vec3 tint_saturate(vec3 v) {
}
void saturate_6bcddf() {
vec3 arg_0 = vec3(1.0f);
vec3 arg_0 = vec3(2.0f);
vec3 res = tint_saturate(arg_0);
}

View File

@ -2,7 +2,7 @@
using namespace metal;
void saturate_6bcddf() {
float3 arg_0 = float3(1.0f);
float3 arg_0 = float3(2.0f);
float3 res = saturate(arg_0);
}

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 41
; Bound: 43
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
@ -39,8 +39,10 @@
%18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%void = OpTypeVoid
%19 = OpTypeFunction %void
%float_2 = OpConstant %float 2
%24 = OpConstantComposite %v3float %float_2 %float_2 %float_2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%28 = OpTypeFunction %v4float
%30 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v3float None %9
%v = OpFunctionParameter %v3float
%13 = OpLabel
@ -51,31 +53,31 @@
%22 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v3float Function %16
%res = OpVariable %_ptr_Function_v3float Function %16
OpStore %arg_0 %18
%26 = OpLoad %v3float %arg_0
%25 = OpFunctionCall %v3float %tint_saturate %26
OpStore %res %25
OpStore %arg_0 %24
%28 = OpLoad %v3float %arg_0
%27 = OpFunctionCall %v3float %tint_saturate %28
OpStore %res %27
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %saturate_6bcddf
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %saturate_6bcddf
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %19
%33 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %19
%36 = OpLabel
%37 = OpFunctionCall %void %saturate_6bcddf
%38 = OpLabel
%39 = OpFunctionCall %void %saturate_6bcddf
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %19
%39 = OpLabel
%40 = OpFunctionCall %void %saturate_6bcddf
%41 = OpLabel
%42 = OpFunctionCall %void %saturate_6bcddf
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
fn saturate_6bcddf() {
var arg_0 = vec3<f32>(1.0f);
var arg_0 = vec3<f32>(2.0f);
var res : vec3<f32> = saturate(arg_0);
}

View File

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

View File

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

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