mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
Add tests derived from VK-GL-CTS
This adds SPIR-V assembly and WGSL tests derived from VK-GL-CTS commit 571256871c2e2f03995373e1e4a02958d8cd8cf5. The following procedure was followed: - Those .amber files in VK-GL-CTS wholly owned by Google were identified - All GLSL and SPIR-V shaders were extracted from the Amber files and converted into SPIR-V binaries - The compact-ids pass of spirv-opt was applied to each binary - Duplicate binaries were removed - spirv-opt -O was used to obtain an optimized version of each remaining binary, with duplicates discarded - Binaries that failed validation using spirv-val with target environment SPIR-V 1.3 were discarded - Those binaries that tint could not successfully convert into WGSL were put aside for further investigation - SPIR-V assembly versions of the remaining binaries are included in this CL - test-runner with -generate-expected and -generate-skip was used to generate expected .spvasm, .msl, .hlsl and .wgsl outputs for these SPIR-V assembly tests - Each successfully-generated .expected.wgsl is included in this CL again, as a WGLSL test - test-runner with -generate-expected and -generate-skip was used again, to generate expected outputs for these WGSL tests Change-Id: Ibe9baf2729cf97e0b633db9a426f53362a5de540 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58842 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
bd3edb564f
commit
f7e73d4ee3
@@ -0,0 +1,77 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %gl_FragCoord %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %f_ "f("
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "injectionSwitch"
|
||||
OpName %_ ""
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 0
|
||||
OpDecorate %gl_FragCoord BuiltIn FragCoord
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%float_1 = OpConstant %float 1
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%int_0 = OpConstant %int 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%bool = OpTypeBool
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Input_float = OpTypePointer Input %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%false = OpConstantFalse %bool
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%26 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
%28 = OpFunctionCall %void %f_
|
||||
OpStore %_GLF_color %26
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f_ = OpFunction %void None %9
|
||||
%29 = OpLabel
|
||||
OpBranch %30
|
||||
%30 = OpLabel
|
||||
OpLoopMerge %31 %32 None
|
||||
OpBranch %33
|
||||
%33 = OpLabel
|
||||
%34 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%35 = OpLoad %float %34
|
||||
%36 = OpFOrdGreaterThan %bool %float_1 %35
|
||||
OpSelectionMerge %37 None
|
||||
OpBranchConditional %36 %38 %37
|
||||
%38 = OpLabel
|
||||
%39 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
||||
%40 = OpLoad %float %39
|
||||
%41 = OpFOrdLessThan %bool %40 %float_0
|
||||
OpSelectionMerge %42 None
|
||||
OpBranchConditional %41 %43 %32
|
||||
%43 = OpLabel
|
||||
OpBranch %32
|
||||
%42 = OpLabel
|
||||
OpBranch %32
|
||||
%32 = OpLabel
|
||||
OpBranchConditional %false %30 %31
|
||||
%37 = OpLabel
|
||||
OpKill
|
||||
%31 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,71 @@
|
||||
cbuffer cbuffer_x_7 : register(b0, space0) {
|
||||
uint4 x_7[1];
|
||||
};
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void f_() {
|
||||
while (true) {
|
||||
const float x_35 = asfloat(x_7[0].y);
|
||||
if ((1.0f > x_35)) {
|
||||
const float x_40 = gl_FragCoord.y;
|
||||
if ((x_40 < 0.0f)) {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard;
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
f_();
|
||||
x_GLF_color = float4(1.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;
|
||||
};
|
||||
|
||||
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
||||
const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param;
|
||||
gl_FragCoord = gl_FragCoord_param;
|
||||
main_1();
|
||||
const main_out tint_symbol_3 = {x_GLF_color};
|
||||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct buf0 {
|
||||
/* 0x0000 */ packed_float2 injectionSwitch;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_2 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void f_(constant buf0& x_7, thread float4* const tint_symbol_5) {
|
||||
while (true) {
|
||||
float const x_35 = x_7.injectionSwitch.y;
|
||||
if ((1.0f > x_35)) {
|
||||
float const x_40 = (*(tint_symbol_5)).y;
|
||||
if ((x_40 < 0.0f)) {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard_fragment();
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void main_1(constant buf0& x_7, thread float4* const tint_symbol_6, thread float4* const tint_symbol_7) {
|
||||
f_(x_7, tint_symbol_6);
|
||||
*(tint_symbol_7) = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_7 [[buffer(0)]]) {
|
||||
thread float4 tint_symbol_8 = 0.0f;
|
||||
thread float4 tint_symbol_9 = 0.0f;
|
||||
tint_symbol_8 = gl_FragCoord_param;
|
||||
main_1(x_7, &(tint_symbol_8), &(tint_symbol_9));
|
||||
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_9};
|
||||
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
SKIP: FAILED
|
||||
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 63
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "injectionSwitch"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %f_ "f_"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %tint_symbol_3 "tint_symbol_3"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %main "main"
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 0
|
||||
OpDecorate %tint_symbol BuiltIn FragCoord
|
||||
OpDecorate %tint_symbol_2 Location 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%9 = OpConstantNull %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %9
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %9
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%tint_symbol = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %9
|
||||
%void = OpTypeVoid
|
||||
%15 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%float_1 = OpConstant %float 1
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Private_float = OpTypePointer Private %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%false = OpConstantFalse %bool
|
||||
%49 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%50 = OpTypeFunction %void %main_out
|
||||
%f_ = OpFunction %void None %15
|
||||
%18 = OpLabel
|
||||
OpBranch %19
|
||||
%19 = OpLabel
|
||||
OpLoopMerge %20 %21 None
|
||||
OpBranch %22
|
||||
%22 = OpLabel
|
||||
%27 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %uint_1
|
||||
%28 = OpLoad %float %27
|
||||
%30 = OpFOrdGreaterThan %bool %float_1 %28
|
||||
OpSelectionMerge %32 None
|
||||
OpBranchConditional %30 %33 %32
|
||||
%33 = OpLabel
|
||||
%35 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
|
||||
%36 = OpLoad %float %35
|
||||
%38 = OpFOrdLessThan %bool %36 %float_0
|
||||
OpSelectionMerge %39 None
|
||||
OpBranchConditional %38 %40 %41
|
||||
%40 = OpLabel
|
||||
OpBranch %21
|
||||
%41 = OpLabel
|
||||
OpBranch %21
|
||||
%39 = OpLabel
|
||||
OpBranch %21
|
||||
%32 = OpLabel
|
||||
OpKill
|
||||
%21 = OpLabel
|
||||
OpSelectionMerge %43 None
|
||||
OpBranchConditional %false %44 %45
|
||||
%44 = OpLabel
|
||||
OpBranch %43
|
||||
%45 = OpLabel
|
||||
OpBranch %20
|
||||
%43 = OpLabel
|
||||
OpBranch %19
|
||||
%20 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %15
|
||||
%47 = OpLabel
|
||||
%48 = OpFunctionCall %void %f_
|
||||
OpStore %x_GLF_color %49
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_3 = OpFunction %void None %50
|
||||
%tint_symbol_1 = OpFunctionParameter %main_out
|
||||
%54 = OpLabel
|
||||
%55 = OpCompositeExtract %v4float %tint_symbol_1 0
|
||||
OpStore %tint_symbol_2 %55
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %15
|
||||
%57 = OpLabel
|
||||
%58 = OpLoad %v4float %tint_symbol
|
||||
OpStore %gl_FragCoord %58
|
||||
%59 = OpFunctionCall %void %main_1
|
||||
%61 = OpLoad %v4float %x_GLF_color
|
||||
%62 = OpCompositeConstruct %main_out %61
|
||||
%60 = OpFunctionCall %void %tint_symbol_3 %62
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
1:1: The continue construct with the continue target 21[%21] is not post dominated by the back-edge block 43[%43]
|
||||
%43 = OpLabel
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
injectionSwitch : vec2<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_7 : buf0;
|
||||
|
||||
var<private> gl_FragCoord : vec4<f32>;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn f_() {
|
||||
loop {
|
||||
let x_35 : f32 = x_7.injectionSwitch.y;
|
||||
if ((1.0 > x_35)) {
|
||||
let x_40 : f32 = gl_FragCoord.y;
|
||||
if ((x_40 < 0.0)) {
|
||||
continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard;
|
||||
|
||||
continuing {
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
f_();
|
||||
x_GLF_color = vec4<f32>(1.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);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
injectionSwitch : vec2<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_7 : buf0;
|
||||
|
||||
var<private> gl_FragCoord : vec4<f32>;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn f_() {
|
||||
loop {
|
||||
let x_35 : f32 = x_7.injectionSwitch.y;
|
||||
if ((1.0 > x_35)) {
|
||||
let x_40 : f32 = gl_FragCoord.y;
|
||||
if ((x_40 < 0.0)) {
|
||||
continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard;
|
||||
|
||||
continuing {
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
f_();
|
||||
x_GLF_color = vec4<f32>(1.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);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
cbuffer cbuffer_x_7 : register(b0, space0) {
|
||||
uint4 x_7[1];
|
||||
};
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void f_() {
|
||||
while (true) {
|
||||
const float x_35 = asfloat(x_7[0].y);
|
||||
if ((1.0f > x_35)) {
|
||||
const float x_40 = gl_FragCoord.y;
|
||||
if ((x_40 < 0.0f)) {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard;
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
f_();
|
||||
x_GLF_color = float4(1.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;
|
||||
};
|
||||
|
||||
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
||||
const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param;
|
||||
gl_FragCoord = gl_FragCoord_param;
|
||||
main_1();
|
||||
const main_out tint_symbol_3 = {x_GLF_color};
|
||||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct buf0 {
|
||||
/* 0x0000 */ packed_float2 injectionSwitch;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_2 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void f_(constant buf0& x_7, thread float4* const tint_symbol_5) {
|
||||
while (true) {
|
||||
float const x_35 = x_7.injectionSwitch.y;
|
||||
if ((1.0f > x_35)) {
|
||||
float const x_40 = (*(tint_symbol_5)).y;
|
||||
if ((x_40 < 0.0f)) {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard_fragment();
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void main_1(constant buf0& x_7, thread float4* const tint_symbol_6, thread float4* const tint_symbol_7) {
|
||||
f_(x_7, tint_symbol_6);
|
||||
*(tint_symbol_7) = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_7 [[buffer(0)]]) {
|
||||
thread float4 tint_symbol_8 = 0.0f;
|
||||
thread float4 tint_symbol_9 = 0.0f;
|
||||
tint_symbol_8 = gl_FragCoord_param;
|
||||
main_1(x_7, &(tint_symbol_8), &(tint_symbol_9));
|
||||
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_9};
|
||||
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
SKIP: FAILED
|
||||
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 63
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "injectionSwitch"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %f_ "f_"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %tint_symbol_3 "tint_symbol_3"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %main "main"
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 0
|
||||
OpDecorate %tint_symbol BuiltIn FragCoord
|
||||
OpDecorate %tint_symbol_2 Location 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%9 = OpConstantNull %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %9
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %9
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%tint_symbol = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %9
|
||||
%void = OpTypeVoid
|
||||
%15 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%float_1 = OpConstant %float 1
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Private_float = OpTypePointer Private %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%false = OpConstantFalse %bool
|
||||
%49 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%50 = OpTypeFunction %void %main_out
|
||||
%f_ = OpFunction %void None %15
|
||||
%18 = OpLabel
|
||||
OpBranch %19
|
||||
%19 = OpLabel
|
||||
OpLoopMerge %20 %21 None
|
||||
OpBranch %22
|
||||
%22 = OpLabel
|
||||
%27 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %uint_1
|
||||
%28 = OpLoad %float %27
|
||||
%30 = OpFOrdGreaterThan %bool %float_1 %28
|
||||
OpSelectionMerge %32 None
|
||||
OpBranchConditional %30 %33 %32
|
||||
%33 = OpLabel
|
||||
%35 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
|
||||
%36 = OpLoad %float %35
|
||||
%38 = OpFOrdLessThan %bool %36 %float_0
|
||||
OpSelectionMerge %39 None
|
||||
OpBranchConditional %38 %40 %41
|
||||
%40 = OpLabel
|
||||
OpBranch %21
|
||||
%41 = OpLabel
|
||||
OpBranch %21
|
||||
%39 = OpLabel
|
||||
OpBranch %21
|
||||
%32 = OpLabel
|
||||
OpKill
|
||||
%21 = OpLabel
|
||||
OpSelectionMerge %43 None
|
||||
OpBranchConditional %false %44 %45
|
||||
%44 = OpLabel
|
||||
OpBranch %43
|
||||
%45 = OpLabel
|
||||
OpBranch %20
|
||||
%43 = OpLabel
|
||||
OpBranch %19
|
||||
%20 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %15
|
||||
%47 = OpLabel
|
||||
%48 = OpFunctionCall %void %f_
|
||||
OpStore %x_GLF_color %49
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_3 = OpFunction %void None %50
|
||||
%tint_symbol_1 = OpFunctionParameter %main_out
|
||||
%54 = OpLabel
|
||||
%55 = OpCompositeExtract %v4float %tint_symbol_1 0
|
||||
OpStore %tint_symbol_2 %55
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %15
|
||||
%57 = OpLabel
|
||||
%58 = OpLoad %v4float %tint_symbol
|
||||
OpStore %gl_FragCoord %58
|
||||
%59 = OpFunctionCall %void %main_1
|
||||
%61 = OpLoad %v4float %x_GLF_color
|
||||
%62 = OpCompositeConstruct %main_out %61
|
||||
%60 = OpFunctionCall %void %tint_symbol_3 %62
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
1:1: The continue construct with the continue target 21[%21] is not post dominated by the back-edge block 43[%43]
|
||||
%43 = OpLabel
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
injectionSwitch : vec2<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_7 : buf0;
|
||||
|
||||
var<private> gl_FragCoord : vec4<f32>;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn f_() {
|
||||
loop {
|
||||
let x_35 : f32 = x_7.injectionSwitch.y;
|
||||
if ((1.0 > x_35)) {
|
||||
let x_40 : f32 = gl_FragCoord.y;
|
||||
if ((x_40 < 0.0)) {
|
||||
continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
discard;
|
||||
|
||||
continuing {
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
f_();
|
||||
x_GLF_color = vec4<f32>(1.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