HLSL: Airplane work: break/continue/discard grammar, and decls for for/if/while.

This commit is contained in:
John Kessenich
2016-06-20 01:22:38 -06:00
parent a4a4d5e22c
commit 5bc4d9a26f
9 changed files with 522 additions and 39 deletions

View File

@@ -2,7 +2,7 @@ hlsl.if.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:29 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:34 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:2 Function Parameters:
0:2 'input' (in 4-component vector of float)
0:? Sequence
@@ -61,6 +61,19 @@ gl_FragCoord origin is upper left
0:26 Branch: Return with expression
0:26 Negate value (temp 4-component vector of float)
0:26 'input' (in 4-component vector of float)
0:30 Test condition and select (temp void)
0:30 Condition
0:30 move second child to first child (temp float)
0:30 'ii' (temp float)
0:30 direct index (temp float)
0:30 'input' (in 4-component vector of float)
0:30 Constant:
0:30 2 (const int)
0:30 true case
0:31 Pre-Increment (temp float)
0:31 'ii' (temp float)
0:32 Pre-Increment (temp int)
0:32 'ii' (temp int)
0:? Linker Objects
@@ -70,7 +83,7 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:29 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:34 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:2 Function Parameters:
0:2 'input' (in 4-component vector of float)
0:? Sequence
@@ -129,11 +142,24 @@ gl_FragCoord origin is upper left
0:26 Branch: Return with expression
0:26 Negate value (temp 4-component vector of float)
0:26 'input' (in 4-component vector of float)
0:30 Test condition and select (temp void)
0:30 Condition
0:30 move second child to first child (temp float)
0:30 'ii' (temp float)
0:30 direct index (temp float)
0:30 'input' (in 4-component vector of float)
0:30 Constant:
0:30 2 (const int)
0:30 true case
0:31 Pre-Increment (temp float)
0:31 'ii' (temp float)
0:32 Pre-Increment (temp int)
0:32 'ii' (temp int)
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 64
// Id's are bound by 82
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -143,6 +169,8 @@ gl_FragCoord origin is upper left
Source HLSL 450
Name 4 "PixelShaderFunction"
Name 9 "input"
Name 65 "ii"
Name 78 "ii"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -151,8 +179,18 @@ gl_FragCoord origin is upper left
9(input): 8(ptr) Variable Input
12: TypeBool
13: TypeVector 12(bool) 4
64: TypePointer Function 6(float)
66: TypeInt 32 0
67: 66(int) Constant 2
68: TypePointer Input 6(float)
74: 6(float) Constant 1065353216
76: TypeInt 32 1
77: TypePointer Function 76(int)
80: 76(int) Constant 1
4(PixelShaderFunction): 2 Function None 3
5: Label
65(ii): 64(ptr) Variable Function
78(ii): 77(ptr) Variable Function
10: 7(fvec4) Load 9(input)
11: 7(fvec4) Load 9(input)
14: 13(bvec4) FOrdEqual 10 11
@@ -219,5 +257,19 @@ gl_FragCoord origin is upper left
62: 7(fvec4) FNegate 61
ReturnValue 62
57: Label
69: 68(ptr) AccessChain 9(input) 67
70: 6(float) Load 69
Store 65(ii) 70
SelectionMerge 72 None
BranchConditional 70 71 72
71: Label
73: 6(float) Load 65(ii)
75: 6(float) FAdd 73 74
Store 65(ii) 75
Branch 72
72: Label
79: 76(int) Load 78(ii)
81: 76(int) IAdd 79 80
Store 78(ii) 81
Return
FunctionEnd