builtins: Add smoothstep, deprecate smoothStep

Bug: tint:1483
Change-Id: I8702933312a7e46f82745f232214910433485fe5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85261
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price 2022-03-30 17:57:39 +00:00
parent 2ec98d961c
commit e6c76095fc
62 changed files with 2759 additions and 1630 deletions

View File

@ -14,6 +14,10 @@
* Attributes using `[[attribute]]` syntax are no longer supported. [tint:1382](crbug.com/tint/1382)
* The `elseif` keyword is no longer supported. [tint:1289](crbug.com/tint/1289)
### Deprecated Features
* The `smoothStep()` builtin has been renamed to `smoothstep()`. [tint:1483](crbug.com/tint/1483)
## Changes for M101
### New Features

File diff suppressed because it is too large Load Diff

View File

@ -382,8 +382,10 @@ fn sin(f32) -> f32
fn sin<N: num>(vec<N, f32>) -> vec<N, f32>
fn sinh(f32) -> f32
fn sinh<N: num>(vec<N, f32>) -> vec<N, f32>
fn smoothStep(f32, f32, f32) -> f32
fn smoothStep<N: num>(vec<N, f32>, vec<N, f32>, vec<N, f32>) -> vec<N, f32>
fn smoothstep(f32, f32, f32) -> f32
fn smoothstep<N: num>(vec<N, f32>, vec<N, f32>, vec<N, f32>) -> vec<N, f32>
[[deprecated]] fn smoothStep(f32, f32, f32) -> f32
[[deprecated]] fn smoothStep<N: num>(vec<N, f32>, vec<N, f32>, vec<N, f32>) -> vec<N, f32>
fn sqrt(f32) -> f32
fn sqrt<N: num>(vec<N, f32>) -> vec<N, f32>
fn step(f32, f32) -> f32

View File

@ -1300,6 +1300,7 @@ INSTANTIATE_TEST_SUITE_P(
ResolverTest,
ResolverBuiltinTest_ThreeParam,
testing::Values(BuiltinData{"mix", BuiltinType::kMix},
BuiltinData{"smoothstep", BuiltinType::kSmoothstep},
BuiltinData{"smoothStep", BuiltinType::kSmoothStep},
BuiltinData{"fma", BuiltinType::kFma}));

View File

@ -92,6 +92,7 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{"sign", BuiltinType::kSign},
BuiltinData{"sin", BuiltinType::kSin},
BuiltinData{"sinh", BuiltinType::kSinh},
BuiltinData{"smoothstep", BuiltinType::kSmoothstep},
BuiltinData{"smoothStep", BuiltinType::kSmoothStep},
BuiltinData{"sqrt", BuiltinType::kSqrt},
BuiltinData{"step", BuiltinType::kStep},

View File

@ -225,6 +225,9 @@ BuiltinType ParseBuiltinType(const std::string& name) {
if (name == "sinh") {
return BuiltinType::kSinh;
}
if (name == "smoothstep") {
return BuiltinType::kSmoothstep;
}
if (name == "smoothStep") {
return BuiltinType::kSmoothStep;
}
@ -479,6 +482,8 @@ const char* str(BuiltinType i) {
return "sin";
case BuiltinType::kSinh:
return "sinh";
case BuiltinType::kSmoothstep:
return "smoothstep";
case BuiltinType::kSmoothStep:
return "smoothStep";
case BuiltinType::kSqrt:

View File

@ -99,6 +99,7 @@ enum class BuiltinType {
kSign,
kSin,
kSinh,
kSmoothstep,
kSmoothStep,
kSqrt,
kStep,

View File

@ -1602,6 +1602,7 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
return "packUnorm4x8";
case sem::BuiltinType::kReverseBits:
return "bitfieldReverse";
case sem::BuiltinType::kSmoothstep:
case sem::BuiltinType::kSmoothStep:
return "smoothstep";
case sem::BuiltinType::kUnpack2x16float:

View File

@ -111,6 +111,7 @@ const ast::CallExpression* GenerateCall(BuiltinType builtin,
case BuiltinType::kFma:
case BuiltinType::kMix:
case BuiltinType::kFaceForward:
case BuiltinType::kSmoothstep:
case BuiltinType::kSmoothStep:
return builder->Call(str.str(), "f2", "f2", "f2");
case BuiltinType::kAll:
@ -233,6 +234,7 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{BuiltinType::kSign, ParamType::kF32, "sign"},
BuiltinData{BuiltinType::kSin, ParamType::kF32, "sin"},
BuiltinData{BuiltinType::kSinh, ParamType::kF32, "sinh"},
BuiltinData{BuiltinType::kSmoothstep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSmoothStep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSqrt, ParamType::kF32, "sqrt"},
BuiltinData{BuiltinType::kStep, ParamType::kF32, "step"},

View File

@ -2547,6 +2547,7 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
return "lerp";
case sem::BuiltinType::kReverseBits:
return "reversebits";
case sem::BuiltinType::kSmoothstep:
case sem::BuiltinType::kSmoothStep:
return "smoothstep";
default:

View File

@ -111,6 +111,7 @@ const ast::CallExpression* GenerateCall(BuiltinType builtin,
case BuiltinType::kFma:
case BuiltinType::kMix:
case BuiltinType::kFaceForward:
case BuiltinType::kSmoothstep:
case BuiltinType::kSmoothStep:
return builder->Call(str.str(), "f2", "f2", "f2");
case BuiltinType::kAll:
@ -232,6 +233,7 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{BuiltinType::kSign, ParamType::kF32, "sign"},
BuiltinData{BuiltinType::kSin, ParamType::kF32, "sin"},
BuiltinData{BuiltinType::kSinh, ParamType::kF32, "sinh"},
BuiltinData{BuiltinType::kSmoothstep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSmoothStep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSqrt, ParamType::kF32, "sqrt"},
BuiltinData{BuiltinType::kStep, ParamType::kF32, "step"},

View File

@ -1423,6 +1423,7 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
case sem::BuiltinType::kRound:
out += "rint";
break;
case sem::BuiltinType::kSmoothstep:
case sem::BuiltinType::kSmoothStep:
out += "smoothstep";
break;

View File

@ -109,6 +109,7 @@ const ast::CallExpression* GenerateCall(BuiltinType builtin,
case BuiltinType::kFma:
case BuiltinType::kMix:
case BuiltinType::kFaceForward:
case BuiltinType::kSmoothstep:
case BuiltinType::kSmoothStep:
return builder->Call(str.str(), "f2", "f2", "f2");
case BuiltinType::kAll:
@ -264,6 +265,7 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{BuiltinType::kSign, ParamType::kF32, "sign"},
BuiltinData{BuiltinType::kSin, ParamType::kF32, "sin"},
BuiltinData{BuiltinType::kSinh, ParamType::kF32, "sinh"},
BuiltinData{BuiltinType::kSmoothstep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSmoothStep, ParamType::kF32, "smoothstep"},
BuiltinData{BuiltinType::kSqrt, ParamType::kF32, "sqrt"},
BuiltinData{BuiltinType::kStep, ParamType::kF32, "step"},

View File

@ -216,6 +216,7 @@ uint32_t builtin_to_glsl_method(const sem::Builtin* builtin) {
return GLSLstd450Sin;
case BuiltinType::kSinh:
return GLSLstd450Sinh;
case BuiltinType::kSmoothstep:
case BuiltinType::kSmoothStep:
return GLSLstd450SmoothStep;
case BuiltinType::kSqrt:

View File

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

View File

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

View File

@ -0,0 +1,30 @@
void smoothstep_392c19() {
float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
smoothstep_392c19();
return float4(0.0f, 0.0f, 0.0f, 0.0f);
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
smoothstep_392c19();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
smoothstep_392c19();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void smoothstep_392c19() {
float2 res = smoothstep(float2(), float2(), float2());
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
smoothstep_392c19();
return float4();
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
smoothstep_392c19();
return;
}
kernel void compute_main() {
smoothstep_392c19();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %smoothstep_392c19 "smoothstep_392c19"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%smoothstep_392c19 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %16
%13 = OpExtInst %v2float %15 SmoothStep %16 %16 %16
OpStore %res %13
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %smoothstep_392c19
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %smoothstep_392c19
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %smoothstep_392c19
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

@ -0,0 +1,30 @@
void smoothstep_40864c() {
float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
smoothstep_40864c();
return float4(0.0f, 0.0f, 0.0f, 0.0f);
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
smoothstep_40864c();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
smoothstep_40864c();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void smoothstep_40864c() {
float4 res = smoothstep(float4(), float4(), float4());
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
smoothstep_40864c();
return float4();
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
smoothstep_40864c();
return;
}
kernel void compute_main() {
smoothstep_40864c();
return;
}

View File

@ -0,0 +1,65 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %smoothstep_40864c "smoothstep_40864c"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%smoothstep_40864c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
%13 = OpExtInst %v4float %14 SmoothStep %5 %5 %5
OpStore %res %13
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %17
%19 = OpLabel
%20 = OpFunctionCall %void %smoothstep_40864c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%22 = OpLabel
%23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %23
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %void %smoothstep_40864c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %smoothstep_40864c
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
^^^^^^^^^^
#version 310 es
void smoothStep_5f615b() {

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
^^^^^^^^^^
void smoothStep_5f615b() {
float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/5f615b.wgsl:28:24 warning: use of deprecated builtin
var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
^^^^^^^^^^
fn smoothStep_5f615b() {
var res : vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
^^^^^^^^^^
#version 310 es
void smoothStep_658be3() {

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
^^^^^^^^^^
void smoothStep_658be3() {
float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/658be3.wgsl:28:24 warning: use of deprecated builtin
var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
^^^^^^^^^^
fn smoothStep_658be3() {
var res : vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
}

View File

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

View File

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

View File

@ -0,0 +1,30 @@
void smoothstep_6c4975() {
float res = smoothstep(1.0f, 1.0f, 1.0f);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
smoothstep_6c4975();
return float4(0.0f, 0.0f, 0.0f, 0.0f);
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
smoothstep_6c4975();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
smoothstep_6c4975();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void smoothstep_6c4975() {
float res = smoothstep(1.0f, 1.0f, 1.0f);
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
smoothstep_6c4975();
return float4();
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
smoothstep_6c4975();
return;
}
kernel void compute_main() {
smoothstep_6c4975();
return;
}

View File

@ -0,0 +1,65 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %smoothstep_6c4975 "smoothstep_6c4975"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %v4float
%smoothstep_6c4975 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
%13 = OpExtInst %float %14 SmoothStep %float_1 %float_1 %float_1
OpStore %res %13
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %18
%20 = OpLabel
%21 = OpFunctionCall %void %smoothstep_6c4975
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%23 = OpLabel
%24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %void %smoothstep_6c4975
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %smoothstep_6c4975
OpReturn
OpFunctionEnd

View File

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

View File

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

View File

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

View File

@ -0,0 +1,30 @@
void smoothstep_aad1db() {
float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
smoothstep_aad1db();
return float4(0.0f, 0.0f, 0.0f, 0.0f);
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
smoothstep_aad1db();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
smoothstep_aad1db();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void smoothstep_aad1db() {
float3 res = smoothstep(float3(), float3(), float3());
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
smoothstep_aad1db();
return float4();
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
smoothstep_aad1db();
return;
}
kernel void compute_main() {
smoothstep_aad1db();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %smoothstep_aad1db "smoothstep_aad1db"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
%19 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%smoothstep_aad1db = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %16
%13 = OpExtInst %v3float %15 SmoothStep %16 %16 %16
OpStore %res %13
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %19
%21 = OpLabel
%22 = OpFunctionCall %void %smoothstep_aad1db
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%24 = OpLabel
%25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %smoothstep_aad1db
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %smoothstep_aad1db
OpReturn
OpFunctionEnd

View File

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

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
^^^^^^^^^^
#version 310 es
void smoothStep_c11eef() {

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
^^^^^^^^^^
void smoothStep_c11eef() {
float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/c11eef.wgsl:28:24 warning: use of deprecated builtin
var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
^^^^^^^^^^
fn smoothStep_c11eef() {
var res : vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
var res: f32 = smoothStep(1.0, 1.0, 1.0);
^^^^^^^^^^
#version 310 es
void smoothStep_cb0bfb() {

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
var res: f32 = smoothStep(1.0, 1.0, 1.0);
^^^^^^^^^^
void smoothStep_cb0bfb() {
float res = smoothstep(1.0f, 1.0f, 1.0f);
}

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
var res: f32 = smoothStep(1.0, 1.0, 1.0);
^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
var res: f32 = smoothStep(1.0, 1.0, 1.0);
^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@ -1,3 +1,7 @@
builtins/gen/smoothstep/cb0bfb.wgsl:28:18 warning: use of deprecated builtin
var res: f32 = smoothStep(1.0, 1.0, 1.0);
^^^^^^^^^^
fn smoothStep_cb0bfb() {
var res : f32 = smoothStep(1.0, 1.0, 1.0);
}