tint: Implement acosh, asinh, atanh
Polyfill them completely for HLSL. For the other backends, just add range checks for acosh and atanh. Fixed: tint:1465 Change-Id: I3abda99b474d9f5ba09abf400381467dc28ea0bd Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94380 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
6058882d4b
commit
d23f296a9a
|
@ -5,6 +5,7 @@
|
|||
### New features
|
||||
|
||||
* Module-scope `var<private>` can now infer the storage type, like function-scope `var`. [tint:1584](crbug.com/tint/1584)
|
||||
* The `acosh`, `asinh`, and `atanh` builtin functions are now supported [tint:1465](crbug.com/tint/1465)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
|
|
|
@ -333,6 +333,8 @@ fn abs<T: fiu32>(T) -> T
|
|||
fn abs<N: num, T: fiu32>(vec<N, T>) -> vec<N, T>
|
||||
fn acos(f32) -> f32
|
||||
fn acos<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn acosh(f32) -> f32
|
||||
fn acosh<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn all(bool) -> bool
|
||||
fn all<N: num>(vec<N, bool>) -> bool
|
||||
fn any(bool) -> bool
|
||||
|
@ -340,10 +342,14 @@ fn any<N: num>(vec<N, bool>) -> bool
|
|||
fn arrayLength<T, A: access>(ptr<storage, array<T>, A>) -> u32
|
||||
fn asin(f32) -> f32
|
||||
fn asin<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn asinh(f32) -> f32
|
||||
fn asinh<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn atan(f32) -> f32
|
||||
fn atan<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn atan2(f32, f32) -> f32
|
||||
fn atan2<N: num>(vec<N, f32>, vec<N, f32>) -> vec<N, f32>
|
||||
fn atanh(f32) -> f32
|
||||
fn atanh<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn ceil(f32) -> f32
|
||||
fn ceil<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn clamp<T: fiu32>(T, T, T) -> T
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -35,6 +35,9 @@ BuiltinType ParseBuiltinType(const std::string& name) {
|
|||
if (name == "acos") {
|
||||
return BuiltinType::kAcos;
|
||||
}
|
||||
if (name == "acosh") {
|
||||
return BuiltinType::kAcosh;
|
||||
}
|
||||
if (name == "all") {
|
||||
return BuiltinType::kAll;
|
||||
}
|
||||
|
@ -47,12 +50,18 @@ BuiltinType ParseBuiltinType(const std::string& name) {
|
|||
if (name == "asin") {
|
||||
return BuiltinType::kAsin;
|
||||
}
|
||||
if (name == "asinh") {
|
||||
return BuiltinType::kAsinh;
|
||||
}
|
||||
if (name == "atan") {
|
||||
return BuiltinType::kAtan;
|
||||
}
|
||||
if (name == "atan2") {
|
||||
return BuiltinType::kAtan2;
|
||||
}
|
||||
if (name == "atanh") {
|
||||
return BuiltinType::kAtanh;
|
||||
}
|
||||
if (name == "ceil") {
|
||||
return BuiltinType::kCeil;
|
||||
}
|
||||
|
@ -358,6 +367,8 @@ const char* str(BuiltinType i) {
|
|||
return "abs";
|
||||
case BuiltinType::kAcos:
|
||||
return "acos";
|
||||
case BuiltinType::kAcosh:
|
||||
return "acosh";
|
||||
case BuiltinType::kAll:
|
||||
return "all";
|
||||
case BuiltinType::kAny:
|
||||
|
@ -366,10 +377,14 @@ const char* str(BuiltinType i) {
|
|||
return "arrayLength";
|
||||
case BuiltinType::kAsin:
|
||||
return "asin";
|
||||
case BuiltinType::kAsinh:
|
||||
return "asinh";
|
||||
case BuiltinType::kAtan:
|
||||
return "atan";
|
||||
case BuiltinType::kAtan2:
|
||||
return "atan2";
|
||||
case BuiltinType::kAtanh:
|
||||
return "atanh";
|
||||
case BuiltinType::kCeil:
|
||||
return "ceil";
|
||||
case BuiltinType::kClamp:
|
||||
|
|
|
@ -35,12 +35,15 @@ enum class BuiltinType {
|
|||
kNone = -1,
|
||||
kAbs,
|
||||
kAcos,
|
||||
kAcosh,
|
||||
kAll,
|
||||
kAny,
|
||||
kArrayLength,
|
||||
kAsin,
|
||||
kAsinh,
|
||||
kAtan,
|
||||
kAtan2,
|
||||
kAtanh,
|
||||
kCeil,
|
||||
kClamp,
|
||||
kCos,
|
||||
|
|
|
@ -44,6 +44,100 @@ struct BuiltinPolyfill::State {
|
|||
/// The source clone context
|
||||
const sem::Info& sem = ctx.src->Sem();
|
||||
|
||||
/// Builds the polyfill function for the `acosh` builtin
|
||||
/// @param ty the parameter and return type for the function
|
||||
/// @return the polyfill function name
|
||||
Symbol acosh(const sem::Type* ty) {
|
||||
auto name = b.Symbols().New("tint_acosh");
|
||||
uint32_t width = WidthOf(ty);
|
||||
|
||||
auto V = [&](AFloat value) -> const ast::Expression* {
|
||||
const ast::Expression* expr = b.Expr(value);
|
||||
if (width == 1) {
|
||||
return expr;
|
||||
}
|
||||
return b.Construct(T(ty), expr);
|
||||
};
|
||||
|
||||
ast::StatementList body;
|
||||
switch (polyfill.acosh) {
|
||||
case Level::kFull:
|
||||
// return log(x + sqrt(x*x - 1));
|
||||
body.emplace_back(b.Return(
|
||||
b.Call("log", b.Add("x", b.Call("sqrt", b.Sub(b.Mul("x", "x"), 1_a))))));
|
||||
break;
|
||||
case Level::kRangeCheck: {
|
||||
// return select(acosh(x), 0, x < 1);
|
||||
body.emplace_back(b.Return(
|
||||
b.Call("select", b.Call("acosh", "x"), V(0.0_a), b.LessThan("x", V(1.0_a)))));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
TINT_ICE(Transform, b.Diagnostics())
|
||||
<< "unhandled polyfill level: " << static_cast<int>(polyfill.acosh);
|
||||
return {};
|
||||
}
|
||||
|
||||
b.Func(name, {b.Param("x", T(ty))}, T(ty), body);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Builds the polyfill function for the `asinh` builtin
|
||||
/// @param ty the parameter and return type for the function
|
||||
/// @return the polyfill function name
|
||||
Symbol asinh(const sem::Type* ty) {
|
||||
auto name = b.Symbols().New("tint_sinh");
|
||||
|
||||
ast::StatementList body;
|
||||
|
||||
// return log(x + sqrt(x*x + 1));
|
||||
body.emplace_back(
|
||||
b.Return(b.Call("log", b.Add("x", b.Call("sqrt", b.Add(b.Mul("x", "x"), 1_a))))));
|
||||
|
||||
b.Func(name, {b.Param("x", T(ty))}, T(ty), body);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Builds the polyfill function for the `atanh` builtin
|
||||
/// @param ty the parameter and return type for the function
|
||||
/// @return the polyfill function name
|
||||
Symbol atanh(const sem::Type* ty) {
|
||||
auto name = b.Symbols().New("tint_atanh");
|
||||
uint32_t width = WidthOf(ty);
|
||||
|
||||
auto V = [&](AFloat value) -> const ast::Expression* {
|
||||
const ast::Expression* expr = b.Expr(value);
|
||||
if (width == 1) {
|
||||
return expr;
|
||||
}
|
||||
return b.Construct(T(ty), expr);
|
||||
};
|
||||
|
||||
ast::StatementList body;
|
||||
switch (polyfill.atanh) {
|
||||
case Level::kFull:
|
||||
// return log((1+x) / (1-x)) * 0.5
|
||||
body.emplace_back(
|
||||
b.Return(b.Mul(b.Call("log", b.Div(b.Add(1_a, "x"), b.Sub(1_a, "x"))), 0.5_a)));
|
||||
break;
|
||||
case Level::kRangeCheck:
|
||||
// return select(atanh(x), 0, x >= 1);
|
||||
body.emplace_back(b.Return(b.Call("select", b.Call("atanh", "x"), V(0.0_a),
|
||||
b.GreaterThanEqual("x", V(1.0_a)))));
|
||||
break;
|
||||
default:
|
||||
TINT_ICE(Transform, b.Diagnostics())
|
||||
<< "unhandled polyfill level: " << static_cast<int>(polyfill.acosh);
|
||||
return {};
|
||||
}
|
||||
|
||||
b.Func(name, {b.Param("x", T(ty))}, T(ty), body);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Builds the polyfill function for the `countLeadingZeros` builtin
|
||||
/// @param ty the parameter and return type for the function
|
||||
/// @return the polyfill function name
|
||||
|
@ -440,6 +534,21 @@ bool BuiltinPolyfill::ShouldRun(const Program* program, const DataMap& data) con
|
|||
if (auto* call = sem.Get<sem::Call>(node)) {
|
||||
if (auto* builtin = call->Target()->As<sem::Builtin>()) {
|
||||
switch (builtin->Type()) {
|
||||
case sem::BuiltinType::kAcosh:
|
||||
if (builtins.acosh != Level::kNone) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kAsinh:
|
||||
if (builtins.asinh) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kAtanh:
|
||||
if (builtins.atanh != Level::kNone) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kCountLeadingZeros:
|
||||
if (builtins.count_leading_zeros) {
|
||||
return true;
|
||||
|
@ -496,6 +605,24 @@ void BuiltinPolyfill::Run(CloneContext& ctx, const DataMap& data, DataMap&) cons
|
|||
if (auto* builtin = call->Target()->As<sem::Builtin>()) {
|
||||
Symbol polyfill;
|
||||
switch (builtin->Type()) {
|
||||
case sem::BuiltinType::kAcosh:
|
||||
if (builtins.acosh != Level::kNone) {
|
||||
polyfill = utils::GetOrCreate(
|
||||
polyfills, builtin, [&] { return s.acosh(builtin->ReturnType()); });
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kAsinh:
|
||||
if (builtins.asinh) {
|
||||
polyfill = utils::GetOrCreate(
|
||||
polyfills, builtin, [&] { return s.asinh(builtin->ReturnType()); });
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kAtanh:
|
||||
if (builtins.atanh != Level::kNone) {
|
||||
polyfill = utils::GetOrCreate(
|
||||
polyfills, builtin, [&] { return s.atanh(builtin->ReturnType()); });
|
||||
}
|
||||
break;
|
||||
case sem::BuiltinType::kCountLeadingZeros:
|
||||
if (builtins.count_leading_zeros) {
|
||||
polyfill = utils::GetOrCreate(polyfills, builtin, [&] {
|
||||
|
|
|
@ -33,12 +33,20 @@ class BuiltinPolyfill final : public Castable<BuiltinPolyfill, Transform> {
|
|||
kNone,
|
||||
/// Clamp the parameters to the inner implementation.
|
||||
kClampParameters,
|
||||
/// Range check the input.
|
||||
kRangeCheck,
|
||||
/// Polyfill the entire function
|
||||
kFull,
|
||||
};
|
||||
|
||||
/// Specifies the builtins that should be polyfilled by the transform.
|
||||
struct Builtins {
|
||||
/// What level should `acosh` be polyfilled?
|
||||
Level acosh = Level::kNone;
|
||||
/// Should `asinh` be polyfilled?
|
||||
bool asinh = false;
|
||||
/// What level should `atanh` be polyfilled?
|
||||
Level atanh = Level::kNone;
|
||||
/// Should `countLeadingZeros()` be polyfilled?
|
||||
bool count_leading_zeros = false;
|
||||
/// Should `countTrailingZeros()` be polyfilled?
|
||||
|
|
|
@ -41,6 +41,292 @@ TEST_F(BuiltinPolyfillTest, EmptyModule) {
|
|||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// acosh
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DataMap polyfillAcosh(Level level) {
|
||||
BuiltinPolyfill::Builtins builtins;
|
||||
builtins.acosh = level;
|
||||
DataMap data;
|
||||
data.Add<BuiltinPolyfill::Config>(builtins);
|
||||
return data;
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, ShouldRunAcosh) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
acosh(1.0);
|
||||
}
|
||||
)";
|
||||
|
||||
EXPECT_FALSE(ShouldRun<BuiltinPolyfill>(src));
|
||||
EXPECT_FALSE(ShouldRun<BuiltinPolyfill>(src, polyfillAcosh(Level::kNone)));
|
||||
EXPECT_TRUE(ShouldRun<BuiltinPolyfill>(src, polyfillAcosh(Level::kClampParameters)));
|
||||
EXPECT_TRUE(ShouldRun<BuiltinPolyfill>(src, polyfillAcosh(Level::kFull)));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Acosh_Full_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = acosh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_acosh(x : f32) -> f32 {
|
||||
return log((x + sqrt(((x * x) - 1))));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_acosh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kFull));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Acosh_Full_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = acosh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_acosh(x : vec3<f32>) -> vec3<f32> {
|
||||
return log((x + sqrt(((x * x) - 1))));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = tint_acosh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kFull));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Acosh_Range_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = acosh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_acosh(x : f32) -> f32 {
|
||||
return select(acosh(x), 0.0, (x < 1.0));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_acosh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kRangeCheck));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Acosh_Range_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = acosh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_acosh(x : vec3<f32>) -> vec3<f32> {
|
||||
return select(acosh(x), vec3<f32>(0.0), (x < vec3<f32>(1.0)));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = tint_acosh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kRangeCheck));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// asinh
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DataMap polyfillSinh() {
|
||||
BuiltinPolyfill::Builtins builtins;
|
||||
builtins.asinh = true;
|
||||
DataMap data;
|
||||
data.Add<BuiltinPolyfill::Config>(builtins);
|
||||
return data;
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, ShouldRunAsinh) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
asinh(1.0);
|
||||
}
|
||||
)";
|
||||
|
||||
EXPECT_FALSE(ShouldRun<BuiltinPolyfill>(src));
|
||||
EXPECT_TRUE(ShouldRun<BuiltinPolyfill>(src, polyfillSinh()));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Asinh_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = asinh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_sinh(x : f32) -> f32 {
|
||||
return log((x + sqrt(((x * x) + 1))));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_sinh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillSinh());
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Asinh_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = asinh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_sinh(x : vec3<f32>) -> vec3<f32> {
|
||||
return log((x + sqrt(((x * x) + 1))));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = tint_sinh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillSinh());
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// atanh
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DataMap polyfillAtanh(Level level) {
|
||||
BuiltinPolyfill::Builtins builtins;
|
||||
builtins.atanh = level;
|
||||
DataMap data;
|
||||
data.Add<BuiltinPolyfill::Config>(builtins);
|
||||
return data;
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, ShouldRunAtanh) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
atanh(1.0);
|
||||
}
|
||||
)";
|
||||
|
||||
EXPECT_FALSE(ShouldRun<BuiltinPolyfill>(src));
|
||||
EXPECT_FALSE(ShouldRun<BuiltinPolyfill>(src, polyfillAtanh(Level::kNone)));
|
||||
EXPECT_TRUE(ShouldRun<BuiltinPolyfill>(src, polyfillAtanh(Level::kClampParameters)));
|
||||
EXPECT_TRUE(ShouldRun<BuiltinPolyfill>(src, polyfillAtanh(Level::kFull)));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Full_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = atanh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_atanh(x : f32) -> f32 {
|
||||
return (log(((1 + x) / (1 - x))) * 0.5);
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_atanh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAtanh(Level::kFull));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Full_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_atanh(x : vec3<f32>) -> vec3<f32> {
|
||||
return (log(((1 + x) / (1 - x))) * 0.5);
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : vec3<f32> = tint_atanh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAtanh(Level::kFull));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Range_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : f32 = atanh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn tint_atanh(x : f32) -> f32 {
|
||||
return select(atanh(x), 0.0, (x >= 1.0));
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let r : f32 = tint_atanh(1234);
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAtanh(Level::kRangeCheck));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
TEST_F(BuiltinPolyfillTest, Atanh_Range_vec3_f32) {
|
||||
auto* src = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
fn f() {
|
||||
let r : vec3<f32> = atanh(vec3<f32>(1234));
|
||||
}
|
||||
)";
|
||||
|
||||
auto got = Run<BuiltinPolyfill>(src, polyfillAcosh(Level::kRangeCheck));
|
||||
|
||||
EXPECT_EQ(expect, str(got));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// countLeadingZeros
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -175,6 +175,8 @@ SanitizedResult Sanitize(const Program* in,
|
|||
|
||||
{ // Builtin polyfills
|
||||
transform::BuiltinPolyfill::Builtins polyfills;
|
||||
polyfills.acosh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.atanh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.count_leading_zeros = true;
|
||||
polyfills.count_trailing_zeros = true;
|
||||
polyfills.extract_bits = transform::BuiltinPolyfill::Level::kClampParameters;
|
||||
|
@ -1605,10 +1607,13 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
|
|||
switch (builtin->Type()) {
|
||||
case sem::BuiltinType::kAbs:
|
||||
case sem::BuiltinType::kAcos:
|
||||
case sem::BuiltinType::kAcosh:
|
||||
case sem::BuiltinType::kAll:
|
||||
case sem::BuiltinType::kAny:
|
||||
case sem::BuiltinType::kAsin:
|
||||
case sem::BuiltinType::kAsinh:
|
||||
case sem::BuiltinType::kAtan:
|
||||
case sem::BuiltinType::kAtanh:
|
||||
case sem::BuiltinType::kCeil:
|
||||
case sem::BuiltinType::kClamp:
|
||||
case sem::BuiltinType::kCos:
|
||||
|
|
|
@ -158,6 +158,9 @@ SanitizedResult Sanitize(const Program* in, const Options& options) {
|
|||
|
||||
{ // Builtin polyfills
|
||||
transform::BuiltinPolyfill::Builtins polyfills;
|
||||
polyfills.acosh = transform::BuiltinPolyfill::Level::kFull;
|
||||
polyfills.asinh = true;
|
||||
polyfills.atanh = transform::BuiltinPolyfill::Level::kFull;
|
||||
// TODO(crbug.com/tint/1449): Some of these can map to HLSL's `firstbitlow`
|
||||
// and `firstbithigh`.
|
||||
polyfills.count_leading_zeros = true;
|
||||
|
|
|
@ -151,6 +151,8 @@ SanitizedResult Sanitize(const Program* in, const Options& options) {
|
|||
|
||||
{ // Builtin polyfills
|
||||
transform::BuiltinPolyfill::Builtins polyfills;
|
||||
polyfills.acosh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.atanh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.extract_bits = transform::BuiltinPolyfill::Level::kClampParameters;
|
||||
polyfills.first_leading_bit = true;
|
||||
polyfills.first_trailing_bit = true;
|
||||
|
@ -1351,9 +1353,12 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
|
|||
std::string out = "";
|
||||
switch (builtin->Type()) {
|
||||
case sem::BuiltinType::kAcos:
|
||||
case sem::BuiltinType::kAcosh:
|
||||
case sem::BuiltinType::kAll:
|
||||
case sem::BuiltinType::kAny:
|
||||
case sem::BuiltinType::kAsin:
|
||||
case sem::BuiltinType::kAsinh:
|
||||
case sem::BuiltinType::kAtanh:
|
||||
case sem::BuiltinType::kAtan:
|
||||
case sem::BuiltinType::kAtan2:
|
||||
case sem::BuiltinType::kCeil:
|
||||
|
|
|
@ -103,12 +103,18 @@ uint32_t builtin_to_glsl_method(const sem::Builtin* builtin) {
|
|||
switch (builtin->Type()) {
|
||||
case BuiltinType::kAcos:
|
||||
return GLSLstd450Acos;
|
||||
case BuiltinType::kAcosh:
|
||||
return GLSLstd450Acosh;
|
||||
case BuiltinType::kAsin:
|
||||
return GLSLstd450Asin;
|
||||
case BuiltinType::kAsinh:
|
||||
return GLSLstd450Asinh;
|
||||
case BuiltinType::kAtan:
|
||||
return GLSLstd450Atan;
|
||||
case BuiltinType::kAtan2:
|
||||
return GLSLstd450Atan2;
|
||||
case BuiltinType::kAtanh:
|
||||
return GLSLstd450Atanh;
|
||||
case BuiltinType::kCeil:
|
||||
return GLSLstd450Ceil;
|
||||
case BuiltinType::kClamp:
|
||||
|
|
|
@ -46,6 +46,8 @@ SanitizedResult Sanitize(const Program* in, const Options& options) {
|
|||
|
||||
{ // Builtin polyfills
|
||||
transform::BuiltinPolyfill::Builtins polyfills;
|
||||
polyfills.acosh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.atanh = transform::BuiltinPolyfill::Level::kRangeCheck;
|
||||
polyfills.count_leading_zeros = true;
|
||||
polyfills.count_trailing_zeros = true;
|
||||
polyfills.extract_bits = transform::BuiltinPolyfill::Level::kClampParameters;
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<2, f32>) -> vec<2, f32>
|
||||
fn acosh_640883() {
|
||||
var res: vec2<f32> = acosh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_640883();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_640883();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_640883();
|
||||
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;
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 res = tint_acosh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float2 tint_acosh(float2 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 res = tint_acosh((0.0f).xx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_640883();
|
||||
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() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float2 tint_acosh(float2 x) {
|
||||
return select(acosh(x), float2(0.0f), (x < float2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 res = tint_acosh(float2(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_640883();
|
||||
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() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_640883 "acosh_640883"
|
||||
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
|
||||
%v2float = OpTypeVector %float 2
|
||||
%9 = OpTypeFunction %v2float %v2float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%20 = OpConstantNull %v2float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v2float None %9
|
||||
%x = OpFunctionParameter %v2float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdLessThan %v2bool %x %16
|
||||
%21 = OpExtInst %v2float %22 Acosh %x
|
||||
%14 = OpSelect %v2float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_640883 = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%27 = OpFunctionCall %v2float %tint_acosh %20
|
||||
OpStore %res %27
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_640883
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_640883() {
|
||||
var res : vec2<f32> = acosh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_640883();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_640883();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<4, f32>) -> vec<4, f32>
|
||||
fn acosh_d51ccb() {
|
||||
var res: vec4<f32> = acosh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_d51ccb();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_d51ccb();
|
||||
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;
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 res = tint_acosh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float4 tint_acosh(float4 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 res = tint_acosh((0.0f).xxxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_d51ccb();
|
||||
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() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float4 tint_acosh(float4 x) {
|
||||
return select(acosh(x), float4(0.0f), (x < float4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 res = tint_acosh(float4(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_d51ccb();
|
||||
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() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%20 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_d51ccb "acosh_d51ccb"
|
||||
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
|
||||
%9 = OpTypeFunction %v4float %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%void = OpTypeVoid
|
||||
%21 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%28 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v4float None %9
|
||||
%x = OpFunctionParameter %v4float
|
||||
%12 = OpLabel
|
||||
%16 = OpFOrdLessThan %v4bool %x %15
|
||||
%19 = OpExtInst %v4float %20 Acosh %x
|
||||
%13 = OpSelect %v4float %16 %5 %19
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%acosh_d51ccb = OpFunction %void None %21
|
||||
%24 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%25 = OpFunctionCall %v4float %tint_acosh %5
|
||||
OpStore %res %25
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %28
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %21
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %34
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %21
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %21
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_d51ccb() {
|
||||
var res : vec4<f32> = acosh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_d51ccb();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<3, f32>) -> vec<3, f32>
|
||||
fn acosh_e38f5c() {
|
||||
var res: vec3<f32> = acosh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_e38f5c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_e38f5c();
|
||||
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;
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 res = tint_acosh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float3 tint_acosh(float3 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 res = tint_acosh((0.0f).xxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_e38f5c();
|
||||
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() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float3 tint_acosh(float3 x) {
|
||||
return select(acosh(x), float3(0.0f), (x < float3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 res = tint_acosh(float3(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_e38f5c();
|
||||
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() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_e38f5c "acosh_e38f5c"
|
||||
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
|
||||
%v3float = OpTypeVector %float 3
|
||||
%9 = OpTypeFunction %v3float %v3float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%20 = OpConstantNull %v3float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v3float None %9
|
||||
%x = OpFunctionParameter %v3float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdLessThan %v3bool %x %16
|
||||
%21 = OpExtInst %v3float %22 Acosh %x
|
||||
%14 = OpSelect %v3float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_e38f5c = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%27 = OpFunctionCall %v3float %tint_acosh %20
|
||||
OpStore %res %27
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %acosh_e38f5c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_e38f5c() {
|
||||
var res : vec3<f32> = acosh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_e38f5c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(f32) -> f32
|
||||
fn acosh_ecf2d1() {
|
||||
var res: f32 = acosh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_ecf2d1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_ecf2d1();
|
||||
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;
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
float tint_acosh(float x) {
|
||||
return ((x < 1.0f) ? 0.0f : acosh(x));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float tint_acosh(float x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_ecf2d1();
|
||||
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() {
|
||||
acosh_ecf2d1();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_ecf2d1();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float tint_acosh(float x) {
|
||||
return select(acosh(x), 0.0f, (x < 1.0f));
|
||||
}
|
||||
|
||||
void acosh_ecf2d1() {
|
||||
float res = tint_acosh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_ecf2d1();
|
||||
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() {
|
||||
acosh_ecf2d1();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_ecf2d1();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 39
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%18 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_ecf2d1 "acosh_ecf2d1"
|
||||
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
|
||||
%9 = OpTypeFunction %float %float
|
||||
%float_1 = OpConstant %float 1
|
||||
%bool = OpTypeBool
|
||||
%void = OpTypeVoid
|
||||
%19 = OpTypeFunction %void
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%26 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %float None %9
|
||||
%x = OpFunctionParameter %float
|
||||
%12 = OpLabel
|
||||
%15 = OpFOrdLessThan %bool %x %float_1
|
||||
%17 = OpExtInst %float %18 Acosh %x
|
||||
%13 = OpSelect %float %15 %8 %17
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%acosh_ecf2d1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%23 = OpFunctionCall %float %tint_acosh %float_1
|
||||
OpStore %res %23
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %26
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %19
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %32
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %19
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %19
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %void %acosh_ecf2d1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn acosh_ecf2d1() {
|
||||
var res : f32 = acosh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_ecf2d1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_ecf2d1();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn asinh(f32) -> f32
|
||||
fn asinh_157447() {
|
||||
var res: f32 = asinh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_157447();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_157447();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_157447();
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void asinh_157447() {
|
||||
float res = asinh(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
asinh_157447();
|
||||
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 asinh_157447() {
|
||||
float res = asinh(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
asinh_157447();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void asinh_157447() {
|
||||
float res = asinh(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
asinh_157447();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float tint_sinh(float x) {
|
||||
return log((x + sqrt(((x * x) + 1.0f))));
|
||||
}
|
||||
|
||||
void asinh_157447() {
|
||||
float res = tint_sinh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_157447();
|
||||
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() {
|
||||
asinh_157447();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
asinh_157447();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void asinh_157447() {
|
||||
float res = asinh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_157447();
|
||||
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() {
|
||||
asinh_157447();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
asinh_157447();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %asinh_157447 "asinh_157447"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%asinh_157447 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 Asinh %float_1
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %asinh_157447
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %asinh_157447
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %asinh_157447
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn asinh_157447() {
|
||||
var res : f32 = asinh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_157447();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_157447();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_157447();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn asinh(vec<3, f32>) -> vec<3, f32>
|
||||
fn asinh_2265ee() {
|
||||
var res: vec3<f32> = asinh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_2265ee();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_2265ee();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_2265ee();
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void asinh_2265ee() {
|
||||
vec3 res = asinh(vec3(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
asinh_2265ee();
|
||||
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 asinh_2265ee() {
|
||||
vec3 res = asinh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
asinh_2265ee();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void asinh_2265ee() {
|
||||
vec3 res = asinh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
asinh_2265ee();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float3 tint_sinh(float3 x) {
|
||||
return log((x + sqrt(((x * x) + 1.0f))));
|
||||
}
|
||||
|
||||
void asinh_2265ee() {
|
||||
float3 res = tint_sinh((0.0f).xxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_2265ee();
|
||||
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() {
|
||||
asinh_2265ee();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
asinh_2265ee();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void asinh_2265ee() {
|
||||
float3 res = asinh(float3(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_2265ee();
|
||||
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() {
|
||||
asinh_2265ee();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
asinh_2265ee();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %asinh_2265ee "asinh_2265ee"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%16 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%asinh_2265ee = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %16
|
||||
%13 = OpExtInst %v3float %15 Asinh %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %asinh_2265ee
|
||||
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 %asinh_2265ee
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %asinh_2265ee
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn asinh_2265ee() {
|
||||
var res : vec3<f32> = asinh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_2265ee();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_2265ee();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_2265ee();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn asinh(vec<2, f32>) -> vec<2, f32>
|
||||
fn asinh_4a2226() {
|
||||
var res: vec2<f32> = asinh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_4a2226();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_4a2226();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_4a2226();
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void asinh_4a2226() {
|
||||
vec2 res = asinh(vec2(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
asinh_4a2226();
|
||||
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 asinh_4a2226() {
|
||||
vec2 res = asinh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
asinh_4a2226();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void asinh_4a2226() {
|
||||
vec2 res = asinh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
asinh_4a2226();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float2 tint_sinh(float2 x) {
|
||||
return log((x + sqrt(((x * x) + 1.0f))));
|
||||
}
|
||||
|
||||
void asinh_4a2226() {
|
||||
float2 res = tint_sinh((0.0f).xx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_4a2226();
|
||||
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() {
|
||||
asinh_4a2226();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
asinh_4a2226();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void asinh_4a2226() {
|
||||
float2 res = asinh(float2(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_4a2226();
|
||||
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() {
|
||||
asinh_4a2226();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
asinh_4a2226();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %asinh_4a2226 "asinh_4a2226"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%16 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%asinh_4a2226 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %16
|
||||
%13 = OpExtInst %v2float %15 Asinh %16
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %asinh_4a2226
|
||||
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 %asinh_4a2226
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %asinh_4a2226
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn asinh_4a2226() {
|
||||
var res : vec2<f32> = asinh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_4a2226();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_4a2226();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_4a2226();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn asinh(vec<4, f32>) -> vec<4, f32>
|
||||
fn asinh_8d2e51() {
|
||||
var res: vec4<f32> = asinh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_8d2e51();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void asinh_8d2e51() {
|
||||
vec4 res = asinh(vec4(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
asinh_8d2e51();
|
||||
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 asinh_8d2e51() {
|
||||
vec4 res = asinh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void asinh_8d2e51() {
|
||||
vec4 res = asinh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float4 tint_sinh(float4 x) {
|
||||
return log((x + sqrt(((x * x) + 1.0f))));
|
||||
}
|
||||
|
||||
void asinh_8d2e51() {
|
||||
float4 res = tint_sinh((0.0f).xxxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_8d2e51();
|
||||
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() {
|
||||
asinh_8d2e51();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
asinh_8d2e51();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void asinh_8d2e51() {
|
||||
float4 res = asinh(float4(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
asinh_8d2e51();
|
||||
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() {
|
||||
asinh_8d2e51();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
asinh_8d2e51();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %asinh_8d2e51 "asinh_8d2e51"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%asinh_8d2e51 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%13 = OpExtInst %v4float %14 Asinh %5
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %asinh_8d2e51
|
||||
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 %asinh_8d2e51
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %asinh_8d2e51
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn asinh_8d2e51() {
|
||||
var res : vec4<f32> = asinh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
asinh_8d2e51();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
asinh_8d2e51();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn atanh(vec<3, f32>) -> vec<3, f32>
|
||||
fn atanh_440cca() {
|
||||
var res: vec3<f32> = atanh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_440cca();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_440cca();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_440cca();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec3 tint_atanh(vec3 x) {
|
||||
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_440cca() {
|
||||
vec3 res = tint_atanh(vec3(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
atanh_440cca();
|
||||
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;
|
||||
|
||||
vec3 tint_atanh(vec3 x) {
|
||||
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_440cca() {
|
||||
vec3 res = tint_atanh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
atanh_440cca();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec3 tint_atanh(vec3 x) {
|
||||
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_440cca() {
|
||||
vec3 res = tint_atanh(vec3(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
atanh_440cca();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float3 tint_atanh(float3 x) {
|
||||
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
|
||||
}
|
||||
|
||||
void atanh_440cca() {
|
||||
float3 res = tint_atanh((0.0f).xxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_440cca();
|
||||
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() {
|
||||
atanh_440cca();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
atanh_440cca();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float3 tint_atanh(float3 x) {
|
||||
return select(atanh(x), float3(0.0f), (x >= float3(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_440cca() {
|
||||
float3 res = tint_atanh(float3(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_440cca();
|
||||
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() {
|
||||
atanh_440cca();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
atanh_440cca();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_atanh "tint_atanh"
|
||||
OpName %x "x"
|
||||
OpName %atanh_440cca "atanh_440cca"
|
||||
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
|
||||
%v3float = OpTypeVector %float 3
|
||||
%9 = OpTypeFunction %v3float %v3float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%20 = OpConstantNull %v3float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_atanh = OpFunction %v3float None %9
|
||||
%x = OpFunctionParameter %v3float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdGreaterThanEqual %v3bool %x %16
|
||||
%21 = OpExtInst %v3float %22 Atanh %x
|
||||
%14 = OpSelect %v3float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%atanh_440cca = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%27 = OpFunctionCall %v3float %tint_atanh %20
|
||||
OpStore %res %27
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %atanh_440cca
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %atanh_440cca
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %atanh_440cca
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn atanh_440cca() {
|
||||
var res : vec3<f32> = atanh(vec3<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_440cca();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_440cca();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_440cca();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn atanh(f32) -> f32
|
||||
fn atanh_7997d8() {
|
||||
var res: f32 = atanh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_7997d8();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_7997d8();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_7997d8();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
float tint_atanh(float x) {
|
||||
return ((x >= 1.0f) ? 0.0f : atanh(x));
|
||||
}
|
||||
|
||||
void atanh_7997d8() {
|
||||
float res = tint_atanh(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
atanh_7997d8();
|
||||
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;
|
||||
|
||||
float tint_atanh(float x) {
|
||||
return ((x >= 1.0f) ? 0.0f : atanh(x));
|
||||
}
|
||||
|
||||
void atanh_7997d8() {
|
||||
float res = tint_atanh(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
atanh_7997d8();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
float tint_atanh(float x) {
|
||||
return ((x >= 1.0f) ? 0.0f : atanh(x));
|
||||
}
|
||||
|
||||
void atanh_7997d8() {
|
||||
float res = tint_atanh(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
atanh_7997d8();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float tint_atanh(float x) {
|
||||
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
|
||||
}
|
||||
|
||||
void atanh_7997d8() {
|
||||
float res = tint_atanh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_7997d8();
|
||||
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() {
|
||||
atanh_7997d8();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
atanh_7997d8();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float tint_atanh(float x) {
|
||||
return select(atanh(x), 0.0f, (x >= 1.0f));
|
||||
}
|
||||
|
||||
void atanh_7997d8() {
|
||||
float res = tint_atanh(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_7997d8();
|
||||
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() {
|
||||
atanh_7997d8();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
atanh_7997d8();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 39
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%18 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_atanh "tint_atanh"
|
||||
OpName %x "x"
|
||||
OpName %atanh_7997d8 "atanh_7997d8"
|
||||
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
|
||||
%9 = OpTypeFunction %float %float
|
||||
%float_1 = OpConstant %float 1
|
||||
%bool = OpTypeBool
|
||||
%void = OpTypeVoid
|
||||
%19 = OpTypeFunction %void
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%26 = OpTypeFunction %v4float
|
||||
%tint_atanh = OpFunction %float None %9
|
||||
%x = OpFunctionParameter %float
|
||||
%12 = OpLabel
|
||||
%15 = OpFOrdGreaterThanEqual %bool %x %float_1
|
||||
%17 = OpExtInst %float %18 Atanh %x
|
||||
%13 = OpSelect %float %15 %8 %17
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%atanh_7997d8 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%23 = OpFunctionCall %float %tint_atanh %float_1
|
||||
OpStore %res %23
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %26
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %atanh_7997d8
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %19
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %32
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %19
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %atanh_7997d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %19
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %void %atanh_7997d8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn atanh_7997d8() {
|
||||
var res : f32 = atanh(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_7997d8();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_7997d8();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_7997d8();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn atanh(vec<2, f32>) -> vec<2, f32>
|
||||
fn atanh_c0e634() {
|
||||
var res: vec2<f32> = atanh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_c0e634();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_c0e634();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_c0e634();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec2 tint_atanh(vec2 x) {
|
||||
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_c0e634() {
|
||||
vec2 res = tint_atanh(vec2(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
atanh_c0e634();
|
||||
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;
|
||||
|
||||
vec2 tint_atanh(vec2 x) {
|
||||
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_c0e634() {
|
||||
vec2 res = tint_atanh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
atanh_c0e634();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec2 tint_atanh(vec2 x) {
|
||||
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_c0e634() {
|
||||
vec2 res = tint_atanh(vec2(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
atanh_c0e634();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float2 tint_atanh(float2 x) {
|
||||
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
|
||||
}
|
||||
|
||||
void atanh_c0e634() {
|
||||
float2 res = tint_atanh((0.0f).xx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_c0e634();
|
||||
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() {
|
||||
atanh_c0e634();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
atanh_c0e634();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float2 tint_atanh(float2 x) {
|
||||
return select(atanh(x), float2(0.0f), (x >= float2(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_c0e634() {
|
||||
float2 res = tint_atanh(float2(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_c0e634();
|
||||
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() {
|
||||
atanh_c0e634();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
atanh_c0e634();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_atanh "tint_atanh"
|
||||
OpName %x "x"
|
||||
OpName %atanh_c0e634 "atanh_c0e634"
|
||||
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
|
||||
%v2float = OpTypeVector %float 2
|
||||
%9 = OpTypeFunction %v2float %v2float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%20 = OpConstantNull %v2float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_atanh = OpFunction %v2float None %9
|
||||
%x = OpFunctionParameter %v2float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdGreaterThanEqual %v2bool %x %16
|
||||
%21 = OpExtInst %v2float %22 Atanh %x
|
||||
%14 = OpSelect %v2float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%atanh_c0e634 = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%27 = OpFunctionCall %v2float %tint_atanh %20
|
||||
OpStore %res %27
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %atanh_c0e634
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %23
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %atanh_c0e634
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %atanh_c0e634
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn atanh_c0e634() {
|
||||
var res : vec2<f32> = atanh(vec2<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_c0e634();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_c0e634();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_c0e634();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn atanh(vec<4, f32>) -> vec<4, f32>
|
||||
fn atanh_f3e01b() {
|
||||
var res: vec4<f32> = atanh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_f3e01b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
#version 310 es
|
||||
|
||||
vec4 tint_atanh(vec4 x) {
|
||||
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_f3e01b() {
|
||||
vec4 res = tint_atanh(vec4(0.0f));
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
atanh_f3e01b();
|
||||
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;
|
||||
|
||||
vec4 tint_atanh(vec4 x) {
|
||||
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_f3e01b() {
|
||||
vec4 res = tint_atanh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec4 tint_atanh(vec4 x) {
|
||||
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_f3e01b() {
|
||||
vec4 res = tint_atanh(vec4(0.0f));
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
float4 tint_atanh(float4 x) {
|
||||
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
|
||||
}
|
||||
|
||||
void atanh_f3e01b() {
|
||||
float4 res = tint_atanh((0.0f).xxxx);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_f3e01b();
|
||||
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() {
|
||||
atanh_f3e01b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
atanh_f3e01b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float4 tint_atanh(float4 x) {
|
||||
return select(atanh(x), float4(0.0f), (x >= float4(1.0f)));
|
||||
}
|
||||
|
||||
void atanh_f3e01b() {
|
||||
float4 res = tint_atanh(float4(0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
atanh_f3e01b();
|
||||
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() {
|
||||
atanh_f3e01b();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
atanh_f3e01b();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%20 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_atanh "tint_atanh"
|
||||
OpName %x "x"
|
||||
OpName %atanh_f3e01b "atanh_f3e01b"
|
||||
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
|
||||
%9 = OpTypeFunction %v4float %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%void = OpTypeVoid
|
||||
%21 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%28 = OpTypeFunction %v4float
|
||||
%tint_atanh = OpFunction %v4float None %9
|
||||
%x = OpFunctionParameter %v4float
|
||||
%12 = OpLabel
|
||||
%16 = OpFOrdGreaterThanEqual %v4bool %x %15
|
||||
%19 = OpExtInst %v4float %20 Atanh %x
|
||||
%13 = OpSelect %v4float %16 %5 %19
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%atanh_f3e01b = OpFunction %void None %21
|
||||
%24 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%25 = OpFunctionCall %v4float %tint_atanh %5
|
||||
OpStore %res %25
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %28
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %atanh_f3e01b
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %21
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %34
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %21
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %atanh_f3e01b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %21
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %atanh_f3e01b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn atanh_f3e01b() {
|
||||
var res : vec4<f32> = atanh(vec4<f32>());
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
atanh_f3e01b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
atanh_f3e01b();
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<2, f32>) -> vec<2, f32>
|
||||
fn acosh_640883() {
|
||||
var arg_0 = vec2<f32>();
|
||||
var res: vec2<f32> = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_640883();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_640883();
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 arg_0 = vec2(0.0f);
|
||||
vec2 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_640883();
|
||||
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;
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 arg_0 = vec2(0.0f);
|
||||
vec2 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec2 tint_acosh(vec2 x) {
|
||||
return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
vec2 arg_0 = vec2(0.0f);
|
||||
vec2 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
float2 tint_acosh(float2 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 arg_0 = (0.0f).xx;
|
||||
float2 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_640883();
|
||||
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() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float2 tint_acosh(float2 x) {
|
||||
return select(acosh(x), float2(0.0f), (x < float2(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_640883() {
|
||||
float2 arg_0 = float2(0.0f);
|
||||
float2 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_640883();
|
||||
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() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_640883();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 45
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%22 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_640883 "acosh_640883"
|
||||
OpName %arg_0 "arg_0"
|
||||
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
|
||||
%v2float = OpTypeVector %float 2
|
||||
%9 = OpTypeFunction %v2float %v2float
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%20 = OpConstantNull %v2float
|
||||
%void = OpTypeVoid
|
||||
%23 = OpTypeFunction %void
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%32 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v2float None %9
|
||||
%x = OpFunctionParameter %v2float
|
||||
%13 = OpLabel
|
||||
%17 = OpFOrdLessThan %v2bool %x %16
|
||||
%21 = OpExtInst %v2float %22 Acosh %x
|
||||
%14 = OpSelect %v2float %17 %20 %21
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%acosh_640883 = OpFunction %void None %23
|
||||
%26 = OpLabel
|
||||
%arg_0 = OpVariable %_ptr_Function_v2float Function %20
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
OpStore %arg_0 %20
|
||||
%30 = OpLoad %v2float %arg_0
|
||||
%29 = OpFunctionCall %v2float %tint_acosh %30
|
||||
OpStore %res %29
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %32
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %acosh_640883
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %23
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %38
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %23
|
||||
%40 = OpLabel
|
||||
%41 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %23
|
||||
%43 = OpLabel
|
||||
%44 = OpFunctionCall %void %acosh_640883
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,20 @@
|
|||
fn acosh_640883() {
|
||||
var arg_0 = vec2<f32>();
|
||||
var res : vec2<f32> = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_640883();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_640883();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_640883();
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<4, f32>) -> vec<4, f32>
|
||||
fn acosh_d51ccb() {
|
||||
var arg_0 = vec4<f32>();
|
||||
var res: vec4<f32> = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_d51ccb();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 arg_0 = vec4(0.0f);
|
||||
vec4 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_d51ccb();
|
||||
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;
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 arg_0 = vec4(0.0f);
|
||||
vec4 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec4 tint_acosh(vec4 x) {
|
||||
return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
vec4 arg_0 = vec4(0.0f);
|
||||
vec4 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
float4 tint_acosh(float4 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 arg_0 = (0.0f).xxxx;
|
||||
float4 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_d51ccb();
|
||||
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() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
float4 tint_acosh(float4 x) {
|
||||
return select(acosh(x), float4(0.0f), (x < float4(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_d51ccb() {
|
||||
float4 arg_0 = float4(0.0f);
|
||||
float4 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_d51ccb();
|
||||
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() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
acosh_d51ccb();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%20 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %tint_acosh "tint_acosh"
|
||||
OpName %x "x"
|
||||
OpName %acosh_d51ccb "acosh_d51ccb"
|
||||
OpName %arg_0 "arg_0"
|
||||
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
|
||||
%9 = OpTypeFunction %v4float %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%void = OpTypeVoid
|
||||
%21 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%30 = OpTypeFunction %v4float
|
||||
%tint_acosh = OpFunction %v4float None %9
|
||||
%x = OpFunctionParameter %v4float
|
||||
%12 = OpLabel
|
||||
%16 = OpFOrdLessThan %v4bool %x %15
|
||||
%19 = OpExtInst %v4float %20 Acosh %x
|
||||
%13 = OpSelect %v4float %16 %5 %19
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%acosh_d51ccb = OpFunction %void None %21
|
||||
%24 = OpLabel
|
||||
%arg_0 = OpVariable %_ptr_Function_v4float Function %5
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
OpStore %arg_0 %5
|
||||
%28 = OpLoad %v4float %arg_0
|
||||
%27 = OpFunctionCall %v4float %tint_acosh %28
|
||||
OpStore %res %27
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %30
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %21
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %36
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %21
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %21
|
||||
%41 = OpLabel
|
||||
%42 = OpFunctionCall %void %acosh_d51ccb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,20 @@
|
|||
fn acosh_d51ccb() {
|
||||
var arg_0 = vec4<f32>();
|
||||
var res : vec4<f32> = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_d51ccb();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_d51ccb();
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/tint/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn acosh(vec<3, f32>) -> vec<3, f32>
|
||||
fn acosh_e38f5c() {
|
||||
var arg_0 = vec3<f32>();
|
||||
var res: vec3<f32> = acosh(arg_0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
acosh_e38f5c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 arg_0 = vec3(0.0f);
|
||||
vec3 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
acosh_e38f5c();
|
||||
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;
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 arg_0 = vec3(0.0f);
|
||||
vec3 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
vec3 tint_acosh(vec3 x) {
|
||||
return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
vec3 arg_0 = vec3(0.0f);
|
||||
vec3 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
acosh_e38f5c();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
float3 tint_acosh(float3 x) {
|
||||
return log((x + sqrt(((x * x) - 1.0f))));
|
||||
}
|
||||
|
||||
void acosh_e38f5c() {
|
||||
float3 arg_0 = (0.0f).xxx;
|
||||
float3 res = tint_acosh(arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
acosh_e38f5c();
|
||||
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() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
acosh_e38f5c();
|
||||
return;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue