tint/transform/builtin_polyfill: Don't polyfill @const builtins

We don't want to replace builtins that are constant-expression
evaluated, as the replacement cannot be used as a constant expression.

Fixed: tint:1667
Change-Id: I554d9884fc41890247ee64b47a70621be5fcdbe5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107680
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ben Clayton 2022-10-28 20:46:07 +00:00 committed by Dawn LUCI CQ
parent 23945c5d27
commit 46de10299f
66 changed files with 793 additions and 1088 deletions

View File

@ -569,6 +569,9 @@ bool BuiltinPolyfill::ShouldRun(const Program* program, const DataMap& data) con
for (auto* node : program->ASTNodes().Objects()) { for (auto* node : program->ASTNodes().Objects()) {
if (auto* call = sem.Get<sem::Call>(node)) { if (auto* call = sem.Get<sem::Call>(node)) {
if (auto* builtin = call->Target()->As<sem::Builtin>()) { if (auto* builtin = call->Target()->As<sem::Builtin>()) {
if (call->Stage() == sem::EvaluationStage::kConstant) {
continue; // Don't polyfill @const expressions
}
switch (builtin->Type()) { switch (builtin->Type()) {
case sem::BuiltinType::kAcosh: case sem::BuiltinType::kAcosh:
if (builtins.acosh != Level::kNone) { if (builtins.acosh != Level::kNone) {
@ -653,6 +656,9 @@ void BuiltinPolyfill::Run(CloneContext& ctx, const DataMap& data, DataMap&) cons
State s{ctx, builtins}; State s{ctx, builtins};
if (auto* call = s.sem.Get<sem::Call>(expr)) { if (auto* call = s.sem.Get<sem::Call>(expr)) {
if (auto* builtin = call->Target()->As<sem::Builtin>()) { if (auto* builtin = call->Target()->As<sem::Builtin>()) {
if (call->Stage() == sem::EvaluationStage::kConstant) {
return nullptr; // Don't polyfill @const expressions
}
Symbol polyfill; Symbol polyfill;
switch (builtin->Type()) { switch (builtin->Type()) {
case sem::BuiltinType::kAcosh: case sem::BuiltinType::kAcosh:

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,5 @@
float tint_sinh(float x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_157447() { void asinh_157447() {
float res = tint_sinh(1.0f); float res = 0.881373584f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float tint_sinh(float x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_157447() { void asinh_157447() {
float res = tint_sinh(1.0f); float res = 0.881373584f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float3 tint_sinh(float3 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_2265ee() { void asinh_2265ee() {
float3 res = tint_sinh((1.0f).xxx); float3 res = (0.881373584f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float3 tint_sinh(float3 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_2265ee() { void asinh_2265ee() {
float3 res = tint_sinh((1.0f).xxx); float3 res = (0.881373584f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float16_t tint_sinh(float16_t x) {
return log((x + sqrt(((x * x) + float16_t(1.0h)))));
}
void asinh_468a48() { void asinh_468a48() {
float16_t res = tint_sinh(float16_t(0.0h)); float16_t res = float16_t(0.0h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float2 tint_sinh(float2 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_4a2226() { void asinh_4a2226() {
float2 res = tint_sinh((1.0f).xx); float2 res = (0.881373584f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float2 tint_sinh(float2 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_4a2226() { void asinh_4a2226() {
float2 res = tint_sinh((1.0f).xx); float2 res = (0.881373584f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float4 tint_sinh(float4 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_8d2e51() { void asinh_8d2e51() {
float4 res = tint_sinh((1.0f).xxxx); float4 res = (0.881373584f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float4 tint_sinh(float4 x) {
return log((x + sqrt(((x * x) + 1.0f))));
}
void asinh_8d2e51() { void asinh_8d2e51() {
float4 res = tint_sinh((1.0f).xxxx); float4 res = (0.881373584f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
vector<float16_t, 4> tint_sinh(vector<float16_t, 4> x) {
return log((x + sqrt(((x * x) + float16_t(1.0h)))));
}
void asinh_95ab2b() { void asinh_95ab2b() {
vector<float16_t, 4> res = tint_sinh((float16_t(0.0h)).xxxx); vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
vector<float16_t, 2> tint_sinh(vector<float16_t, 2> x) {
return log((x + sqrt(((x * x) + float16_t(1.0h)))));
}
void asinh_ad8f8b() { void asinh_ad8f8b() {
vector<float16_t, 2> res = tint_sinh((float16_t(0.0h)).xx); vector<float16_t, 2> res = (float16_t(0.0h)).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
vector<float16_t, 3> tint_sinh(vector<float16_t, 3> x) {
return log((x + sqrt(((x * x) + float16_t(1.0h)))));
}
void asinh_fb5e8c() { void asinh_fb5e8c() {
vector<float16_t, 3> res = tint_sinh((float16_t(0.0h)).xxx); vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float3 tint_atanh(float3 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_440cca() { void atanh_440cca() {
float3 res = tint_atanh((0.5f).xxx); float3 res = (0.549306154f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float3 tint_atanh(float3 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_440cca() { void atanh_440cca() {
float3 res = tint_atanh((0.5f).xxx); float3 res = (0.549306154f).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec3 tint_atanh(vec3 x) {
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
}
void atanh_440cca() { void atanh_440cca() {
vec3 res = tint_atanh(vec3(0.5f)); vec3 res = vec3(0.549306154f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec3 tint_atanh(vec3 x) {
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
}
void atanh_440cca() { void atanh_440cca() {
vec3 res = tint_atanh(vec3(0.5f)); vec3 res = vec3(0.549306154f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec3 tint_atanh(vec3 x) {
return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
}
void atanh_440cca() { void atanh_440cca() {
vec3 res = tint_atanh(vec3(0.5f)); vec3 res = vec3(0.549306154f);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float3 tint_atanh(float3 x) {
return select(atanh(x), float3(0.0f), (x >= float3(1.0f)));
}
void atanh_440cca() { void atanh_440cca() {
float3 res = tint_atanh(float3(0.5f)); float3 res = float3(0.549306154f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 45 ; Bound: 33
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%22 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_440cca "atanh_440cca" OpName %atanh_440cca "atanh_440cca"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,53 +28,40 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%v3float = OpTypeVector %float 3
%9 = OpTypeFunction %v3float %v3float
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%20 = OpConstantNull %v3float
%void = OpTypeVoid %void = OpTypeVoid
%23 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_0_5 = OpConstant %float 0.5 %v3float = OpTypeVector %float 3
%29 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5 %float_0_549306154 = OpConstant %float 0.549306154
%15 = OpConstantComposite %v3float %float_0_549306154 %float_0_549306154 %float_0_549306154
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%32 = OpTypeFunction %v4float %18 = OpConstantNull %v3float
%tint_atanh = OpFunction %v3float None %9 %19 = OpTypeFunction %v4float
%x = OpFunctionParameter %v3float %float_1 = OpConstant %float 1
%13 = OpLabel %atanh_440cca = OpFunction %void None %9
%17 = OpFOrdGreaterThanEqual %v3bool %x %16 %12 = OpLabel
%21 = OpExtInst %v3float %22 Atanh %x %res = OpVariable %_ptr_Function_v3float Function %18
%14 = OpSelect %v3float %17 %20 %21 OpStore %res %15
OpReturnValue %14
OpFunctionEnd
%atanh_440cca = OpFunction %void None %23
%26 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %20
%27 = OpFunctionCall %v3float %tint_atanh %29
OpStore %res %27
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %32 %vertex_main_inner = OpFunction %v4float None %19
%34 = OpLabel %21 = OpLabel
%35 = OpFunctionCall %void %atanh_440cca %22 = OpFunctionCall %void %atanh_440cca
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %23 %vertex_main = OpFunction %void None %9
%37 = OpLabel %24 = OpLabel
%38 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %38 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %23 %fragment_main = OpFunction %void None %9
%40 = OpLabel %28 = OpLabel
%41 = OpFunctionCall %void %atanh_440cca %29 = OpFunctionCall %void %atanh_440cca
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %23 %compute_main = OpFunction %void None %9
%43 = OpLabel %31 = OpLabel
%44 = OpFunctionCall %void %atanh_440cca %32 = OpFunctionCall %void %atanh_440cca
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
vector<float16_t, 2> tint_atanh(vector<float16_t, 2> x) {
return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
}
void atanh_5bf88d() { void atanh_5bf88d() {
vector<float16_t, 2> res = tint_atanh((float16_t(0.0h)).xx); vector<float16_t, 2> res = (float16_t(0.0h)).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_atanh(f16vec2 x) {
return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
}
void atanh_5bf88d() { void atanh_5bf88d() {
f16vec2 res = tint_atanh(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec2 tint_atanh(f16vec2 x) {
return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
}
void atanh_5bf88d() { void atanh_5bf88d() {
f16vec2 res = tint_atanh(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_atanh(f16vec2 x) {
return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
}
void atanh_5bf88d() { void atanh_5bf88d() {
f16vec2 res = tint_atanh(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half2 tint_atanh(half2 x) {
return select(atanh(x), half2(0.0h), (x >= half2(1.0h)));
}
void atanh_5bf88d() { void atanh_5bf88d() {
half2 res = tint_atanh(half2(0.0h)); half2 res = half2(0.0h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 45 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%23 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_5bf88d "atanh_5bf88d" OpName %atanh_5bf88d "atanh_5bf88d"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,53 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v2half = OpTypeVector %half 2 %v2half = OpTypeVector %half 2
%9 = OpTypeFunction %v2half %v2half %15 = OpConstantNull %v2half
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%21 = OpConstantNull %v2half
%void = OpTypeVoid
%24 = OpTypeFunction %void
%_ptr_Function_v2half = OpTypePointer Function %v2half %_ptr_Function_v2half = OpTypePointer Function %v2half
%31 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_atanh = OpFunction %v2half None %9 %atanh_5bf88d = OpFunction %void None %9
%x = OpFunctionParameter %v2half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v2half Function %15
%18 = OpFOrdGreaterThanEqual %v2bool %x %17 OpStore %res %15
%22 = OpExtInst %v2half %23 Atanh %x
%15 = OpSelect %v2half %18 %21 %22
OpReturnValue %15
OpFunctionEnd
%atanh_5bf88d = OpFunction %void None %24
%27 = OpLabel
%res = OpVariable %_ptr_Function_v2half Function %21
%28 = OpFunctionCall %v2half %tint_atanh %21
OpStore %res %28
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %31 %vertex_main_inner = OpFunction %v4float None %18
%33 = OpLabel %20 = OpLabel
%34 = OpFunctionCall %void %atanh_5bf88d %21 = OpFunctionCall %void %atanh_5bf88d
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %24 %vertex_main = OpFunction %void None %9
%36 = OpLabel %23 = OpLabel
%37 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %37 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %24 %fragment_main = OpFunction %void None %9
%40 = OpLabel %27 = OpLabel
%41 = OpFunctionCall %void %atanh_5bf88d %28 = OpFunctionCall %void %atanh_5bf88d
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %24 %compute_main = OpFunction %void None %9
%43 = OpLabel %30 = OpLabel
%44 = OpFunctionCall %void %atanh_5bf88d %31 = OpFunctionCall %void %atanh_5bf88d
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float tint_atanh(float x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float tint_atanh(float x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
float tint_atanh(float x) {
return ((x >= 1.0f) ? 0.0f : atanh(x));
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
float tint_atanh(float x) {
return ((x >= 1.0f) ? 0.0f : atanh(x));
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
float tint_atanh(float x) {
return ((x >= 1.0f) ? 0.0f : atanh(x));
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float tint_atanh(float x) {
return select(atanh(x), 0.0f, (x >= 1.0f));
}
void atanh_7997d8() { void atanh_7997d8() {
float res = tint_atanh(0.5f); float res = 0.549306154f;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 40 ; Bound: 30
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_7997d8 "atanh_7997d8" OpName %atanh_7997d8 "atanh_7997d8"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,48 +28,37 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%9 = OpTypeFunction %float %float
%float_1 = OpConstant %float 1
%bool = OpTypeBool
%void = OpTypeVoid %void = OpTypeVoid
%19 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_0_5 = OpConstant %float 0.5 %float_0_549306154 = OpConstant %float 0.549306154
%_ptr_Function_float = OpTypePointer Function %float %_ptr_Function_float = OpTypePointer Function %float
%27 = OpTypeFunction %v4float %16 = OpTypeFunction %v4float
%tint_atanh = OpFunction %float None %9 %float_1 = OpConstant %float 1
%x = OpFunctionParameter %float %atanh_7997d8 = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%15 = OpFOrdGreaterThanEqual %bool %x %float_1
%17 = OpExtInst %float %18 Atanh %x
%13 = OpSelect %float %15 %8 %17
OpReturnValue %13
OpFunctionEnd
%atanh_7997d8 = OpFunction %void None %19
%22 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8 %res = OpVariable %_ptr_Function_float Function %8
%23 = OpFunctionCall %float %tint_atanh %float_0_5 OpStore %res %float_0_549306154
OpStore %res %23
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27 %vertex_main_inner = OpFunction %v4float None %16
%29 = OpLabel %18 = OpLabel
%30 = OpFunctionCall %void %atanh_7997d8 %19 = OpFunctionCall %void %atanh_7997d8
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %19 %vertex_main = OpFunction %void None %9
%32 = OpLabel %21 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner %22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33 OpStore %value %22
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %19 %fragment_main = OpFunction %void None %9
%35 = OpLabel %25 = OpLabel
%36 = OpFunctionCall %void %atanh_7997d8 %26 = OpFunctionCall %void %atanh_7997d8
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %19 %compute_main = OpFunction %void None %9
%38 = OpLabel %28 = OpLabel
%39 = OpFunctionCall %void %atanh_7997d8 %29 = OpFunctionCall %void %atanh_7997d8
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float2 tint_atanh(float2 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_c0e634() { void atanh_c0e634() {
float2 res = tint_atanh((0.5f).xx); float2 res = (0.549306154f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float2 tint_atanh(float2 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_c0e634() { void atanh_c0e634() {
float2 res = tint_atanh((0.5f).xx); float2 res = (0.549306154f).xx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec2 tint_atanh(vec2 x) {
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
}
void atanh_c0e634() { void atanh_c0e634() {
vec2 res = tint_atanh(vec2(0.5f)); vec2 res = vec2(0.549306154f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec2 tint_atanh(vec2 x) {
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
}
void atanh_c0e634() { void atanh_c0e634() {
vec2 res = tint_atanh(vec2(0.5f)); vec2 res = vec2(0.549306154f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec2 tint_atanh(vec2 x) {
return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
}
void atanh_c0e634() { void atanh_c0e634() {
vec2 res = tint_atanh(vec2(0.5f)); vec2 res = vec2(0.549306154f);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float2 tint_atanh(float2 x) {
return select(atanh(x), float2(0.0f), (x >= float2(1.0f)));
}
void atanh_c0e634() { void atanh_c0e634() {
float2 res = tint_atanh(float2(0.5f)); float2 res = float2(0.549306154f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 45 ; Bound: 33
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%22 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_c0e634 "atanh_c0e634" OpName %atanh_c0e634 "atanh_c0e634"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,53 +28,40 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%v2float = OpTypeVector %float 2
%9 = OpTypeFunction %v2float %v2float
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v2float %float_1 %float_1
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%20 = OpConstantNull %v2float
%void = OpTypeVoid %void = OpTypeVoid
%23 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_0_5 = OpConstant %float 0.5 %v2float = OpTypeVector %float 2
%29 = OpConstantComposite %v2float %float_0_5 %float_0_5 %float_0_549306154 = OpConstant %float 0.549306154
%15 = OpConstantComposite %v2float %float_0_549306154 %float_0_549306154
%_ptr_Function_v2float = OpTypePointer Function %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float
%32 = OpTypeFunction %v4float %18 = OpConstantNull %v2float
%tint_atanh = OpFunction %v2float None %9 %19 = OpTypeFunction %v4float
%x = OpFunctionParameter %v2float %float_1 = OpConstant %float 1
%13 = OpLabel %atanh_c0e634 = OpFunction %void None %9
%17 = OpFOrdGreaterThanEqual %v2bool %x %16 %12 = OpLabel
%21 = OpExtInst %v2float %22 Atanh %x %res = OpVariable %_ptr_Function_v2float Function %18
%14 = OpSelect %v2float %17 %20 %21 OpStore %res %15
OpReturnValue %14
OpFunctionEnd
%atanh_c0e634 = OpFunction %void None %23
%26 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %20
%27 = OpFunctionCall %v2float %tint_atanh %29
OpStore %res %27
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %32 %vertex_main_inner = OpFunction %v4float None %19
%34 = OpLabel %21 = OpLabel
%35 = OpFunctionCall %void %atanh_c0e634 %22 = OpFunctionCall %void %atanh_c0e634
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %23 %vertex_main = OpFunction %void None %9
%37 = OpLabel %24 = OpLabel
%38 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %38 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %23 %fragment_main = OpFunction %void None %9
%40 = OpLabel %28 = OpLabel
%41 = OpFunctionCall %void %atanh_c0e634 %29 = OpFunctionCall %void %atanh_c0e634
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %23 %compute_main = OpFunction %void None %9
%43 = OpLabel %31 = OpLabel
%44 = OpFunctionCall %void %atanh_c0e634 %32 = OpFunctionCall %void %atanh_c0e634
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float16_t tint_atanh(float16_t x) {
return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
}
void atanh_d2d8cd() { void atanh_d2d8cd() {
float16_t res = tint_atanh(float16_t(0.0h)); float16_t res = float16_t(0.0h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_atanh(float16_t x) {
return ((x >= 1.0hf) ? 0.0hf : atanh(x));
}
void atanh_d2d8cd() { void atanh_d2d8cd() {
float16_t res = tint_atanh(0.0hf); float16_t res = 0.0hf;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
float16_t tint_atanh(float16_t x) {
return ((x >= 1.0hf) ? 0.0hf : atanh(x));
}
void atanh_d2d8cd() { void atanh_d2d8cd() {
float16_t res = tint_atanh(0.0hf); float16_t res = 0.0hf;
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_atanh(float16_t x) {
return ((x >= 1.0hf) ? 0.0hf : atanh(x));
}
void atanh_d2d8cd() { void atanh_d2d8cd() {
float16_t res = tint_atanh(0.0hf); float16_t res = 0.0hf;
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half tint_atanh(half x) {
return select(atanh(x), 0.0h, (x >= 1.0h));
}
void atanh_d2d8cd() { void atanh_d2d8cd() {
half res = tint_atanh(0.0h); half res = 0.0h;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 42 ; Bound: 31
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_d2d8cd "atanh_d2d8cd" OpName %atanh_d2d8cd "atanh_d2d8cd"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,50 +32,38 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%half = OpTypeFloat 16
%9 = OpTypeFunction %half %half
%half_0x1p_0 = OpConstant %half 0x1p+0
%bool = OpTypeBool
%18 = OpConstantNull %half
%void = OpTypeVoid %void = OpTypeVoid
%21 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16
%14 = OpConstantNull %half
%_ptr_Function_half = OpTypePointer Function %half %_ptr_Function_half = OpTypePointer Function %half
%28 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_atanh = OpFunction %half None %9 %atanh_d2d8cd = OpFunction %void None %9
%x = OpFunctionParameter %half %12 = OpLabel
%13 = OpLabel %res = OpVariable %_ptr_Function_half Function %14
%16 = OpFOrdGreaterThanEqual %bool %x %half_0x1p_0 OpStore %res %14
%19 = OpExtInst %half %20 Atanh %x
%14 = OpSelect %half %16 %18 %19
OpReturnValue %14
OpFunctionEnd
%atanh_d2d8cd = OpFunction %void None %21
%24 = OpLabel
%res = OpVariable %_ptr_Function_half Function %18
%25 = OpFunctionCall %half %tint_atanh %18
OpStore %res %25
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28 %vertex_main_inner = OpFunction %v4float None %17
%30 = OpLabel %19 = OpLabel
%31 = OpFunctionCall %void %atanh_d2d8cd %20 = OpFunctionCall %void %atanh_d2d8cd
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %21 %vertex_main = OpFunction %void None %9
%33 = OpLabel %22 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %21 %fragment_main = OpFunction %void None %9
%37 = OpLabel %26 = OpLabel
%38 = OpFunctionCall %void %atanh_d2d8cd %27 = OpFunctionCall %void %atanh_d2d8cd
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %21 %compute_main = OpFunction %void None %9
%40 = OpLabel %29 = OpLabel
%41 = OpFunctionCall %void %atanh_d2d8cd %30 = OpFunctionCall %void %atanh_d2d8cd
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
vector<float16_t, 4> tint_atanh(vector<float16_t, 4> x) {
return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
}
void atanh_e3b450() { void atanh_e3b450() {
vector<float16_t, 4> res = tint_atanh((float16_t(0.0h)).xxxx); vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_atanh(f16vec4 x) {
return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
}
void atanh_e3b450() { void atanh_e3b450() {
f16vec4 res = tint_atanh(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec4 tint_atanh(f16vec4 x) {
return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
}
void atanh_e3b450() { void atanh_e3b450() {
f16vec4 res = tint_atanh(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_atanh(f16vec4 x) {
return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
}
void atanh_e3b450() { void atanh_e3b450() {
f16vec4 res = tint_atanh(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half4 tint_atanh(half4 x) {
return select(atanh(x), half4(0.0h), (x >= half4(1.0h)));
}
void atanh_e3b450() { void atanh_e3b450() {
half4 res = tint_atanh(half4(0.0h)); half4 res = half4(0.0h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 45 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%23 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_e3b450 "atanh_e3b450" OpName %atanh_e3b450 "atanh_e3b450"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,53 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v4half = OpTypeVector %half 4 %v4half = OpTypeVector %half 4
%9 = OpTypeFunction %v4half %v4half %15 = OpConstantNull %v4half
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
%21 = OpConstantNull %v4half
%void = OpTypeVoid
%24 = OpTypeFunction %void
%_ptr_Function_v4half = OpTypePointer Function %v4half %_ptr_Function_v4half = OpTypePointer Function %v4half
%31 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_atanh = OpFunction %v4half None %9 %atanh_e3b450 = OpFunction %void None %9
%x = OpFunctionParameter %v4half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v4half Function %15
%18 = OpFOrdGreaterThanEqual %v4bool %x %17 OpStore %res %15
%22 = OpExtInst %v4half %23 Atanh %x
%15 = OpSelect %v4half %18 %21 %22
OpReturnValue %15
OpFunctionEnd
%atanh_e3b450 = OpFunction %void None %24
%27 = OpLabel
%res = OpVariable %_ptr_Function_v4half Function %21
%28 = OpFunctionCall %v4half %tint_atanh %21
OpStore %res %28
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %31 %vertex_main_inner = OpFunction %v4float None %18
%33 = OpLabel %20 = OpLabel
%34 = OpFunctionCall %void %atanh_e3b450 %21 = OpFunctionCall %void %atanh_e3b450
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %24 %vertex_main = OpFunction %void None %9
%36 = OpLabel %23 = OpLabel
%37 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %37 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %24 %fragment_main = OpFunction %void None %9
%40 = OpLabel %27 = OpLabel
%41 = OpFunctionCall %void %atanh_e3b450 %28 = OpFunctionCall %void %atanh_e3b450
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %24 %compute_main = OpFunction %void None %9
%43 = OpLabel %30 = OpLabel
%44 = OpFunctionCall %void %atanh_e3b450 %31 = OpFunctionCall %void %atanh_e3b450
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
vector<float16_t, 3> tint_atanh(vector<float16_t, 3> x) {
return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
}
void atanh_ec4b06() { void atanh_ec4b06() {
vector<float16_t, 3> res = tint_atanh((float16_t(0.0h)).xxx); vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_atanh(f16vec3 x) {
return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
}
void atanh_ec4b06() { void atanh_ec4b06() {
f16vec3 res = tint_atanh(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec3 tint_atanh(f16vec3 x) {
return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
}
void atanh_ec4b06() { void atanh_ec4b06() {
f16vec3 res = tint_atanh(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_atanh(f16vec3 x) {
return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
}
void atanh_ec4b06() { void atanh_ec4b06() {
f16vec3 res = tint_atanh(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
half3 tint_atanh(half3 x) {
return select(atanh(x), half3(0.0h), (x >= half3(1.0h)));
}
void atanh_ec4b06() { void atanh_ec4b06() {
half3 res = tint_atanh(half3(0.0h)); half3 res = half3(0.0h);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 45 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%23 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_ec4b06 "atanh_ec4b06" OpName %atanh_ec4b06 "atanh_ec4b06"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,53 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v3half = OpTypeVector %half 3 %v3half = OpTypeVector %half 3
%9 = OpTypeFunction %v3half %v3half %15 = OpConstantNull %v3half
%half_0x1p_0 = OpConstant %half 0x1p+0
%17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%21 = OpConstantNull %v3half
%void = OpTypeVoid
%24 = OpTypeFunction %void
%_ptr_Function_v3half = OpTypePointer Function %v3half %_ptr_Function_v3half = OpTypePointer Function %v3half
%31 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_atanh = OpFunction %v3half None %9 %atanh_ec4b06 = OpFunction %void None %9
%x = OpFunctionParameter %v3half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v3half Function %15
%18 = OpFOrdGreaterThanEqual %v3bool %x %17 OpStore %res %15
%22 = OpExtInst %v3half %23 Atanh %x
%15 = OpSelect %v3half %18 %21 %22
OpReturnValue %15
OpFunctionEnd
%atanh_ec4b06 = OpFunction %void None %24
%27 = OpLabel
%res = OpVariable %_ptr_Function_v3half Function %21
%28 = OpFunctionCall %v3half %tint_atanh %21
OpStore %res %28
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %31 %vertex_main_inner = OpFunction %v4float None %18
%33 = OpLabel %20 = OpLabel
%34 = OpFunctionCall %void %atanh_ec4b06 %21 = OpFunctionCall %void %atanh_ec4b06
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %24 %vertex_main = OpFunction %void None %9
%36 = OpLabel %23 = OpLabel
%37 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %37 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %24 %fragment_main = OpFunction %void None %9
%40 = OpLabel %27 = OpLabel
%41 = OpFunctionCall %void %atanh_ec4b06 %28 = OpFunctionCall %void %atanh_ec4b06
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %24 %compute_main = OpFunction %void None %9
%43 = OpLabel %30 = OpLabel
%44 = OpFunctionCall %void %atanh_ec4b06 %31 = OpFunctionCall %void %atanh_ec4b06
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,9 +1,5 @@
float4 tint_atanh(float4 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_f3e01b() { void atanh_f3e01b() {
float4 res = tint_atanh((0.5f).xxxx); float4 res = (0.549306154f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,9 +1,5 @@
float4 tint_atanh(float4 x) {
return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
}
void atanh_f3e01b() { void atanh_f3e01b() {
float4 res = tint_atanh((0.5f).xxxx); float4 res = (0.549306154f).xxxx;
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec4 tint_atanh(vec4 x) {
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
}
void atanh_f3e01b() { void atanh_f3e01b() {
vec4 res = tint_atanh(vec4(0.5f)); vec4 res = vec4(0.549306154f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec4 tint_atanh(vec4 x) {
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
}
void atanh_f3e01b() { void atanh_f3e01b() {
vec4 res = tint_atanh(vec4(0.5f)); vec4 res = vec4(0.549306154f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec4 tint_atanh(vec4 x) {
return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
}
void atanh_f3e01b() { void atanh_f3e01b() {
vec4 res = tint_atanh(vec4(0.5f)); vec4 res = vec4(0.549306154f);
} }
void compute_main() { void compute_main() {

View File

@ -1,12 +1,8 @@
#include <metal_stdlib> #include <metal_stdlib>
using namespace metal; using namespace metal;
float4 tint_atanh(float4 x) {
return select(atanh(x), float4(0.0f), (x >= float4(1.0f)));
}
void atanh_f3e01b() { void atanh_f3e01b() {
float4 res = tint_atanh(float4(0.5f)); float4 res = float4(0.549306154f);
} }
struct tint_symbol { struct tint_symbol {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 43 ; Bound: 31
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_atanh "tint_atanh"
OpName %x "x"
OpName %atanh_f3e01b "atanh_f3e01b" OpName %atanh_f3e01b "atanh_f3e01b"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,51 +28,38 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%9 = OpTypeFunction %v4float %v4float
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
%void = OpTypeVoid %void = OpTypeVoid
%21 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_0_5 = OpConstant %float 0.5 %float_0_549306154 = OpConstant %float 0.549306154
%27 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5 %14 = OpConstantComposite %v4float %float_0_549306154 %float_0_549306154 %float_0_549306154 %float_0_549306154
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%30 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%tint_atanh = OpFunction %v4float None %9 %float_1 = OpConstant %float 1
%x = OpFunctionParameter %v4float %atanh_f3e01b = OpFunction %void None %9
%12 = OpLabel %12 = OpLabel
%16 = OpFOrdGreaterThanEqual %v4bool %x %15
%19 = OpExtInst %v4float %20 Atanh %x
%13 = OpSelect %v4float %16 %5 %19
OpReturnValue %13
OpFunctionEnd
%atanh_f3e01b = OpFunction %void None %21
%24 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%25 = OpFunctionCall %v4float %tint_atanh %27 OpStore %res %14
OpStore %res %25
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %30 %vertex_main_inner = OpFunction %v4float None %17
%32 = OpLabel %19 = OpLabel
%33 = OpFunctionCall %void %atanh_f3e01b %20 = OpFunctionCall %void %atanh_f3e01b
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %21 %vertex_main = OpFunction %void None %9
%35 = OpLabel %22 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %21 %fragment_main = OpFunction %void None %9
%38 = OpLabel %26 = OpLabel
%39 = OpFunctionCall %void %atanh_f3e01b %27 = OpFunctionCall %void %atanh_f3e01b
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %21 %compute_main = OpFunction %void None %9
%41 = OpLabel %29 = OpLabel
%42 = OpFunctionCall %void %atanh_f3e01b %30 = OpFunctionCall %void %atanh_f3e01b
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
float tint_saturate(float v) {
return clamp(v, 0.0f, 1.0f);
}
void saturate_270da5() { void saturate_270da5() {
float res = tint_saturate(2.0f); float res = 1.0f;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
float tint_saturate(float v) {
return clamp(v, 0.0f, 1.0f);
}
void saturate_270da5() { void saturate_270da5() {
float res = tint_saturate(2.0f); float res = 1.0f;
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
float tint_saturate(float v) {
return clamp(v, 0.0f, 1.0f);
}
void saturate_270da5() { void saturate_270da5() {
float res = tint_saturate(2.0f); float res = 1.0f;
} }
void compute_main() { void compute_main() {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 37 ; Bound: 29
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_270da5 "saturate_270da5" OpName %saturate_270da5 "saturate_270da5"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,45 +28,36 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%9 = OpTypeFunction %float %float
%float_1 = OpConstant %float 1
%void = OpTypeVoid %void = OpTypeVoid
%16 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_2 = OpConstant %float 2 %float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float %_ptr_Function_float = OpTypePointer Function %float
%24 = OpTypeFunction %v4float %16 = OpTypeFunction %v4float
%tint_saturate = OpFunction %float None %9 %saturate_270da5 = OpFunction %void None %9
%v = OpFunctionParameter %float
%12 = OpLabel %12 = OpLabel
%13 = OpExtInst %float %14 NClamp %v %8 %float_1
OpReturnValue %13
OpFunctionEnd
%saturate_270da5 = OpFunction %void None %16
%19 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8 %res = OpVariable %_ptr_Function_float Function %8
%20 = OpFunctionCall %float %tint_saturate %float_2 OpStore %res %float_1
OpStore %res %20
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24 %vertex_main_inner = OpFunction %v4float None %16
%26 = OpLabel %18 = OpLabel
%27 = OpFunctionCall %void %saturate_270da5 %19 = OpFunctionCall %void %saturate_270da5
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %16 %vertex_main = OpFunction %void None %9
%29 = OpLabel %21 = OpLabel
%30 = OpFunctionCall %v4float %vertex_main_inner %22 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %30 OpStore %value %22
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %16 %fragment_main = OpFunction %void None %9
%32 = OpLabel %24 = OpLabel
%33 = OpFunctionCall %void %saturate_270da5 %25 = OpFunctionCall %void %saturate_270da5
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %16 %compute_main = OpFunction %void None %9
%35 = OpLabel %27 = OpLabel
%36 = OpFunctionCall %void %saturate_270da5 %28 = OpFunctionCall %void %saturate_270da5
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_saturate(f16vec3 v) {
return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
}
void saturate_462535() { void saturate_462535() {
f16vec3 res = tint_saturate(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec3 tint_saturate(f16vec3 v) {
return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
}
void saturate_462535() { void saturate_462535() {
f16vec3 res = tint_saturate(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec3 tint_saturate(f16vec3 v) {
return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
}
void saturate_462535() { void saturate_462535() {
f16vec3 res = tint_saturate(f16vec3(0.0hf)); f16vec3 res = f16vec3(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 41 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_462535 "saturate_462535" OpName %saturate_462535 "saturate_462535"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,49 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v3half = OpTypeVector %half 3 %v3half = OpTypeVector %half 3
%9 = OpTypeFunction %v3half %v3half %15 = OpConstantNull %v3half
%17 = OpConstantNull %v3half
%half_0x1p_0 = OpConstant %half 0x1p+0
%19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_v3half = OpTypePointer Function %v3half %_ptr_Function_v3half = OpTypePointer Function %v3half
%27 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_saturate = OpFunction %v3half None %9 %saturate_462535 = OpFunction %void None %9
%v = OpFunctionParameter %v3half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v3half Function %15
%15 = OpExtInst %v3half %16 NClamp %v %17 %19 OpStore %res %15
OpReturnValue %15
OpFunctionEnd
%saturate_462535 = OpFunction %void None %20
%23 = OpLabel
%res = OpVariable %_ptr_Function_v3half Function %17
%24 = OpFunctionCall %v3half %tint_saturate %17
OpStore %res %24
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27 %vertex_main_inner = OpFunction %v4float None %18
%29 = OpLabel %20 = OpLabel
%30 = OpFunctionCall %void %saturate_462535 %21 = OpFunctionCall %void %saturate_462535
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %20 %vertex_main = OpFunction %void None %9
%32 = OpLabel %23 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %20 %fragment_main = OpFunction %void None %9
%36 = OpLabel %27 = OpLabel
%37 = OpFunctionCall %void %saturate_462535 %28 = OpFunctionCall %void %saturate_462535
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %20 %compute_main = OpFunction %void None %9
%39 = OpLabel %30 = OpLabel
%40 = OpFunctionCall %void %saturate_462535 %31 = OpFunctionCall %void %saturate_462535
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec2 tint_saturate(vec2 v) {
return clamp(v, vec2(0.0f), vec2(1.0f));
}
void saturate_51567f() { void saturate_51567f() {
vec2 res = tint_saturate(vec2(2.0f)); vec2 res = vec2(1.0f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec2 tint_saturate(vec2 v) {
return clamp(v, vec2(0.0f), vec2(1.0f));
}
void saturate_51567f() { void saturate_51567f() {
vec2 res = tint_saturate(vec2(2.0f)); vec2 res = vec2(1.0f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec2 tint_saturate(vec2 v) {
return clamp(v, vec2(0.0f), vec2(1.0f));
}
void saturate_51567f() { void saturate_51567f() {
vec2 res = tint_saturate(vec2(2.0f)); vec2 res = vec2(1.0f);
} }
void compute_main() { void compute_main() {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 41 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_51567f "saturate_51567f" OpName %saturate_51567f "saturate_51567f"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,49 +28,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%v2float = OpTypeVector %float 2
%9 = OpTypeFunction %v2float %v2float
%16 = OpConstantNull %v2float
%float_1 = OpConstant %float 1
%18 = OpConstantComposite %v2float %float_1 %float_1
%void = OpTypeVoid %void = OpTypeVoid
%19 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_2 = OpConstant %float 2 %v2float = OpTypeVector %float 2
%25 = OpConstantComposite %v2float %float_2 %float_2 %float_1 = OpConstant %float 1
%15 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float
%28 = OpTypeFunction %v4float %18 = OpConstantNull %v2float
%tint_saturate = OpFunction %v2float None %9 %19 = OpTypeFunction %v4float
%v = OpFunctionParameter %v2float %saturate_51567f = OpFunction %void None %9
%13 = OpLabel %12 = OpLabel
%14 = OpExtInst %v2float %15 NClamp %v %16 %18 %res = OpVariable %_ptr_Function_v2float Function %18
OpReturnValue %14 OpStore %res %15
OpFunctionEnd
%saturate_51567f = OpFunction %void None %19
%22 = OpLabel
%res = OpVariable %_ptr_Function_v2float Function %16
%23 = OpFunctionCall %v2float %tint_saturate %25
OpStore %res %23
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28 %vertex_main_inner = OpFunction %v4float None %19
%30 = OpLabel %21 = OpLabel
%31 = OpFunctionCall %void %saturate_51567f %22 = OpFunctionCall %void %saturate_51567f
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %19 %vertex_main = OpFunction %void None %9
%33 = OpLabel %24 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %19 %fragment_main = OpFunction %void None %9
%36 = OpLabel %27 = OpLabel
%37 = OpFunctionCall %void %saturate_51567f %28 = OpFunctionCall %void %saturate_51567f
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %19 %compute_main = OpFunction %void None %9
%39 = OpLabel %30 = OpLabel
%40 = OpFunctionCall %void %saturate_51567f %31 = OpFunctionCall %void %saturate_51567f
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec3 tint_saturate(vec3 v) {
return clamp(v, vec3(0.0f), vec3(1.0f));
}
void saturate_6bcddf() { void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(2.0f)); vec3 res = vec3(1.0f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec3 tint_saturate(vec3 v) {
return clamp(v, vec3(0.0f), vec3(1.0f));
}
void saturate_6bcddf() { void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(2.0f)); vec3 res = vec3(1.0f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec3 tint_saturate(vec3 v) {
return clamp(v, vec3(0.0f), vec3(1.0f));
}
void saturate_6bcddf() { void saturate_6bcddf() {
vec3 res = tint_saturate(vec3(2.0f)); vec3 res = vec3(1.0f);
} }
void compute_main() { void compute_main() {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 41 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_6bcddf "saturate_6bcddf" OpName %saturate_6bcddf "saturate_6bcddf"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,49 +28,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%v3float = OpTypeVector %float 3
%9 = OpTypeFunction %v3float %v3float
%16 = OpConstantNull %v3float
%float_1 = OpConstant %float 1
%18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%void = OpTypeVoid %void = OpTypeVoid
%19 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_2 = OpConstant %float 2 %v3float = OpTypeVector %float 3
%25 = OpConstantComposite %v3float %float_2 %float_2 %float_2 %float_1 = OpConstant %float 1
%15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%_ptr_Function_v3float = OpTypePointer Function %v3float %_ptr_Function_v3float = OpTypePointer Function %v3float
%28 = OpTypeFunction %v4float %18 = OpConstantNull %v3float
%tint_saturate = OpFunction %v3float None %9 %19 = OpTypeFunction %v4float
%v = OpFunctionParameter %v3float %saturate_6bcddf = OpFunction %void None %9
%13 = OpLabel %12 = OpLabel
%14 = OpExtInst %v3float %15 NClamp %v %16 %18 %res = OpVariable %_ptr_Function_v3float Function %18
OpReturnValue %14 OpStore %res %15
OpFunctionEnd
%saturate_6bcddf = OpFunction %void None %19
%22 = OpLabel
%res = OpVariable %_ptr_Function_v3float Function %16
%23 = OpFunctionCall %v3float %tint_saturate %25
OpStore %res %23
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28 %vertex_main_inner = OpFunction %v4float None %19
%30 = OpLabel %21 = OpLabel
%31 = OpFunctionCall %void %saturate_6bcddf %22 = OpFunctionCall %void %saturate_6bcddf
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %19 %vertex_main = OpFunction %void None %9
%33 = OpLabel %24 = OpLabel
%34 = OpFunctionCall %v4float %vertex_main_inner %25 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %34 OpStore %value %25
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %19 %fragment_main = OpFunction %void None %9
%36 = OpLabel %27 = OpLabel
%37 = OpFunctionCall %void %saturate_6bcddf %28 = OpFunctionCall %void %saturate_6bcddf
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %19 %compute_main = OpFunction %void None %9
%39 = OpLabel %30 = OpLabel
%40 = OpFunctionCall %void %saturate_6bcddf %31 = OpFunctionCall %void %saturate_6bcddf
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,11 +1,7 @@
#version 310 es #version 310 es
vec4 tint_saturate(vec4 v) {
return clamp(v, vec4(0.0f), vec4(1.0f));
}
void saturate_a5b571() { void saturate_a5b571() {
vec4 res = tint_saturate(vec4(2.0f)); vec4 res = vec4(1.0f);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -24,12 +20,8 @@ void main() {
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec4 tint_saturate(vec4 v) {
return clamp(v, vec4(0.0f), vec4(1.0f));
}
void saturate_a5b571() { void saturate_a5b571() {
vec4 res = tint_saturate(vec4(2.0f)); vec4 res = vec4(1.0f);
} }
void fragment_main() { void fragment_main() {
@ -42,12 +34,8 @@ void main() {
} }
#version 310 es #version 310 es
vec4 tint_saturate(vec4 v) {
return clamp(v, vec4(0.0f), vec4(1.0f));
}
void saturate_a5b571() { void saturate_a5b571() {
vec4 res = tint_saturate(vec4(2.0f)); vec4 res = vec4(1.0f);
} }
void compute_main() { void compute_main() {

View File

@ -1,10 +1,9 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 39 ; Bound: 30
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
%14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -13,8 +12,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_a5b571 "saturate_a5b571" OpName %saturate_a5b571 "saturate_a5b571"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -31,47 +28,37 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%9 = OpTypeFunction %v4float %v4float
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%void = OpTypeVoid %void = OpTypeVoid
%17 = OpTypeFunction %void %9 = OpTypeFunction %void
%float_2 = OpConstant %float 2 %float_1 = OpConstant %float 1
%23 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2 %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%26 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%tint_saturate = OpFunction %v4float None %9 %saturate_a5b571 = OpFunction %void None %9
%v = OpFunctionParameter %v4float
%12 = OpLabel %12 = OpLabel
%13 = OpExtInst %v4float %14 NClamp %v %5 %16
OpReturnValue %13
OpFunctionEnd
%saturate_a5b571 = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5 %res = OpVariable %_ptr_Function_v4float Function %5
%21 = OpFunctionCall %v4float %tint_saturate %23 OpStore %res %14
OpStore %res %21
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %26 %vertex_main_inner = OpFunction %v4float None %17
%28 = OpLabel %19 = OpLabel
%29 = OpFunctionCall %void %saturate_a5b571 %20 = OpFunctionCall %void %saturate_a5b571
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %17 %vertex_main = OpFunction %void None %9
%31 = OpLabel %22 = OpLabel
%32 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %32 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %17 %fragment_main = OpFunction %void None %9
%34 = OpLabel %25 = OpLabel
%35 = OpFunctionCall %void %saturate_a5b571 %26 = OpFunctionCall %void %saturate_a5b571
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %17 %compute_main = OpFunction %void None %9
%37 = OpLabel %28 = OpLabel
%38 = OpFunctionCall %void %saturate_a5b571 %29 = OpFunctionCall %void %saturate_a5b571
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_saturate(f16vec2 v) {
return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
}
void saturate_cd2028() { void saturate_cd2028() {
f16vec2 res = tint_saturate(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec2 tint_saturate(f16vec2 v) {
return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
}
void saturate_cd2028() { void saturate_cd2028() {
f16vec2 res = tint_saturate(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec2 tint_saturate(f16vec2 v) {
return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
}
void saturate_cd2028() { void saturate_cd2028() {
f16vec2 res = tint_saturate(f16vec2(0.0hf)); f16vec2 res = f16vec2(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 41 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_cd2028 "saturate_cd2028" OpName %saturate_cd2028 "saturate_cd2028"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,49 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v2half = OpTypeVector %half 2 %v2half = OpTypeVector %half 2
%9 = OpTypeFunction %v2half %v2half %15 = OpConstantNull %v2half
%17 = OpConstantNull %v2half
%half_0x1p_0 = OpConstant %half 0x1p+0
%19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_v2half = OpTypePointer Function %v2half %_ptr_Function_v2half = OpTypePointer Function %v2half
%27 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_saturate = OpFunction %v2half None %9 %saturate_cd2028 = OpFunction %void None %9
%v = OpFunctionParameter %v2half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v2half Function %15
%15 = OpExtInst %v2half %16 NClamp %v %17 %19 OpStore %res %15
OpReturnValue %15
OpFunctionEnd
%saturate_cd2028 = OpFunction %void None %20
%23 = OpLabel
%res = OpVariable %_ptr_Function_v2half Function %17
%24 = OpFunctionCall %v2half %tint_saturate %17
OpStore %res %24
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27 %vertex_main_inner = OpFunction %v4float None %18
%29 = OpLabel %20 = OpLabel
%30 = OpFunctionCall %void %saturate_cd2028 %21 = OpFunctionCall %void %saturate_cd2028
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %20 %vertex_main = OpFunction %void None %9
%32 = OpLabel %23 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %20 %fragment_main = OpFunction %void None %9
%36 = OpLabel %27 = OpLabel
%37 = OpFunctionCall %void %saturate_cd2028 %28 = OpFunctionCall %void %saturate_cd2028
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %20 %compute_main = OpFunction %void None %9
%39 = OpLabel %30 = OpLabel
%40 = OpFunctionCall %void %saturate_cd2028 %31 = OpFunctionCall %void %saturate_cd2028
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_saturate(f16vec4 v) {
return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
}
void saturate_dcde71() { void saturate_dcde71() {
f16vec4 res = tint_saturate(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
f16vec4 tint_saturate(f16vec4 v) {
return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
}
void saturate_dcde71() { void saturate_dcde71() {
f16vec4 res = tint_saturate(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
f16vec4 tint_saturate(f16vec4 v) {
return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
}
void saturate_dcde71() { void saturate_dcde71() {
f16vec4 res = tint_saturate(f16vec4(0.0hf)); f16vec4 res = f16vec4(0.0hf);
} }
void compute_main() { void compute_main() {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 41 ; Bound: 32
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_dcde71 "saturate_dcde71" OpName %saturate_dcde71 "saturate_dcde71"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,49 +32,39 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16 %half = OpTypeFloat 16
%v4half = OpTypeVector %half 4 %v4half = OpTypeVector %half 4
%9 = OpTypeFunction %v4half %v4half %15 = OpConstantNull %v4half
%17 = OpConstantNull %v4half
%half_0x1p_0 = OpConstant %half 0x1p+0
%19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_v4half = OpTypePointer Function %v4half %_ptr_Function_v4half = OpTypePointer Function %v4half
%27 = OpTypeFunction %v4float %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_saturate = OpFunction %v4half None %9 %saturate_dcde71 = OpFunction %void None %9
%v = OpFunctionParameter %v4half %12 = OpLabel
%14 = OpLabel %res = OpVariable %_ptr_Function_v4half Function %15
%15 = OpExtInst %v4half %16 NClamp %v %17 %19 OpStore %res %15
OpReturnValue %15
OpFunctionEnd
%saturate_dcde71 = OpFunction %void None %20
%23 = OpLabel
%res = OpVariable %_ptr_Function_v4half Function %17
%24 = OpFunctionCall %v4half %tint_saturate %17
OpStore %res %24
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %27 %vertex_main_inner = OpFunction %v4float None %18
%29 = OpLabel %20 = OpLabel
%30 = OpFunctionCall %void %saturate_dcde71 %21 = OpFunctionCall %void %saturate_dcde71
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %20 %vertex_main = OpFunction %void None %9
%32 = OpLabel %23 = OpLabel
%33 = OpFunctionCall %v4float %vertex_main_inner %24 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %33 OpStore %value %24
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %20 %fragment_main = OpFunction %void None %9
%36 = OpLabel %27 = OpLabel
%37 = OpFunctionCall %void %saturate_dcde71 %28 = OpFunctionCall %void %saturate_dcde71
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %20 %compute_main = OpFunction %void None %9
%39 = OpLabel %30 = OpLabel
%40 = OpFunctionCall %void %saturate_dcde71 %31 = OpFunctionCall %void %saturate_dcde71
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd

View File

@ -1,12 +1,8 @@
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_saturate(float16_t v) {
return clamp(v, 0.0hf, 1.0hf);
}
void saturate_e8df56() { void saturate_e8df56() {
float16_t res = tint_saturate(0.0hf); float16_t res = 0.0hf;
} }
vec4 vertex_main() { vec4 vertex_main() {
@ -26,12 +22,8 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
precision mediump float; precision mediump float;
float16_t tint_saturate(float16_t v) {
return clamp(v, 0.0hf, 1.0hf);
}
void saturate_e8df56() { void saturate_e8df56() {
float16_t res = tint_saturate(0.0hf); float16_t res = 0.0hf;
} }
void fragment_main() { void fragment_main() {
@ -45,12 +37,8 @@ void main() {
#version 310 es #version 310 es
#extension GL_AMD_gpu_shader_half_float : require #extension GL_AMD_gpu_shader_half_float : require
float16_t tint_saturate(float16_t v) {
return clamp(v, 0.0hf, 1.0hf);
}
void saturate_e8df56() { void saturate_e8df56() {
float16_t res = tint_saturate(0.0hf); float16_t res = 0.0hf;
} }
void compute_main() { void compute_main() {

View File

@ -1,14 +1,13 @@
; SPIR-V ; SPIR-V
; Version: 1.3 ; Version: 1.3
; Generator: Google Tint Compiler; 0 ; Generator: Google Tint Compiler; 0
; Bound: 39 ; Bound: 31
; Schema: 0 ; Schema: 0
OpCapability Shader OpCapability Shader
OpCapability Float16 OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16 OpCapability StorageInputOutput16
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450 OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main" OpEntryPoint Fragment %fragment_main "fragment_main"
@ -17,8 +16,6 @@
OpExecutionMode %compute_main LocalSize 1 1 1 OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value" OpName %value "value"
OpName %vertex_point_size "vertex_point_size" OpName %vertex_point_size "vertex_point_size"
OpName %tint_saturate "tint_saturate"
OpName %v "v"
OpName %saturate_e8df56 "saturate_e8df56" OpName %saturate_e8df56 "saturate_e8df56"
OpName %res "res" OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner" OpName %vertex_main_inner "vertex_main_inner"
@ -35,47 +32,38 @@
%_ptr_Output_float = OpTypePointer Output %float %_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float %8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
%half = OpTypeFloat 16
%9 = OpTypeFunction %half %half
%16 = OpConstantNull %half
%half_0x1p_0 = OpConstant %half 0x1p+0
%void = OpTypeVoid %void = OpTypeVoid
%18 = OpTypeFunction %void %9 = OpTypeFunction %void
%half = OpTypeFloat 16
%14 = OpConstantNull %half
%_ptr_Function_half = OpTypePointer Function %half %_ptr_Function_half = OpTypePointer Function %half
%25 = OpTypeFunction %v4float %17 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1 %float_1 = OpConstant %float 1
%tint_saturate = OpFunction %half None %9 %saturate_e8df56 = OpFunction %void None %9
%v = OpFunctionParameter %half %12 = OpLabel
%13 = OpLabel %res = OpVariable %_ptr_Function_half Function %14
%14 = OpExtInst %half %15 NClamp %v %16 %half_0x1p_0 OpStore %res %14
OpReturnValue %14
OpFunctionEnd
%saturate_e8df56 = OpFunction %void None %18
%21 = OpLabel
%res = OpVariable %_ptr_Function_half Function %16
%22 = OpFunctionCall %half %tint_saturate %16
OpStore %res %22
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %25 %vertex_main_inner = OpFunction %v4float None %17
%27 = OpLabel %19 = OpLabel
%28 = OpFunctionCall %void %saturate_e8df56 %20 = OpFunctionCall %void %saturate_e8df56
OpReturnValue %5 OpReturnValue %5
OpFunctionEnd OpFunctionEnd
%vertex_main = OpFunction %void None %18 %vertex_main = OpFunction %void None %9
%30 = OpLabel %22 = OpLabel
%31 = OpFunctionCall %v4float %vertex_main_inner %23 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %31 OpStore %value %23
OpStore %vertex_point_size %float_1 OpStore %vertex_point_size %float_1
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%fragment_main = OpFunction %void None %18 %fragment_main = OpFunction %void None %9
%34 = OpLabel %26 = OpLabel
%35 = OpFunctionCall %void %saturate_e8df56 %27 = OpFunctionCall %void %saturate_e8df56
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%compute_main = OpFunction %void None %18 %compute_main = OpFunction %void None %9
%37 = OpLabel %29 = OpLabel
%38 = OpFunctionCall %void %saturate_e8df56 %30 = OpFunctionCall %void %saturate_e8df56
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd