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

View File

@ -4,8 +4,10 @@ struct {
float4 m[7]; float4 m[7];
} s[11]; } 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]; 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) TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
{ {
TIntermAggregate* aggrNode = node->getAsAggregate();
TOperator op = intermediate.mapTypeToConstructorOp(type); TOperator op = intermediate.mapTypeToConstructorOp(type);
// Combined texture-sampler constructors are completely semantic checked // Combined texture-sampler constructors are completely semantic checked
// in constructorTextureSamplerError() // in constructorTextureSamplerError()
if (op == EOpConstructTextureSampler) if (op == EOpConstructTextureSampler)
return intermediate.setAggregateOperator(node->getAsAggregate(), op, type, loc); return intermediate.setAggregateOperator(aggrNode, op, type, loc);
TTypeList::const_iterator memberTypes; TTypeList::const_iterator memberTypes;
if (op == EOpConstructStruct) if (op == EOpConstructStruct)
@ -7826,7 +7827,6 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
elementType.shallowCopy(type); elementType.shallowCopy(type);
bool singleArg; bool singleArg;
TIntermAggregate* aggrNode = node->getAsAggregate();
if (aggrNode != nullptr) { if (aggrNode != nullptr) {
if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1) if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
singleArg = true; singleArg = true;
@ -7844,7 +7844,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
newNode = convertArray(node, type); newNode = convertArray(node, type);
// If structure constructor or array constructor is being called // 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()) else if (type.isArray())
newNode = constructAggregate(node, elementType, 1, node->getLoc()); newNode = constructAggregate(node, elementType, 1, node->getLoc());
else if (op == EOpConstructStruct) else if (op == EOpConstructStruct)