mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
tint->dawn: Shuffle source tree in preperation of merging repos
docs/ -> docs/tint/ fuzzers/ -> src/tint/fuzzers/ samples/ -> src/tint/cmd/ src/ -> src/tint/ test/ -> test/tint/ BUG=tint:1418,tint:1433 Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
38f1e9c75c
commit
dbc13af287
@@ -0,0 +1,266 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %gl_FragCoord %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 320
|
||||
OpName %main "main"
|
||||
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_0 "a"
|
||||
OpName %b_0 "b"
|
||||
OpName %c "c"
|
||||
OpName %pab "pab"
|
||||
OpName %param "param"
|
||||
OpName %param_0 "param"
|
||||
OpName %pbc "pbc"
|
||||
OpName %param_1 "param"
|
||||
OpName %param_2 "param"
|
||||
OpName %pca "pca"
|
||||
OpName %param_3 "param"
|
||||
OpName %param_4 "param"
|
||||
OpName %pos "pos"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "resolution"
|
||||
OpName %_ ""
|
||||
OpName %param_5 "param"
|
||||
OpName %param_6 "param"
|
||||
OpName %param_7 "param"
|
||||
OpName %param_8 "param"
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpDecorate %gl_FragCoord BuiltIn FragCoord
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 0
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%30 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%34 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
|
||||
%int = OpTypeInt 32 1
|
||||
%36 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_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
|
||||
%bool = OpTypeBool
|
||||
%float_0 = OpConstant %float 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_1 = OpConstant %int 1
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
||||
%float_0_699999988 = OpConstant %float 0.699999988
|
||||
%float_0_300000012 = OpConstant %float 0.300000012
|
||||
%51 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%float_0_899999976 = OpConstant %float 0.899999976
|
||||
%54 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
|
||||
%float_0_100000001 = OpConstant %float 0.100000001
|
||||
%float_0_400000006 = OpConstant %float 0.400000006
|
||||
%57 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%float_1 = OpConstant %float 1
|
||||
%60 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%61 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
|
||||
%main = OpFunction %void None %30
|
||||
%62 = OpLabel
|
||||
%pos = OpVariable %_ptr_Function_v2float Function
|
||||
%param_5 = OpVariable %_ptr_Function_v2float Function
|
||||
%param_6 = OpVariable %_ptr_Function_v2float Function
|
||||
%param_7 = OpVariable %_ptr_Function_v2float Function
|
||||
%param_8 = OpVariable %_ptr_Function_v2float Function
|
||||
%63 = OpLoad %v4float %gl_FragCoord
|
||||
%64 = OpVectorShuffle %v2float %63 %63 0 1
|
||||
%65 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0
|
||||
%66 = OpLoad %v2float %65
|
||||
%67 = OpFDiv %v2float %64 %66
|
||||
OpStore %pos %67
|
||||
%68 = OpLoad %v2float %pos
|
||||
OpStore %param_5 %68
|
||||
OpStore %param_6 %51
|
||||
OpStore %param_7 %54
|
||||
OpStore %param_8 %57
|
||||
%69 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_5 %param_6 %param_7 %param_8
|
||||
%70 = OpIEqual %bool %69 %int_1
|
||||
OpSelectionMerge %71 None
|
||||
OpBranchConditional %70 %72 %73
|
||||
%72 = OpLabel
|
||||
OpStore %_GLF_color %60
|
||||
OpBranch %71
|
||||
%73 = OpLabel
|
||||
OpStore %_GLF_color %61
|
||||
OpBranch %71
|
||||
%71 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%cross2d_vf2_vf2_ = OpFunction %float None %34
|
||||
%a = OpFunctionParameter %_ptr_Function_v2float
|
||||
%b = OpFunctionParameter %_ptr_Function_v2float
|
||||
%74 = OpLabel
|
||||
%75 = OpAccessChain %_ptr_Function_float %a %uint_0
|
||||
%76 = OpLoad %float %75
|
||||
%77 = OpAccessChain %_ptr_Function_float %b %uint_1
|
||||
%78 = OpLoad %float %77
|
||||
%79 = OpFMul %float %76 %78
|
||||
%80 = OpAccessChain %_ptr_Function_float %b %uint_0
|
||||
%81 = OpLoad %float %80
|
||||
%82 = OpAccessChain %_ptr_Function_float %a %uint_1
|
||||
%83 = OpLoad %float %82
|
||||
%84 = OpFMul %float %81 %83
|
||||
%85 = OpFSub %float %79 %84
|
||||
OpReturnValue %85
|
||||
OpFunctionEnd
|
||||
%pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %36
|
||||
%p = OpFunctionParameter %_ptr_Function_v2float
|
||||
%a_0 = OpFunctionParameter %_ptr_Function_v2float
|
||||
%b_0 = OpFunctionParameter %_ptr_Function_v2float
|
||||
%c = OpFunctionParameter %_ptr_Function_v2float
|
||||
%86 = OpLabel
|
||||
%pab = OpVariable %_ptr_Function_float Function
|
||||
%param = OpVariable %_ptr_Function_v2float Function
|
||||
%param_0 = OpVariable %_ptr_Function_v2float Function
|
||||
%pbc = OpVariable %_ptr_Function_float Function
|
||||
%param_1 = OpVariable %_ptr_Function_v2float Function
|
||||
%param_2 = OpVariable %_ptr_Function_v2float Function
|
||||
%pca = OpVariable %_ptr_Function_float Function
|
||||
%param_3 = OpVariable %_ptr_Function_v2float Function
|
||||
%param_4 = OpVariable %_ptr_Function_v2float Function
|
||||
%87 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%88 = OpLoad %float %87
|
||||
%89 = OpAccessChain %_ptr_Function_float %a_0 %uint_0
|
||||
%90 = OpLoad %float %89
|
||||
%91 = OpFSub %float %88 %90
|
||||
%92 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%93 = OpLoad %float %92
|
||||
%94 = OpAccessChain %_ptr_Function_float %a_0 %uint_1
|
||||
%95 = OpLoad %float %94
|
||||
%96 = OpFSub %float %93 %95
|
||||
%97 = OpCompositeConstruct %v2float %91 %96
|
||||
%98 = OpAccessChain %_ptr_Function_float %b_0 %uint_0
|
||||
%99 = OpLoad %float %98
|
||||
%100 = OpAccessChain %_ptr_Function_float %a_0 %uint_0
|
||||
%101 = OpLoad %float %100
|
||||
%102 = OpFSub %float %99 %101
|
||||
%103 = OpAccessChain %_ptr_Function_float %b_0 %uint_1
|
||||
%104 = OpLoad %float %103
|
||||
%105 = OpAccessChain %_ptr_Function_float %a_0 %uint_1
|
||||
%106 = OpLoad %float %105
|
||||
%107 = OpFSub %float %104 %106
|
||||
%108 = OpCompositeConstruct %v2float %102 %107
|
||||
OpStore %param %97
|
||||
OpStore %param_0 %108
|
||||
%109 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_0
|
||||
OpStore %pab %109
|
||||
%110 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%111 = OpLoad %float %110
|
||||
%112 = OpAccessChain %_ptr_Function_float %b_0 %uint_0
|
||||
%113 = OpLoad %float %112
|
||||
%114 = OpFSub %float %111 %113
|
||||
%115 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%116 = OpLoad %float %115
|
||||
%117 = OpAccessChain %_ptr_Function_float %b_0 %uint_1
|
||||
%118 = OpLoad %float %117
|
||||
%119 = OpFSub %float %116 %118
|
||||
%120 = OpCompositeConstruct %v2float %114 %119
|
||||
%121 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%122 = OpLoad %float %121
|
||||
%123 = OpAccessChain %_ptr_Function_float %b_0 %uint_0
|
||||
%124 = OpLoad %float %123
|
||||
%125 = OpFSub %float %122 %124
|
||||
%126 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%127 = OpLoad %float %126
|
||||
%128 = OpAccessChain %_ptr_Function_float %b_0 %uint_1
|
||||
%129 = OpLoad %float %128
|
||||
%130 = OpFSub %float %127 %129
|
||||
%131 = OpCompositeConstruct %v2float %125 %130
|
||||
OpStore %param_1 %120
|
||||
OpStore %param_2 %131
|
||||
%132 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_1 %param_2
|
||||
OpStore %pbc %132
|
||||
%133 = OpLoad %float %pab
|
||||
%134 = OpFOrdLessThan %bool %133 %float_0
|
||||
%135 = OpLoad %float %pbc
|
||||
%136 = OpFOrdLessThan %bool %135 %float_0
|
||||
%137 = OpLogicalAnd %bool %134 %136
|
||||
%138 = OpLogicalNot %bool %137
|
||||
OpSelectionMerge %139 None
|
||||
OpBranchConditional %138 %140 %139
|
||||
%140 = OpLabel
|
||||
%141 = OpLoad %float %pab
|
||||
%142 = OpFOrdGreaterThanEqual %bool %141 %float_0
|
||||
%143 = OpLoad %float %pbc
|
||||
%144 = OpFOrdGreaterThanEqual %bool %143 %float_0
|
||||
%145 = OpLogicalAnd %bool %142 %144
|
||||
OpBranch %139
|
||||
%139 = OpLabel
|
||||
%146 = OpPhi %bool %137 %86 %145 %140
|
||||
%147 = OpLogicalNot %bool %146
|
||||
OpSelectionMerge %148 None
|
||||
OpBranchConditional %147 %149 %148
|
||||
%149 = OpLabel
|
||||
OpReturnValue %int_0
|
||||
%148 = OpLabel
|
||||
%150 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%151 = OpLoad %float %150
|
||||
%152 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%153 = OpLoad %float %152
|
||||
%154 = OpFSub %float %151 %153
|
||||
%155 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%156 = OpLoad %float %155
|
||||
%157 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%158 = OpLoad %float %157
|
||||
%159 = OpFSub %float %156 %158
|
||||
%160 = OpCompositeConstruct %v2float %154 %159
|
||||
%161 = OpAccessChain %_ptr_Function_float %a_0 %uint_0
|
||||
%162 = OpLoad %float %161
|
||||
%163 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%164 = OpLoad %float %163
|
||||
%165 = OpFSub %float %162 %164
|
||||
%166 = OpAccessChain %_ptr_Function_float %a_0 %uint_1
|
||||
%167 = OpLoad %float %166
|
||||
%168 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%169 = OpLoad %float %168
|
||||
%170 = OpFSub %float %167 %169
|
||||
%171 = OpCompositeConstruct %v2float %165 %170
|
||||
OpStore %param_3 %160
|
||||
OpStore %param_4 %171
|
||||
%172 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_3 %param_4
|
||||
OpStore %pca %172
|
||||
%173 = OpLoad %float %pab
|
||||
%174 = OpFOrdLessThan %bool %173 %float_0
|
||||
%175 = OpLoad %float %pca
|
||||
%176 = OpFOrdLessThan %bool %175 %float_0
|
||||
%177 = OpLogicalAnd %bool %174 %176
|
||||
%178 = OpLogicalNot %bool %177
|
||||
OpSelectionMerge %179 None
|
||||
OpBranchConditional %178 %180 %179
|
||||
%180 = OpLabel
|
||||
%181 = OpLoad %float %pab
|
||||
%182 = OpFOrdGreaterThanEqual %bool %181 %float_0
|
||||
%183 = OpLoad %float %pca
|
||||
%184 = OpFOrdGreaterThanEqual %bool %183 %float_0
|
||||
%185 = OpLogicalAnd %bool %182 %184
|
||||
OpBranch %179
|
||||
%179 = OpLabel
|
||||
%186 = OpPhi %bool %177 %148 %185 %180
|
||||
%187 = OpLogicalNot %bool %186
|
||||
OpSelectionMerge %188 None
|
||||
OpBranchConditional %187 %189 %188
|
||||
%189 = OpLabel
|
||||
OpReturnValue %int_0
|
||||
%188 = OpLabel
|
||||
OpReturnValue %int_1
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,133 @@
|
||||
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_76 : f32 = (*(a)).x;
|
||||
let x_78 : f32 = (*(b)).y;
|
||||
let x_81 : f32 = (*(b)).x;
|
||||
let x_83 : f32 = (*(a)).y;
|
||||
return ((x_76 * x_78) - (x_81 * x_83));
|
||||
}
|
||||
|
||||
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 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_145 : bool;
|
||||
var x_185 : bool;
|
||||
var x_146_phi : bool;
|
||||
var x_186_phi : bool;
|
||||
let x_88 : f32 = (*(p)).x;
|
||||
let x_90 : f32 = (*(a_1)).x;
|
||||
let x_93 : f32 = (*(p)).y;
|
||||
let x_95 : f32 = (*(a_1)).y;
|
||||
let x_99 : f32 = (*(b_1)).x;
|
||||
let x_101 : f32 = (*(a_1)).x;
|
||||
let x_104 : f32 = (*(b_1)).y;
|
||||
let x_106 : f32 = (*(a_1)).y;
|
||||
param = vec2<f32>((x_88 - x_90), (x_93 - x_95));
|
||||
param_1 = vec2<f32>((x_99 - x_101), (x_104 - x_106));
|
||||
let x_109 : f32 = cross2d_vf2_vf2_(&(param), &(param_1));
|
||||
pab = x_109;
|
||||
let x_111 : f32 = (*(p)).x;
|
||||
let x_113 : f32 = (*(b_1)).x;
|
||||
let x_116 : f32 = (*(p)).y;
|
||||
let x_118 : f32 = (*(b_1)).y;
|
||||
let x_122 : f32 = (*(c)).x;
|
||||
let x_124 : f32 = (*(b_1)).x;
|
||||
let x_127 : f32 = (*(c)).y;
|
||||
let x_129 : f32 = (*(b_1)).y;
|
||||
param_2 = vec2<f32>((x_111 - x_113), (x_116 - x_118));
|
||||
param_3 = vec2<f32>((x_122 - x_124), (x_127 - x_129));
|
||||
let x_132 : f32 = cross2d_vf2_vf2_(&(param_2), &(param_3));
|
||||
pbc = x_132;
|
||||
let x_133 : f32 = pab;
|
||||
let x_135 : f32 = pbc;
|
||||
let x_137 : bool = ((x_133 < 0.0) && (x_135 < 0.0));
|
||||
x_146_phi = x_137;
|
||||
if (!(x_137)) {
|
||||
let x_141 : f32 = pab;
|
||||
let x_143 : f32 = pbc;
|
||||
x_145 = ((x_141 >= 0.0) && (x_143 >= 0.0));
|
||||
x_146_phi = x_145;
|
||||
}
|
||||
let x_146 : bool = x_146_phi;
|
||||
if (!(x_146)) {
|
||||
return 0;
|
||||
}
|
||||
let x_151 : f32 = (*(p)).x;
|
||||
let x_153 : f32 = (*(c)).x;
|
||||
let x_156 : f32 = (*(p)).y;
|
||||
let x_158 : f32 = (*(c)).y;
|
||||
let x_162 : f32 = (*(a_1)).x;
|
||||
let x_164 : f32 = (*(c)).x;
|
||||
let x_167 : f32 = (*(a_1)).y;
|
||||
let x_169 : f32 = (*(c)).y;
|
||||
param_4 = vec2<f32>((x_151 - x_153), (x_156 - x_158));
|
||||
param_5 = vec2<f32>((x_162 - x_164), (x_167 - x_169));
|
||||
let x_172 : f32 = cross2d_vf2_vf2_(&(param_4), &(param_5));
|
||||
pca = x_172;
|
||||
let x_173 : f32 = pab;
|
||||
let x_175 : f32 = pca;
|
||||
let x_177 : bool = ((x_173 < 0.0) && (x_175 < 0.0));
|
||||
x_186_phi = x_177;
|
||||
if (!(x_177)) {
|
||||
let x_181 : f32 = pab;
|
||||
let x_183 : f32 = pca;
|
||||
x_185 = ((x_181 >= 0.0) && (x_183 >= 0.0));
|
||||
x_186_phi = x_185;
|
||||
}
|
||||
let x_186 : bool = x_186_phi;
|
||||
if (!(x_186)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
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_63 : vec4<f32> = gl_FragCoord;
|
||||
let x_66 : vec2<f32> = x_24.resolution;
|
||||
pos = (vec2<f32>(x_63.x, x_63.y) / x_66);
|
||||
let x_68 : vec2<f32> = pos;
|
||||
param_6 = x_68;
|
||||
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_69 : i32 = pointInTriangle_vf2_vf2_vf2_vf2_(&(param_6), &(param_7), &(param_8), &(param_9));
|
||||
if ((x_69 == 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);
|
||||
}
|
||||
Reference in New Issue
Block a user