test: Remove many expected files

For these tests, we only really care that we can successfully consume
them and generate valid output for each backend. Having the expected
files in the tree generates significant churn for any change to how we
generate backend code, which makes it hard to inspect diffs.

Change-Id: Ic98c248081144c0fb1791f1303eaf6d459548e3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62720
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-08-24 22:49:42 +00:00
committed by Tint LUCI CQ
parent 568136dd10
commit 87cce20f67
8526 changed files with 12 additions and 613699 deletions

View File

@@ -1,148 +0,0 @@
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
cbuffer cbuffer_x_24 : register(b0, space0) {
uint4 x_24[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
float cross2d_vf2_vf2_(inout float2 a, inout float2 b) {
const float x_79 = a.x;
const float x_81 = b.y;
const float x_84 = b.x;
const float x_86 = a.y;
return ((x_79 * x_81) - (x_84 * x_86));
}
int pointInTriangle_vf2_vf2_vf2_vf2_(inout float2 p, inout float2 a_1, inout float2 b_1, inout float2 c) {
bool x_90 = false;
int x_91 = 0;
float pab = 0.0f;
float2 param = float2(0.0f, 0.0f);
float2 param_1 = float2(0.0f, 0.0f);
float pbc = 0.0f;
float2 param_2 = float2(0.0f, 0.0f);
float2 param_3 = float2(0.0f, 0.0f);
float pca = 0.0f;
float2 param_4 = float2(0.0f, 0.0f);
float2 param_5 = float2(0.0f, 0.0f);
bool x_140 = false;
bool x_168 = false;
bool x_141_phi = false;
bool x_169_phi = false;
int x_173_phi = 0;
switch(0u) {
default: {
const float x_95 = p.x;
const float x_97 = a_1.x;
const float x_100 = p.y;
const float x_102 = a_1.y;
const float x_106 = b_1.x;
const float x_107 = a_1.x;
const float x_110 = b_1.y;
const float x_111 = a_1.y;
param = float2((x_95 - x_97), (x_100 - x_102));
param_1 = float2((x_106 - x_107), (x_110 - x_111));
const float x_114 = cross2d_vf2_vf2_(param, param_1);
pab = x_114;
const float x_115 = p.x;
const float x_116 = b_1.x;
const float x_118 = p.y;
const float x_119 = b_1.y;
const float x_123 = c.x;
const float x_124 = b_1.x;
const float x_127 = c.y;
const float x_128 = b_1.y;
param_2 = float2((x_115 - x_116), (x_118 - x_119));
param_3 = float2((x_123 - x_124), (x_127 - x_128));
const float x_131 = cross2d_vf2_vf2_(param_2, param_3);
pbc = x_131;
const bool x_134 = ((x_114 < 0.0f) & (x_131 < 0.0f));
x_141_phi = x_134;
if (!(x_134)) {
x_140 = ((x_114 >= 0.0f) & (x_131 >= 0.0f));
x_141_phi = x_140;
}
if (!(x_141_phi)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
const float x_145 = p.x;
const float x_146 = c.x;
const float x_148 = p.y;
const float x_149 = c.y;
const float x_152 = a_1.x;
const float x_153 = c.x;
const float x_155 = a_1.y;
const float x_156 = c.y;
param_4 = float2((x_145 - x_146), (x_148 - x_149));
param_5 = float2((x_152 - x_153), (x_155 - x_156));
const float x_159 = cross2d_vf2_vf2_(param_4, param_5);
pca = x_159;
const bool x_162 = ((x_114 < 0.0f) & (x_159 < 0.0f));
x_169_phi = x_162;
if (!(x_162)) {
x_168 = ((x_114 >= 0.0f) & (x_159 >= 0.0f));
x_169_phi = x_168;
}
if (!(x_169_phi)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
break;
}
}
return x_173_phi;
}
void main_1() {
float2 pos = float2(0.0f, 0.0f);
float2 param_6 = float2(0.0f, 0.0f);
float2 param_7 = float2(0.0f, 0.0f);
float2 param_8 = float2(0.0f, 0.0f);
float2 param_9 = float2(0.0f, 0.0f);
const float4 x_67 = gl_FragCoord;
const float2 x_70 = asfloat(x_24[0].xy);
const float2 x_71 = (float2(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = float2(0.699999988f, 0.300000012f);
param_8 = float2(0.5f, 0.899999976f);
param_9 = float2(0.100000001f, 0.400000006f);
const int x_72 = pointInTriangle_vf2_vf2_vf2_vf2_(param_6, param_7, param_8, param_9);
if ((x_72 == 1)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 gl_FragCoord_param : SV_Position;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner(float4 gl_FragCoord_param) {
gl_FragCoord = gl_FragCoord_param;
main_1();
const main_out tint_symbol_4 = {x_GLF_color};
return tint_symbol_4;
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param);
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,151 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ float2 resolution;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
float cross2d_vf2_vf2_(thread float2* const a, thread float2* const b) {
float const x_79 = (*(a)).x;
float const x_81 = (*(b)).y;
float const x_84 = (*(b)).x;
float const x_86 = (*(a)).y;
return ((x_79 * x_81) - (x_84 * x_86));
}
int pointInTriangle_vf2_vf2_vf2_vf2_(thread float2* const p, thread float2* const a_1, thread float2* const b_1, thread float2* const c) {
bool x_90 = false;
int x_91 = 0;
float pab = 0.0f;
float2 param = 0.0f;
float2 param_1 = 0.0f;
float pbc = 0.0f;
float2 param_2 = 0.0f;
float2 param_3 = 0.0f;
float pca = 0.0f;
float2 param_4 = 0.0f;
float2 param_5 = 0.0f;
bool x_140 = false;
bool x_168 = false;
bool x_141_phi = false;
bool x_169_phi = false;
int x_173_phi = 0;
switch(0u) {
default: {
float const x_95 = (*(p)).x;
float const x_97 = (*(a_1)).x;
float const x_100 = (*(p)).y;
float const x_102 = (*(a_1)).y;
float const x_106 = (*(b_1)).x;
float const x_107 = (*(a_1)).x;
float const x_110 = (*(b_1)).y;
float const x_111 = (*(a_1)).y;
param = float2((x_95 - x_97), (x_100 - x_102));
param_1 = float2((x_106 - x_107), (x_110 - x_111));
float const x_114 = cross2d_vf2_vf2_(&(param), &(param_1));
pab = x_114;
float const x_115 = (*(p)).x;
float const x_116 = (*(b_1)).x;
float const x_118 = (*(p)).y;
float const x_119 = (*(b_1)).y;
float const x_123 = (*(c)).x;
float const x_124 = (*(b_1)).x;
float const x_127 = (*(c)).y;
float const x_128 = (*(b_1)).y;
param_2 = float2((x_115 - x_116), (x_118 - x_119));
param_3 = float2((x_123 - x_124), (x_127 - x_128));
float const x_131 = cross2d_vf2_vf2_(&(param_2), &(param_3));
pbc = x_131;
bool const x_134 = ((x_114 < 0.0f) & (x_131 < 0.0f));
x_141_phi = x_134;
if (!(x_134)) {
x_140 = ((x_114 >= 0.0f) & (x_131 >= 0.0f));
x_141_phi = x_140;
}
bool const x_141 = x_141_phi;
if (!(x_141)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
float const x_145 = (*(p)).x;
float const x_146 = (*(c)).x;
float const x_148 = (*(p)).y;
float const x_149 = (*(c)).y;
float const x_152 = (*(a_1)).x;
float const x_153 = (*(c)).x;
float const x_155 = (*(a_1)).y;
float const x_156 = (*(c)).y;
param_4 = float2((x_145 - x_146), (x_148 - x_149));
param_5 = float2((x_152 - x_153), (x_155 - x_156));
float const x_159 = cross2d_vf2_vf2_(&(param_4), &(param_5));
pca = x_159;
bool const x_162 = ((x_114 < 0.0f) & (x_159 < 0.0f));
x_169_phi = x_162;
if (!(x_162)) {
x_168 = ((x_114 >= 0.0f) & (x_159 >= 0.0f));
x_169_phi = x_168;
}
bool const x_169 = x_169_phi;
if (!(x_169)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
break;
}
}
int const x_173 = x_173_phi;
return x_173;
}
void main_1(constant buf0& x_24, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) {
float2 pos = 0.0f;
float2 param_6 = 0.0f;
float2 param_7 = 0.0f;
float2 param_8 = 0.0f;
float2 param_9 = 0.0f;
float4 const x_67 = *(tint_symbol_3);
float2 const x_70 = x_24.resolution;
float2 const x_71 = (float2(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = float2(0.699999988f, 0.300000012f);
param_8 = float2(0.5f, 0.899999976f);
param_9 = float2(0.100000001f, 0.400000006f);
int const x_72 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
if ((x_72 == 1)) {
*(tint_symbol_4) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_4) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_24, float4 gl_FragCoord_param, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
*(tint_symbol_5) = gl_FragCoord_param;
main_1(x_24, tint_symbol_5, tint_symbol_6);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_24 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_24, gl_FragCoord_param, &(tint_symbol_7), &(tint_symbol_8));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,340 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 257
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_24 "x_24"
OpName %x_GLF_color "x_GLF_color"
OpName %cross2d_vf2_vf2_ "cross2d_vf2_vf2_"
OpName %a "a"
OpName %b "b"
OpName %pointInTriangle_vf2_vf2_vf2_vf2_ "pointInTriangle_vf2_vf2_vf2_vf2_"
OpName %p "p"
OpName %a_1 "a_1"
OpName %b_1 "b_1"
OpName %c "c"
OpName %x_90 "x_90"
OpName %x_91 "x_91"
OpName %pab "pab"
OpName %param "param"
OpName %param_1 "param_1"
OpName %pbc "pbc"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %pca "pca"
OpName %param_4 "param_4"
OpName %param_5 "param_5"
OpName %x_140 "x_140"
OpName %x_168 "x_168"
OpName %x_141_phi "x_141_phi"
OpName %x_169_phi "x_169_phi"
OpName %x_173_phi "x_173_phi"
OpName %main_1 "main_1"
OpName %pos "pos"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %gl_FragCoord_param "gl_FragCoord_param"
OpName %main "main"
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_24 NonWritable
OpDecorate %x_24 DescriptorSet 0
OpDecorate %x_24 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%7 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
%_ptr_Private_v4float = OpTypePointer Private %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_24 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
%_ptr_Function_v2float = OpTypePointer Function %v2float
%15 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
%40 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float
%bool = OpTypeBool
%false = OpConstantFalse %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%52 = OpConstantNull %bool
%_ptr_Function_int = OpTypePointer Function %int
%55 = OpConstantNull %int
%57 = OpConstantNull %float
%59 = OpConstantNull %v2float
%float_0 = OpConstant %float 0
%true = OpConstantTrue %bool
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%void = OpTypeVoid
%206 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%225 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%228 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%231 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%float_1 = OpConstant %float 1
%242 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%243 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%244 = OpTypeFunction %main_out %v4float
%cross2d_vf2_vf2_ = OpFunction %float None %15
%a = OpFunctionParameter %_ptr_Function_v2float
%b = OpFunctionParameter %_ptr_Function_v2float
%20 = OpLabel
%25 = OpAccessChain %_ptr_Function_float %a %uint_0
%26 = OpLoad %float %25
%29 = OpAccessChain %_ptr_Function_float %b %uint_1
%30 = OpLoad %float %29
%32 = OpAccessChain %_ptr_Function_float %b %uint_0
%33 = OpLoad %float %32
%35 = OpAccessChain %_ptr_Function_float %a %uint_1
%36 = OpLoad %float %35
%37 = OpFMul %float %26 %30
%38 = OpFMul %float %33 %36
%39 = OpFSub %float %37 %38
OpReturnValue %39
OpFunctionEnd
%pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %40
%p = OpFunctionParameter %_ptr_Function_v2float
%a_1 = OpFunctionParameter %_ptr_Function_v2float
%b_1 = OpFunctionParameter %_ptr_Function_v2float
%c = OpFunctionParameter %_ptr_Function_v2float
%47 = OpLabel
%x_90 = OpVariable %_ptr_Function_bool Function %52
%x_91 = OpVariable %_ptr_Function_int Function %55
%pab = OpVariable %_ptr_Function_float Function %57
%param = OpVariable %_ptr_Function_v2float Function %59
%param_1 = OpVariable %_ptr_Function_v2float Function %59
%pbc = OpVariable %_ptr_Function_float Function %57
%param_2 = OpVariable %_ptr_Function_v2float Function %59
%param_3 = OpVariable %_ptr_Function_v2float Function %59
%pca = OpVariable %_ptr_Function_float Function %57
%param_4 = OpVariable %_ptr_Function_v2float Function %59
%param_5 = OpVariable %_ptr_Function_v2float Function %59
%x_140 = OpVariable %_ptr_Function_bool Function %52
%x_168 = OpVariable %_ptr_Function_bool Function %52
%x_141_phi = OpVariable %_ptr_Function_bool Function %52
%x_169_phi = OpVariable %_ptr_Function_bool Function %52
%x_173_phi = OpVariable %_ptr_Function_int Function %55
OpStore %x_90 %false
OpSelectionMerge %72 None
OpSwitch %uint_0 %73
%73 = OpLabel
%75 = OpAccessChain %_ptr_Function_float %p %uint_0
%76 = OpLoad %float %75
%78 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%79 = OpLoad %float %78
%81 = OpAccessChain %_ptr_Function_float %p %uint_1
%82 = OpLoad %float %81
%84 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%85 = OpLoad %float %84
%87 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%88 = OpLoad %float %87
%90 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%91 = OpLoad %float %90
%93 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%94 = OpLoad %float %93
%96 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%97 = OpLoad %float %96
%98 = OpFSub %float %76 %79
%99 = OpFSub %float %82 %85
%100 = OpCompositeConstruct %v2float %98 %99
OpStore %param %100
%101 = OpFSub %float %88 %91
%102 = OpFSub %float %94 %97
%103 = OpCompositeConstruct %v2float %101 %102
OpStore %param_1 %103
%104 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1
OpStore %pab %104
%108 = OpAccessChain %_ptr_Function_float %p %uint_0
%109 = OpLoad %float %108
%111 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%112 = OpLoad %float %111
%114 = OpAccessChain %_ptr_Function_float %p %uint_1
%115 = OpLoad %float %114
%117 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%118 = OpLoad %float %117
%120 = OpAccessChain %_ptr_Function_float %c %uint_0
%121 = OpLoad %float %120
%123 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%124 = OpLoad %float %123
%126 = OpAccessChain %_ptr_Function_float %c %uint_1
%127 = OpLoad %float %126
%129 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%130 = OpLoad %float %129
%131 = OpFSub %float %109 %112
%132 = OpFSub %float %115 %118
%133 = OpCompositeConstruct %v2float %131 %132
OpStore %param_2 %133
%134 = OpFSub %float %121 %124
%135 = OpFSub %float %127 %130
%136 = OpCompositeConstruct %v2float %134 %135
OpStore %param_3 %136
%137 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3
OpStore %pbc %137
%141 = OpFOrdLessThan %bool %104 %float_0
%142 = OpFOrdLessThan %bool %137 %float_0
%143 = OpLogicalAnd %bool %141 %142
OpStore %x_141_phi %143
%144 = OpLogicalNot %bool %143
OpSelectionMerge %145 None
OpBranchConditional %144 %146 %145
%146 = OpLabel
%147 = OpFOrdGreaterThanEqual %bool %104 %float_0
%148 = OpFOrdGreaterThanEqual %bool %137 %float_0
%149 = OpLogicalAnd %bool %147 %148
OpStore %x_140 %149
%150 = OpLoad %bool %x_140
OpStore %x_141_phi %150
OpBranch %145
%145 = OpLabel
%151 = OpLoad %bool %x_141_phi
%152 = OpLogicalNot %bool %151
OpSelectionMerge %153 None
OpBranchConditional %152 %154 %153
%154 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_0
OpStore %x_173_phi %int_0
OpBranch %72
%153 = OpLabel
%158 = OpAccessChain %_ptr_Function_float %p %uint_0
%159 = OpLoad %float %158
%161 = OpAccessChain %_ptr_Function_float %c %uint_0
%162 = OpLoad %float %161
%164 = OpAccessChain %_ptr_Function_float %p %uint_1
%165 = OpLoad %float %164
%167 = OpAccessChain %_ptr_Function_float %c %uint_1
%168 = OpLoad %float %167
%170 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%171 = OpLoad %float %170
%173 = OpAccessChain %_ptr_Function_float %c %uint_0
%174 = OpLoad %float %173
%176 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%177 = OpLoad %float %176
%179 = OpAccessChain %_ptr_Function_float %c %uint_1
%180 = OpLoad %float %179
%181 = OpFSub %float %159 %162
%182 = OpFSub %float %165 %168
%183 = OpCompositeConstruct %v2float %181 %182
OpStore %param_4 %183
%184 = OpFSub %float %171 %174
%185 = OpFSub %float %177 %180
%186 = OpCompositeConstruct %v2float %184 %185
OpStore %param_5 %186
%187 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
OpStore %pca %187
%190 = OpFOrdLessThan %bool %104 %float_0
%191 = OpFOrdLessThan %bool %187 %float_0
%192 = OpLogicalAnd %bool %190 %191
OpStore %x_169_phi %192
%193 = OpLogicalNot %bool %192
OpSelectionMerge %194 None
OpBranchConditional %193 %195 %194
%195 = OpLabel
%196 = OpFOrdGreaterThanEqual %bool %104 %float_0
%197 = OpFOrdGreaterThanEqual %bool %187 %float_0
%198 = OpLogicalAnd %bool %196 %197
OpStore %x_168 %198
%199 = OpLoad %bool %x_168
OpStore %x_169_phi %199
OpBranch %194
%194 = OpLabel
%200 = OpLoad %bool %x_169_phi
%201 = OpLogicalNot %bool %200
OpSelectionMerge %202 None
OpBranchConditional %201 %203 %202
%203 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_0
OpStore %x_173_phi %int_0
OpBranch %72
%202 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_1
OpStore %x_173_phi %int_1
OpBranch %72
%72 = OpLabel
%205 = OpLoad %int %x_173_phi
OpReturnValue %205
OpFunctionEnd
%main_1 = OpFunction %void None %206
%209 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %59
%param_6 = OpVariable %_ptr_Function_v2float Function %59
%param_7 = OpVariable %_ptr_Function_v2float Function %59
%param_8 = OpVariable %_ptr_Function_v2float Function %59
%param_9 = OpVariable %_ptr_Function_v2float Function %59
%215 = OpLoad %v4float %gl_FragCoord
%217 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0
%218 = OpLoad %v2float %217
%219 = OpCompositeExtract %float %215 0
%220 = OpCompositeExtract %float %215 1
%221 = OpCompositeConstruct %v2float %219 %220
%222 = OpFDiv %v2float %221 %218
OpStore %pos %222
OpStore %param_6 %222
OpStore %param_7 %225
OpStore %param_8 %228
OpStore %param_9 %231
%232 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%237 = OpIEqual %bool %232 %int_1
OpSelectionMerge %238 None
OpBranchConditional %237 %239 %240
%239 = OpLabel
OpStore %x_GLF_color %242
OpBranch %238
%240 = OpLabel
OpStore %x_GLF_color %243
OpBranch %238
%238 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %244
%gl_FragCoord_param = OpFunctionParameter %v4float
%248 = OpLabel
OpStore %gl_FragCoord %gl_FragCoord_param
%249 = OpFunctionCall %void %main_1
%250 = OpLoad %v4float %x_GLF_color
%251 = OpCompositeConstruct %main_out %250
OpReturnValue %251
OpFunctionEnd
%main = OpFunction %void None %206
%253 = OpLabel
%255 = OpLoad %v4float %gl_FragCoord_param_1
%254 = OpFunctionCall %main_out %main_inner %255
%256 = OpCompositeExtract %v4float %254 0
OpStore %x_GLF_color_1_1 %256
OpReturn
OpFunctionEnd

View File

@@ -1,151 +0,0 @@
[[block]]
struct buf0 {
resolution : vec2<f32>;
};
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_24 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn cross2d_vf2_vf2_(a : ptr<function, vec2<f32>>, b : ptr<function, vec2<f32>>) -> f32 {
let x_79 : f32 = (*(a)).x;
let x_81 : f32 = (*(b)).y;
let x_84 : f32 = (*(b)).x;
let x_86 : f32 = (*(a)).y;
return ((x_79 * x_81) - (x_84 * x_86));
}
fn pointInTriangle_vf2_vf2_vf2_vf2_(p : ptr<function, vec2<f32>>, a_1 : ptr<function, vec2<f32>>, b_1 : ptr<function, vec2<f32>>, c : ptr<function, vec2<f32>>) -> i32 {
var x_90 : bool = false;
var x_91 : i32;
var pab : f32;
var param : vec2<f32>;
var param_1 : vec2<f32>;
var pbc : f32;
var param_2 : vec2<f32>;
var param_3 : vec2<f32>;
var pca : f32;
var param_4 : vec2<f32>;
var param_5 : vec2<f32>;
var x_140 : bool;
var x_168 : bool;
var x_141_phi : bool;
var x_169_phi : bool;
var x_173_phi : i32;
switch(0u) {
default: {
let x_94 : ptr<function, f32> = &((*(p)).x);
let x_95 : f32 = *(x_94);
let x_96 : ptr<function, f32> = &((*(a_1)).x);
let x_97 : f32 = *(x_96);
let x_99 : ptr<function, f32> = &((*(p)).y);
let x_100 : f32 = *(x_99);
let x_101 : ptr<function, f32> = &((*(a_1)).y);
let x_102 : f32 = *(x_101);
let x_105 : ptr<function, f32> = &((*(b_1)).x);
let x_106 : f32 = *(x_105);
let x_107 : f32 = *(x_96);
let x_109 : ptr<function, f32> = &((*(b_1)).y);
let x_110 : f32 = *(x_109);
let x_111 : f32 = *(x_101);
param = vec2<f32>((x_95 - x_97), (x_100 - x_102));
param_1 = vec2<f32>((x_106 - x_107), (x_110 - x_111));
let x_114 : f32 = cross2d_vf2_vf2_(&(param), &(param_1));
pab = x_114;
let x_115 : f32 = *(x_94);
let x_116 : f32 = *(x_105);
let x_118 : f32 = *(x_99);
let x_119 : f32 = *(x_109);
let x_122 : ptr<function, f32> = &((*(c)).x);
let x_123 : f32 = *(x_122);
let x_124 : f32 = *(x_105);
let x_126 : ptr<function, f32> = &((*(c)).y);
let x_127 : f32 = *(x_126);
let x_128 : f32 = *(x_109);
param_2 = vec2<f32>((x_115 - x_116), (x_118 - x_119));
param_3 = vec2<f32>((x_123 - x_124), (x_127 - x_128));
let x_131 : f32 = cross2d_vf2_vf2_(&(param_2), &(param_3));
pbc = x_131;
let x_134 : bool = ((x_114 < 0.0) & (x_131 < 0.0));
x_141_phi = x_134;
if (!(x_134)) {
x_140 = ((x_114 >= 0.0) & (x_131 >= 0.0));
x_141_phi = x_140;
}
let x_141 : bool = x_141_phi;
if (!(x_141)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
let x_145 : f32 = *(x_94);
let x_146 : f32 = *(x_122);
let x_148 : f32 = *(x_99);
let x_149 : f32 = *(x_126);
let x_152 : f32 = *(x_96);
let x_153 : f32 = *(x_122);
let x_155 : f32 = *(x_101);
let x_156 : f32 = *(x_126);
param_4 = vec2<f32>((x_145 - x_146), (x_148 - x_149));
param_5 = vec2<f32>((x_152 - x_153), (x_155 - x_156));
let x_159 : f32 = cross2d_vf2_vf2_(&(param_4), &(param_5));
pca = x_159;
let x_162 : bool = ((x_114 < 0.0) & (x_159 < 0.0));
x_169_phi = x_162;
if (!(x_162)) {
x_168 = ((x_114 >= 0.0) & (x_159 >= 0.0));
x_169_phi = x_168;
}
let x_169 : bool = x_169_phi;
if (!(x_169)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
}
}
let x_173 : i32 = x_173_phi;
return x_173;
}
fn main_1() {
var pos : vec2<f32>;
var param_6 : vec2<f32>;
var param_7 : vec2<f32>;
var param_8 : vec2<f32>;
var param_9 : vec2<f32>;
let x_67 : vec4<f32> = gl_FragCoord;
let x_70 : vec2<f32> = x_24.resolution;
let x_71 : vec2<f32> = (vec2<f32>(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = vec2<f32>(0.699999988, 0.300000012);
param_8 = vec2<f32>(0.5, 0.899999976);
param_9 = vec2<f32>(0.100000001, 0.400000006);
let x_72 : i32 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
if ((x_72 == 1)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 0.0, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);
}

View File

@@ -1,164 +0,0 @@
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
cbuffer cbuffer_x_24 : register(b0, space0) {
uint4 x_24[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
float cross2d_vf2_vf2_(inout float2 a, inout float2 b) {
const float x_79 = a.x;
const float x_81 = b.y;
const float x_84 = b.x;
const float x_86 = a.y;
return ((x_79 * x_81) - (x_84 * x_86));
}
int pointInTriangle_vf2_vf2_vf2_vf2_(inout float2 p, inout float2 a_1, inout float2 b_1, inout float2 c) {
bool x_90 = false;
int x_91 = 0;
float pab = 0.0f;
float2 param = float2(0.0f, 0.0f);
float2 param_1 = float2(0.0f, 0.0f);
float pbc = 0.0f;
float2 param_2 = float2(0.0f, 0.0f);
float2 param_3 = float2(0.0f, 0.0f);
float pca = 0.0f;
float2 param_4 = float2(0.0f, 0.0f);
float2 param_5 = float2(0.0f, 0.0f);
bool x_140 = false;
bool x_168 = false;
bool x_141_phi = false;
bool x_169_phi = false;
int x_173_phi = 0;
switch(0u) {
default: {
const float x_95 = p.x;
const float x_97 = a_1.x;
const float x_100 = p.y;
const float x_102 = a_1.y;
const float x_106 = b_1.x;
const float x_107 = a_1.x;
const float x_110 = b_1.y;
const float x_111 = a_1.y;
param = float2((x_95 - x_97), (x_100 - x_102));
param_1 = float2((x_106 - x_107), (x_110 - x_111));
const float x_114 = cross2d_vf2_vf2_(param, param_1);
pab = x_114;
const float x_115 = p.x;
const float x_116 = b_1.x;
const float x_118 = p.y;
const float x_119 = b_1.y;
const float x_123 = c.x;
const float x_124 = b_1.x;
const float x_127 = c.y;
const float x_128 = b_1.y;
param_2 = float2((x_115 - x_116), (x_118 - x_119));
param_3 = float2((x_123 - x_124), (x_127 - x_128));
const float x_131 = cross2d_vf2_vf2_(param_2, param_3);
pbc = x_131;
bool tint_tmp = (x_114 < 0.0f);
if (tint_tmp) {
tint_tmp = (x_131 < 0.0f);
}
const bool x_134 = (tint_tmp);
x_141_phi = x_134;
if (!(x_134)) {
bool tint_tmp_1 = (x_114 >= 0.0f);
if (tint_tmp_1) {
tint_tmp_1 = (x_131 >= 0.0f);
}
x_140 = (tint_tmp_1);
x_141_phi = x_140;
}
if (!(x_141_phi)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
const float x_145 = p.x;
const float x_146 = c.x;
const float x_148 = p.y;
const float x_149 = c.y;
const float x_152 = a_1.x;
const float x_153 = c.x;
const float x_155 = a_1.y;
const float x_156 = c.y;
param_4 = float2((x_145 - x_146), (x_148 - x_149));
param_5 = float2((x_152 - x_153), (x_155 - x_156));
const float x_159 = cross2d_vf2_vf2_(param_4, param_5);
pca = x_159;
bool tint_tmp_2 = (x_114 < 0.0f);
if (tint_tmp_2) {
tint_tmp_2 = (x_159 < 0.0f);
}
const bool x_162 = (tint_tmp_2);
x_169_phi = x_162;
if (!(x_162)) {
bool tint_tmp_3 = (x_114 >= 0.0f);
if (tint_tmp_3) {
tint_tmp_3 = (x_159 >= 0.0f);
}
x_168 = (tint_tmp_3);
x_169_phi = x_168;
}
if (!(x_169_phi)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
break;
}
}
return x_173_phi;
}
void main_1() {
float2 pos = float2(0.0f, 0.0f);
float2 param_6 = float2(0.0f, 0.0f);
float2 param_7 = float2(0.0f, 0.0f);
float2 param_8 = float2(0.0f, 0.0f);
float2 param_9 = float2(0.0f, 0.0f);
const float4 x_67 = gl_FragCoord;
const float2 x_70 = asfloat(x_24[0].xy);
const float2 x_71 = (float2(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = float2(0.699999988f, 0.300000012f);
param_8 = float2(0.5f, 0.899999976f);
param_9 = float2(0.100000001f, 0.400000006f);
const int x_72 = pointInTriangle_vf2_vf2_vf2_vf2_(param_6, param_7, param_8, param_9);
if ((x_72 == 1)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 gl_FragCoord_param : SV_Position;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner(float4 gl_FragCoord_param) {
gl_FragCoord = gl_FragCoord_param;
main_1();
const main_out tint_symbol_4 = {x_GLF_color};
return tint_symbol_4;
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param);
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,151 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ float2 resolution;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
float cross2d_vf2_vf2_(thread float2* const a, thread float2* const b) {
float const x_79 = (*(a)).x;
float const x_81 = (*(b)).y;
float const x_84 = (*(b)).x;
float const x_86 = (*(a)).y;
return ((x_79 * x_81) - (x_84 * x_86));
}
int pointInTriangle_vf2_vf2_vf2_vf2_(thread float2* const p, thread float2* const a_1, thread float2* const b_1, thread float2* const c) {
bool x_90 = false;
int x_91 = 0;
float pab = 0.0f;
float2 param = 0.0f;
float2 param_1 = 0.0f;
float pbc = 0.0f;
float2 param_2 = 0.0f;
float2 param_3 = 0.0f;
float pca = 0.0f;
float2 param_4 = 0.0f;
float2 param_5 = 0.0f;
bool x_140 = false;
bool x_168 = false;
bool x_141_phi = false;
bool x_169_phi = false;
int x_173_phi = 0;
switch(0u) {
default: {
float const x_95 = (*(p)).x;
float const x_97 = (*(a_1)).x;
float const x_100 = (*(p)).y;
float const x_102 = (*(a_1)).y;
float const x_106 = (*(b_1)).x;
float const x_107 = (*(a_1)).x;
float const x_110 = (*(b_1)).y;
float const x_111 = (*(a_1)).y;
param = float2((x_95 - x_97), (x_100 - x_102));
param_1 = float2((x_106 - x_107), (x_110 - x_111));
float const x_114 = cross2d_vf2_vf2_(&(param), &(param_1));
pab = x_114;
float const x_115 = (*(p)).x;
float const x_116 = (*(b_1)).x;
float const x_118 = (*(p)).y;
float const x_119 = (*(b_1)).y;
float const x_123 = (*(c)).x;
float const x_124 = (*(b_1)).x;
float const x_127 = (*(c)).y;
float const x_128 = (*(b_1)).y;
param_2 = float2((x_115 - x_116), (x_118 - x_119));
param_3 = float2((x_123 - x_124), (x_127 - x_128));
float const x_131 = cross2d_vf2_vf2_(&(param_2), &(param_3));
pbc = x_131;
bool const x_134 = ((x_114 < 0.0f) && (x_131 < 0.0f));
x_141_phi = x_134;
if (!(x_134)) {
x_140 = ((x_114 >= 0.0f) && (x_131 >= 0.0f));
x_141_phi = x_140;
}
bool const x_141 = x_141_phi;
if (!(x_141)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
float const x_145 = (*(p)).x;
float const x_146 = (*(c)).x;
float const x_148 = (*(p)).y;
float const x_149 = (*(c)).y;
float const x_152 = (*(a_1)).x;
float const x_153 = (*(c)).x;
float const x_155 = (*(a_1)).y;
float const x_156 = (*(c)).y;
param_4 = float2((x_145 - x_146), (x_148 - x_149));
param_5 = float2((x_152 - x_153), (x_155 - x_156));
float const x_159 = cross2d_vf2_vf2_(&(param_4), &(param_5));
pca = x_159;
bool const x_162 = ((x_114 < 0.0f) && (x_159 < 0.0f));
x_169_phi = x_162;
if (!(x_162)) {
x_168 = ((x_114 >= 0.0f) && (x_159 >= 0.0f));
x_169_phi = x_168;
}
bool const x_169 = x_169_phi;
if (!(x_169)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
break;
}
}
int const x_173 = x_173_phi;
return x_173;
}
void main_1(constant buf0& x_24, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) {
float2 pos = 0.0f;
float2 param_6 = 0.0f;
float2 param_7 = 0.0f;
float2 param_8 = 0.0f;
float2 param_9 = 0.0f;
float4 const x_67 = *(tint_symbol_3);
float2 const x_70 = x_24.resolution;
float2 const x_71 = (float2(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = float2(0.699999988f, 0.300000012f);
param_8 = float2(0.5f, 0.899999976f);
param_9 = float2(0.100000001f, 0.400000006f);
int const x_72 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
if ((x_72 == 1)) {
*(tint_symbol_4) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_4) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_24, float4 gl_FragCoord_param, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
*(tint_symbol_5) = gl_FragCoord_param;
main_1(x_24, tint_symbol_5, tint_symbol_6);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_24 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_24, gl_FragCoord_param, &(tint_symbol_7), &(tint_symbol_8));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,360 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 265
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_24 "x_24"
OpName %x_GLF_color "x_GLF_color"
OpName %cross2d_vf2_vf2_ "cross2d_vf2_vf2_"
OpName %a "a"
OpName %b "b"
OpName %pointInTriangle_vf2_vf2_vf2_vf2_ "pointInTriangle_vf2_vf2_vf2_vf2_"
OpName %p "p"
OpName %a_1 "a_1"
OpName %b_1 "b_1"
OpName %c "c"
OpName %x_90 "x_90"
OpName %x_91 "x_91"
OpName %pab "pab"
OpName %param "param"
OpName %param_1 "param_1"
OpName %pbc "pbc"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %pca "pca"
OpName %param_4 "param_4"
OpName %param_5 "param_5"
OpName %x_140 "x_140"
OpName %x_168 "x_168"
OpName %x_141_phi "x_141_phi"
OpName %x_169_phi "x_169_phi"
OpName %x_173_phi "x_173_phi"
OpName %main_1 "main_1"
OpName %pos "pos"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %gl_FragCoord_param "gl_FragCoord_param"
OpName %main "main"
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_24 NonWritable
OpDecorate %x_24 DescriptorSet 0
OpDecorate %x_24 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%7 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
%_ptr_Private_v4float = OpTypePointer Private %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_24 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
%_ptr_Function_v2float = OpTypePointer Function %v2float
%15 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
%40 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float
%bool = OpTypeBool
%false = OpConstantFalse %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%52 = OpConstantNull %bool
%_ptr_Function_int = OpTypePointer Function %int
%55 = OpConstantNull %int
%57 = OpConstantNull %float
%59 = OpConstantNull %v2float
%float_0 = OpConstant %float 0
%true = OpConstantTrue %bool
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%void = OpTypeVoid
%214 = OpTypeFunction %void
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_0_699999988 = OpConstant %float 0.699999988
%float_0_300000012 = OpConstant %float 0.300000012
%233 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
%float_0_5 = OpConstant %float 0.5
%float_0_899999976 = OpConstant %float 0.899999976
%236 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
%float_0_100000001 = OpConstant %float 0.100000001
%float_0_400000006 = OpConstant %float 0.400000006
%239 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
%float_1 = OpConstant %float 1
%250 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%251 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%252 = OpTypeFunction %main_out %v4float
%cross2d_vf2_vf2_ = OpFunction %float None %15
%a = OpFunctionParameter %_ptr_Function_v2float
%b = OpFunctionParameter %_ptr_Function_v2float
%20 = OpLabel
%25 = OpAccessChain %_ptr_Function_float %a %uint_0
%26 = OpLoad %float %25
%29 = OpAccessChain %_ptr_Function_float %b %uint_1
%30 = OpLoad %float %29
%32 = OpAccessChain %_ptr_Function_float %b %uint_0
%33 = OpLoad %float %32
%35 = OpAccessChain %_ptr_Function_float %a %uint_1
%36 = OpLoad %float %35
%37 = OpFMul %float %26 %30
%38 = OpFMul %float %33 %36
%39 = OpFSub %float %37 %38
OpReturnValue %39
OpFunctionEnd
%pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %40
%p = OpFunctionParameter %_ptr_Function_v2float
%a_1 = OpFunctionParameter %_ptr_Function_v2float
%b_1 = OpFunctionParameter %_ptr_Function_v2float
%c = OpFunctionParameter %_ptr_Function_v2float
%47 = OpLabel
%x_90 = OpVariable %_ptr_Function_bool Function %52
%x_91 = OpVariable %_ptr_Function_int Function %55
%pab = OpVariable %_ptr_Function_float Function %57
%param = OpVariable %_ptr_Function_v2float Function %59
%param_1 = OpVariable %_ptr_Function_v2float Function %59
%pbc = OpVariable %_ptr_Function_float Function %57
%param_2 = OpVariable %_ptr_Function_v2float Function %59
%param_3 = OpVariable %_ptr_Function_v2float Function %59
%pca = OpVariable %_ptr_Function_float Function %57
%param_4 = OpVariable %_ptr_Function_v2float Function %59
%param_5 = OpVariable %_ptr_Function_v2float Function %59
%x_140 = OpVariable %_ptr_Function_bool Function %52
%x_168 = OpVariable %_ptr_Function_bool Function %52
%x_141_phi = OpVariable %_ptr_Function_bool Function %52
%x_169_phi = OpVariable %_ptr_Function_bool Function %52
%x_173_phi = OpVariable %_ptr_Function_int Function %55
OpStore %x_90 %false
OpSelectionMerge %72 None
OpSwitch %uint_0 %73
%73 = OpLabel
%75 = OpAccessChain %_ptr_Function_float %p %uint_0
%76 = OpLoad %float %75
%78 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%79 = OpLoad %float %78
%81 = OpAccessChain %_ptr_Function_float %p %uint_1
%82 = OpLoad %float %81
%84 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%85 = OpLoad %float %84
%87 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%88 = OpLoad %float %87
%90 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%91 = OpLoad %float %90
%93 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%94 = OpLoad %float %93
%96 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%97 = OpLoad %float %96
%98 = OpFSub %float %76 %79
%99 = OpFSub %float %82 %85
%100 = OpCompositeConstruct %v2float %98 %99
OpStore %param %100
%101 = OpFSub %float %88 %91
%102 = OpFSub %float %94 %97
%103 = OpCompositeConstruct %v2float %101 %102
OpStore %param_1 %103
%104 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1
OpStore %pab %104
%108 = OpAccessChain %_ptr_Function_float %p %uint_0
%109 = OpLoad %float %108
%111 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%112 = OpLoad %float %111
%114 = OpAccessChain %_ptr_Function_float %p %uint_1
%115 = OpLoad %float %114
%117 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%118 = OpLoad %float %117
%120 = OpAccessChain %_ptr_Function_float %c %uint_0
%121 = OpLoad %float %120
%123 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
%124 = OpLoad %float %123
%126 = OpAccessChain %_ptr_Function_float %c %uint_1
%127 = OpLoad %float %126
%129 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
%130 = OpLoad %float %129
%131 = OpFSub %float %109 %112
%132 = OpFSub %float %115 %118
%133 = OpCompositeConstruct %v2float %131 %132
OpStore %param_2 %133
%134 = OpFSub %float %121 %124
%135 = OpFSub %float %127 %130
%136 = OpCompositeConstruct %v2float %134 %135
OpStore %param_3 %136
%137 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3
OpStore %pbc %137
%141 = OpFOrdLessThan %bool %104 %float_0
OpSelectionMerge %142 None
OpBranchConditional %141 %143 %142
%143 = OpLabel
%144 = OpFOrdLessThan %bool %137 %float_0
OpBranch %142
%142 = OpLabel
%145 = OpPhi %bool %141 %73 %144 %143
OpStore %x_141_phi %145
%146 = OpLogicalNot %bool %145
OpSelectionMerge %147 None
OpBranchConditional %146 %148 %147
%148 = OpLabel
%149 = OpFOrdGreaterThanEqual %bool %104 %float_0
OpSelectionMerge %150 None
OpBranchConditional %149 %151 %150
%151 = OpLabel
%152 = OpFOrdGreaterThanEqual %bool %137 %float_0
OpBranch %150
%150 = OpLabel
%153 = OpPhi %bool %149 %148 %152 %151
OpStore %x_140 %153
%154 = OpLoad %bool %x_140
OpStore %x_141_phi %154
OpBranch %147
%147 = OpLabel
%155 = OpLoad %bool %x_141_phi
%156 = OpLogicalNot %bool %155
OpSelectionMerge %157 None
OpBranchConditional %156 %158 %157
%158 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_0
OpStore %x_173_phi %int_0
OpBranch %72
%157 = OpLabel
%162 = OpAccessChain %_ptr_Function_float %p %uint_0
%163 = OpLoad %float %162
%165 = OpAccessChain %_ptr_Function_float %c %uint_0
%166 = OpLoad %float %165
%168 = OpAccessChain %_ptr_Function_float %p %uint_1
%169 = OpLoad %float %168
%171 = OpAccessChain %_ptr_Function_float %c %uint_1
%172 = OpLoad %float %171
%174 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
%175 = OpLoad %float %174
%177 = OpAccessChain %_ptr_Function_float %c %uint_0
%178 = OpLoad %float %177
%180 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
%181 = OpLoad %float %180
%183 = OpAccessChain %_ptr_Function_float %c %uint_1
%184 = OpLoad %float %183
%185 = OpFSub %float %163 %166
%186 = OpFSub %float %169 %172
%187 = OpCompositeConstruct %v2float %185 %186
OpStore %param_4 %187
%188 = OpFSub %float %175 %178
%189 = OpFSub %float %181 %184
%190 = OpCompositeConstruct %v2float %188 %189
OpStore %param_5 %190
%191 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
OpStore %pca %191
%194 = OpFOrdLessThan %bool %104 %float_0
OpSelectionMerge %195 None
OpBranchConditional %194 %196 %195
%196 = OpLabel
%197 = OpFOrdLessThan %bool %191 %float_0
OpBranch %195
%195 = OpLabel
%198 = OpPhi %bool %194 %157 %197 %196
OpStore %x_169_phi %198
%199 = OpLogicalNot %bool %198
OpSelectionMerge %200 None
OpBranchConditional %199 %201 %200
%201 = OpLabel
%202 = OpFOrdGreaterThanEqual %bool %104 %float_0
OpSelectionMerge %203 None
OpBranchConditional %202 %204 %203
%204 = OpLabel
%205 = OpFOrdGreaterThanEqual %bool %191 %float_0
OpBranch %203
%203 = OpLabel
%206 = OpPhi %bool %202 %201 %205 %204
OpStore %x_168 %206
%207 = OpLoad %bool %x_168
OpStore %x_169_phi %207
OpBranch %200
%200 = OpLabel
%208 = OpLoad %bool %x_169_phi
%209 = OpLogicalNot %bool %208
OpSelectionMerge %210 None
OpBranchConditional %209 %211 %210
%211 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_0
OpStore %x_173_phi %int_0
OpBranch %72
%210 = OpLabel
OpStore %x_90 %true
OpStore %x_91 %int_1
OpStore %x_173_phi %int_1
OpBranch %72
%72 = OpLabel
%213 = OpLoad %int %x_173_phi
OpReturnValue %213
OpFunctionEnd
%main_1 = OpFunction %void None %214
%217 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %59
%param_6 = OpVariable %_ptr_Function_v2float Function %59
%param_7 = OpVariable %_ptr_Function_v2float Function %59
%param_8 = OpVariable %_ptr_Function_v2float Function %59
%param_9 = OpVariable %_ptr_Function_v2float Function %59
%223 = OpLoad %v4float %gl_FragCoord
%225 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0
%226 = OpLoad %v2float %225
%227 = OpCompositeExtract %float %223 0
%228 = OpCompositeExtract %float %223 1
%229 = OpCompositeConstruct %v2float %227 %228
%230 = OpFDiv %v2float %229 %226
OpStore %pos %230
OpStore %param_6 %230
OpStore %param_7 %233
OpStore %param_8 %236
OpStore %param_9 %239
%240 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
%245 = OpIEqual %bool %240 %int_1
OpSelectionMerge %246 None
OpBranchConditional %245 %247 %248
%247 = OpLabel
OpStore %x_GLF_color %250
OpBranch %246
%248 = OpLabel
OpStore %x_GLF_color %251
OpBranch %246
%246 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %252
%gl_FragCoord_param = OpFunctionParameter %v4float
%256 = OpLabel
OpStore %gl_FragCoord %gl_FragCoord_param
%257 = OpFunctionCall %void %main_1
%258 = OpLoad %v4float %x_GLF_color
%259 = OpCompositeConstruct %main_out %258
OpReturnValue %259
OpFunctionEnd
%main = OpFunction %void None %214
%261 = OpLabel
%263 = OpLoad %v4float %gl_FragCoord_param_1
%262 = OpFunctionCall %main_out %main_inner %263
%264 = OpCompositeExtract %v4float %262 0
OpStore %x_GLF_color_1_1 %264
OpReturn
OpFunctionEnd

View File

@@ -1,151 +0,0 @@
[[block]]
struct buf0 {
resolution : vec2<f32>;
};
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_24 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn cross2d_vf2_vf2_(a : ptr<function, vec2<f32>>, b : ptr<function, vec2<f32>>) -> f32 {
let x_79 : f32 = (*(a)).x;
let x_81 : f32 = (*(b)).y;
let x_84 : f32 = (*(b)).x;
let x_86 : f32 = (*(a)).y;
return ((x_79 * x_81) - (x_84 * x_86));
}
fn pointInTriangle_vf2_vf2_vf2_vf2_(p : ptr<function, vec2<f32>>, a_1 : ptr<function, vec2<f32>>, b_1 : ptr<function, vec2<f32>>, c : ptr<function, vec2<f32>>) -> i32 {
var x_90 : bool = false;
var x_91 : i32;
var pab : f32;
var param : vec2<f32>;
var param_1 : vec2<f32>;
var pbc : f32;
var param_2 : vec2<f32>;
var param_3 : vec2<f32>;
var pca : f32;
var param_4 : vec2<f32>;
var param_5 : vec2<f32>;
var x_140 : bool;
var x_168 : bool;
var x_141_phi : bool;
var x_169_phi : bool;
var x_173_phi : i32;
switch(0u) {
default: {
let x_94 : ptr<function, f32> = &((*(p)).x);
let x_95 : f32 = *(x_94);
let x_96 : ptr<function, f32> = &((*(a_1)).x);
let x_97 : f32 = *(x_96);
let x_99 : ptr<function, f32> = &((*(p)).y);
let x_100 : f32 = *(x_99);
let x_101 : ptr<function, f32> = &((*(a_1)).y);
let x_102 : f32 = *(x_101);
let x_105 : ptr<function, f32> = &((*(b_1)).x);
let x_106 : f32 = *(x_105);
let x_107 : f32 = *(x_96);
let x_109 : ptr<function, f32> = &((*(b_1)).y);
let x_110 : f32 = *(x_109);
let x_111 : f32 = *(x_101);
param = vec2<f32>((x_95 - x_97), (x_100 - x_102));
param_1 = vec2<f32>((x_106 - x_107), (x_110 - x_111));
let x_114 : f32 = cross2d_vf2_vf2_(&(param), &(param_1));
pab = x_114;
let x_115 : f32 = *(x_94);
let x_116 : f32 = *(x_105);
let x_118 : f32 = *(x_99);
let x_119 : f32 = *(x_109);
let x_122 : ptr<function, f32> = &((*(c)).x);
let x_123 : f32 = *(x_122);
let x_124 : f32 = *(x_105);
let x_126 : ptr<function, f32> = &((*(c)).y);
let x_127 : f32 = *(x_126);
let x_128 : f32 = *(x_109);
param_2 = vec2<f32>((x_115 - x_116), (x_118 - x_119));
param_3 = vec2<f32>((x_123 - x_124), (x_127 - x_128));
let x_131 : f32 = cross2d_vf2_vf2_(&(param_2), &(param_3));
pbc = x_131;
let x_134 : bool = ((x_114 < 0.0) && (x_131 < 0.0));
x_141_phi = x_134;
if (!(x_134)) {
x_140 = ((x_114 >= 0.0) && (x_131 >= 0.0));
x_141_phi = x_140;
}
let x_141 : bool = x_141_phi;
if (!(x_141)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
let x_145 : f32 = *(x_94);
let x_146 : f32 = *(x_122);
let x_148 : f32 = *(x_99);
let x_149 : f32 = *(x_126);
let x_152 : f32 = *(x_96);
let x_153 : f32 = *(x_122);
let x_155 : f32 = *(x_101);
let x_156 : f32 = *(x_126);
param_4 = vec2<f32>((x_145 - x_146), (x_148 - x_149));
param_5 = vec2<f32>((x_152 - x_153), (x_155 - x_156));
let x_159 : f32 = cross2d_vf2_vf2_(&(param_4), &(param_5));
pca = x_159;
let x_162 : bool = ((x_114 < 0.0) && (x_159 < 0.0));
x_169_phi = x_162;
if (!(x_162)) {
x_168 = ((x_114 >= 0.0) && (x_159 >= 0.0));
x_169_phi = x_168;
}
let x_169 : bool = x_169_phi;
if (!(x_169)) {
x_90 = true;
x_91 = 0;
x_173_phi = 0;
break;
}
x_90 = true;
x_91 = 1;
x_173_phi = 1;
}
}
let x_173 : i32 = x_173_phi;
return x_173;
}
fn main_1() {
var pos : vec2<f32>;
var param_6 : vec2<f32>;
var param_7 : vec2<f32>;
var param_8 : vec2<f32>;
var param_9 : vec2<f32>;
let x_67 : vec4<f32> = gl_FragCoord;
let x_70 : vec2<f32> = x_24.resolution;
let x_71 : vec2<f32> = (vec2<f32>(x_67.x, x_67.y) / x_70);
pos = x_71;
param_6 = x_71;
param_7 = vec2<f32>(0.699999988, 0.300000012);
param_8 = vec2<f32>(0.5, 0.899999976);
param_9 = vec2<f32>(0.100000001, 0.400000006);
let x_72 : i32 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
if ((x_72 == 1)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 0.0, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);
}