Add const-eval for `smoothstep`
This CL adds const-eval for `smoothstep`. Bug: tint:1581 Change-Id: I78aa5c4a39882f29ff78e37313e6c44708719095 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110176 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
19e5042ade
commit
32c28cbc90
|
@ -535,8 +535,8 @@ fn refract<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
|
|||
@const fn sin<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn sinh<T: fa_f32_f16>(T) -> T
|
||||
@const fn sinh<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
fn smoothstep<T: f32_f16>(T, T, T) -> T
|
||||
fn smoothstep<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||
@const fn smoothstep<T: fa_f32_f16>(@test_value(2) T, @test_value(4) T, @test_value(3) T) -> T
|
||||
@const fn smoothstep<N: num, T: fa_f32_f16>(@test_value(2) vec<N, T>, @test_value(4) vec<N, T>, @test_value(3) vec<N, T>) -> vec<N, T>
|
||||
@const fn sqrt<T: fa_f32_f16>(T) -> T
|
||||
@const fn sqrt<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn step<T: fa_f32_f16>(T, T) -> T
|
||||
|
|
|
@ -733,6 +733,41 @@ utils::Result<NumberT> ConstEval::Mul(NumberT a, NumberT b) {
|
|||
return result;
|
||||
}
|
||||
|
||||
template <typename NumberT>
|
||||
utils::Result<NumberT> ConstEval::Div(NumberT a, NumberT b) {
|
||||
NumberT result;
|
||||
if constexpr (IsAbstract<NumberT>) {
|
||||
// Check for over/underflow for abstract values
|
||||
if (auto r = CheckedDiv(a, b)) {
|
||||
result = r->value;
|
||||
} else {
|
||||
AddError(OverflowErrorMessage(a, "/", b), *current_source);
|
||||
return utils::Failure;
|
||||
}
|
||||
} else {
|
||||
using T = UnwrapNumber<NumberT>;
|
||||
auto divide_values = [](T lhs, T rhs) {
|
||||
if constexpr (std::is_integral_v<T>) {
|
||||
// For integers, lhs / 0 returns lhs
|
||||
if (rhs == 0) {
|
||||
return lhs;
|
||||
}
|
||||
|
||||
if constexpr (std::is_signed_v<T>) {
|
||||
// For signed integers, for lhs / -1, return lhs if lhs is the
|
||||
// most negative value
|
||||
if (rhs == -1 && lhs == std::numeric_limits<T>::min()) {
|
||||
return lhs;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lhs / rhs;
|
||||
};
|
||||
result = divide_values(a.value, b.value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename NumberT>
|
||||
utils::Result<NumberT> ConstEval::Dot2(NumberT a1, NumberT a2, NumberT b1, NumberT b2) {
|
||||
auto r1 = Mul(a1, b1);
|
||||
|
@ -878,6 +913,15 @@ auto ConstEval::MulFunc(const sem::Type* elem_ty) {
|
|||
};
|
||||
}
|
||||
|
||||
auto ConstEval::DivFunc(const sem::Type* elem_ty) {
|
||||
return [=](auto a1, auto a2) -> ImplResult {
|
||||
if (auto r = Div(a1, a2)) {
|
||||
return CreateElement(builder, elem_ty, r.Get());
|
||||
}
|
||||
return utils::Failure;
|
||||
};
|
||||
}
|
||||
|
||||
auto ConstEval::Dot2Func(const sem::Type* elem_ty) {
|
||||
return [=](auto a1, auto a2, auto b1, auto b2) -> ImplResult {
|
||||
if (auto r = Dot2(a1, a2, b1, b2)) {
|
||||
|
@ -1366,42 +1410,9 @@ ConstEval::Result ConstEval::OpMultiplyMatMat(const sem::Type* ty,
|
|||
ConstEval::Result ConstEval::OpDivide(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
TINT_SCOPED_ASSIGNMENT(current_source, &source);
|
||||
auto transform = [&](const sem::Constant* c0, const sem::Constant* c1) {
|
||||
auto create = [&](auto i, auto j) -> ImplResult {
|
||||
using NumberT = decltype(i);
|
||||
NumberT result;
|
||||
if constexpr (IsAbstract<NumberT>) {
|
||||
// Check for over/underflow for abstract values
|
||||
if (auto r = CheckedDiv(i, j)) {
|
||||
result = r->value;
|
||||
} else {
|
||||
AddError(OverflowErrorMessage(i, "/", j), source);
|
||||
return utils::Failure;
|
||||
}
|
||||
} else {
|
||||
using T = UnwrapNumber<NumberT>;
|
||||
auto divide_values = [](T lhs, T rhs) {
|
||||
if constexpr (std::is_integral_v<T>) {
|
||||
// For integers, lhs / 0 returns lhs
|
||||
if (rhs == 0) {
|
||||
return lhs;
|
||||
}
|
||||
|
||||
if constexpr (std::is_signed_v<T>) {
|
||||
// For signed integers, for lhs / -1, return lhs if lhs is the
|
||||
// most negative value
|
||||
if (rhs == -1 && lhs == std::numeric_limits<T>::min()) {
|
||||
return lhs;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lhs / rhs;
|
||||
};
|
||||
result = divide_values(i.value, j.value);
|
||||
}
|
||||
return CreateElement(builder, c0->Type(), result);
|
||||
};
|
||||
return Dispatch_fia_fiu32_f16(create, c0, c1);
|
||||
return Dispatch_fia_fiu32_f16(DivFunc(c0->Type()), c0, c1);
|
||||
};
|
||||
|
||||
return TransformBinaryElements(builder, ty, transform, args[0], args[1]);
|
||||
|
@ -2397,6 +2408,59 @@ ConstEval::Result ConstEval::sinh(const sem::Type* ty,
|
|||
return TransformElements(builder, ty, transform, args[0]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::smoothstep(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
TINT_SCOPED_ASSIGNMENT(current_source, &source);
|
||||
|
||||
auto transform = [&](const sem::Constant* c0, const sem::Constant* c1,
|
||||
const sem::Constant* c2) {
|
||||
auto create = [&](auto low, auto high, auto x) -> ImplResult {
|
||||
using NumberT = decltype(low);
|
||||
|
||||
auto err = [&] {
|
||||
AddNote("when calculating smoothstep", source);
|
||||
return utils::Failure;
|
||||
};
|
||||
|
||||
// t = clamp((x - low) / (high - low), 0.0, 1.0)
|
||||
auto x_minus_low = Sub(x, low);
|
||||
auto high_minus_low = Sub(high, low);
|
||||
if (!x_minus_low || !high_minus_low) {
|
||||
return err();
|
||||
}
|
||||
|
||||
auto div = Div(x_minus_low.Get(), high_minus_low.Get());
|
||||
if (!div) {
|
||||
return err();
|
||||
}
|
||||
|
||||
auto clamp = Clamp(div.Get(), NumberT(0), NumberT(1));
|
||||
auto t = clamp.Get();
|
||||
|
||||
// result = t * t * (3.0 - 2.0 * t)
|
||||
auto t_times_t = Mul(t, t);
|
||||
auto t_times_2 = Mul(NumberT(2), t);
|
||||
if (!t_times_t || !t_times_2) {
|
||||
return err();
|
||||
}
|
||||
|
||||
auto three_minus_t_times_2 = Sub(NumberT(3), t_times_2.Get());
|
||||
if (!three_minus_t_times_2) {
|
||||
return err();
|
||||
}
|
||||
|
||||
auto result = Mul(t_times_t.Get(), three_minus_t_times_2.Get());
|
||||
if (!result) {
|
||||
return err();
|
||||
}
|
||||
return CreateElement(builder, c0->Type(), result.Get());
|
||||
};
|
||||
return Dispatch_fa_f32_f16(create, c0, c1, c2);
|
||||
};
|
||||
return TransformElements(builder, ty, transform, args[0], args[1], args[2]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::step(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source&) {
|
||||
|
@ -2587,4 +2651,8 @@ void ConstEval::AddWarning(const std::string& msg, const Source& source) const {
|
|||
builder.Diagnostics().add_warning(diag::System::Resolver, msg, source);
|
||||
}
|
||||
|
||||
void ConstEval::AddNote(const std::string& msg, const Source& source) const {
|
||||
builder.Diagnostics().add_note(diag::System::Resolver, msg, source);
|
||||
}
|
||||
|
||||
} // namespace tint::resolver
|
||||
|
|
|
@ -719,6 +719,15 @@ class ConstEval {
|
|||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// smoothstep 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 smoothstep(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// step builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
|
@ -825,6 +834,9 @@ class ConstEval {
|
|||
/// Adds the given warning message to the diagnostics
|
||||
void AddWarning(const std::string& msg, const Source& source) const;
|
||||
|
||||
/// Adds the given note message to the diagnostics
|
||||
void AddNote(const std::string& msg, const Source& source) const;
|
||||
|
||||
/// Adds two Number<T>s
|
||||
/// @param a the lhs number
|
||||
/// @param b the rhs number
|
||||
|
@ -846,6 +858,13 @@ class ConstEval {
|
|||
template <typename NumberT>
|
||||
utils::Result<NumberT> Mul(NumberT a, NumberT b);
|
||||
|
||||
/// Divides two Number<T>s
|
||||
/// @param a the lhs number
|
||||
/// @param b the rhs number
|
||||
/// @returns the result number on success, or logs an error and returns Failure
|
||||
template <typename NumberT>
|
||||
utils::Result<NumberT> Div(NumberT a, NumberT b);
|
||||
|
||||
/// Returns the dot product of (a1,a2) with (b1,b2)
|
||||
/// @param a1 component 1 of lhs vector
|
||||
/// @param a2 component 2 of lhs vector
|
||||
|
@ -925,6 +944,12 @@ class ConstEval {
|
|||
/// @returns the callable function
|
||||
auto MulFunc(const sem::Type* elem_ty);
|
||||
|
||||
/// Returns a callable that calls Div, and creates a Constant with its result of type `elem_ty`
|
||||
/// if successful, or returns Failure otherwise.
|
||||
/// @param elem_ty the element type of the Constant to create on success
|
||||
/// @returns the callable function
|
||||
auto DivFunc(const sem::Type* elem_ty);
|
||||
|
||||
/// Returns a callable that calls Dot2, and creates a Constant with its result of type `elem_ty`
|
||||
/// if successful, or returns Failure otherwise.
|
||||
/// @param elem_ty the element type of the Constant to create on success
|
||||
|
|
|
@ -1648,6 +1648,90 @@ INSTANTIATE_TEST_SUITE_P( //
|
|||
SinhCases<f32>(),
|
||||
SinhCases<f16>()))));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> SmoothstepCases() {
|
||||
return {
|
||||
// t == 0
|
||||
C({T(4), T(6), T(2)}, T(0)),
|
||||
// t == 1
|
||||
C({T(4), T(6), T(8)}, T(1)),
|
||||
// t == .5
|
||||
C({T(4), T(6), T(5)}, T(.5)),
|
||||
|
||||
// Vector tests
|
||||
C({Vec(T(4), T(4)), Vec(T(6), T(6)), Vec(T(2), T(8))}, Vec(T(0), T(1))),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Smoothstep,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kSmoothstep),
|
||||
testing::ValuesIn(Concat(SmoothstepCases<AFloat>(), //
|
||||
SmoothstepCases<f32>(),
|
||||
SmoothstepCases<f16>()))));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> SmoothstepAFloatErrorCases() {
|
||||
auto error_msg = [](auto a, const char* op, auto b) {
|
||||
return "12:34 error: " + OverflowErrorMessage(a, op, b) + R"(
|
||||
12:34 note: when calculating smoothstep)";
|
||||
};
|
||||
|
||||
return {// `x - low` underflows
|
||||
E({T::Highest(), T(1), T::Lowest()}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// `high - low` underflows
|
||||
E({T::Highest(), T::Lowest(), T(0)}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// Divid by zero on `(x - low) / (high - low)`
|
||||
E({T(0), T(0), T(0)}, error_msg(T(0), "/", T(0)))};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
SmoothstepAFloatError,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kSmoothstep),
|
||||
testing::ValuesIn(SmoothstepAFloatErrorCases<AFloat>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> SmoothstepF16ErrorCases() {
|
||||
auto error_msg = [](auto a, const char* op, auto b) {
|
||||
return "12:34 error: " + OverflowErrorMessage(a, op, b) + R"(
|
||||
12:34 note: when calculating smoothstep)";
|
||||
};
|
||||
|
||||
return {// `x - low` underflows
|
||||
E({T::Highest(), T(1), T::Lowest()}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// `high - low` underflows
|
||||
E({T::Highest(), T::Lowest(), T(0)}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// Divid by zero on `(x - low) / (high - low)`
|
||||
E({T(0), T(0), T(0)}, error_msg(T(0), "/", T(0)))};
|
||||
}
|
||||
// TODO(crbug.com/tint/1581): Enable when non-abstract math is checked.
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
DISABLED_SmoothstepF16Error,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kSmoothstep),
|
||||
testing::ValuesIn(SmoothstepF16ErrorCases<f16>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> SmoothstepF32ErrorCases() {
|
||||
auto error_msg = [](auto a, const char* op, auto b) {
|
||||
return "12:34 error: " + OverflowErrorMessage(a, op, b) + R"(
|
||||
12:34 note: when calculating smoothstep)";
|
||||
};
|
||||
|
||||
return {// `x - low` underflows
|
||||
E({T::Highest(), T(1), T::Lowest()}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// `high - low` underflows
|
||||
E({T::Highest(), T::Lowest(), T(0)}, error_msg(T::Lowest(), "-", T::Highest())),
|
||||
// Divid by zero on `(x - low) / (high - low)`
|
||||
E({T(0), T(0), T(0)}, error_msg(T(0), "/", T(0)))};
|
||||
}
|
||||
// TODO(crbug.com/tint/1581): Enable when non-abstract math is checked.
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
DISABLED_SmoothstepF32Error,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kSmoothstep),
|
||||
testing::ValuesIn(SmoothstepF32ErrorCases<f32>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> StepCases() {
|
||||
return {
|
||||
|
|
|
@ -13113,24 +13113,24 @@ constexpr OverloadInfo kOverloads[] = {
|
|||
/* num parameters */ 3,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 0,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[10],
|
||||
/* parameters */ &kParameters[489],
|
||||
/* return matcher indices */ &kMatcherIndices[3],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::smoothstep,
|
||||
},
|
||||
{
|
||||
/* [399] */
|
||||
/* num parameters */ 3,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[4],
|
||||
/* parameters */ &kParameters[492],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::smoothstep,
|
||||
},
|
||||
{
|
||||
/* [400] */
|
||||
|
@ -14504,8 +14504,8 @@ constexpr IntrinsicInfo kBuiltins[] = {
|
|||
},
|
||||
{
|
||||
/* [72] */
|
||||
/* fn smoothstep<T : f32_f16>(T, T, T) -> T */
|
||||
/* fn smoothstep<N : num, T : f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
|
||||
/* fn smoothstep<T : fa_f32_f16>(@test_value(2) T, @test_value(4) T, @test_value(3) T) -> T */
|
||||
/* fn smoothstep<N : num, T : fa_f32_f16>(@test_value(2) vec<N, T>, @test_value(4) vec<N, T>, @test_value(3) vec<N, T>) -> vec<N, T> */
|
||||
/* num overloads */ 2,
|
||||
/* overloads */ &kOverloads[398],
|
||||
},
|
||||
|
|
|
@ -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 smoothstep(vec<2, fa>, vec<2, fa>, vec<2, fa>) -> vec<2, fa>
|
||||
fn smoothstep_0c481b() {
|
||||
var res = smoothstep(vec2(2.), vec2(4.), vec2(3.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c481b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c481b() {
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c481b() {
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_0c481b();
|
||||
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 smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_0c481b() {
|
||||
float2 res = float2(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %smoothstep_0c481b "smoothstep_0c481b"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%15 = OpConstantComposite %v2float %float_0_5 %float_0_5
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_0c481b = 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 %smoothstep_0c481b
|
||||
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_0c481b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_0c481b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn smoothstep_0c481b() {
|
||||
var res = smoothstep(vec2(2.0), vec2(4.0), vec2(3.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c481b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
|
@ -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 smoothstep(vec<4, fa>, vec<4, fa>, vec<4, fa>) -> vec<4, fa>
|
||||
fn smoothstep_0c4ffc() {
|
||||
var res = smoothstep(vec4(2.), vec4(4.), vec4(3.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c4ffc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c4ffc() {
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c4ffc() {
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_0c4ffc();
|
||||
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 smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_0c4ffc() {
|
||||
float4 res = float4(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %smoothstep_0c4ffc "smoothstep_0c4ffc"
|
||||
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_0_5 = OpConstant %float 0.5
|
||||
%14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_0c4ffc = 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 %smoothstep_0c4ffc
|
||||
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_0c4ffc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_0c4ffc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn smoothstep_0c4ffc() {
|
||||
var res = smoothstep(vec4(2.0), vec4(4.0), vec4(3.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c4ffc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn smoothstep(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
|
||||
fn smoothstep_12c031() {
|
||||
var res: vec2<f16> = smoothstep(vec2<f16>(1.h), vec2<f16>(1.h), vec2<f16>(1.h));
|
||||
var res: vec2<f16> = smoothstep(vec2<f16>(2.h), vec2<f16>(4.h), vec2<f16>(3.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_12c031() {
|
||||
vector<float16_t, 2> res = smoothstep((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
|
||||
vector<float16_t, 2> res = (float16_t(0.5h)).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_12c031() {
|
||||
f16vec2 res = smoothstep(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.5hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_12c031() {
|
||||
f16vec2 res = smoothstep(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.5hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_12c031() {
|
||||
f16vec2 res = smoothstep(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.5hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_12c031() {
|
||||
half2 res = smoothstep(half2(1.0h), half2(1.0h), half2(1.0h));
|
||||
half2 res = half2(0.5h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,37 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v2half = OpTypeVector %half 2
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
|
||||
%half_0x1pn1 = OpConstant %half 0x1p-1
|
||||
%16 = OpConstantComposite %v2half %half_0x1pn1 %half_0x1pn1
|
||||
%_ptr_Function_v2half = OpTypePointer Function %v2half
|
||||
%21 = OpConstantNull %v2half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v2half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_12c031 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2half Function %21
|
||||
%13 = OpExtInst %v2half %16 SmoothStep %18 %18 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %smoothstep_12c031
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %smoothstep_12c031
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_12c031
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_12c031
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %smoothstep_12c031
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_12c031
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn smoothstep_12c031() {
|
||||
var res : vec2<f16> = smoothstep(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<f16>(1.0h));
|
||||
var res : vec2<f16> = smoothstep(vec2<f16>(2.0h), vec2<f16>(4.0h), vec2<f16>(3.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn smoothstep(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
|
||||
fn smoothstep_392c19() {
|
||||
var res: vec2<f32> = smoothstep(vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
|
||||
var res: vec2<f32> = smoothstep(vec2<f32>(2.f), vec2<f32>(4.f), vec2<f32>(3.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_392c19() {
|
||||
float2 res = smoothstep((1.0f).xx, (1.0f).xx, (1.0f).xx);
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_392c19() {
|
||||
float2 res = smoothstep((1.0f).xx, (1.0f).xx, (1.0f).xx);
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_392c19() {
|
||||
vec2 res = smoothstep(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_392c19() {
|
||||
vec2 res = smoothstep(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_392c19() {
|
||||
vec2 res = smoothstep(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_392c19() {
|
||||
float2 res = smoothstep(float2(1.0f), float2(1.0f), float2(1.0f));
|
||||
float2 res = float2(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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"
|
||||
|
@ -32,37 +31,37 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%15 = OpConstantComposite %v2float %float_0_5 %float_0_5
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%20 = OpConstantNull %v2float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_392c19 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%13 = OpExtInst %v2float %15 SmoothStep %17 %17 %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %smoothstep_392c19
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %smoothstep_392c19
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %27
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_392c19
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %smoothstep_392c19
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_392c19
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_392c19
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn smoothstep_392c19() {
|
||||
var res : vec2<f32> = smoothstep(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
|
||||
var res : vec2<f32> = smoothstep(vec2<f32>(2.0f), vec2<f32>(4.0f), vec2<f32>(3.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn smoothstep(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
|
||||
fn smoothstep_40864c() {
|
||||
var res: vec4<f32> = smoothstep(vec4<f32>(1.f), vec4<f32>(1.f), vec4<f32>(1.f));
|
||||
var res: vec4<f32> = smoothstep(vec4<f32>(2.f), vec4<f32>(4.f), vec4<f32>(3.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_40864c() {
|
||||
float4 res = smoothstep((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_40864c() {
|
||||
float4 res = smoothstep((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_40864c() {
|
||||
vec4 res = smoothstep(vec4(1.0f), vec4(1.0f), vec4(1.0f));
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_40864c() {
|
||||
vec4 res = smoothstep(vec4(1.0f), vec4(1.0f), vec4(1.0f));
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_40864c() {
|
||||
vec4 res = smoothstep(vec4(1.0f), vec4(1.0f), vec4(1.0f));
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_40864c() {
|
||||
float4 res = smoothstep(float4(1.0f), float4(1.0f), float4(1.0f));
|
||||
float4 res = float4(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 32
|
||||
; 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"
|
||||
|
@ -31,36 +30,36 @@
|
|||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%19 = OpTypeFunction %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 %16 %16 %16
|
||||
OpStore %res %13
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %smoothstep_40864c
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %smoothstep_40864c
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %smoothstep_40864c
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %smoothstep_40864c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %smoothstep_40864c
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_40864c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn smoothstep_40864c() {
|
||||
var res : vec4<f32> = smoothstep(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<f32>(1.0f));
|
||||
var res : vec4<f32> = smoothstep(vec4<f32>(2.0f), vec4<f32>(4.0f), vec4<f32>(3.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn smoothstep(f16, f16, f16) -> f16
|
||||
fn smoothstep_586e12() {
|
||||
var res: f16 = smoothstep(1.h, 1.h, 1.h);
|
||||
var res: f16 = smoothstep(2.h, 4.h, 3.h);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_586e12() {
|
||||
float16_t res = smoothstep(float16_t(1.0h), float16_t(1.0h), float16_t(1.0h));
|
||||
float16_t res = float16_t(0.5h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_586e12() {
|
||||
float16_t res = smoothstep(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 0.5hf;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_586e12() {
|
||||
float16_t res = smoothstep(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 0.5hf;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_586e12() {
|
||||
float16_t res = smoothstep(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 0.5hf;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_586e12() {
|
||||
half res = smoothstep(1.0h, 1.0h, 1.0h);
|
||||
half res = 0.5h;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -36,37 +35,36 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%half_0x1pn1 = OpConstant %half 0x1p-1
|
||||
%_ptr_Function_half = OpTypePointer Function %half
|
||||
%19 = OpConstantNull %half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%17 = OpConstantNull %half
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_586e12 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_half Function %19
|
||||
%13 = OpExtInst %half %15 SmoothStep %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_half Function %17
|
||||
OpStore %res %half_0x1pn1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %smoothstep_586e12
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %smoothstep_586e12
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_586e12
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %smoothstep_586e12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_586e12
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %smoothstep_586e12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn smoothstep_586e12() {
|
||||
var res : f16 = smoothstep(1.0h, 1.0h, 1.0h);
|
||||
var res : f16 = smoothstep(2.0h, 4.0h, 3.0h);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -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 smoothstep(vec<3, fa>, vec<3, fa>, vec<3, fa>) -> vec<3, fa>
|
||||
fn smoothstep_66e4bd() {
|
||||
var res = smoothstep(vec3(2.), vec3(4.), vec3(3.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_66e4bd();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_66e4bd() {
|
||||
float3 res = (0.5f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_66e4bd();
|
||||
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() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_66e4bd() {
|
||||
float3 res = (0.5f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_66e4bd();
|
||||
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() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_66e4bd() {
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_66e4bd();
|
||||
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 smoothstep_66e4bd() {
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_66e4bd() {
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_66e4bd() {
|
||||
float3 res = float3(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_66e4bd();
|
||||
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() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %smoothstep_66e4bd "smoothstep_66e4bd"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%15 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_66e4bd = 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 %smoothstep_66e4bd
|
||||
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_66e4bd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_66e4bd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn smoothstep_66e4bd() {
|
||||
var res = smoothstep(vec3(2.0), vec3(4.0), vec3(3.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_66e4bd();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_66e4bd();
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn smoothstep(f32, f32, f32) -> f32
|
||||
fn smoothstep_6c4975() {
|
||||
var res: f32 = smoothstep(1.f, 1.f, 1.f);
|
||||
var res: f32 = smoothstep(2.f, 4.f, 3.f);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_6c4975() {
|
||||
float res = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -31,35 +30,35 @@
|
|||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%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
|
||||
OpStore %res %float_0_5
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %smoothstep_6c4975
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %smoothstep_6c4975
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %22
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %smoothstep_6c4975
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %smoothstep_6c4975
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_6c4975
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %smoothstep_6c4975
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn smoothstep_6c4975() {
|
||||
var res : f32 = smoothstep(1.0f, 1.0f, 1.0f);
|
||||
var res : f32 = smoothstep(2.0f, 4.0f, 3.0f);
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn smoothstep(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
|
||||
fn smoothstep_6e7a74() {
|
||||
var res: vec3<f16> = smoothstep(vec3<f16>(1.h), vec3<f16>(1.h), vec3<f16>(1.h));
|
||||
var res: vec3<f16> = smoothstep(vec3<f16>(2.h), vec3<f16>(4.h), vec3<f16>(3.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_6e7a74() {
|
||||
vector<float16_t, 3> res = smoothstep((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(0.5h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_6e7a74() {
|
||||
f16vec3 res = smoothstep(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.5hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_6e7a74() {
|
||||
f16vec3 res = smoothstep(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.5hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_6e7a74() {
|
||||
f16vec3 res = smoothstep(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.5hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_6e7a74() {
|
||||
half3 res = smoothstep(half3(1.0h), half3(1.0h), half3(1.0h));
|
||||
half3 res = half3(0.5h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,37 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%half_0x1pn1 = OpConstant %half 0x1p-1
|
||||
%16 = OpConstantComposite %v3half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%21 = OpConstantNull %v3half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v3half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_6e7a74 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%13 = OpExtInst %v3half %16 SmoothStep %18 %18 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_6e7a74
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn smoothstep_6e7a74() {
|
||||
var res : vec3<f16> = smoothstep(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<f16>(1.0h));
|
||||
var res : vec3<f16> = smoothstep(vec3<f16>(2.0h), vec3<f16>(4.0h), vec3<f16>(3.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -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 smoothstep(fa, fa, fa) -> fa
|
||||
fn smoothstep_a80fff() {
|
||||
var res = smoothstep(2., 4., 3.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_a80fff();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_a80fff();
|
||||
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() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_a80fff();
|
||||
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() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_a80fff();
|
||||
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 smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_a80fff() {
|
||||
float res = 0.5f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_a80fff();
|
||||
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() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_a80fff();
|
||||
return;
|
||||
}
|
||||
|
|
@ -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 %smoothstep_a80fff "smoothstep_a80fff"
|
||||
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_0_5 = OpConstant %float 0.5
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_a80fff = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %float_0_5
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %smoothstep_a80fff
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %22
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %smoothstep_a80fff
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %smoothstep_a80fff
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn smoothstep_a80fff() {
|
||||
var res = smoothstep(2.0, 4.0, 3.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_a80fff();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_a80fff();
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
// fn smoothstep(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
|
||||
fn smoothstep_aad1db() {
|
||||
var res: vec3<f32> = smoothstep(vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
|
||||
var res: vec3<f32> = smoothstep(vec3<f32>(2.f), vec3<f32>(4.f), vec3<f32>(3.f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_aad1db() {
|
||||
float3 res = smoothstep((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
|
||||
float3 res = (0.5f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_aad1db() {
|
||||
float3 res = smoothstep((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
|
||||
float3 res = (0.5f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_aad1db() {
|
||||
vec3 res = smoothstep(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_aad1db() {
|
||||
vec3 res = smoothstep(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_aad1db() {
|
||||
vec3 res = smoothstep(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_aad1db() {
|
||||
float3 res = smoothstep(float3(1.0f), float3(1.0f), float3(1.0f));
|
||||
float3 res = float3(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; 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"
|
||||
|
@ -32,37 +31,37 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%15 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%20 = OpConstantNull %v3float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_aad1db = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%13 = OpExtInst %v3float %15 SmoothStep %17 %17 %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %smoothstep_aad1db
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %smoothstep_aad1db
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %27
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_aad1db
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %smoothstep_aad1db
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_aad1db
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_aad1db
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fn smoothstep_aad1db() {
|
||||
var res : vec3<f32> = smoothstep(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
|
||||
var res : vec3<f32> = smoothstep(vec3<f32>(2.0f), vec3<f32>(4.0f), vec3<f32>(3.0f));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -25,7 +25,7 @@ enable f16;
|
|||
|
||||
// fn smoothstep(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
|
||||
fn smoothstep_c43ebd() {
|
||||
var res: vec4<f16> = smoothstep(vec4<f16>(1.h), vec4<f16>(1.h), vec4<f16>(1.h));
|
||||
var res: vec4<f16> = smoothstep(vec4<f16>(2.h), vec4<f16>(4.h), vec4<f16>(3.h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void smoothstep_c43ebd() {
|
||||
vector<float16_t, 4> res = smoothstep((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
|
||||
vector<float16_t, 4> res = (float16_t(0.5h)).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_c43ebd() {
|
||||
f16vec4 res = smoothstep(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.5hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void smoothstep_c43ebd() {
|
||||
f16vec4 res = smoothstep(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.5hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void smoothstep_c43ebd() {
|
||||
f16vec4 res = smoothstep(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.5hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void smoothstep_c43ebd() {
|
||||
half4 res = smoothstep(half4(1.0h), half4(1.0h), half4(1.0h));
|
||||
half4 res = half4(0.5h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,37 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v4half = OpTypeVector %half 4
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%half_0x1pn1 = OpConstant %half 0x1p-1
|
||||
%16 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
|
||||
%_ptr_Function_v4half = OpTypePointer Function %v4half
|
||||
%21 = OpConstantNull %v4half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v4half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_c43ebd = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4half Function %21
|
||||
%13 = OpExtInst %v4half %16 SmoothStep %18 %18 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v4half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %smoothstep_c43ebd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enable f16;
|
||||
|
||||
fn smoothstep_c43ebd() {
|
||||
var res : vec4<f16> = smoothstep(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<f16>(1.0h));
|
||||
var res : vec4<f16> = smoothstep(vec4<f16>(2.0h), vec4<f16>(4.0h), vec4<f16>(3.0h));
|
||||
}
|
||||
|
||||
@vertex
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
// 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 smoothstep(vec<2, fa>, vec<2, fa>, vec<2, fa>) -> vec<2, fa>
|
||||
fn smoothstep_0c481b() {
|
||||
const arg_0 = vec2(2.);
|
||||
const arg_1 = vec2(4.);
|
||||
const arg_2 = vec2(3.);
|
||||
var res = smoothstep(arg_0, arg_1, arg_2);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c481b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c481b() {
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c481b() {
|
||||
float2 res = (0.5f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_0c481b();
|
||||
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 smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_0c481b() {
|
||||
vec2 res = vec2(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_0c481b() {
|
||||
float2 res = float2(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c481b();
|
||||
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() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_0c481b();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %smoothstep_0c481b "smoothstep_0c481b"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%15 = OpConstantComposite %v2float %float_0_5 %float_0_5
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_0c481b = 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 %smoothstep_0c481b
|
||||
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_0c481b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %smoothstep_0c481b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,22 @@
|
|||
fn smoothstep_0c481b() {
|
||||
const arg_0 = vec2(2.0);
|
||||
const arg_1 = vec2(4.0);
|
||||
const arg_2 = vec2(3.0);
|
||||
var res = smoothstep(arg_0, arg_1, arg_2);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c481b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c481b();
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// 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 smoothstep(vec<4, fa>, vec<4, fa>, vec<4, fa>) -> vec<4, fa>
|
||||
fn smoothstep_0c4ffc() {
|
||||
const arg_0 = vec4(2.);
|
||||
const arg_1 = vec4(4.);
|
||||
const arg_2 = vec4(3.);
|
||||
var res = smoothstep(arg_0, arg_1, arg_2);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c4ffc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c4ffc() {
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void smoothstep_0c4ffc() {
|
||||
float4 res = (0.5f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
smoothstep_0c4ffc();
|
||||
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 smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void smoothstep_0c4ffc() {
|
||||
vec4 res = vec4(0.5f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void smoothstep_0c4ffc() {
|
||||
float4 res = float4(0.5f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
smoothstep_0c4ffc();
|
||||
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() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %smoothstep_0c4ffc "smoothstep_0c4ffc"
|
||||
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_0_5 = OpConstant %float 0.5
|
||||
%14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%smoothstep_0c4ffc = 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 %smoothstep_0c4ffc
|
||||
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_0c4ffc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %smoothstep_0c4ffc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,22 @@
|
|||
fn smoothstep_0c4ffc() {
|
||||
const arg_0 = vec4(2.0);
|
||||
const arg_1 = vec4(4.0);
|
||||
const arg_2 = vec4(3.0);
|
||||
var res = smoothstep(arg_0, arg_1, arg_2);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
smoothstep_0c4ffc();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
smoothstep_0c4ffc();
|
||||
}
|
|
@ -25,9 +25,9 @@ enable f16;
|
|||
|
||||
// fn smoothstep(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
|
||||
fn smoothstep_12c031() {
|
||||
var arg_0 = vec2<f16>(1.h);
|
||||
var arg_1 = vec2<f16>(1.h);
|
||||
var arg_2 = vec2<f16>(1.h);
|
||||
var arg_0 = vec2<f16>(2.h);
|
||||
var arg_1 = vec2<f16>(4.h);
|
||||
var arg_2 = vec2<f16>(3.h);
|
||||
var res: vec2<f16> = smoothstep(arg_0, arg_1, arg_2);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue