Test: Make another test legal HLSL, and rationalize GLSL vs HLSL addConstructor().

This commit is contained in:
John Kessenich 2017-09-15 13:15:23 -06:00
parent bdbbc68e29
commit c64a9dd6a9
3 changed files with 280 additions and 211 deletions

View File

@ -2,72 +2,95 @@ hlsl.array.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:8 Function Parameters:
0:8 'i' ( in int)
0:8 'input' ( in 3-element array of 4-component vector of float)
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:10 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:10 Function Parameters:
0:10 'i' ( in int)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:? Sequence
0:10 Branch: Return with expression
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 direct index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 indirect index ( temp 4-component vector of float)
0:10 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:10 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:10 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 1 (const uint)
0:10 'i' ( in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' ( in int)
0:8 Function Definition: PixelShaderFunction( ( temp void)
0:8 Function Parameters:
0:11 Sequence
0:11 move second child to first child ( temp 10-element array of 4-component vector of float)
0:11 'b' ( temp 10-element array of 4-component vector of float)
0:11 Construct vec4 ( temp 10-element array of 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:12 Branch: Return with expression
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 direct index ( temp 4-component vector of float)
0:12 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 0 (const uint)
0:12 Constant:
0:12 1 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 0 (const uint)
0:12 'i' ( in int)
0:12 direct index ( temp 4-component vector of float)
0:12 'input' ( in 3-element array of 4-component vector of float)
0:12 Constant:
0:12 2 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 'input' ( in 3-element array of 4-component vector of float)
0:12 'i' ( in int)
0:12 direct index ( temp 4-component vector of float)
0:12 'b' ( temp 10-element array of 4-component vector of float)
0:12 Constant:
0:12 5 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 'b' ( temp 10-element array of 4-component vector of float)
0:12 'i' ( in int)
0:12 indirect index ( temp 4-component vector of float)
0:12 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:12 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:12 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 1 (const uint)
0:12 'i' ( in int)
0:12 Constant:
0:12 0 (const int)
0:12 'i' ( in int)
0:10 Function Definition: PixelShaderFunction( ( temp void)
0:10 Function Parameters:
0:? Sequence
0:8 move second child to first child ( temp int)
0:10 move second child to first child ( temp int)
0:? 'i' ( temp int)
0:? 'i' (layout( location=0) flat in int)
0:8 move second child to first child ( temp 3-element array of 4-component vector of float)
0:10 move second child to first child ( temp 3-element array of 4-component vector of float)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:10 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:8 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:10 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:? 'i' ( temp int)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:? 'C' ( global 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
@ -79,116 +102,140 @@ Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:8 Function Parameters:
0:8 'i' ( in int)
0:8 'input' ( in 3-element array of 4-component vector of float)
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:10 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:10 Function Parameters:
0:10 'i' ( in int)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:? Sequence
0:10 Branch: Return with expression
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 direct index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 indirect index ( temp 4-component vector of float)
0:10 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:10 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:10 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 1 (const uint)
0:10 'i' ( in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' ( in int)
0:8 Function Definition: PixelShaderFunction( ( temp void)
0:8 Function Parameters:
0:11 Sequence
0:11 move second child to first child ( temp 10-element array of 4-component vector of float)
0:11 'b' ( temp 10-element array of 4-component vector of float)
0:11 Construct vec4 ( temp 10-element array of 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:12 Branch: Return with expression
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 add ( temp 4-component vector of float)
0:12 direct index ( temp 4-component vector of float)
0:12 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 0 (const uint)
0:12 Constant:
0:12 1 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 0 (const uint)
0:12 'i' ( in int)
0:12 direct index ( temp 4-component vector of float)
0:12 'input' ( in 3-element array of 4-component vector of float)
0:12 Constant:
0:12 2 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 'input' ( in 3-element array of 4-component vector of float)
0:12 'i' ( in int)
0:12 direct index ( temp 4-component vector of float)
0:12 'b' ( temp 10-element array of 4-component vector of float)
0:12 Constant:
0:12 5 (const int)
0:12 indirect index ( temp 4-component vector of float)
0:12 'b' ( temp 10-element array of 4-component vector of float)
0:12 'i' ( in int)
0:12 indirect index ( temp 4-component vector of float)
0:12 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:12 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:12 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:12 Constant:
0:12 1 (const uint)
0:12 'i' ( in int)
0:12 Constant:
0:12 0 (const int)
0:12 'i' ( in int)
0:10 Function Definition: PixelShaderFunction( ( temp void)
0:10 Function Parameters:
0:? Sequence
0:8 move second child to first child ( temp int)
0:10 move second child to first child ( temp int)
0:? 'i' ( temp int)
0:? 'i' (layout( location=0) flat in int)
0:8 move second child to first child ( temp 3-element array of 4-component vector of float)
0:10 move second child to first child ( temp 3-element array of 4-component vector of float)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:10 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:8 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:10 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:? 'i' ( temp int)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:? 'C' ( global 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 81
// Id's are bound by 99
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 68 72 75
EntryPoint Fragment 4 "PixelShaderFunction" 86 90 93
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
Name 17 "@PixelShaderFunction(i1;vf4[3];"
Name 15 "i"
Name 16 "input"
Name 23 ""
MemberName 23 0 "m"
Name 26 "$Global"
MemberName 26($Global) 0 "a"
MemberName 26($Global) 1 "s"
Name 28 ""
Name 50 "b"
Name 66 "i"
Name 68 "i"
Name 70 "input"
Name 72 "input"
Name 75 "@entryPointOutput"
Name 76 "param"
Name 78 "param"
Decorate 20 ArrayStride 16
Decorate 22 ArrayStride 16
MemberDecorate 23 0 Offset 0
Decorate 25 ArrayStride 112
MemberDecorate 26($Global) 0 Offset 0
MemberDecorate 26($Global) 1 Offset 64
Decorate 26($Global) Block
Decorate 28 DescriptorSet 0
Decorate 68(i) Flat
Decorate 68(i) Location 0
Decorate 72(input) Location 1
Decorate 75(@entryPointOutput) Location 0
Name 20 "C"
Name 29 "b"
Name 45 ""
MemberName 45 0 "m"
Name 48 "$Global"
MemberName 48($Global) 0 "a"
MemberName 48($Global) 1 "s"
Name 50 ""
Name 84 "i"
Name 86 "i"
Name 88 "input"
Name 90 "input"
Name 93 "@entryPointOutput"
Name 94 "param"
Name 96 "param"
Decorate 42 ArrayStride 16
Decorate 44 ArrayStride 16
MemberDecorate 45 0 Offset 0
Decorate 47 ArrayStride 112
MemberDecorate 48($Global) 0 Offset 0
MemberDecorate 48($Global) 1 Offset 64
Decorate 48($Global) Block
Decorate 50 DescriptorSet 0
Decorate 86(i) Flat
Decorate 86(i) Location 0
Decorate 90(input) Location 1
Decorate 93(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -200,78 +247,98 @@ gl_FragCoord origin is upper left
12: TypeArray 9(fvec4) 11
13: TypePointer Function 12
14: TypeFunction 9(fvec4) 7(ptr) 13(ptr)
19: 10(int) Constant 4
20: TypeArray 9(fvec4) 19
21: 10(int) Constant 7
22: TypeArray 9(fvec4) 21
23: TypeStruct 22
24: 10(int) Constant 11
25: TypeArray 23(struct) 24
26($Global): TypeStruct 20 25
27: TypePointer Uniform 26($Global)
28: 27(ptr) Variable Uniform
29: 6(int) Constant 0
30: 6(int) Constant 1
31: TypePointer Uniform 9(fvec4)
38: 6(int) Constant 2
39: TypePointer Function 9(fvec4)
47: 10(int) Constant 10
48: TypeArray 9(fvec4) 47
49: TypePointer Function 48
51: 6(int) Constant 5
67: TypePointer Input 6(int)
68(i): 67(ptr) Variable Input
71: TypePointer Input 12
72(input): 71(ptr) Variable Input
74: TypePointer Output 9(fvec4)
75(@entryPointOutput): 74(ptr) Variable Output
19: TypePointer Private 9(fvec4)
20(C): 19(ptr) Variable Private
21: 8(float) Constant 1065353216
22: 8(float) Constant 1073741824
23: 8(float) Constant 1077936128
24: 8(float) Constant 1082130432
25: 9(fvec4) ConstantComposite 21 22 23 24
26: 10(int) Constant 10
27: TypeArray 9(fvec4) 26
28: TypePointer Function 27
41: 10(int) Constant 4
42: TypeArray 9(fvec4) 41
43: 10(int) Constant 7
44: TypeArray 9(fvec4) 43
45: TypeStruct 44
46: 10(int) Constant 11
47: TypeArray 45(struct) 46
48($Global): TypeStruct 42 47
49: TypePointer Uniform 48($Global)
50: 49(ptr) Variable Uniform
51: 6(int) Constant 0
52: 6(int) Constant 1
53: TypePointer Uniform 9(fvec4)
60: 6(int) Constant 2
61: TypePointer Function 9(fvec4)
69: 6(int) Constant 5
85: TypePointer Input 6(int)
86(i): 85(ptr) Variable Input
89: TypePointer Input 12
90(input): 89(ptr) Variable Input
92: TypePointer Output 9(fvec4)
93(@entryPointOutput): 92(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3
5: Label
66(i): 7(ptr) Variable Function
70(input): 13(ptr) Variable Function
76(param): 7(ptr) Variable Function
78(param): 13(ptr) Variable Function
69: 6(int) Load 68(i)
Store 66(i) 69
73: 12 Load 72(input)
Store 70(input) 73
77: 6(int) Load 66(i)
Store 76(param) 77
79: 12 Load 70(input)
Store 78(param) 79
80: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 76(param) 78(param)
Store 75(@entryPointOutput) 80
84(i): 7(ptr) Variable Function
88(input): 13(ptr) Variable Function
94(param): 7(ptr) Variable Function
96(param): 13(ptr) Variable Function
Store 20(C) 25
87: 6(int) Load 86(i)
Store 84(i) 87
91: 12 Load 90(input)
Store 88(input) 91
95: 6(int) Load 84(i)
Store 94(param) 95
97: 12 Load 88(input)
Store 96(param) 97
98: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 94(param) 96(param)
Store 93(@entryPointOutput) 98
Return
FunctionEnd
17(@PixelShaderFunction(i1;vf4[3];): 9(fvec4) Function None 14
15(i): 7(ptr) FunctionParameter
16(input): 13(ptr) FunctionParameter
18: Label
50(b): 49(ptr) Variable Function
32: 31(ptr) AccessChain 28 29 30
33: 9(fvec4) Load 32
34: 6(int) Load 15(i)
35: 31(ptr) AccessChain 28 29 34
36: 9(fvec4) Load 35
37: 9(fvec4) FAdd 33 36
40: 39(ptr) AccessChain 16(input) 38
41: 9(fvec4) Load 40
42: 9(fvec4) FAdd 37 41
43: 6(int) Load 15(i)
44: 39(ptr) AccessChain 16(input) 43
45: 9(fvec4) Load 44
46: 9(fvec4) FAdd 42 45
52: 39(ptr) AccessChain 50(b) 51
53: 9(fvec4) Load 52
54: 9(fvec4) FAdd 46 53
55: 6(int) Load 15(i)
56: 39(ptr) AccessChain 50(b) 55
57: 9(fvec4) Load 56
58: 9(fvec4) FAdd 54 57
59: 6(int) Load 15(i)
60: 6(int) Load 15(i)
61: 31(ptr) AccessChain 28 30 59 29 60
62: 9(fvec4) Load 61
63: 9(fvec4) FAdd 58 62
ReturnValue 63
29(b): 28(ptr) Variable Function
30: 9(fvec4) Load 20(C)
31: 9(fvec4) Load 20(C)
32: 9(fvec4) Load 20(C)
33: 9(fvec4) Load 20(C)
34: 9(fvec4) Load 20(C)
35: 9(fvec4) Load 20(C)
36: 9(fvec4) Load 20(C)
37: 9(fvec4) Load 20(C)
38: 9(fvec4) Load 20(C)
39: 9(fvec4) Load 20(C)
40: 27 CompositeConstruct 30 31 32 33 34 35 36 37 38 39
Store 29(b) 40
54: 53(ptr) AccessChain 50 51 52
55: 9(fvec4) Load 54
56: 6(int) Load 15(i)
57: 53(ptr) AccessChain 50 51 56
58: 9(fvec4) Load 57
59: 9(fvec4) FAdd 55 58
62: 61(ptr) AccessChain 16(input) 60
63: 9(fvec4) Load 62
64: 9(fvec4) FAdd 59 63
65: 6(int) Load 15(i)
66: 61(ptr) AccessChain 16(input) 65
67: 9(fvec4) Load 66
68: 9(fvec4) FAdd 64 67
70: 61(ptr) AccessChain 29(b) 69
71: 9(fvec4) Load 70
72: 9(fvec4) FAdd 68 71
73: 6(int) Load 15(i)
74: 61(ptr) AccessChain 29(b) 73
75: 9(fvec4) Load 74
76: 9(fvec4) FAdd 72 75
77: 6(int) Load 15(i)
78: 6(int) Load 15(i)
79: 53(ptr) AccessChain 50 52 77 51 78
80: 9(fvec4) Load 79
81: 9(fvec4) FAdd 76 80
ReturnValue 81
FunctionEnd

View File

@ -4,8 +4,10 @@ struct {
float4 m[7];
} s[11];
float4 PixelShaderFunction(int i, float4 input[3]) : COLOR0
static float4 C = float4(1,2,3,4);
float4 PixelShaderFunction(int i : sem1, float4 input[3] : sem2) : SV_TARGET0
{
float4 b[10];
float4 b[10] = { C, C, C, C, C, C, C, C, C, C };
return a[1] + a[i] + input[2] + input[i] + b[5] + b[i] + s[i].m[i];
}
}

View File

@ -7807,12 +7807,13 @@ TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TInterm
//
TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
{
TIntermAggregate* aggrNode = node->getAsAggregate();
TOperator op = intermediate.mapTypeToConstructorOp(type);
// Combined texture-sampler constructors are completely semantic checked
// in constructorTextureSamplerError()
if (op == EOpConstructTextureSampler)
return intermediate.setAggregateOperator(node->getAsAggregate(), op, type, loc);
return intermediate.setAggregateOperator(aggrNode, op, type, loc);
TTypeList::const_iterator memberTypes;
if (op == EOpConstructStruct)
@ -7826,7 +7827,6 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
elementType.shallowCopy(type);
bool singleArg;
TIntermAggregate* aggrNode = node->getAsAggregate();
if (aggrNode != nullptr) {
if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
singleArg = true;
@ -7844,7 +7844,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
newNode = convertArray(node, type);
// If structure constructor or array constructor is being called
// for only one parameter inside the structure, we need to call constructAggregate function once.
// for only one parameter inside the aggregate, we need to call constructAggregate function once.
else if (type.isArray())
newNode = constructAggregate(node, elementType, 1, node->getLoc());
else if (op == EOpConstructStruct)
@ -7868,7 +7868,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
//
// Handle list of arguments.
//
TIntermSequence &sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor
TIntermSequence& sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor
// if the structure constructor contains more than one parameter, then construct
// each parameter