tint: const eval of mix builtin
Bug: tint:1581 Change-Id: I3b9f0ff3a58956616daf17b3d4a922979fc30216 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113680 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
b5fedb7b5a
commit
7c9e639e35
|
@ -520,9 +520,9 @@ fn ldexp<N: num, T: f32_f16>(vec<N, T>, vec<N, i32>) -> vec<N, T>
|
|||
@const fn max<N: num, T: fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||
@const fn min<T: fia_fiu32_f16>(T, T) -> T
|
||||
@const fn min<N: num, T: fia_fiu32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||
fn mix<T: f32_f16>(T, T, T) -> T
|
||||
fn mix<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||
fn mix<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
|
||||
@const fn mix<T: fa_f32_f16>(T, T, T) -> T
|
||||
@const fn mix<N: num, T: fa_f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
|
||||
@const fn mix<N: num, T: fa_f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
|
||||
@const fn modf<T: fa_f32_f16>(@test_value(-1.5) T) -> __modf_result<T>
|
||||
@const fn modf<N: num, T: fa_f32_f16>(@test_value(-1.5) vec<N, T>) -> __modf_result_vec<N, T>
|
||||
@const fn normalize<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
|
|
|
@ -2864,6 +2864,49 @@ ConstEval::Result ConstEval::min(const type::Type* ty,
|
|||
return TransformElements(builder, ty, transform, args[0], args[1]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::mix(const type::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
auto transform = [&](const sem::Constant* c0, const sem::Constant* c1, size_t index) {
|
||||
auto create = [&](auto e1, auto e2) -> ImplResult {
|
||||
using NumberT = decltype(e1);
|
||||
// e3 is either a vector or a scalar
|
||||
NumberT e3;
|
||||
auto* c2 = args[2];
|
||||
if (c2->Type()->Is<type::Vector>()) {
|
||||
e3 = c2->Index(index)->As<NumberT>();
|
||||
} else {
|
||||
e3 = c2->As<NumberT>();
|
||||
}
|
||||
// Implement as `e1 * (1 - e3) + e2 * e3)` instead of as `e1 + e3 * (e2 - e1)` to avoid
|
||||
// float precision loss when e1 and e2 significantly differ in magnitude.
|
||||
auto one_sub_e3 = Sub(source, NumberT{1}, e3);
|
||||
if (!one_sub_e3) {
|
||||
return utils::Failure;
|
||||
}
|
||||
auto e1_mul_one_sub_e3 = Mul(source, e1, one_sub_e3.Get());
|
||||
if (!e1_mul_one_sub_e3) {
|
||||
return utils::Failure;
|
||||
}
|
||||
auto e2_mul_e3 = Mul(source, e2, e3);
|
||||
if (!e2_mul_e3) {
|
||||
return utils::Failure;
|
||||
}
|
||||
auto r = Add(source, e1_mul_one_sub_e3.Get(), e2_mul_e3.Get());
|
||||
if (!r) {
|
||||
return utils::Failure;
|
||||
}
|
||||
return CreateElement(builder, source, c0->Type(), r.Get());
|
||||
};
|
||||
return Dispatch_fa_f32_f16(create, c0, c1);
|
||||
};
|
||||
auto r = TransformElements(builder, ty, transform, args[0], args[1]);
|
||||
if (!r) {
|
||||
AddNote("when calculating mix", source);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::modf(const type::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
|
|
|
@ -757,6 +757,15 @@ class ConstEval {
|
|||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// mix builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
/// @param source the source location
|
||||
/// @return the result value, or null if the value cannot be calculated
|
||||
Result mix(const type::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// modf builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
|
|
|
@ -179,7 +179,7 @@ TEST_P(ResolverConstEvalBuiltinTest, Test) {
|
|||
CheckConstant(value, expected_case.values[0], expected_case.flags);
|
||||
}
|
||||
} else {
|
||||
EXPECT_FALSE(r()->Resolve());
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
EXPECT_EQ(r()->error(), c.expected.Failure().error);
|
||||
}
|
||||
}
|
||||
|
@ -1733,6 +1733,94 @@ INSTANTIATE_TEST_SUITE_P( //
|
|||
MinCases<AFloat>(),
|
||||
MinCases<f32>(),
|
||||
MinCases<f16>()))));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> MixCases() {
|
||||
auto r = std::vector<Case>{
|
||||
C({T(0), T(1), T(0)}, T(0)), //
|
||||
C({T(0), T(1), T(1)}, T(1)), //
|
||||
C({T(0), T(1), T(2)}, T(2)), //
|
||||
C({T(0), T(1), T::Highest()}, T::Highest()), //
|
||||
C({T::Lowest(), T::Highest(), T(1)}, T::Highest()), //
|
||||
C({T::Lowest(), T::Highest(), T(0)}, T::Lowest()), //
|
||||
C({T(0), T(1), T(0.25)}, T(0.25)), //
|
||||
C({T(0), T(1), T(0.5)}, T(0.5)), //
|
||||
C({T(0), T(1), T(0.75)}, T(0.75)), //
|
||||
C({T(0), T(1000), T(0.25)}, T(250)), //
|
||||
C({T(0), T(1000), T(0.5)}, T(500)), //
|
||||
C({T(0), T(1000), T(0.75)}, T(750)), //
|
||||
// Swap e1 and e2//
|
||||
C({T(1), T(0), T(0)}, T(1)), //
|
||||
C({T(1), T(0), T(1)}, T(0)), //
|
||||
C({T(1), T(0), T(2)}, T(-1)), //
|
||||
C({T::Highest(), T::Lowest(), T(1)}, T::Lowest()), //
|
||||
C({T::Highest(), T::Lowest(), T(0)}, T::Highest()), //
|
||||
C({T(1), T(0), T(0.25)}, T(0.75)), //
|
||||
C({T(1), T(0), T(0.5)}, T(0.5)), //
|
||||
C({T(1), T(0), T(0.75)}, T(0.25)), //
|
||||
C({T(1000), T(0), T(0.25)}, T(750)), //
|
||||
C({T(1000), T(0), T(0.5)}, T(500)), //
|
||||
C({T(1000), T(0), T(0.75)}, T(250)),
|
||||
|
||||
// mix(vec, vec, vec) cases
|
||||
C({Vec(T(0), T(0), T(0)), //
|
||||
Vec(T(1), T(1), T(1)), //
|
||||
Vec(T(0), T(1), T(2))},
|
||||
Vec(T(0), T(1), T(2))),
|
||||
|
||||
// mix(vec, vec, scalar) cases
|
||||
C({Vec(T(0), T(1), T(0)), //
|
||||
Vec(T(1), T(0), T(1000)), //
|
||||
Val(T(0.25))},
|
||||
Vec(T(0.25), T(0.75), T(250))),
|
||||
};
|
||||
// Can't interpolate lowest value for f16 because (1 - lowest) is not representable as f16.
|
||||
if constexpr (!std::is_same_v<T, f16>) {
|
||||
ConcatInto(r, std::vector<Case>{
|
||||
C({T(0), T(1), T::Lowest()}, T::Lowest()),
|
||||
C({T(1), T(0), T::Highest()}, T::Lowest()),
|
||||
});
|
||||
}
|
||||
|
||||
auto error_msg = [](auto a, const char* op, auto b) {
|
||||
return "12:34 error: " + OverflowErrorMessage(a, op, b) + R"(
|
||||
12:34 note: when calculating mix)";
|
||||
};
|
||||
auto kLargeValue = T{T::Highest() / 2};
|
||||
// Test f16 separately as it overflows for a different reason at the boundary inputs.
|
||||
// Specifically, (1 - lowest) fails for f16 because the result is not representable.
|
||||
if constexpr (!std::is_same_v<T, f16>) {
|
||||
ConcatInto( //
|
||||
r,
|
||||
std::vector<Case>{
|
||||
E({T(0), T::Highest(), T::Highest()}, error_msg(T::Highest(), "*", T::Highest())),
|
||||
E({T(0), T::Lowest(), T::Lowest()}, error_msg(T::Lowest(), "*", T::Lowest())),
|
||||
E({T::Highest(), T(0), T::Lowest()}, error_msg(T::Highest(), "*", T::Highest())),
|
||||
E({-kLargeValue, kLargeValue, T(2)},
|
||||
error_msg(T{-kLargeValue * T(1 - 2)}, "+", T{kLargeValue * T(2)})),
|
||||
});
|
||||
} else {
|
||||
ConcatInto( //
|
||||
r,
|
||||
std::vector<Case>{
|
||||
E({T(0), T::Highest(), T::Highest()}, error_msg(T::Highest(), "*", T::Highest())),
|
||||
E({T(0), T::Lowest(), T::Lowest()}, error_msg(T(1), "-", T::Lowest())),
|
||||
E({T::Highest(), T(0), T::Lowest()}, error_msg(T(1), "-", T::Lowest())),
|
||||
E({-kLargeValue, kLargeValue, T(2)},
|
||||
error_msg(T{-kLargeValue * T(1 - 2)}, "+", T{kLargeValue * T(2)})),
|
||||
});
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Mix,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kMix),
|
||||
testing::ValuesIn(Concat(MixCases<AFloat>(), //
|
||||
MixCases<f32>(), //
|
||||
MixCases<f16>()))));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> ModfCases() {
|
||||
return {
|
||||
|
|
|
@ -101,7 +101,8 @@ inline void CheckConstant(const sem::Constant* got_constant,
|
|||
[&](const auto& expected) {
|
||||
using T = std::decay_t<decltype(expected)>;
|
||||
|
||||
ASSERT_TRUE(std::holds_alternative<T>(got_scalar));
|
||||
ASSERT_TRUE(std::holds_alternative<T>(got_scalar))
|
||||
<< "Scalar variant index: " << got_scalar.index();
|
||||
auto got = std::get<T>(got_scalar);
|
||||
|
||||
if constexpr (std::is_same_v<bool, T>) {
|
||||
|
|
|
@ -11441,36 +11441,36 @@ constexpr OverloadInfo kOverloads[] = {
|
|||
/* num parameters */ 3,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 0,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[10],
|
||||
/* parameters */ &kParameters[468],
|
||||
/* return matcher indices */ &kMatcherIndices[3],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::mix,
|
||||
},
|
||||
{
|
||||
/* [263] */
|
||||
/* num parameters */ 3,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[4],
|
||||
/* parameters */ &kParameters[471],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::mix,
|
||||
},
|
||||
{
|
||||
/* [264] */
|
||||
/* num parameters */ 3,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[4],
|
||||
/* parameters */ &kParameters[474],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::mix,
|
||||
},
|
||||
{
|
||||
/* [265] */
|
||||
|
@ -14294,9 +14294,9 @@ constexpr IntrinsicInfo kBuiltins[] = {
|
|||
},
|
||||
{
|
||||
/* [52] */
|
||||
/* fn mix<T : f32_f16>(T, T, T) -> T */
|
||||
/* fn mix<N : num, T : f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
|
||||
/* fn mix<N : num, T : f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T> */
|
||||
/* fn mix<T : fa_f32_f16>(T, T, T) -> T */
|
||||
/* fn mix<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> */
|
||||
/* fn mix<N : num, T : fa_f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T> */
|
||||
/* num overloads */ 3,
|
||||
/* overloads */ &kOverloads[262],
|
||||
},
|
||||
|
|
|
@ -1483,68 +1483,6 @@ Case::Create<u32V, u32V, u32V, u32V, u32V, u32V, AIntV>(
|
|||
// clang-format on
|
||||
));
|
||||
|
||||
struct IntrinsicTableAbstractTernaryTest_NonConstEval : public ResolverTestWithParam<Case> {
|
||||
std::unique_ptr<IntrinsicTable> table = IntrinsicTable::Create(*this);
|
||||
};
|
||||
|
||||
TEST_P(IntrinsicTableAbstractTernaryTest_NonConstEval, MatchMix) {
|
||||
auto* arg_a = GetParam().arg_a(*this);
|
||||
auto* arg_b = GetParam().arg_b(*this);
|
||||
auto* arg_c = GetParam().arg_c(*this);
|
||||
auto builtin = table->Lookup(sem::BuiltinType::kMix, utils::Vector{arg_a, arg_b, arg_c},
|
||||
sem::EvaluationStage::kConstant, Source{{12, 34}});
|
||||
|
||||
bool matched = builtin.sem != nullptr;
|
||||
bool expected_match = GetParam().expected_match;
|
||||
EXPECT_EQ(matched, expected_match) << Diagnostics().str();
|
||||
|
||||
auto* result = builtin.sem ? builtin.sem->ReturnType() : nullptr;
|
||||
auto* expected_result = GetParam().expected_result(*this);
|
||||
EXPECT_TYPE(result, expected_result);
|
||||
|
||||
auto* param_a = builtin.sem ? builtin.sem->Parameters()[0]->Type() : nullptr;
|
||||
auto* expected_param_a = GetParam().expected_param_a(*this);
|
||||
EXPECT_TYPE(param_a, expected_param_a);
|
||||
|
||||
auto* param_b = builtin.sem ? builtin.sem->Parameters()[1]->Type() : nullptr;
|
||||
auto* expected_param_b = GetParam().expected_param_b(*this);
|
||||
EXPECT_TYPE(param_b, expected_param_b);
|
||||
|
||||
auto* param_c = builtin.sem ? builtin.sem->Parameters()[2]->Type() : nullptr;
|
||||
auto* expected_param_c = GetParam().expected_param_c(*this);
|
||||
EXPECT_TYPE(param_c, expected_param_c);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AFloat_f32,
|
||||
IntrinsicTableAbstractTernaryTest_NonConstEval,
|
||||
testing::Values( // clang-format off
|
||||
// result | param a | param b | param c | arg a | arg b | arg c
|
||||
Case::Create<f32, f32, f32, f32, AFloat, AFloat, AFloat>(),
|
||||
Case::Create<f32, f32, f32, f32, AFloat, AFloat, f32>(),
|
||||
Case::Create<f32, f32, f32, f32, AFloat, f32, AFloat>(),
|
||||
Case::Create<f32, f32, f32, f32, AFloat, f32, f32>(),
|
||||
Case::Create<f32, f32, f32, f32, f32, AFloat, AFloat>(),
|
||||
Case::Create<f32, f32, f32, f32, f32, AFloat, f32>(),
|
||||
Case::Create<f32, f32, f32, f32, f32, f32, AFloat>()
|
||||
// clang-format on
|
||||
));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
VecAFloat_Vecf32,
|
||||
IntrinsicTableAbstractTernaryTest_NonConstEval,
|
||||
testing::Values( // clang-format off
|
||||
// result | param a | param b | param c | arg a | arg b | arg c
|
||||
Case::Create<f32V, f32V, f32V, f32V, AFloatV, AFloatV, AFloatV>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, AFloatV, AFloatV, f32V>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, AFloatV, f32V, AFloatV>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, AFloatV, f32V, f32V>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, f32V, AFloatV, AFloatV>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, f32V, AFloatV, f32V>(),
|
||||
Case::Create<f32V, f32V, f32V, f32V, f32V, f32V, AFloatV> ()
|
||||
// clang-format on
|
||||
));
|
||||
|
||||
} // namespace AbstractTernaryTests
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float a = lerp(1.0f, 1.0f, 1.0f);
|
||||
const float a = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float a = lerp(1.0f, 1.0f, 1.0f);
|
||||
const float a = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void tint_symbol() {
|
||||
float a = mix(1.0f, 1.0f, 1.0f);
|
||||
float a = 1.0f;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
float const a = mix(1.0f, 1.0f, 1.0f);
|
||||
float const a = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 9
|
||||
; Bound: 7
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%7 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
|
@ -15,6 +14,5 @@
|
|||
%float_1 = OpConstant %float 1
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%5 = OpExtInst %float %7 FMix %float_1 %float_1 %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_0c8c33() {
|
||||
float3 res = lerp((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_0c8c33() {
|
||||
float3 res = lerp((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_0c8c33() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_0c8c33() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_0c8c33() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), vec3(1.0f));
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_0c8c33() {
|
||||
float3 res = mix(float3(1.0f), float3(1.0f), float3(1.0f));
|
||||
float3 res = float3(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -33,36 +32,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%20 = OpConstantNull %v3float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_0c8c33 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%13 = OpExtInst %v3float %15 FMix %17 %17 %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %mix_0c8c33
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_0c8c33
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %27
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_0c8c33
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_0c8c33
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_0c8c33
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_0c8c33
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_1faeb1() {
|
||||
float4 res = lerp((1.0f).xxxx, (1.0f).xxxx, 1.0f);
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_1faeb1() {
|
||||
float4 res = lerp((1.0f).xxxx, (1.0f).xxxx, 1.0f);
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_1faeb1() {
|
||||
vec4 res = mix(vec4(1.0f), vec4(1.0f), 1.0f);
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_1faeb1() {
|
||||
vec4 res = mix(vec4(1.0f), vec4(1.0f), 1.0f);
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_1faeb1() {
|
||||
vec4 res = mix(vec4(1.0f), vec4(1.0f), 1.0f);
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_1faeb1() {
|
||||
float4 res = mix(float4(1.0f), float4(1.0f), 1.0f);
|
||||
float4 res = float4(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -32,37 +31,34 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%mix_1faeb1 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%17 = OpVariable %_ptr_Function_v4float Function %5
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%19 = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%13 = OpExtInst %v4float %14 FMix %16 %16 %19
|
||||
OpStore %res %13
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %mix_1faeb1
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %mix_1faeb1
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %27
|
||||
%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
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_1faeb1
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %mix_1faeb1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_1faeb1
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %mix_1faeb1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(vec<4, fa>, vec<4, fa>, fa) -> vec<4, fa>
|
||||
fn mix_275cac() {
|
||||
var res = mix(vec4(1.), vec4(1.), 1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_275cac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_275cac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_275cac();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_275cac() {
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_275cac();
|
||||
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() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_275cac() {
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_275cac();
|
||||
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() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_275cac() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_275cac();
|
||||
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 mix_275cac() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_275cac();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_275cac() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_275cac();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_275cac() {
|
||||
float4 res = float4(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_275cac();
|
||||
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() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_275cac();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_275cac "mix_275cac"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%mix_275cac = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %mix_275cac
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %mix_275cac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %mix_275cac
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_275cac() {
|
||||
var res = mix(vec4(1.0), vec4(1.0), 1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_275cac();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_275cac();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_275cac();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_2fadab() {
|
||||
float2 res = lerp((1.0f).xx, (1.0f).xx, 1.0f);
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_2fadab() {
|
||||
float2 res = lerp((1.0f).xx, (1.0f).xx, 1.0f);
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_2fadab() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), 1.0f);
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_2fadab() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), 1.0f);
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_2fadab() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), 1.0f);
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_2fadab() {
|
||||
float2 res = mix(float2(1.0f), float2(1.0f), 1.0f);
|
||||
float2 res = float2(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -33,38 +32,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%15 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%20 = OpConstantNull %v2float
|
||||
%23 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_2fadab = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%18 = OpVariable %_ptr_Function_v2float Function %20
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%21 = OpCompositeConstruct %v2float %float_1 %float_1
|
||||
%13 = OpExtInst %v2float %15 FMix %17 %17 %21
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %23
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %mix_2fadab
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_2fadab
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %29
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %mix_2fadab
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_2fadab
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %mix_2fadab
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_2fadab
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(fa, fa, fa) -> fa
|
||||
fn mix_30de36() {
|
||||
var res = mix(1., 1., 1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_30de36();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_30de36();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_30de36();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_30de36();
|
||||
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() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_30de36();
|
||||
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() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_30de36();
|
||||
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 mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_30de36();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_30de36();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_30de36() {
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_30de36();
|
||||
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() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_30de36();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 29
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_30de36 "mix_30de36"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%mix_30de36 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %mix_30de36
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %22
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %mix_30de36
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_30de36
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_30de36() {
|
||||
var res = mix(1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_30de36();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_30de36();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_30de36();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_315264() {
|
||||
float3 res = lerp((1.0f).xxx, (1.0f).xxx, 1.0f);
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_315264() {
|
||||
float3 res = lerp((1.0f).xxx, (1.0f).xxx, 1.0f);
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_315264() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), 1.0f);
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_315264() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), 1.0f);
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_315264() {
|
||||
vec3 res = mix(vec3(1.0f), vec3(1.0f), 1.0f);
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_315264() {
|
||||
float3 res = mix(float3(1.0f), float3(1.0f), 1.0f);
|
||||
float3 res = float3(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -33,38 +32,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%20 = OpConstantNull %v3float
|
||||
%23 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_315264 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%18 = OpVariable %_ptr_Function_v3float Function %20
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%21 = OpCompositeConstruct %v3float %float_1 %float_1 %float_1
|
||||
%13 = OpExtInst %v3float %15 FMix %17 %17 %21
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %23
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %mix_315264
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_315264
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %29
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %mix_315264
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_315264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %mix_315264
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_315264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(vec<3, fa>, vec<3, fa>, vec<3, fa>) -> vec<3, fa>
|
||||
fn mix_343c49() {
|
||||
var res = mix(vec3(1.), vec3(1.), vec3(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_343c49();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_343c49();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_343c49();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_343c49() {
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_343c49();
|
||||
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() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_343c49() {
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_343c49();
|
||||
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() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_343c49() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_343c49();
|
||||
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 mix_343c49() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_343c49();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_343c49() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_343c49();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_343c49() {
|
||||
float3 res = float3(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_343c49();
|
||||
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() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_343c49();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_343c49 "mix_343c49"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_343c49 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_343c49
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_343c49
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_343c49
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_343c49() {
|
||||
var res = mix(vec3(1.0), vec3(1.0), vec3(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_343c49();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_343c49();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_343c49();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_38cbbb() {
|
||||
float16_t res = lerp(float16_t(1.0h), float16_t(1.0h), float16_t(1.0h));
|
||||
float16_t res = float16_t(1.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_38cbbb() {
|
||||
float16_t res = mix(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 1.0hf;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_38cbbb() {
|
||||
float16_t res = mix(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 1.0hf;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_38cbbb() {
|
||||
float16_t res = mix(1.0hf, 1.0hf, 1.0hf);
|
||||
float16_t res = 1.0hf;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_38cbbb() {
|
||||
half res = mix(1.0h, 1.0h, 1.0h);
|
||||
half res = 1.0h;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -38,35 +37,34 @@
|
|||
%half = OpTypeFloat 16
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%_ptr_Function_half = OpTypePointer Function %half
|
||||
%19 = OpConstantNull %half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%17 = OpConstantNull %half
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%mix_38cbbb = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_half Function %19
|
||||
%13 = OpExtInst %half %15 FMix %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_half Function %17
|
||||
OpStore %res %half_0x1p_0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %mix_38cbbb
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %mix_38cbbb
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_38cbbb
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_38cbbb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_38cbbb
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_38cbbb
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(vec<2, fa>, vec<2, fa>, fa) -> vec<2, fa>
|
||||
fn mix_42d11d() {
|
||||
var res = mix(vec2(1.), vec2(1.), 1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_42d11d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_42d11d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_42d11d();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_42d11d() {
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_42d11d();
|
||||
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() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_42d11d() {
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_42d11d();
|
||||
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() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_42d11d() {
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_42d11d();
|
||||
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 mix_42d11d() {
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_42d11d();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_42d11d() {
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_42d11d();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_42d11d() {
|
||||
float2 res = float2(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_42d11d();
|
||||
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() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_42d11d();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_42d11d "mix_42d11d"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_42d11d = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_42d11d
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_42d11d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_42d11d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_42d11d() {
|
||||
var res = mix(vec2(1.0), vec2(1.0), 1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_42d11d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_42d11d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_42d11d();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_4f0b5e() {
|
||||
float res = lerp(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_4f0b5e() {
|
||||
float res = lerp(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_4f0b5e() {
|
||||
float res = mix(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_4f0b5e() {
|
||||
float res = mix(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_4f0b5e() {
|
||||
float res = mix(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_4f0b5e() {
|
||||
float res = mix(1.0f, 1.0f, 1.0f);
|
||||
float res = 1.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Bound: 29
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%14 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -33,33 +32,32 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%16 = OpTypeFunction %v4float
|
||||
%mix_4f0b5e = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 FMix %float_1 %float_1 %float_1
|
||||
OpStore %res %13
|
||||
OpStore %res %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %mix_4f0b5e
|
||||
%vertex_main_inner = OpFunction %v4float None %16
|
||||
%18 = OpLabel
|
||||
%19 = OpFunctionCall %void %mix_4f0b5e
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %22
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %mix_4f0b5e
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %mix_4f0b5e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_4f0b5e
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_4f0b5e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_63f2fd() {
|
||||
vector<float16_t, 3> res = lerp((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_63f2fd() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_63f2fd() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_63f2fd() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_63f2fd() {
|
||||
half3 res = mix(half3(1.0h), half3(1.0h), half3(1.0h));
|
||||
half3 res = half3(1.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -38,37 +37,36 @@
|
|||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%21 = OpConstantNull %v3half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v3half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%mix_63f2fd = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%13 = OpExtInst %v3half %16 FMix %18 %18 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %mix_63f2fd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %mix_63f2fd
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %mix_63f2fd
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_63f2fd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %mix_63f2fd
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_63f2fd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_6f8adc() {
|
||||
float2 res = lerp((1.0f).xx, (1.0f).xx, (1.0f).xx);
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void mix_6f8adc() {
|
||||
float2 res = lerp((1.0f).xx, (1.0f).xx, (1.0f).xx);
|
||||
float2 res = (1.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_6f8adc() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_6f8adc() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void mix_6f8adc() {
|
||||
vec2 res = mix(vec2(1.0f), vec2(1.0f), vec2(1.0f));
|
||||
vec2 res = vec2(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_6f8adc() {
|
||||
float2 res = mix(float2(1.0f), float2(1.0f), float2(1.0f));
|
||||
float2 res = float2(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -33,36 +32,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%15 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%20 = OpConstantNull %v2float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%18 = OpConstantNull %v2float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_6f8adc = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%13 = OpExtInst %v2float %15 FMix %17 %17 %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %mix_6f8adc
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_6f8adc
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %27
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_6f8adc
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_6f8adc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_6f8adc
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_6f8adc
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(vec<4, fa>, vec<4, fa>, vec<4, fa>) -> vec<4, fa>
|
||||
fn mix_98007a() {
|
||||
var res = mix(vec4(1.), vec4(1.), vec4(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_98007a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_98007a();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_98007a();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_98007a() {
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_98007a();
|
||||
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() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_98007a() {
|
||||
float4 res = (1.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_98007a();
|
||||
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() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_98007a() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_98007a();
|
||||
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 mix_98007a() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_98007a();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_98007a() {
|
||||
vec4 res = vec4(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_98007a();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_98007a() {
|
||||
float4 res = float4(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_98007a();
|
||||
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() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_98007a();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_98007a "mix_98007a"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%mix_98007a = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %mix_98007a
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %void %mix_98007a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
%29 = OpFunctionCall %void %mix_98007a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_98007a() {
|
||||
var res = mix(vec4(1.0), vec4(1.0), vec4(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_98007a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_98007a();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_98007a();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_98ee3e() {
|
||||
vector<float16_t, 2> res = lerp((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
|
||||
vector<float16_t, 2> res = (float16_t(1.0h)).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_98ee3e() {
|
||||
f16vec2 res = mix(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_98ee3e() {
|
||||
f16vec2 res = mix(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_98ee3e() {
|
||||
f16vec2 res = mix(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(1.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_98ee3e() {
|
||||
half2 res = mix(half2(1.0h), half2(1.0h), half2(1.0h));
|
||||
half2 res = half2(1.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -38,37 +37,36 @@
|
|||
%half = OpTypeFloat 16
|
||||
%v2half = OpTypeVector %half 2
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
|
||||
%16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
|
||||
%_ptr_Function_v2half = OpTypePointer Function %v2half
|
||||
%21 = OpConstantNull %v2half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v2half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%mix_98ee3e = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2half Function %21
|
||||
%13 = OpExtInst %v2half %16 FMix %18 %18 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %mix_98ee3e
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %mix_98ee3e
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %mix_98ee3e
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_98ee3e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %mix_98ee3e
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_98ee3e
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2022 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/src/cmd/gen
|
||||
// using the template:
|
||||
// test/tint/builtins/gen/gen.wgsl.tmpl
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn mix(vec<3, fa>, vec<3, fa>, fa) -> vec<3, fa>
|
||||
fn mix_9c2681() {
|
||||
var res = mix(vec3(1.), vec3(1.), 1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_9c2681();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_9c2681();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_9c2681();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_9c2681() {
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_9c2681();
|
||||
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() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void mix_9c2681() {
|
||||
float3 res = (1.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_9c2681();
|
||||
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() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void mix_9c2681() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
mix_9c2681();
|
||||
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 mix_9c2681() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
mix_9c2681();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void mix_9c2681() {
|
||||
vec3 res = vec3(1.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
mix_9c2681();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
compute_main();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void mix_9c2681() {
|
||||
float3 res = float3(1.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
mix_9c2681();
|
||||
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() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
mix_9c2681();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %mix_9c2681 "mix_9c2681"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%18 = OpConstantNull %v3float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%mix_9c2681 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %18
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %mix_9c2681
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %mix_9c2681
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %mix_9c2681
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn mix_9c2681() {
|
||||
var res = mix(vec3(1.0), vec3(1.0), 1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
mix_9c2681();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
mix_9c2681();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
mix_9c2681();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void mix_c1aec6() {
|
||||
vector<float16_t, 3> res = lerp((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, float16_t(1.0h));
|
||||
vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_c1aec6() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), 1.0hf);
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void mix_c1aec6() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), 1.0hf);
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void mix_c1aec6() {
|
||||
f16vec3 res = mix(f16vec3(1.0hf), f16vec3(1.0hf), 1.0hf);
|
||||
f16vec3 res = f16vec3(1.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void mix_c1aec6() {
|
||||
half3 res = mix(half3(1.0h), half3(1.0h), 1.0h);
|
||||
half3 res = half3(1.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 38
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -38,39 +37,36 @@
|
|||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%21 = OpConstantNull %v3half
|
||||
%24 = OpTypeFunction %v4float
|
||||
%19 = OpConstantNull %v3half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%mix_c1aec6 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%19 = OpVariable %_ptr_Function_v3half Function %21
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%22 = OpCompositeConstruct %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%13 = OpExtInst %v3half %16 FMix %18 %18 %22
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3half Function %19
|
||||
OpStore %res %16
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %24
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %mix_c1aec6
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %mix_c1aec6
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %30
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %mix_c1aec6
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %mix_c1aec6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %mix_c1aec6
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %mix_c1aec6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue