Add const-eval for `log` and `log2`.
This CL adds const-eval routines for `log` and `log2`. Bug: tint:1581 Change-Id: I052b5ddd3bc8bdcd7c0925fa7912dcbe1a60e299 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111323 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
7a9fe30b11
commit
f2ad5fd260
|
@ -493,10 +493,10 @@ fn ldexp<T: f32_f16>(T, i32) -> T
|
|||
fn ldexp<N: num, T: f32_f16>(vec<N, T>, vec<N, i32>) -> vec<N, T>
|
||||
@const fn length<T: fa_f32_f16>(@test_value(0.0) T) -> T
|
||||
@const fn length<N: num, T: fa_f32_f16>(@test_value(0.0) vec<N, T>) -> T
|
||||
fn log<T: f32_f16>(T) -> T
|
||||
fn log<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
fn log2<T: f32_f16>(T) -> T
|
||||
fn log2<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn log<T: fa_f32_f16>(T) -> T
|
||||
@const fn log<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn log2<T: fa_f32_f16>(T) -> T
|
||||
@const fn log2<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
|
||||
@const fn max<T: fia_fiu32_f16>(T, T) -> 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
|
||||
|
|
|
@ -1099,7 +1099,7 @@ TEST_P(FloatAllMatching, Scalar) {
|
|||
|
||||
utils::Vector<const ast::Expression*, 8> params;
|
||||
for (uint32_t i = 0; i < num_params; ++i) {
|
||||
params.Push(Expr(f32(i)));
|
||||
params.Push(Expr(f32(i + 1)));
|
||||
}
|
||||
auto* builtin = Call(name, params);
|
||||
Func("func", utils::Empty, ty.void_(),
|
||||
|
@ -1120,7 +1120,7 @@ TEST_P(FloatAllMatching, Vec2) {
|
|||
|
||||
utils::Vector<const ast::Expression*, 8> params;
|
||||
for (uint32_t i = 0; i < num_params; ++i) {
|
||||
params.Push(vec2<f32>(f32(i), f32(i)));
|
||||
params.Push(vec2<f32>(f32(i + 1), f32(i + 1)));
|
||||
}
|
||||
auto* builtin = Call(name, params);
|
||||
Func("func", utils::Empty, ty.void_(),
|
||||
|
@ -1141,7 +1141,7 @@ TEST_P(FloatAllMatching, Vec3) {
|
|||
|
||||
utils::Vector<const ast::Expression*, 8> params;
|
||||
for (uint32_t i = 0; i < num_params; ++i) {
|
||||
params.Push(vec3<f32>(f32(i), f32(i), f32(i)));
|
||||
params.Push(vec3<f32>(f32(i + 1), f32(i + 1), f32(i + 1)));
|
||||
}
|
||||
auto* builtin = Call(name, params);
|
||||
Func("func", utils::Empty, ty.void_(),
|
||||
|
@ -1162,7 +1162,7 @@ TEST_P(FloatAllMatching, Vec4) {
|
|||
|
||||
utils::Vector<const ast::Expression*, 8> params;
|
||||
for (uint32_t i = 0; i < num_params; ++i) {
|
||||
params.Push(vec4<f32>(f32(i), f32(i), f32(i), f32(i)));
|
||||
params.Push(vec4<f32>(f32(i + 1), f32(i + 1), f32(i + 1), f32(i + 1)));
|
||||
}
|
||||
auto* builtin = Call(name, params);
|
||||
Func("func", utils::Empty, ty.void_(),
|
||||
|
|
|
@ -2300,6 +2300,40 @@ ConstEval::Result ConstEval::length(const sem::Type* ty,
|
|||
return r;
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::log(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
auto transform = [&](const sem::Constant* c0) {
|
||||
auto create = [&](auto v) -> ImplResult {
|
||||
using NumberT = decltype(v);
|
||||
if (v <= NumberT(0)) {
|
||||
AddError("log must be called with a value > 0", source);
|
||||
return utils::Failure;
|
||||
}
|
||||
return CreateElement(builder, source, c0->Type(), NumberT(std::log(v)));
|
||||
};
|
||||
return Dispatch_fa_f32_f16(create, c0);
|
||||
};
|
||||
return TransformElements(builder, ty, transform, args[0]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::log2(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
auto transform = [&](const sem::Constant* c0) {
|
||||
auto create = [&](auto v) -> ImplResult {
|
||||
using NumberT = decltype(v);
|
||||
if (v <= NumberT(0)) {
|
||||
AddError("log2 must be called with a value > 0", source);
|
||||
return utils::Failure;
|
||||
}
|
||||
return CreateElement(builder, source, c0->Type(), NumberT(std::log2(v)));
|
||||
};
|
||||
return Dispatch_fa_f32_f16(create, c0);
|
||||
};
|
||||
return TransformElements(builder, ty, transform, args[0]);
|
||||
}
|
||||
|
||||
ConstEval::Result ConstEval::max(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source) {
|
||||
|
|
|
@ -628,6 +628,24 @@ class ConstEval {
|
|||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// log 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 log(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// log2 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 log2(const sem::Type* ty,
|
||||
utils::VectorRef<const sem::Constant*> args,
|
||||
const Source& source);
|
||||
|
||||
/// max builtin
|
||||
/// @param ty the expression type
|
||||
/// @param args the input arguments
|
||||
|
|
|
@ -1296,6 +1296,110 @@ INSTANTIATE_TEST_SUITE_P( //
|
|||
LengthCases<f32>(),
|
||||
LengthCases<f16>()))));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> LogCases() {
|
||||
auto error_msg = [] { return "12:34 error: log must be called with a value > 0"; };
|
||||
return std::vector<Case>{C({T(1)}, T(0)), //
|
||||
C({T(54.598150033)}, T(4)).FloatComp(0.002), //
|
||||
|
||||
E({T::Lowest()}, error_msg()), E({T(0)}, error_msg()),
|
||||
E({-T(0)}, error_msg())};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Log,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog),
|
||||
testing::ValuesIn(Concat(LogCases<AFloat>(), //
|
||||
LogCases<f32>(),
|
||||
LogCases<f16>()))));
|
||||
template <typename T>
|
||||
std::vector<Case> LogF16Cases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(11.085938)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
LogF16,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog),
|
||||
testing::ValuesIn(LogF16Cases<f16>())));
|
||||
template <typename T>
|
||||
std::vector<Case> LogF32Cases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(88.722839)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
LogF32,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog),
|
||||
testing::ValuesIn(LogF32Cases<f32>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> LogAbstractCases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(709.78271)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
LogAbstract,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog),
|
||||
testing::ValuesIn(LogAbstractCases<AFloat>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> Log2Cases() {
|
||||
auto error_msg = [] { return "12:34 error: log2 must be called with a value > 0"; };
|
||||
return std::vector<Case>{
|
||||
C({T(1)}, T(0)), //
|
||||
C({T(4)}, T(2)), //
|
||||
|
||||
E({T::Lowest()}, error_msg()),
|
||||
E({T(0)}, error_msg()),
|
||||
E({-T(0)}, error_msg()),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Log2,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog2),
|
||||
testing::ValuesIn(Concat(Log2Cases<AFloat>(), //
|
||||
Log2Cases<f32>(),
|
||||
Log2Cases<f16>()))));
|
||||
template <typename T>
|
||||
std::vector<Case> Log2F16Cases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(15.9922)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Log2F16,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog2),
|
||||
testing::ValuesIn(Log2F16Cases<f16>())));
|
||||
template <typename T>
|
||||
std::vector<Case> Log2F32Cases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(128)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Log2F32,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog2),
|
||||
testing::ValuesIn(Log2F32Cases<f32>())));
|
||||
template <typename T>
|
||||
std::vector<Case> Log2AbstractCases() {
|
||||
return std::vector<Case>{
|
||||
C({T::Highest()}, T(1024)).FloatComp(),
|
||||
};
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P( //
|
||||
Log2Abstract,
|
||||
ResolverConstEvalBuiltinTest,
|
||||
testing::Combine(testing::Values(sem::BuiltinType::kLog2),
|
||||
testing::ValuesIn(Log2AbstractCases<AFloat>())));
|
||||
|
||||
template <typename T>
|
||||
std::vector<Case> MaxCases() {
|
||||
return {
|
||||
|
|
|
@ -12750,48 +12750,48 @@ constexpr OverloadInfo kOverloads[] = {
|
|||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 0,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[10],
|
||||
/* parameters */ &kParameters[874],
|
||||
/* return matcher indices */ &kMatcherIndices[3],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::log,
|
||||
},
|
||||
{
|
||||
/* [370] */
|
||||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[4],
|
||||
/* parameters */ &kParameters[875],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::log,
|
||||
},
|
||||
{
|
||||
/* [371] */
|
||||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 0,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[10],
|
||||
/* parameters */ &kParameters[876],
|
||||
/* return matcher indices */ &kMatcherIndices[3],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::log2,
|
||||
},
|
||||
{
|
||||
/* [372] */
|
||||
/* num parameters */ 1,
|
||||
/* num template types */ 1,
|
||||
/* num template numbers */ 1,
|
||||
/* template types */ &kTemplateTypes[26],
|
||||
/* template types */ &kTemplateTypes[23],
|
||||
/* template numbers */ &kTemplateNumbers[4],
|
||||
/* parameters */ &kParameters[877],
|
||||
/* return matcher indices */ &kMatcherIndices[30],
|
||||
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
|
||||
/* const eval */ nullptr,
|
||||
/* const eval */ &ConstEval::log2,
|
||||
},
|
||||
{
|
||||
/* [373] */
|
||||
|
@ -14315,15 +14315,15 @@ constexpr IntrinsicInfo kBuiltins[] = {
|
|||
},
|
||||
{
|
||||
/* [48] */
|
||||
/* fn log<T : f32_f16>(T) -> T */
|
||||
/* fn log<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
|
||||
/* fn log<T : fa_f32_f16>(T) -> T */
|
||||
/* fn log<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
|
||||
/* num overloads */ 2,
|
||||
/* overloads */ &kOverloads[369],
|
||||
},
|
||||
{
|
||||
/* [49] */
|
||||
/* fn log2<T : f32_f16>(T) -> T */
|
||||
/* fn log2<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
|
||||
/* fn log2<T : fa_f32_f16>(T) -> T */
|
||||
/* fn log2<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
|
||||
/* num overloads */ 2,
|
||||
/* overloads */ &kOverloads[371],
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_3da25a() {
|
||||
float4 res = log((1.0f).xxxx);
|
||||
float4 res = (0.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_3da25a() {
|
||||
float4 res = log((1.0f).xxxx);
|
||||
float4 res = (0.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void log_3da25a() {
|
||||
vec4 res = log(vec4(1.0f));
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_3da25a() {
|
||||
vec4 res = log(vec4(1.0f));
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void log_3da25a() {
|
||||
vec4 res = log(vec4(1.0f));
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_3da25a() {
|
||||
float4 res = log(float4(1.0f));
|
||||
float4 res = float4(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 32
|
||||
; 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"
|
||||
|
@ -31,36 +30,34 @@
|
|||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%19 = OpTypeFunction %v4float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_3da25a = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
%13 = OpExtInst %v4float %14 Log %16
|
||||
OpStore %res %13
|
||||
OpStore %res %5
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %19
|
||||
%21 = OpLabel
|
||||
%22 = OpFunctionCall %void %log_3da25a
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log_3da25a
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %25
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_3da25a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_3da25a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %log_3da25a
|
||||
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 log(fa) -> fa
|
||||
fn log_655989() {
|
||||
var res = log(1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_655989();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_655989();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_655989();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_655989();
|
||||
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() {
|
||||
log_655989();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_655989();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_655989();
|
||||
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() {
|
||||
log_655989();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_655989();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log_655989();
|
||||
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 log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log_655989();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log_655989();
|
||||
}
|
||||
|
||||
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 log_655989() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_655989();
|
||||
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() {
|
||||
log_655989();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log_655989();
|
||||
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 %log_655989 "log_655989"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_655989 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log_655989
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_655989
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_655989
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log_655989() {
|
||||
var res = log(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_655989();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_655989();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_655989();
|
||||
}
|
|
@ -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 log(vec<4, fa>) -> vec<4, fa>
|
||||
fn log_697e1d() {
|
||||
var res = log(vec4(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_697e1d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_697e1d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_697e1d();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_697e1d() {
|
||||
float4 res = (0.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_697e1d();
|
||||
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() {
|
||||
log_697e1d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_697e1d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_697e1d() {
|
||||
float4 res = (0.0f).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_697e1d();
|
||||
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() {
|
||||
log_697e1d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_697e1d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log_697e1d() {
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log_697e1d();
|
||||
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 log_697e1d() {
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log_697e1d();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log_697e1d() {
|
||||
vec4 res = vec4(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log_697e1d();
|
||||
}
|
||||
|
||||
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 log_697e1d() {
|
||||
float4 res = float4(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_697e1d();
|
||||
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() {
|
||||
log_697e1d();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log_697e1d();
|
||||
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 %log_697e1d "log_697e1d"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_697e1d = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4float Function %5
|
||||
OpStore %res %5
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log_697e1d
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_697e1d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_697e1d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log_697e1d() {
|
||||
var res = log(vec4(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_697e1d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_697e1d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_697e1d();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void log_6ff86f() {
|
||||
vector<float16_t, 3> res = log((float16_t(1.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_6ff86f() {
|
||||
f16vec3 res = log(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_6ff86f() {
|
||||
f16vec3 res = log(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_6ff86f() {
|
||||
f16vec3 res = log(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_6ff86f() {
|
||||
half3 res = log(half3(1.0h));
|
||||
half3 res = half3(0.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%15 = OpConstantNull %v3half
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%21 = OpConstantNull %v3half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_6ff86f = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%13 = OpExtInst %v3half %16 Log %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3half Function %15
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_6ff86f
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log_6ff86f
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %log_6ff86f
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_6ff86f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %log_6ff86f
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %log_6ff86f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_7114a6() {
|
||||
float res = log(1.0f);
|
||||
float res = 0.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"
|
||||
|
@ -31,35 +30,34 @@
|
|||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_7114a6 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 Log %float_1
|
||||
OpStore %res %13
|
||||
OpStore %res %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log_7114a6
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log_7114a6
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_7114a6
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_7114a6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_7114a6
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_7114a6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_8f0e32() {
|
||||
vector<float16_t, 2> res = log((float16_t(1.0h)).xx);
|
||||
vector<float16_t, 2> res = (float16_t(0.0h)).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_8f0e32() {
|
||||
f16vec2 res = log(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_8f0e32() {
|
||||
f16vec2 res = log(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_8f0e32() {
|
||||
f16vec2 res = log(f16vec2(1.0hf));
|
||||
f16vec2 res = f16vec2(0.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_8f0e32() {
|
||||
half2 res = log(half2(1.0h));
|
||||
half2 res = half2(0.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v2half = OpTypeVector %half 2
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
|
||||
%15 = OpConstantNull %v2half
|
||||
%_ptr_Function_v2half = OpTypePointer Function %v2half
|
||||
%21 = OpConstantNull %v2half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_8f0e32 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2half Function %21
|
||||
%13 = OpExtInst %v2half %16 Log %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2half Function %15
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_8f0e32
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log_8f0e32
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %log_8f0e32
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_8f0e32
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %log_8f0e32
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %log_8f0e32
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_b2ce28() {
|
||||
float2 res = log((1.0f).xx);
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_b2ce28() {
|
||||
float2 res = log((1.0f).xx);
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void log_b2ce28() {
|
||||
vec2 res = log(vec2(1.0f));
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_b2ce28() {
|
||||
vec2 res = log(vec2(1.0f));
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void log_b2ce28() {
|
||||
vec2 res = log(vec2(1.0f));
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_b2ce28() {
|
||||
float2 res = log(float2(1.0f));
|
||||
float2 res = float2(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -32,37 +31,35 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v2float %float_1 %float_1
|
||||
%14 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%20 = OpConstantNull %v2float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_b2ce28 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %20
|
||||
%13 = OpExtInst %v2float %15 Log %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v2float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %log_b2ce28
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log_b2ce28
|
||||
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
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_b2ce28
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_b2ce28
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %log_b2ce28
|
||||
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 log(vec<3, fa>) -> vec<3, fa>
|
||||
fn log_b8088d() {
|
||||
var res = log(vec3(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_b8088d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_b8088d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_b8088d();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_b8088d() {
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_b8088d();
|
||||
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() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_b8088d() {
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_b8088d();
|
||||
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() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log_b8088d() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log_b8088d();
|
||||
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 log_b8088d() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log_b8088d();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log_b8088d() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log_b8088d();
|
||||
}
|
||||
|
||||
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 log_b8088d() {
|
||||
float3 res = float3(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_b8088d();
|
||||
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() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log_b8088d();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %log_b8088d "log_b8088d"
|
||||
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
|
||||
%14 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_b8088d = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log_b8088d
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_b8088d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_b8088d
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log_b8088d() {
|
||||
var res = log(vec3(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_b8088d();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_b8088d();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_b8088d();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void log_c9f489() {
|
||||
float16_t res = log(float16_t(1.0h));
|
||||
float16_t res = float16_t(0.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_c9f489() {
|
||||
float16_t res = log(1.0hf);
|
||||
float16_t res = 0.0hf;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_c9f489() {
|
||||
float16_t res = log(1.0hf);
|
||||
float16_t res = 0.0hf;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_c9f489() {
|
||||
float16_t res = log(1.0hf);
|
||||
float16_t res = 0.0hf;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_c9f489() {
|
||||
half res = log(1.0h);
|
||||
half res = 0.0h;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -36,37 +35,35 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%14 = OpConstantNull %half
|
||||
%_ptr_Function_half = OpTypePointer Function %half
|
||||
%19 = OpConstantNull %half
|
||||
%20 = OpTypeFunction %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_c9f489 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_half Function %19
|
||||
%13 = OpExtInst %half %15 Log %half_0x1p_0
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_half Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %20
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %void %log_c9f489
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log_c9f489
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%25 = OpLabel
|
||||
%26 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %26
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_c9f489
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_c9f489
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %log_c9f489
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_cdbdc1() {
|
||||
vector<float16_t, 4> res = log((float16_t(1.0h)).xxxx);
|
||||
vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_cdbdc1() {
|
||||
f16vec4 res = log(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_cdbdc1() {
|
||||
f16vec4 res = log(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log_cdbdc1() {
|
||||
f16vec4 res = log(f16vec4(1.0hf));
|
||||
f16vec4 res = f16vec4(0.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_cdbdc1() {
|
||||
half4 res = log(half4(1.0h));
|
||||
half4 res = half4(0.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v4half = OpTypeVector %half 4
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%15 = OpConstantNull %v4half
|
||||
%_ptr_Function_v4half = OpTypePointer Function %v4half
|
||||
%21 = OpConstantNull %v4half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_cdbdc1 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v4half Function %21
|
||||
%13 = OpExtInst %v4half %16 Log %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v4half Function %15
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log_cdbdc1
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log_cdbdc1
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %log_cdbdc1
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log_cdbdc1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %log_cdbdc1
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %log_cdbdc1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_f4c570() {
|
||||
float3 res = log((1.0f).xxx);
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log_f4c570() {
|
||||
float3 res = log((1.0f).xxx);
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void log_f4c570() {
|
||||
vec3 res = log(vec3(1.0f));
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log_f4c570() {
|
||||
vec3 res = log(vec3(1.0f));
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void log_f4c570() {
|
||||
vec3 res = log(vec3(1.0f));
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log_f4c570() {
|
||||
float3 res = log(float3(1.0f));
|
||||
float3 res = float3(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 34
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%15 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -32,37 +31,35 @@
|
|||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%14 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%20 = OpConstantNull %v3float
|
||||
%21 = OpTypeFunction %v4float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_f4c570 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %20
|
||||
%13 = OpExtInst %v3float %15 Log %17
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %21
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %void %log_f4c570
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log_f4c570
|
||||
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
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_f4c570
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_f4c570
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %log_f4c570
|
||||
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 log(vec<2, fa>) -> vec<2, fa>
|
||||
fn log_f60cc7() {
|
||||
var res = log(vec2(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_f60cc7();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_f60cc7();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_f60cc7();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_f60cc7() {
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_f60cc7();
|
||||
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() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log_f60cc7() {
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_f60cc7();
|
||||
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() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log_f60cc7() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log_f60cc7();
|
||||
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 log_f60cc7() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log_f60cc7();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log_f60cc7() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log_f60cc7();
|
||||
}
|
||||
|
||||
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 log_f60cc7() {
|
||||
float2 res = float2(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log_f60cc7();
|
||||
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() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log_f60cc7();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %log_f60cc7 "log_f60cc7"
|
||||
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
|
||||
%14 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log_f60cc7 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log_f60cc7
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log_f60cc7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log_f60cc7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log_f60cc7() {
|
||||
var res = log(vec2(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log_f60cc7();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log_f60cc7();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log_f60cc7();
|
||||
}
|
|
@ -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 log2(vec<3, fa>) -> vec<3, fa>
|
||||
fn log2_0fbd39() {
|
||||
var res = log2(vec3(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_0fbd39();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_0fbd39();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_0fbd39();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_0fbd39() {
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_0fbd39();
|
||||
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() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_0fbd39() {
|
||||
float3 res = (0.0f).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_0fbd39();
|
||||
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() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log2_0fbd39() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log2_0fbd39();
|
||||
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 log2_0fbd39() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log2_0fbd39();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log2_0fbd39() {
|
||||
vec3 res = vec3(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log2_0fbd39();
|
||||
}
|
||||
|
||||
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 log2_0fbd39() {
|
||||
float3 res = float3(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_0fbd39();
|
||||
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() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log2_0fbd39();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %log2_0fbd39 "log2_0fbd39"
|
||||
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
|
||||
%14 = OpConstantNull %v3float
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log2_0fbd39 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log2_0fbd39
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log2_0fbd39
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log2_0fbd39
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log2_0fbd39() {
|
||||
var res = log2(vec3(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_0fbd39();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_0fbd39();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_0fbd39();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
void log2_38b478() {
|
||||
vector<float16_t, 3> res = log2((float16_t(1.0h)).xxx);
|
||||
vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log2_38b478() {
|
||||
f16vec3 res = log2(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -23,7 +23,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log2_38b478() {
|
||||
f16vec3 res = log2(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
#extension GL_AMD_gpu_shader_half_float : require
|
||||
|
||||
void log2_38b478() {
|
||||
f16vec3 res = log2(f16vec3(1.0hf));
|
||||
f16vec3 res = f16vec3(0.0hf);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log2_38b478() {
|
||||
half3 res = log2(half3(1.0h));
|
||||
half3 res = half3(0.0h);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 36
|
||||
; Bound: 32
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
OpCapability UniformAndStorageBuffer16BitAccess
|
||||
OpCapability StorageBuffer16BitAccess
|
||||
OpCapability StorageInputOutput16
|
||||
%16 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
|
@ -37,38 +36,35 @@
|
|||
%9 = OpTypeFunction %void
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%half_0x1p_0 = OpConstant %half 0x1p+0
|
||||
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
|
||||
%15 = OpConstantNull %v3half
|
||||
%_ptr_Function_v3half = OpTypePointer Function %v3half
|
||||
%21 = OpConstantNull %v3half
|
||||
%22 = OpTypeFunction %v4float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log2_38b478 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v3half Function %21
|
||||
%13 = OpExtInst %v3half %16 Log2 %18
|
||||
OpStore %res %13
|
||||
%res = OpVariable %_ptr_Function_v3half Function %15
|
||||
OpStore %res %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %22
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log2_38b478
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log2_38b478
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %28
|
||||
%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
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %log2_38b478
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log2_38b478
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%34 = OpLabel
|
||||
%35 = OpFunctionCall %void %log2_38b478
|
||||
%30 = OpLabel
|
||||
%31 = OpFunctionCall %void %log2_38b478
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#version 310 es
|
||||
|
||||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
|||
precision mediump float;
|
||||
|
||||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
|
@ -35,7 +35,7 @@ void main() {
|
|||
#version 310 es
|
||||
|
||||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace metal;
|
||||
void log2_4036ed() {
|
||||
float res = log2(1.0f);
|
||||
float res = 0.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"
|
||||
|
@ -31,35 +30,34 @@
|
|||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float_1 = OpConstant %float 1
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%18 = OpTypeFunction %v4float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log2_4036ed = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
%13 = OpExtInst %float %14 Log2 %float_1
|
||||
OpStore %res %13
|
||||
OpStore %res %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %18
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %log2_4036ed
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log2_4036ed
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%23 = OpLabel
|
||||
%24 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %24
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log2_4036ed
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log2_4036ed
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log2_4036ed
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log2_4036ed
|
||||
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 log2(fa) -> fa
|
||||
fn log2_5b464b() {
|
||||
var res = log2(1.);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_5b464b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_5b464b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_5b464b();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_5b464b();
|
||||
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() {
|
||||
log2_5b464b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_5b464b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_5b464b();
|
||||
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() {
|
||||
log2_5b464b();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_5b464b();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log2_5b464b();
|
||||
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 log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log2_5b464b();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log2_5b464b();
|
||||
}
|
||||
|
||||
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 log2_5b464b() {
|
||||
float res = 0.0f;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_5b464b();
|
||||
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() {
|
||||
log2_5b464b();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log2_5b464b();
|
||||
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 %log2_5b464b "log2_5b464b"
|
||||
OpName %res "res"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %value BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%15 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log2_5b464b = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %15
|
||||
%17 = OpLabel
|
||||
%18 = OpFunctionCall %void %log2_5b464b
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %21
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%24 = OpLabel
|
||||
%25 = OpFunctionCall %void %log2_5b464b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %log2_5b464b
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log2_5b464b() {
|
||||
var res = log2(1.0);
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_5b464b();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_5b464b();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_5b464b();
|
||||
}
|
|
@ -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 log2(vec<2, fa>) -> vec<2, fa>
|
||||
fn log2_6b8954() {
|
||||
var res = log2(vec2(1.));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_6b8954();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_6b8954();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_6b8954();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_6b8954() {
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_6b8954();
|
||||
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() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
void log2_6b8954() {
|
||||
float2 res = (0.0f).xx;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_6b8954();
|
||||
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() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#version 310 es
|
||||
|
||||
void log2_6b8954() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
vec4 vertex_main() {
|
||||
log2_6b8954();
|
||||
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 log2_6b8954() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
log2_6b8954();
|
||||
}
|
||||
|
||||
void main() {
|
||||
fragment_main();
|
||||
return;
|
||||
}
|
||||
#version 310 es
|
||||
|
||||
void log2_6b8954() {
|
||||
vec2 res = vec2(0.0f);
|
||||
}
|
||||
|
||||
void compute_main() {
|
||||
log2_6b8954();
|
||||
}
|
||||
|
||||
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 log2_6b8954() {
|
||||
float2 res = float2(0.0f);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
float4 vertex_main_inner() {
|
||||
log2_6b8954();
|
||||
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() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
log2_6b8954();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 31
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %value "value"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %log2_6b8954 "log2_6b8954"
|
||||
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
|
||||
%14 = OpConstantNull %v2float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%17 = OpTypeFunction %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%log2_6b8954 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_v2float Function %14
|
||||
OpStore %res %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main_inner = OpFunction %v4float None %17
|
||||
%19 = OpLabel
|
||||
%20 = OpFunctionCall %void %log2_6b8954
|
||||
OpReturnValue %5
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%22 = OpLabel
|
||||
%23 = OpFunctionCall %v4float %vertex_main_inner
|
||||
OpStore %value %23
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%26 = OpLabel
|
||||
%27 = OpFunctionCall %void %log2_6b8954
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
%30 = OpFunctionCall %void %log2_6b8954
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn log2_6b8954() {
|
||||
var res = log2(vec2(1.0));
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex_main() -> @builtin(position) vec4<f32> {
|
||||
log2_6b8954();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fragment_main() {
|
||||
log2_6b8954();
|
||||
}
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn compute_main() {
|
||||
log2_6b8954();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue