mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
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:
committed by
Tint LUCI CQ
parent
568136dd10
commit
87cce20f67
@@ -1,75 +0,0 @@
|
||||
static int x_GLF_global_loop_count = 0;
|
||||
cbuffer cbuffer_x_7 : register(b0, space0) {
|
||||
uint4 x_7[3];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
int func_() {
|
||||
while (true) {
|
||||
if ((x_GLF_global_loop_count < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_78 = asint(x_7[scalar_offset / 4][scalar_offset % 4]);
|
||||
return x_78;
|
||||
}
|
||||
const int x_80 = asint(x_7[2].x);
|
||||
return x_80;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
int a = 0;
|
||||
x_GLF_global_loop_count = 0;
|
||||
while (true) {
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
if ((true & (x_GLF_global_loop_count < 100))) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const int x_42 = func_();
|
||||
a = x_42;
|
||||
const int x_43 = a;
|
||||
const int x_45 = asint(x_7[2].x);
|
||||
if ((x_43 == x_45)) {
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_51 = asint(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
const int x_54 = asint(x_7[1].x);
|
||||
const int x_57 = asint(x_7[1].x);
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_60 = asint(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
x_GLF_color = float4(float(x_51), float(x_54), float(x_57), float(x_60));
|
||||
} else {
|
||||
const int x_64 = asint(x_7[1].x);
|
||||
const float x_65 = float(x_64);
|
||||
x_GLF_color = float4(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
main_out main_inner() {
|
||||
main_1();
|
||||
const main_out tint_symbol_2 = {x_GLF_color};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
tint_symbol main() {
|
||||
const main_out inner_result = main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
int func_(constant buf0& x_7, thread int* const tint_symbol_3) {
|
||||
while (true) {
|
||||
int const x_72 = *(tint_symbol_3);
|
||||
if ((x_72 < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_75 = *(tint_symbol_3);
|
||||
*(tint_symbol_3) = as_type<int>((as_type<uint>(x_75) + as_type<uint>(1)));
|
||||
int const x_78 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
return x_78;
|
||||
}
|
||||
int const x_80 = x_7.x_GLF_uniform_int_values.arr[2].el;
|
||||
return x_80;
|
||||
}
|
||||
|
||||
void main_1(constant buf0& x_7, thread int* const tint_symbol_4, thread float4* const tint_symbol_5) {
|
||||
int a = 0;
|
||||
*(tint_symbol_4) = 0;
|
||||
while (true) {
|
||||
int const x_35 = *(tint_symbol_4);
|
||||
*(tint_symbol_4) = as_type<int>((as_type<uint>(x_35) + as_type<uint>(1)));
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
int const x_39 = *(tint_symbol_4);
|
||||
if ((true & (x_39 < 100))) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int const x_42 = func_(x_7, tint_symbol_4);
|
||||
a = x_42;
|
||||
int const x_43 = a;
|
||||
int const x_45 = x_7.x_GLF_uniform_int_values.arr[2].el;
|
||||
if ((x_43 == x_45)) {
|
||||
int const x_51 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_54 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_57 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_60 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_51), float(x_54), float(x_57), float(x_60));
|
||||
} else {
|
||||
int const x_64 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_65 = float(x_64);
|
||||
*(tint_symbol_5) = float4(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf0& x_7, thread int* const tint_symbol_6, thread float4* const tint_symbol_7) {
|
||||
main_1(x_7, tint_symbol_6, tint_symbol_7);
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_7)};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_7 [[buffer(0)]]) {
|
||||
thread int tint_symbol_8 = 0;
|
||||
thread float4 tint_symbol_9 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_7, &(tint_symbol_8), &(tint_symbol_9));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 98
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %x_GLF_global_loop_count "x_GLF_global_loop_count"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %func_ "func_"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %a "a"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%9 = OpConstantNull %int
|
||||
%x_GLF_global_loop_count = OpVariable %_ptr_Private_int Private %9
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%18 = OpTypeFunction %int
|
||||
%int_100 = OpConstant %int 100
|
||||
%bool = OpTypeBool
|
||||
%int_1 = OpConstant %int 1
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_2 = OpConstant %int 2
|
||||
%void = OpTypeVoid
|
||||
%43 = OpTypeFunction %void
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%false = OpConstantFalse %bool
|
||||
%true = OpConstantTrue %bool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%87 = OpTypeFunction %main_out
|
||||
%func_ = OpFunction %int None %18
|
||||
%20 = OpLabel
|
||||
OpBranch %21
|
||||
%21 = OpLabel
|
||||
OpLoopMerge %22 %23 None
|
||||
OpBranch %24
|
||||
%24 = OpLabel
|
||||
%25 = OpLoad %int %x_GLF_global_loop_count
|
||||
%27 = OpSLessThan %bool %25 %int_100
|
||||
OpSelectionMerge %29 None
|
||||
OpBranchConditional %27 %30 %31
|
||||
%30 = OpLabel
|
||||
OpBranch %29
|
||||
%31 = OpLabel
|
||||
OpBranch %22
|
||||
%29 = OpLabel
|
||||
%32 = OpLoad %int %x_GLF_global_loop_count
|
||||
%34 = OpIAdd %int %32 %int_1
|
||||
OpStore %x_GLF_global_loop_count %34
|
||||
%38 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%39 = OpLoad %int %38
|
||||
OpReturnValue %39
|
||||
%23 = OpLabel
|
||||
OpBranch %21
|
||||
%22 = OpLabel
|
||||
%41 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_2
|
||||
%42 = OpLoad %int %41
|
||||
OpReturnValue %42
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %43
|
||||
%46 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_int Function %9
|
||||
OpStore %x_GLF_global_loop_count %int_0
|
||||
OpBranch %49
|
||||
%49 = OpLabel
|
||||
OpLoopMerge %50 %51 None
|
||||
OpBranch %52
|
||||
%52 = OpLabel
|
||||
%53 = OpLoad %int %x_GLF_global_loop_count
|
||||
%54 = OpIAdd %int %53 %int_1
|
||||
OpStore %x_GLF_global_loop_count %54
|
||||
OpSelectionMerge %56 None
|
||||
OpBranchConditional %false %57 %56
|
||||
%57 = OpLabel
|
||||
OpReturn
|
||||
%56 = OpLabel
|
||||
OpBranch %51
|
||||
%51 = OpLabel
|
||||
%58 = OpLoad %int %x_GLF_global_loop_count
|
||||
%60 = OpSLessThan %bool %58 %int_100
|
||||
%61 = OpLogicalAnd %bool %true %60
|
||||
OpBranchConditional %61 %49 %50
|
||||
%50 = OpLabel
|
||||
%62 = OpFunctionCall %int %func_
|
||||
OpStore %a %62
|
||||
%63 = OpLoad %int %a
|
||||
%64 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_2
|
||||
%65 = OpLoad %int %64
|
||||
%66 = OpIEqual %bool %63 %65
|
||||
OpSelectionMerge %67 None
|
||||
OpBranchConditional %66 %68 %69
|
||||
%68 = OpLabel
|
||||
%70 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%71 = OpLoad %int %70
|
||||
%72 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%73 = OpLoad %int %72
|
||||
%74 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%75 = OpLoad %int %74
|
||||
%76 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%77 = OpLoad %int %76
|
||||
%78 = OpConvertSToF %float %71
|
||||
%79 = OpConvertSToF %float %73
|
||||
%80 = OpConvertSToF %float %75
|
||||
%81 = OpConvertSToF %float %77
|
||||
%82 = OpCompositeConstruct %v4float %78 %79 %80 %81
|
||||
OpStore %x_GLF_color %82
|
||||
OpBranch %67
|
||||
%69 = OpLabel
|
||||
%83 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%84 = OpLoad %int %83
|
||||
%85 = OpConvertSToF %float %84
|
||||
%86 = OpCompositeConstruct %v4float %85 %85 %85 %85
|
||||
OpStore %x_GLF_color %86
|
||||
OpBranch %67
|
||||
%67 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %87
|
||||
%90 = OpLabel
|
||||
%91 = OpFunctionCall %void %main_1
|
||||
%92 = OpLoad %v4float %x_GLF_color
|
||||
%93 = OpCompositeConstruct %main_out %92
|
||||
OpReturnValue %93
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %43
|
||||
%95 = OpLabel
|
||||
%96 = OpFunctionCall %main_out %main_inner
|
||||
%97 = OpCompositeExtract %v4float %96 0
|
||||
OpStore %x_GLF_color_1_1 %97
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,75 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
var<private> x_GLF_global_loop_count : i32;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_7 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn func_() -> i32 {
|
||||
loop {
|
||||
let x_72 : i32 = x_GLF_global_loop_count;
|
||||
if ((x_72 < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_75 : i32 = x_GLF_global_loop_count;
|
||||
x_GLF_global_loop_count = (x_75 + 1);
|
||||
let x_78 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
return x_78;
|
||||
}
|
||||
let x_80 : i32 = x_7.x_GLF_uniform_int_values[2];
|
||||
return x_80;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
var a : i32;
|
||||
x_GLF_global_loop_count = 0;
|
||||
loop {
|
||||
let x_35 : i32 = x_GLF_global_loop_count;
|
||||
x_GLF_global_loop_count = (x_35 + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
|
||||
continuing {
|
||||
let x_39 : i32 = x_GLF_global_loop_count;
|
||||
if ((true & (x_39 < 100))) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let x_42 : i32 = func_();
|
||||
a = x_42;
|
||||
let x_43 : i32 = a;
|
||||
let x_45 : i32 = x_7.x_GLF_uniform_int_values[2];
|
||||
if ((x_43 == x_45)) {
|
||||
let x_51 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
let x_54 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_57 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_60 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_51), f32(x_54), f32(x_57), f32(x_60));
|
||||
} else {
|
||||
let x_64 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_65 : f32 = f32(x_64);
|
||||
x_GLF_color = vec4<f32>(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[location(0)]]
|
||||
x_GLF_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main() -> main_out {
|
||||
main_1();
|
||||
return main_out(x_GLF_color);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
static int x_GLF_global_loop_count = 0;
|
||||
cbuffer cbuffer_x_7 : register(b0, space0) {
|
||||
uint4 x_7[3];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
int func_() {
|
||||
while (true) {
|
||||
if ((x_GLF_global_loop_count < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_78 = asint(x_7[scalar_offset / 4][scalar_offset % 4]);
|
||||
return x_78;
|
||||
}
|
||||
const int x_80 = asint(x_7[2].x);
|
||||
return x_80;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
int a = 0;
|
||||
x_GLF_global_loop_count = 0;
|
||||
while (true) {
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
bool tint_tmp = true;
|
||||
if (tint_tmp) {
|
||||
tint_tmp = (x_GLF_global_loop_count < 100);
|
||||
}
|
||||
if ((tint_tmp)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const int x_42 = func_();
|
||||
a = x_42;
|
||||
const int x_43 = a;
|
||||
const int x_45 = asint(x_7[2].x);
|
||||
if ((x_43 == x_45)) {
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_51 = asint(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
const int x_54 = asint(x_7[1].x);
|
||||
const int x_57 = asint(x_7[1].x);
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_60 = asint(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
x_GLF_color = float4(float(x_51), float(x_54), float(x_57), float(x_60));
|
||||
} else {
|
||||
const int x_64 = asint(x_7[1].x);
|
||||
const float x_65 = float(x_64);
|
||||
x_GLF_color = float4(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
main_out main_inner() {
|
||||
main_1();
|
||||
const main_out tint_symbol_2 = {x_GLF_color};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
tint_symbol main() {
|
||||
const main_out inner_result = main_inner();
|
||||
tint_symbol wrapper_result = (tint_symbol)0;
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
int func_(constant buf0& x_7, thread int* const tint_symbol_3) {
|
||||
while (true) {
|
||||
int const x_72 = *(tint_symbol_3);
|
||||
if ((x_72 < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_75 = *(tint_symbol_3);
|
||||
*(tint_symbol_3) = as_type<int>((as_type<uint>(x_75) + as_type<uint>(1)));
|
||||
int const x_78 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
return x_78;
|
||||
}
|
||||
int const x_80 = x_7.x_GLF_uniform_int_values.arr[2].el;
|
||||
return x_80;
|
||||
}
|
||||
|
||||
void main_1(constant buf0& x_7, thread int* const tint_symbol_4, thread float4* const tint_symbol_5) {
|
||||
int a = 0;
|
||||
*(tint_symbol_4) = 0;
|
||||
while (true) {
|
||||
int const x_35 = *(tint_symbol_4);
|
||||
*(tint_symbol_4) = as_type<int>((as_type<uint>(x_35) + as_type<uint>(1)));
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
int const x_39 = *(tint_symbol_4);
|
||||
if ((true && (x_39 < 100))) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int const x_42 = func_(x_7, tint_symbol_4);
|
||||
a = x_42;
|
||||
int const x_43 = a;
|
||||
int const x_45 = x_7.x_GLF_uniform_int_values.arr[2].el;
|
||||
if ((x_43 == x_45)) {
|
||||
int const x_51 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_54 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_57 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_60 = x_7.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_51), float(x_54), float(x_57), float(x_60));
|
||||
} else {
|
||||
int const x_64 = x_7.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_65 = float(x_64);
|
||||
*(tint_symbol_5) = float4(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf0& x_7, thread int* const tint_symbol_6, thread float4* const tint_symbol_7) {
|
||||
main_1(x_7, tint_symbol_6, tint_symbol_7);
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_7)};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_7 [[buffer(0)]]) {
|
||||
thread int tint_symbol_8 = 0;
|
||||
thread float4 tint_symbol_9 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_7, &(tint_symbol_8), &(tint_symbol_9));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 100
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %x_GLF_global_loop_count "x_GLF_global_loop_count"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %func_ "func_"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %a "a"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%9 = OpConstantNull %int
|
||||
%x_GLF_global_loop_count = OpVariable %_ptr_Private_int Private %9
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%18 = OpTypeFunction %int
|
||||
%int_100 = OpConstant %int 100
|
||||
%bool = OpTypeBool
|
||||
%int_1 = OpConstant %int 1
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_2 = OpConstant %int 2
|
||||
%void = OpTypeVoid
|
||||
%43 = OpTypeFunction %void
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%false = OpConstantFalse %bool
|
||||
%true = OpConstantTrue %bool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%89 = OpTypeFunction %main_out
|
||||
%func_ = OpFunction %int None %18
|
||||
%20 = OpLabel
|
||||
OpBranch %21
|
||||
%21 = OpLabel
|
||||
OpLoopMerge %22 %23 None
|
||||
OpBranch %24
|
||||
%24 = OpLabel
|
||||
%25 = OpLoad %int %x_GLF_global_loop_count
|
||||
%27 = OpSLessThan %bool %25 %int_100
|
||||
OpSelectionMerge %29 None
|
||||
OpBranchConditional %27 %30 %31
|
||||
%30 = OpLabel
|
||||
OpBranch %29
|
||||
%31 = OpLabel
|
||||
OpBranch %22
|
||||
%29 = OpLabel
|
||||
%32 = OpLoad %int %x_GLF_global_loop_count
|
||||
%34 = OpIAdd %int %32 %int_1
|
||||
OpStore %x_GLF_global_loop_count %34
|
||||
%38 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%39 = OpLoad %int %38
|
||||
OpReturnValue %39
|
||||
%23 = OpLabel
|
||||
OpBranch %21
|
||||
%22 = OpLabel
|
||||
%41 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_2
|
||||
%42 = OpLoad %int %41
|
||||
OpReturnValue %42
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %43
|
||||
%46 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_int Function %9
|
||||
OpStore %x_GLF_global_loop_count %int_0
|
||||
OpBranch %49
|
||||
%49 = OpLabel
|
||||
OpLoopMerge %50 %51 None
|
||||
OpBranch %52
|
||||
%52 = OpLabel
|
||||
%53 = OpLoad %int %x_GLF_global_loop_count
|
||||
%54 = OpIAdd %int %53 %int_1
|
||||
OpStore %x_GLF_global_loop_count %54
|
||||
OpSelectionMerge %56 None
|
||||
OpBranchConditional %false %57 %56
|
||||
%57 = OpLabel
|
||||
OpReturn
|
||||
%56 = OpLabel
|
||||
OpBranch %51
|
||||
%51 = OpLabel
|
||||
%58 = OpLoad %int %x_GLF_global_loop_count
|
||||
OpSelectionMerge %60 None
|
||||
OpBranchConditional %true %61 %60
|
||||
%61 = OpLabel
|
||||
%62 = OpSLessThan %bool %58 %int_100
|
||||
OpBranch %60
|
||||
%60 = OpLabel
|
||||
%63 = OpPhi %bool %true %51 %62 %61
|
||||
OpBranchConditional %63 %49 %50
|
||||
%50 = OpLabel
|
||||
%64 = OpFunctionCall %int %func_
|
||||
OpStore %a %64
|
||||
%65 = OpLoad %int %a
|
||||
%66 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_2
|
||||
%67 = OpLoad %int %66
|
||||
%68 = OpIEqual %bool %65 %67
|
||||
OpSelectionMerge %69 None
|
||||
OpBranchConditional %68 %70 %71
|
||||
%70 = OpLabel
|
||||
%72 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%73 = OpLoad %int %72
|
||||
%74 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%75 = OpLoad %int %74
|
||||
%76 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%77 = OpLoad %int %76
|
||||
%78 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
||||
%79 = OpLoad %int %78
|
||||
%80 = OpConvertSToF %float %73
|
||||
%81 = OpConvertSToF %float %75
|
||||
%82 = OpConvertSToF %float %77
|
||||
%83 = OpConvertSToF %float %79
|
||||
%84 = OpCompositeConstruct %v4float %80 %81 %82 %83
|
||||
OpStore %x_GLF_color %84
|
||||
OpBranch %69
|
||||
%71 = OpLabel
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpConvertSToF %float %86
|
||||
%88 = OpCompositeConstruct %v4float %87 %87 %87 %87
|
||||
OpStore %x_GLF_color %88
|
||||
OpBranch %69
|
||||
%69 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %89
|
||||
%92 = OpLabel
|
||||
%93 = OpFunctionCall %void %main_1
|
||||
%94 = OpLoad %v4float %x_GLF_color
|
||||
%95 = OpCompositeConstruct %main_out %94
|
||||
OpReturnValue %95
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %43
|
||||
%97 = OpLabel
|
||||
%98 = OpFunctionCall %main_out %main_inner
|
||||
%99 = OpCompositeExtract %v4float %98 0
|
||||
OpStore %x_GLF_color_1_1 %99
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,75 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
var<private> x_GLF_global_loop_count : i32;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_7 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn func_() -> i32 {
|
||||
loop {
|
||||
let x_72 : i32 = x_GLF_global_loop_count;
|
||||
if ((x_72 < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_75 : i32 = x_GLF_global_loop_count;
|
||||
x_GLF_global_loop_count = (x_75 + 1);
|
||||
let x_78 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
return x_78;
|
||||
}
|
||||
let x_80 : i32 = x_7.x_GLF_uniform_int_values[2];
|
||||
return x_80;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
var a : i32;
|
||||
x_GLF_global_loop_count = 0;
|
||||
loop {
|
||||
let x_35 : i32 = x_GLF_global_loop_count;
|
||||
x_GLF_global_loop_count = (x_35 + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
|
||||
continuing {
|
||||
let x_39 : i32 = x_GLF_global_loop_count;
|
||||
if ((true && (x_39 < 100))) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let x_42 : i32 = func_();
|
||||
a = x_42;
|
||||
let x_43 : i32 = a;
|
||||
let x_45 : i32 = x_7.x_GLF_uniform_int_values[2];
|
||||
if ((x_43 == x_45)) {
|
||||
let x_51 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
let x_54 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_57 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_60 : i32 = x_7.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_51), f32(x_54), f32(x_57), f32(x_60));
|
||||
} else {
|
||||
let x_64 : i32 = x_7.x_GLF_uniform_int_values[1];
|
||||
let x_65 : f32 = f32(x_64);
|
||||
x_GLF_color = vec4<f32>(x_65, x_65, x_65, x_65);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[location(0)]]
|
||||
x_GLF_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main() -> main_out {
|
||||
main_1();
|
||||
return main_out(x_GLF_color);
|
||||
}
|
||||
Reference in New Issue
Block a user