HLSL: Grammar: Make comma-separated declaration lists work.

This commit is contained in:
John Kessenich 2016-07-01 19:06:44 -06:00
parent 92d44b1bb2
commit 532543c1c4
14 changed files with 6383 additions and 5047 deletions

View File

@ -31,12 +31,13 @@ gl_FragCoord origin is upper left
0:10 0 (const int)
0:10 true case
0:11 Branch: Kill
0:12 move second child to first child (temp float)
0:12 'f' (temp float)
0:12 direct index (temp float)
0:12 'input' (in 4-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 Sequence
0:12 move second child to first child (temp float)
0:12 'f' (temp float)
0:12 direct index (temp float)
0:12 'input' (in 4-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:13 Branch: Kill
0:? Linker Objects
@ -76,12 +77,13 @@ gl_FragCoord origin is upper left
0:10 0 (const int)
0:10 true case
0:11 Branch: Kill
0:12 move second child to first child (temp float)
0:12 'f' (temp float)
0:12 direct index (temp float)
0:12 'input' (in 4-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 Sequence
0:12 move second child to first child (temp float)
0:12 'f' (temp float)
0:12 direct index (temp float)
0:12 'input' (in 4-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:13 Branch: Kill
0:? Linker Objects

View File

@ -2,14 +2,16 @@ hlsl.float1.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:2 move second child to first child (temp float)
0:2 'scalar' (temp float)
0:2 Constant:
0:2 2.000000
0:1 Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:2 Sequence
0:2 move second child to first child (temp float)
0:2 'scalar' (temp float)
0:2 Constant:
0:2 2.000000
0:8 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:5 Function Parameters:
0:5 'inFloat1' (in 1-component vector of float)
@ -34,14 +36,16 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:2 move second child to first child (temp float)
0:2 'scalar' (temp float)
0:2 Constant:
0:2 2.000000
0:1 Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:2 Sequence
0:2 move second child to first child (temp float)
0:2 'scalar' (temp float)
0:2 Constant:
0:2 2.000000
0:8 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:5 Function Parameters:
0:5 'inFloat1' (in 1-component vector of float)
@ -61,7 +65,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 24
// Id's are bound by 26
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -80,21 +84,25 @@ gl_FragCoord origin is upper left
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr) 7(ptr)
14: 6(float) Constant 1065353216
16: 6(float) Constant 1073741824
4(PixelShaderFunction): 2 Function None 3
5: Label
13(f1): 7(ptr) Variable Function
15(scalar): 7(ptr) Variable Function
Store 13(f1) 14
Store 15(scalar) 16
FunctionEnd
11(ShaderFunction(vf1;f1;): 6(float) Function None 8
9(inFloat1): 7(ptr) FunctionParameter
10(inScalar): 7(ptr) FunctionParameter
12: Label
13(f1): 7(ptr) Variable Function
15(scalar): 7(ptr) Variable Function
14: 6(float) Load 13(f1)
16: 6(float) Load 15(scalar)
17: 6(float) IMul 14 16
18: 6(float) Load 9(inFloat1)
19: 6(float) Load 10(inScalar)
20: 6(float) IMul 18 19
21: 6(float) FAdd 17 20
ReturnValue 21
17: 6(float) Load 13(f1)
18: 6(float) Load 15(scalar)
19: 6(float) IMul 17 18
20: 6(float) Load 9(inFloat1)
21: 6(float) Load 10(inScalar)
22: 6(float) IMul 20 21
23: 6(float) FAdd 19 22
ReturnValue 23
FunctionEnd

View File

@ -2,13 +2,14 @@ hlsl.float4.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:12 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:9 Function Parameters:
0:9 'input' (in 4-component vector of float)
@ -31,13 +32,14 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:12 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:9 Function Parameters:
0:9 'input' (in 4-component vector of float)
@ -55,7 +57,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 25
// Id's are bound by 29
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -66,34 +68,39 @@ gl_FragCoord origin is upper left
Name 4 "PixelShaderFunction"
Name 11 "ShaderFunction(vf4;"
Name 10 "input"
Name 14 "AmbientColor"
Name 21 "ff1"
Name 22 "ff2"
Name 23 "ff3"
Name 24 "ff4"
Decorate 21(ff1) BuiltIn FrontFacing
Decorate 24(ff4) BuiltIn FragCoord
Name 13 "AmbientColor"
Name 25 "ff1"
Name 26 "ff2"
Name 27 "ff3"
Name 28 "ff4"
Decorate 25(ff1) BuiltIn FrontFacing
Decorate 28(ff4) BuiltIn FragCoord
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 7(fvec4) 8(ptr)
19: TypeBool
20: TypePointer Function 19(bool)
14: 6(float) Constant 1065353216
15: 6(float) Constant 1056964608
16: 6(float) Constant 0
17: 7(fvec4) ConstantComposite 14 15 16 14
23: TypeBool
24: TypePointer Function 23(bool)
4(PixelShaderFunction): 2 Function None 3
5: Label
13(AmbientColor): 8(ptr) Variable Function
Store 13(AmbientColor) 17
FunctionEnd
11(ShaderFunction(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
12: Label
14(AmbientColor): 8(ptr) Variable Function
21(ff1): 20(ptr) Variable Function
22(ff2): 8(ptr) Variable Function
23(ff3): 8(ptr) Variable Function
24(ff4): 8(ptr) Variable Function
13: 7(fvec4) Load 10(input)
15: 7(fvec4) Load 14(AmbientColor)
16: 7(fvec4) FMul 13 15
ReturnValue 16
25(ff1): 24(ptr) Variable Function
26(ff2): 8(ptr) Variable Function
27(ff3): 8(ptr) Variable Function
28(ff4): 8(ptr) Variable Function
18: 7(fvec4) Load 10(input)
19: 7(fvec4) Load 13(AmbientColor)
20: 7(fvec4) FMul 18 19
ReturnValue 20
FunctionEnd

View File

@ -0,0 +1,224 @@
hlsl.init.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'a1' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 move second child to first child (temp 4-component vector of float)
0:1 'b1' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 2.500000
0:? 2.100000
0:? 2.200000
0:2 Sequence
0:2 move second child to first child (temp float)
0:2 'a2' (temp float)
0:2 Constant:
0:2 0.200000
0:? Sequence
0:3 move second child to first child (temp float)
0:3 'b3' (temp float)
0:3 Constant:
0:3 0.300000
0:? Sequence
0:4 move second child to first child (temp float)
0:4 'b4' (temp float)
0:4 Constant:
0:4 0.400000
0:5 Sequence
0:5 move second child to first child (temp float)
0:5 'a5' (temp float)
0:5 Constant:
0:5 0.500000
0:5 move second child to first child (temp float)
0:5 'c5' (temp float)
0:5 Constant:
0:5 1.500000
0:13 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:8 Function Parameters:
0:8 'input' (in 4-component vector of float)
0:? Sequence
0:9 Sequence
0:9 move second child to first child (temp 4-component vector of float)
0:9 'a2' (temp 4-component vector of float)
0:? Constant:
0:? 0.200000
0:? 0.300000
0:? 0.400000
0:? 0.500000
0:11 Branch: Return with expression
0:11 component-wise multiply (temp 4-component vector of float)
0:11 'input' (in 4-component vector of float)
0:11 'a1' (temp 4-component vector of float)
0:? Linker Objects
0:? 'a1' (temp 4-component vector of float)
0:? 'b1' (temp 4-component vector of float)
0:? 'a2' (temp float)
0:? 'b2' (temp float)
0:? 'a3' (temp float)
0:? 'b3' (temp float)
0:? 'a4' (temp float)
0:? 'b4' (temp float)
0:? 'c4' (temp float)
0:? 'a5' (temp float)
0:? 'b5' (temp float)
0:? 'c5' (temp float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'a1' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 move second child to first child (temp 4-component vector of float)
0:1 'b1' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 2.500000
0:? 2.100000
0:? 2.200000
0:2 Sequence
0:2 move second child to first child (temp float)
0:2 'a2' (temp float)
0:2 Constant:
0:2 0.200000
0:? Sequence
0:3 move second child to first child (temp float)
0:3 'b3' (temp float)
0:3 Constant:
0:3 0.300000
0:? Sequence
0:4 move second child to first child (temp float)
0:4 'b4' (temp float)
0:4 Constant:
0:4 0.400000
0:5 Sequence
0:5 move second child to first child (temp float)
0:5 'a5' (temp float)
0:5 Constant:
0:5 0.500000
0:5 move second child to first child (temp float)
0:5 'c5' (temp float)
0:5 Constant:
0:5 1.500000
0:13 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:8 Function Parameters:
0:8 'input' (in 4-component vector of float)
0:? Sequence
0:9 Sequence
0:9 move second child to first child (temp 4-component vector of float)
0:9 'a2' (temp 4-component vector of float)
0:? Constant:
0:? 0.200000
0:? 0.300000
0:? 0.400000
0:? 0.500000
0:11 Branch: Return with expression
0:11 component-wise multiply (temp 4-component vector of float)
0:11 'input' (in 4-component vector of float)
0:11 'a1' (temp 4-component vector of float)
0:? Linker Objects
0:? 'a1' (temp 4-component vector of float)
0:? 'b1' (temp 4-component vector of float)
0:? 'a2' (temp float)
0:? 'b2' (temp float)
0:? 'a3' (temp float)
0:? 'b3' (temp float)
0:? 'a4' (temp float)
0:? 'b4' (temp float)
0:? 'c4' (temp float)
0:? 'a5' (temp float)
0:? 'b5' (temp float)
0:? 'c5' (temp float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 43
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "ShaderFunction" 33
ExecutionMode 4 OriginUpperLeft
Source HLSL 450
Name 4 "ShaderFunction"
Name 9 "a1"
Name 14 "b1"
Name 21 "a2"
Name 23 "b3"
Name 25 "b4"
Name 27 "a5"
Name 28 "c5"
Name 30 "a2"
Name 33 "input"
Name 38 "b2"
Name 39 "a3"
Name 40 "a4"
Name 41 "c4"
Name 42 "b5"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: 6(float) Constant 1065353216
11: 6(float) Constant 1056964608
12: 6(float) Constant 0
13: 7(fvec4) ConstantComposite 10 11 12 10
15: 6(float) Constant 1073741824
16: 6(float) Constant 1075838976
17: 6(float) Constant 1074161254
18: 6(float) Constant 1074580685
19: 7(fvec4) ConstantComposite 15 16 17 18
20: TypePointer Function 6(float)
22: 6(float) Constant 1045220557
24: 6(float) Constant 1050253722
26: 6(float) Constant 1053609165
29: 6(float) Constant 1069547520
31: 7(fvec4) ConstantComposite 22 24 26 11
32: TypePointer Input 7(fvec4)
33(input): 32(ptr) Variable Input
4(ShaderFunction): 2 Function None 3
5: Label
9(a1): 8(ptr) Variable Function
14(b1): 8(ptr) Variable Function
21(a2): 20(ptr) Variable Function
23(b3): 20(ptr) Variable Function
25(b4): 20(ptr) Variable Function
27(a5): 20(ptr) Variable Function
28(c5): 20(ptr) Variable Function
30(a2): 8(ptr) Variable Function
38(b2): 20(ptr) Variable Function
39(a3): 20(ptr) Variable Function
40(a4): 20(ptr) Variable Function
41(c4): 20(ptr) Variable Function
42(b5): 20(ptr) Variable Function
Store 9(a1) 13
Store 14(b1) 19
Store 21(a2) 22
Store 23(b3) 24
Store 25(b4) 26
Store 27(a5) 11
Store 28(c5) 29
Store 30(a2) 31
34: 7(fvec4) Load 33(input)
35: 7(fvec4) Load 9(a1)
36: 7(fvec4) FMul 34 35
ReturnValue 36
FunctionEnd

View File

@ -13,18 +13,20 @@ gl_FragCoord origin is upper left
0:5 'inU1a' (in uint)
0:5 'inU1b' (in uint)
0:? Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:6 Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 Sequence
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:9 Branch: Return with expression
0:9 Constant:
0:9 0.000000
@ -48,18 +50,20 @@ gl_FragCoord origin is upper left
0:5 'inU1a' (in uint)
0:5 'inU1b' (in uint)
0:? Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:6 Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 Sequence
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:9 Branch: Return with expression
0:9 Constant:
0:9 0.000000

File diff suppressed because it is too large Load Diff

View File

@ -8,32 +8,33 @@ gl_FragCoord origin is upper left
0:2 'n_dot_h' (in float)
0:2 'm' (in float)
0:? Sequence
0:3 move second child to first child (temp 4-component vector of float)
0:3 'r0' (temp 4-component vector of float)
0:3 Construct vec4 (temp 4-component vector of float)
0:3 Constant:
0:3 1.000000
0:3 max (temp float)
0:3 'n_dot_l' (in float)
0:3 Sequence
0:3 move second child to first child (temp 4-component vector of float)
0:3 'r0' (temp 4-component vector of float)
0:3 Construct vec4 (temp 4-component vector of float)
0:3 Constant:
0:3 0.000000
0:3 Test condition and select (temp float)
0:3 Condition
0:3 Compare Less Than (temp bool)
0:3 min (temp float)
0:3 'n_dot_l' (in float)
0:3 'n_dot_h' (in float)
0:3 1.000000
0:3 max (temp float)
0:3 'n_dot_l' (in float)
0:3 Constant:
0:3 0.000000
0:3 true case
0:3 Test condition and select (temp float)
0:3 Condition
0:3 Compare Less Than (temp bool)
0:3 min (temp float)
0:3 'n_dot_l' (in float)
0:3 'n_dot_h' (in float)
0:3 Constant:
0:3 0.000000
0:3 true case
0:3 Constant:
0:3 0.000000
0:3 false case
0:3 component-wise multiply (temp float)
0:3 'n_dot_h' (in float)
0:3 'm' (in float)
0:3 Constant:
0:3 0.000000
0:3 false case
0:3 component-wise multiply (temp float)
0:3 'n_dot_h' (in float)
0:3 'm' (in float)
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:? Linker Objects
@ -49,32 +50,33 @@ gl_FragCoord origin is upper left
0:2 'n_dot_h' (in float)
0:2 'm' (in float)
0:? Sequence
0:3 move second child to first child (temp 4-component vector of float)
0:3 'r0' (temp 4-component vector of float)
0:3 Construct vec4 (temp 4-component vector of float)
0:3 Constant:
0:3 1.000000
0:3 max (temp float)
0:3 'n_dot_l' (in float)
0:3 Sequence
0:3 move second child to first child (temp 4-component vector of float)
0:3 'r0' (temp 4-component vector of float)
0:3 Construct vec4 (temp 4-component vector of float)
0:3 Constant:
0:3 0.000000
0:3 Test condition and select (temp float)
0:3 Condition
0:3 Compare Less Than (temp bool)
0:3 min (temp float)
0:3 'n_dot_l' (in float)
0:3 'n_dot_h' (in float)
0:3 1.000000
0:3 max (temp float)
0:3 'n_dot_l' (in float)
0:3 Constant:
0:3 0.000000
0:3 true case
0:3 Test condition and select (temp float)
0:3 Condition
0:3 Compare Less Than (temp bool)
0:3 min (temp float)
0:3 'n_dot_l' (in float)
0:3 'n_dot_h' (in float)
0:3 Constant:
0:3 0.000000
0:3 true case
0:3 Constant:
0:3 0.000000
0:3 false case
0:3 component-wise multiply (temp float)
0:3 'n_dot_h' (in float)
0:3 'm' (in float)
0:3 Constant:
0:3 0.000000
0:3 false case
0:3 component-wise multiply (temp float)
0:3 'n_dot_h' (in float)
0:3 'm' (in float)
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:? Linker Objects
// Module Version 10000

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,11 @@ hlsl.matType.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:1 Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:9 Function Parameters:
0:9 'inFloat1' (in 1-component vector of float)
@ -25,10 +26,11 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:1 Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:9 Function Parameters:
0:9 'inFloat1' (in 1-component vector of float)
@ -43,7 +45,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 36
// Id's are bound by 37
Capability Shader
Capability Float64
@ -56,46 +58,48 @@ gl_FragCoord origin is upper left
Name 11 "ShaderFunction(vf1;f1;"
Name 9 "inFloat1"
Name 10 "inScalar"
Name 14 "f1"
Name 18 "fmat11"
Name 22 "fmat41"
Name 25 "fmat12"
Name 30 "dmat23"
Name 35 "int44"
Name 13 "f1"
Name 19 "fmat11"
Name 23 "fmat41"
Name 26 "fmat12"
Name 31 "dmat23"
Name 36 "int44"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr) 7(ptr)
15: TypeVector 6(float) 1
16: TypeMatrix 15(fvec) 1
17: TypePointer Function 16
19: TypeVector 6(float) 4
20: TypeMatrix 19(fvec4) 1
21: TypePointer Function 20
23: TypeMatrix 15(fvec) 2
24: TypePointer Function 23
26: TypeFloat 64
27: TypeVector 26(float) 2
28: TypeMatrix 27(fvec2) 3
29: TypePointer Function 28
31: TypeInt 32 1
32: TypeVector 31(int) 4
33: TypeMatrix 32(ivec4) 4
34: TypePointer Function 33
14: 6(float) Constant 1065353216
16: TypeVector 6(float) 1
17: TypeMatrix 16(fvec) 1
18: TypePointer Function 17
20: TypeVector 6(float) 4
21: TypeMatrix 20(fvec4) 1
22: TypePointer Function 21
24: TypeMatrix 16(fvec) 2
25: TypePointer Function 24
27: TypeFloat 64
28: TypeVector 27(float) 2
29: TypeMatrix 28(fvec2) 3
30: TypePointer Function 29
32: TypeInt 32 1
33: TypeVector 32(int) 4
34: TypeMatrix 33(ivec4) 4
35: TypePointer Function 34
4(PixelShaderFunction): 2 Function None 3
5: Label
13(f1): 7(ptr) Variable Function
Store 13(f1) 14
FunctionEnd
11(ShaderFunction(vf1;f1;): 6(float) Function None 8
9(inFloat1): 7(ptr) FunctionParameter
10(inScalar): 7(ptr) FunctionParameter
12: Label
14(f1): 7(ptr) Variable Function
18(fmat11): 17(ptr) Variable Function
22(fmat41): 21(ptr) Variable Function
25(fmat12): 24(ptr) Variable Function
30(dmat23): 29(ptr) Variable Function
35(int44): 34(ptr) Variable Function
13: 6(float) Undef
ReturnValue 13
19(fmat11): 18(ptr) Variable Function
23(fmat41): 22(ptr) Variable Function
26(fmat12): 25(ptr) Variable Function
31(dmat23): 30(ptr) Variable Function
36(int44): 35(ptr) Variable Function
15: 6(float) Undef
ReturnValue 15
FunctionEnd

View File

@ -2,13 +2,14 @@ hlsl.swizzle.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:7 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:4 Function Parameters:
0:4 'input' (in 4-component vector of float)
@ -41,13 +42,14 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:1 Sequence
0:1 move second child to first child (temp 4-component vector of float)
0:1 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:7 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float)
0:4 Function Parameters:
0:4 'input' (in 4-component vector of float)
@ -75,7 +77,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 25
// Id's are bound by 29
Capability Shader
1: ExtInstImport "GLSL.std.450"
@ -86,28 +88,33 @@ gl_FragCoord origin is upper left
Name 4 "PixelShaderFunction"
Name 11 "ShaderFunction(vf4;"
Name 10 "input"
Name 15 "AmbientColor"
Name 13 "AmbientColor"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 7(fvec4) 8(ptr)
16: TypeInt 32 0
17: 16(int) Constant 2
18: TypePointer Function 6(float)
14: 6(float) Constant 1065353216
15: 6(float) Constant 1056964608
16: 6(float) Constant 0
17: 7(fvec4) ConstantComposite 14 15 16 14
20: TypeInt 32 0
21: 20(int) Constant 2
22: TypePointer Function 6(float)
4(PixelShaderFunction): 2 Function None 3
5: Label
13(AmbientColor): 8(ptr) Variable Function
Store 13(AmbientColor) 17
FunctionEnd
11(ShaderFunction(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
12: Label
15(AmbientColor): 8(ptr) Variable Function
13: 7(fvec4) Load 10(input)
14: 7(fvec4) VectorShuffle 13 13 3 3 1 0
19: 18(ptr) AccessChain 15(AmbientColor) 17
20: 6(float) Load 19
21: 7(fvec4) CompositeConstruct 20 20 20 20
22: 7(fvec4) FMul 14 21
ReturnValue 22
18: 7(fvec4) Load 10(input)
19: 7(fvec4) VectorShuffle 18 18 3 3 1 0
23: 22(ptr) AccessChain 13(AmbientColor) 21
24: 6(float) Load 23
25: 7(fvec4) CompositeConstruct 24 24 24 24
26: 7(fvec4) FMul 19 25
ReturnValue 26
FunctionEnd

View File

@ -5,212 +5,240 @@ gl_FragCoord origin is upper left
0:48 Function Definition: PixelShaderFunction( (temp float)
0:3 Function Parameters:
0:? Sequence
0:4 move second child to first child (temp 4-component vector of float)
0:4 'r00' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:5 move second child to first child (temp 4-component vector of float)
0:5 'r01' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:7 move second child to first child (temp 1-component vector of bool)
0:7 'r12' (temp 1-component vector of bool)
0:7 Constant:
0:7 false (const bool)
0:8 move second child to first child (temp 1-component vector of int)
0:8 'r13' (temp 1-component vector of int)
0:8 Constant:
0:8 1 (const int)
0:9 move second child to first child (temp 1-component vector of float)
0:9 'r14' (temp 1-component vector of float)
0:9 Constant:
0:9 1.000000
0:10 move second child to first child (temp 1-component vector of double)
0:10 'r15' (temp 1-component vector of double)
0:10 Constant:
0:10 1.000000
0:11 move second child to first child (temp 1-component vector of uint)
0:11 'r16' (temp 1-component vector of uint)
0:11 Constant:
0:11 1 (const uint)
0:13 move second child to first child (temp 2-component vector of bool)
0:13 'r20' (temp 2-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:14 move second child to first child (temp 2-component vector of int)
0:14 'r21' (temp 2-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:15 move second child to first child (temp 2-component vector of float)
0:15 'r22' (temp 2-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:16 move second child to first child (temp 2-component vector of double)
0:16 'r23' (temp 2-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:17 move second child to first child (temp 2-component vector of uint)
0:17 'r24' (temp 2-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:19 move second child to first child (temp 3-component vector of bool)
0:19 'r30' (temp 3-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:20 move second child to first child (temp 3-component vector of int)
0:20 'r31' (temp 3-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:21 move second child to first child (temp 3-component vector of float)
0:21 'r32' (temp 3-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:22 move second child to first child (temp 3-component vector of double)
0:22 'r33' (temp 3-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:23 move second child to first child (temp 3-component vector of uint)
0:23 'r34' (temp 3-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:25 move second child to first child (temp 4-component vector of bool)
0:25 'r40' (temp 4-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:? false (const bool)
0:26 move second child to first child (temp 4-component vector of int)
0:26 'r41' (temp 4-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:27 move second child to first child (temp 4-component vector of float)
0:27 'r42' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 move second child to first child (temp 4-component vector of double)
0:28 'r43' (temp 4-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:29 move second child to first child (temp 4-component vector of uint)
0:29 'r44' (temp 4-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:? 4 (const uint)
0:31 move second child to first child (temp 4X4 matrix of float)
0:31 'r50' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:32 move second child to first child (temp 4X4 matrix of float)
0:32 'r51' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:35 move second child to first child (temp 3X2 matrix of float)
0:35 'r61' (temp 3X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:36 move second child to first child (temp 2X3 matrix of float)
0:36 'r62' (temp 2X3 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:39 move second child to first child (temp 2X4 matrix of float)
0:39 'r65' (temp 2X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:40 move second child to first child (temp 3X4 matrix of float)
0:40 'r66' (temp 3X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:4 Sequence
0:4 move second child to first child (temp 4-component vector of float)
0:4 'r00' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:5 Sequence
0:5 move second child to first child (temp 4-component vector of float)
0:5 'r01' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:7 Sequence
0:7 move second child to first child (temp 1-component vector of bool)
0:7 'r12' (temp 1-component vector of bool)
0:7 Constant:
0:7 false (const bool)
0:8 Sequence
0:8 move second child to first child (temp 1-component vector of int)
0:8 'r13' (temp 1-component vector of int)
0:8 Constant:
0:8 1 (const int)
0:9 Sequence
0:9 move second child to first child (temp 1-component vector of float)
0:9 'r14' (temp 1-component vector of float)
0:9 Constant:
0:9 1.000000
0:10 Sequence
0:10 move second child to first child (temp 1-component vector of double)
0:10 'r15' (temp 1-component vector of double)
0:10 Constant:
0:10 1.000000
0:11 Sequence
0:11 move second child to first child (temp 1-component vector of uint)
0:11 'r16' (temp 1-component vector of uint)
0:11 Constant:
0:11 1 (const uint)
0:13 Sequence
0:13 move second child to first child (temp 2-component vector of bool)
0:13 'r20' (temp 2-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:14 Sequence
0:14 move second child to first child (temp 2-component vector of int)
0:14 'r21' (temp 2-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:15 Sequence
0:15 move second child to first child (temp 2-component vector of float)
0:15 'r22' (temp 2-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:16 Sequence
0:16 move second child to first child (temp 2-component vector of double)
0:16 'r23' (temp 2-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:17 Sequence
0:17 move second child to first child (temp 2-component vector of uint)
0:17 'r24' (temp 2-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:19 Sequence
0:19 move second child to first child (temp 3-component vector of bool)
0:19 'r30' (temp 3-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:20 Sequence
0:20 move second child to first child (temp 3-component vector of int)
0:20 'r31' (temp 3-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:21 Sequence
0:21 move second child to first child (temp 3-component vector of float)
0:21 'r32' (temp 3-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:22 Sequence
0:22 move second child to first child (temp 3-component vector of double)
0:22 'r33' (temp 3-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:23 Sequence
0:23 move second child to first child (temp 3-component vector of uint)
0:23 'r34' (temp 3-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:25 Sequence
0:25 move second child to first child (temp 4-component vector of bool)
0:25 'r40' (temp 4-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:? false (const bool)
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of int)
0:26 'r41' (temp 4-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:27 'r42' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 Sequence
0:28 move second child to first child (temp 4-component vector of double)
0:28 'r43' (temp 4-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:29 Sequence
0:29 move second child to first child (temp 4-component vector of uint)
0:29 'r44' (temp 4-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:? 4 (const uint)
0:31 Sequence
0:31 move second child to first child (temp 4X4 matrix of float)
0:31 'r50' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:32 Sequence
0:32 move second child to first child (temp 4X4 matrix of float)
0:32 'r51' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:35 Sequence
0:35 move second child to first child (temp 3X2 matrix of float)
0:35 'r61' (temp 3X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:36 Sequence
0:36 move second child to first child (temp 2X3 matrix of float)
0:36 'r62' (temp 2X3 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:39 Sequence
0:39 move second child to first child (temp 2X4 matrix of float)
0:39 'r65' (temp 2X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:40 Sequence
0:40 move second child to first child (temp 3X4 matrix of float)
0:40 'r66' (temp 3X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:45 Branch: Return with expression
0:45 Constant:
0:45 0.000000
@ -226,212 +254,240 @@ gl_FragCoord origin is upper left
0:48 Function Definition: PixelShaderFunction( (temp float)
0:3 Function Parameters:
0:? Sequence
0:4 move second child to first child (temp 4-component vector of float)
0:4 'r00' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:5 move second child to first child (temp 4-component vector of float)
0:5 'r01' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:7 move second child to first child (temp 1-component vector of bool)
0:7 'r12' (temp 1-component vector of bool)
0:7 Constant:
0:7 false (const bool)
0:8 move second child to first child (temp 1-component vector of int)
0:8 'r13' (temp 1-component vector of int)
0:8 Constant:
0:8 1 (const int)
0:9 move second child to first child (temp 1-component vector of float)
0:9 'r14' (temp 1-component vector of float)
0:9 Constant:
0:9 1.000000
0:10 move second child to first child (temp 1-component vector of double)
0:10 'r15' (temp 1-component vector of double)
0:10 Constant:
0:10 1.000000
0:11 move second child to first child (temp 1-component vector of uint)
0:11 'r16' (temp 1-component vector of uint)
0:11 Constant:
0:11 1 (const uint)
0:13 move second child to first child (temp 2-component vector of bool)
0:13 'r20' (temp 2-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:14 move second child to first child (temp 2-component vector of int)
0:14 'r21' (temp 2-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:15 move second child to first child (temp 2-component vector of float)
0:15 'r22' (temp 2-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:16 move second child to first child (temp 2-component vector of double)
0:16 'r23' (temp 2-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:17 move second child to first child (temp 2-component vector of uint)
0:17 'r24' (temp 2-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:19 move second child to first child (temp 3-component vector of bool)
0:19 'r30' (temp 3-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:20 move second child to first child (temp 3-component vector of int)
0:20 'r31' (temp 3-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:21 move second child to first child (temp 3-component vector of float)
0:21 'r32' (temp 3-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:22 move second child to first child (temp 3-component vector of double)
0:22 'r33' (temp 3-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:23 move second child to first child (temp 3-component vector of uint)
0:23 'r34' (temp 3-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:25 move second child to first child (temp 4-component vector of bool)
0:25 'r40' (temp 4-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:? false (const bool)
0:26 move second child to first child (temp 4-component vector of int)
0:26 'r41' (temp 4-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:27 move second child to first child (temp 4-component vector of float)
0:27 'r42' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 move second child to first child (temp 4-component vector of double)
0:28 'r43' (temp 4-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:29 move second child to first child (temp 4-component vector of uint)
0:29 'r44' (temp 4-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:? 4 (const uint)
0:31 move second child to first child (temp 4X4 matrix of float)
0:31 'r50' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:32 move second child to first child (temp 4X4 matrix of float)
0:32 'r51' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:35 move second child to first child (temp 3X2 matrix of float)
0:35 'r61' (temp 3X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:36 move second child to first child (temp 2X3 matrix of float)
0:36 'r62' (temp 2X3 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:39 move second child to first child (temp 2X4 matrix of float)
0:39 'r65' (temp 2X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:40 move second child to first child (temp 3X4 matrix of float)
0:40 'r66' (temp 3X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:4 Sequence
0:4 move second child to first child (temp 4-component vector of float)
0:4 'r00' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:5 Sequence
0:5 move second child to first child (temp 4-component vector of float)
0:5 'r01' (temp 4-component vector of float)
0:? Constant:
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:7 Sequence
0:7 move second child to first child (temp 1-component vector of bool)
0:7 'r12' (temp 1-component vector of bool)
0:7 Constant:
0:7 false (const bool)
0:8 Sequence
0:8 move second child to first child (temp 1-component vector of int)
0:8 'r13' (temp 1-component vector of int)
0:8 Constant:
0:8 1 (const int)
0:9 Sequence
0:9 move second child to first child (temp 1-component vector of float)
0:9 'r14' (temp 1-component vector of float)
0:9 Constant:
0:9 1.000000
0:10 Sequence
0:10 move second child to first child (temp 1-component vector of double)
0:10 'r15' (temp 1-component vector of double)
0:10 Constant:
0:10 1.000000
0:11 Sequence
0:11 move second child to first child (temp 1-component vector of uint)
0:11 'r16' (temp 1-component vector of uint)
0:11 Constant:
0:11 1 (const uint)
0:13 Sequence
0:13 move second child to first child (temp 2-component vector of bool)
0:13 'r20' (temp 2-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:14 Sequence
0:14 move second child to first child (temp 2-component vector of int)
0:14 'r21' (temp 2-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:15 Sequence
0:15 move second child to first child (temp 2-component vector of float)
0:15 'r22' (temp 2-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:16 Sequence
0:16 move second child to first child (temp 2-component vector of double)
0:16 'r23' (temp 2-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:17 Sequence
0:17 move second child to first child (temp 2-component vector of uint)
0:17 'r24' (temp 2-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:19 Sequence
0:19 move second child to first child (temp 3-component vector of bool)
0:19 'r30' (temp 3-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:20 Sequence
0:20 move second child to first child (temp 3-component vector of int)
0:20 'r31' (temp 3-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:21 Sequence
0:21 move second child to first child (temp 3-component vector of float)
0:21 'r32' (temp 3-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:22 Sequence
0:22 move second child to first child (temp 3-component vector of double)
0:22 'r33' (temp 3-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:23 Sequence
0:23 move second child to first child (temp 3-component vector of uint)
0:23 'r34' (temp 3-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:25 Sequence
0:25 move second child to first child (temp 4-component vector of bool)
0:25 'r40' (temp 4-component vector of bool)
0:? Constant:
0:? false (const bool)
0:? true (const bool)
0:? true (const bool)
0:? false (const bool)
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of int)
0:26 'r41' (temp 4-component vector of int)
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:27 'r42' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 Sequence
0:28 move second child to first child (temp 4-component vector of double)
0:28 'r43' (temp 4-component vector of double)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:29 Sequence
0:29 move second child to first child (temp 4-component vector of uint)
0:29 'r44' (temp 4-component vector of uint)
0:? Constant:
0:? 1 (const uint)
0:? 2 (const uint)
0:? 3 (const uint)
0:? 4 (const uint)
0:31 Sequence
0:31 move second child to first child (temp 4X4 matrix of float)
0:31 'r50' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:32 Sequence
0:32 move second child to first child (temp 4X4 matrix of float)
0:32 'r51' (temp 4X4 matrix of float)
0:? Constant:
0:? 0.000000
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:? 13.000000
0:? 14.000000
0:? 15.000000
0:35 Sequence
0:35 move second child to first child (temp 3X2 matrix of float)
0:35 'r61' (temp 3X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:36 Sequence
0:36 move second child to first child (temp 2X3 matrix of float)
0:36 'r62' (temp 2X3 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:39 Sequence
0:39 move second child to first child (temp 2X4 matrix of float)
0:39 'r65' (temp 2X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:40 Sequence
0:40 move second child to first child (temp 3X4 matrix of float)
0:40 'r66' (temp 3X4 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 9.000000
0:? 10.000000
0:? 11.000000
0:? 12.000000
0:45 Branch: Return with expression
0:45 Constant:
0:45 0.000000

12
Test/hlsl.init.frag Normal file
View File

@ -0,0 +1,12 @@
float4 a1 = float4(1, 0.5, 0, 1), b1 = float4(2.0, 2.5, 2.1, 2.2);
float a2 = 0.2, b2;
float a3, b3 = 0.3;
float a4, b4 = 0.4, c4;
float a5 = 0.5, b5, c5 = 1.5;
float4 ShaderFunction(float4 input) : COLOR0
{
float4 a2 = float4(0.2, 0.3, 0.4, 0.5);
return input * a1;
}

View File

@ -82,6 +82,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.float4.frag", "PixelShaderFunction"},
{"hlsl.forLoop.frag", "PixelShaderFunction"},
{"hlsl.if.frag", "PixelShaderFunction"},
{"hlsl.init.frag", "ShaderFunction"},
{"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.evalfns.frag", "main"},

View File

@ -107,12 +107,23 @@ bool HlslGrammar::acceptCompilationUnit()
// declaration
// : SEMICOLON
// | fully_specified_type SEMICOLON
// | fully_specified_type identifier array_specifier post_decls (EQUAL expression)opt SEMICOLON
// | fully_specified_type init_declarator_list SEMICOLON
// | fully_specified_type identifier function_parameters post_decls SEMICOLON // function prototype
// | fully_specified_type identifier function_parameters post_decls compound_statement // function definition
//
// 'node' could get created if the declaration creates code, like an initializer
// init_declarator_list
// : init_declarator COMMA init_declarator COMMA init_declarator...
//
// init_declarator
// : identifier array_specifier post_decls
// | identifier array_specifier post_decls EQUAL assignment_expression
//
// Parsing has to go pretty far in to know whether it's an init_declarator_list
// or not, so the implementation below doesn't perfectly divide up the grammar
// as above. (The 'identifier' in the first item in init_declarator list is the
// same as 'identifier' for function declarations.)
//
// 'node' could get populated if the declaration creates code, like an initializer
// or a function body.
//
bool HlslGrammar::acceptDeclaration(TIntermNode*& node)
@ -134,18 +145,72 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node)
// post_decls
acceptPostDecls(type);
// EQUAL expression
// EQUAL assignment_expression
TIntermTyped* expressionNode = nullptr;
if (acceptTokenClass(EHTokAssign)) {
if (! acceptExpression(expressionNode)) {
if (! acceptAssignmentExpression(expressionNode)) {
expected("initializer");
return false;
}
}
// COMMA
// This means we've been in an init_declarator_list.
// Finish the first init_declarator and recognize the rest of the list.
if (acceptTokenClass(EHTokComma)) {
// init_declarator
// we know have multiple declarations
node = parseContext.declareVariable(idToken.loc, *idToken.string, type, arraySizes, expressionNode);
node = intermediate.makeAggregate(node);
do {
// identifier
if (! acceptIdentifier(idToken)) {
expected("identifier");
return false;
}
// array_specifier
arraySizes = nullptr;
acceptArraySpecifier(arraySizes);
// post_decls
acceptPostDecls(type);
// EQUAL assignment_expression
TIntermTyped* expressionNode = nullptr;
if (acceptTokenClass(EHTokAssign)) {
if (! acceptAssignmentExpression(expressionNode)) {
expected("initializer");
return false;
}
}
node = intermediate.growAggregate(node, parseContext.declareVariable(idToken.loc, *idToken.string, type, arraySizes, expressionNode));
if (acceptTokenClass(EHTokSemicolon)) {
if (node != nullptr)
node->getAsAggregate()->setOperator(EOpSequence);
return true;
}
if (acceptTokenClass(EHTokComma))
continue;
expected(", or ;");
return false;
} while (true);
}
// SEMICOLON
// This also means we've been in an init_declarator_list, but with no COMMA seen.
// Recognize the init_declarator_list, which contains a single declaration.
if (acceptTokenClass(EHTokSemicolon)) {
node = parseContext.declareVariable(idToken.loc, *idToken.string, type, arraySizes, expressionNode);
// use standard AST shape for declarations; just to be safe
node = intermediate.makeAggregate(node);
if (node != nullptr)
node->getAsAggregate()->setOperator(EOpSequence);
return true;
}
@ -451,8 +516,6 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type)
// Otherwise, return false, and don't advance
bool HlslGrammar::acceptType(TType& type)
{
TBasicType basicType;
switch (peek()) {
case EHTokVector:
return acceptVectorTemplateType(type);