Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-08-06 15:06:40 +0300
committerHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-08-06 15:06:40 +0300
commit34a21b96cfdb22a55e486365b2098850d59b5d5c (patch)
tree8ce7a9f8403ec9c02aa5fdef139466df96e88410
parent40bb42f9ab4858bebe2ca3283ef0efe70f268c26 (diff)
Add test case for phi-only continue block.
-rw-r--r--reference/opt/shaders/asm/frag/for-loop-phi-only-continue.asm.frag17
-rw-r--r--reference/shaders/asm/frag/for-loop-phi-only-continue.asm.frag19
-rw-r--r--shaders/asm/frag/for-loop-phi-only-continue.asm.frag48
3 files changed, 84 insertions, 0 deletions
diff --git a/reference/opt/shaders/asm/frag/for-loop-phi-only-continue.asm.frag b/reference/opt/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
new file mode 100644
index 00000000..7a78d00b
--- /dev/null
+++ b/reference/opt/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
@@ -0,0 +1,17 @@
+#version 450
+
+layout(location = 0) out vec4 FragColor;
+
+void main()
+{
+ float _19;
+ _19 = 0.0;
+ for (int _22 = 0; _22 < 16; )
+ {
+ _19 += 1.0;
+ _22++;
+ continue;
+ }
+ FragColor = vec4(_19);
+}
+
diff --git a/reference/shaders/asm/frag/for-loop-phi-only-continue.asm.frag b/reference/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
new file mode 100644
index 00000000..feb45db4
--- /dev/null
+++ b/reference/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
@@ -0,0 +1,19 @@
+#version 450
+
+layout(location = 0) out vec4 FragColor;
+
+void main()
+{
+ float _19;
+ _19 = 0.0;
+ float _20;
+ int _23;
+ for (int _22 = 0; _22 < 16; _19 = _20, _22 = _23)
+ {
+ _20 = _19 + 1.0;
+ _23 = _22 + 1;
+ continue;
+ }
+ FragColor = vec4(_19);
+}
+
diff --git a/shaders/asm/frag/for-loop-phi-only-continue.asm.frag b/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
new file mode 100644
index 00000000..ae84b30b
--- /dev/null
+++ b/shaders/asm/frag/for-loop-phi-only-continue.asm.frag
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 6
+; Bound: 51
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %FragColor
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %FragColor "FragColor"
+ OpDecorate %FragColor Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_16 = OpConstant %int 16
+ %bool = OpTypeBool
+ %float_1 = OpConstant %float 1
+ %int_1 = OpConstant %int 1
+ %float_2 = OpConstant %float 2
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %FragColor = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpBranch %14
+ %14 = OpLabel
+ %50 = OpPhi %float %float_0 %5 %25 %15
+ %47 = OpPhi %int %int_0 %5 %28 %15
+ %22 = OpSLessThan %bool %47 %int_16
+ OpLoopMerge %16 %15 None
+ OpBranchConditional %22 %body1 %16
+ %body1 = OpLabel
+ %25 = OpFAdd %float %50 %float_1
+ %28 = OpIAdd %int %47 %int_1
+ OpBranch %15
+ %15 = OpLabel
+ OpBranch %14
+ %16 = OpLabel
+ %46 = OpCompositeConstruct %v4float %50 %50 %50 %50
+ OpStore %FragColor %46
+ OpReturn
+ OpFunctionEnd