Updated glslang.

This commit is contained in:
Branimir Karadžić
2017-01-04 20:34:04 -08:00
parent b9b8a6e871
commit 6def346bf9
70 changed files with 5107 additions and 796 deletions

View File

@@ -0,0 +1,19 @@
cppBad2.vert
ERROR: 0:3: 'macro expansion' : End of input in macro b
ERROR: 0:3: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
Shader version: 100
ERROR: node is still EOpNull!
0:? Linker Objects
Linked vertex stage:
ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
Shader version: 100
ERROR: node is still EOpNull!
0:? Linker Objects

View File

@@ -2,13 +2,17 @@ hlsl.basic.comp
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main(i1; (temp void)
0:4 Function Definition: main(i1;i1; (temp void)
0:4 Function Parameters:
0:4 'dti' (in int LocalInvocationID)
0:4 'dti' (in int GlobalInvocationID)
0:4 'gti' (in int LocalInvocationID)
0:? Sequence
0:5 'dti' (in int LocalInvocationID)
0:5 subtract (temp int)
0:5 'dti' (in int GlobalInvocationID)
0:5 'gti' (in int LocalInvocationID)
0:? Linker Objects
0:? 'dti' (in int LocalInvocationID)
0:? 'dti' (in int GlobalInvocationID)
0:? 'gti' (in int LocalInvocationID)
0:? 'a' (shared 100-element array of 4-component vector of float)
@@ -18,41 +22,51 @@ Linked compute stage:
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main(i1; (temp void)
0:4 Function Definition: main(i1;i1; (temp void)
0:4 Function Parameters:
0:4 'dti' (in int LocalInvocationID)
0:4 'dti' (in int GlobalInvocationID)
0:4 'gti' (in int LocalInvocationID)
0:? Sequence
0:5 'dti' (in int LocalInvocationID)
0:5 subtract (temp int)
0:5 'dti' (in int GlobalInvocationID)
0:5 'gti' (in int LocalInvocationID)
0:? Linker Objects
0:? 'dti' (in int LocalInvocationID)
0:? 'dti' (in int GlobalInvocationID)
0:? 'gti' (in int LocalInvocationID)
0:? 'a' (shared 100-element array of 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 16
// Id's are bound by 20
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 8
EntryPoint GLCompute 4 "main" 8 10
ExecutionMode 4 LocalSize 1 1 1
Name 4 "main"
Name 8 "dti"
Name 15 "a"
Decorate 8(dti) BuiltIn LocalInvocationId
Name 10 "gti"
Name 19 "a"
Decorate 8(dti) BuiltIn GlobalInvocationId
Decorate 10(gti) BuiltIn LocalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Input 6(int)
8(dti): 7(ptr) Variable Input
9: TypeFloat 32
10: TypeVector 9(float) 4
11: TypeInt 32 0
12: 11(int) Constant 100
13: TypeArray 10(fvec4) 12
14: TypePointer Workgroup 13
15(a): 14(ptr) Variable Workgroup
10(gti): 7(ptr) Variable Input
13: TypeFloat 32
14: TypeVector 13(float) 4
15: TypeInt 32 0
16: 15(int) Constant 100
17: TypeArray 14(fvec4) 16
18: TypePointer Workgroup 17
19(a): 18(ptr) Variable Workgroup
4(main): 2 Function None 3
5: Label
9: 6(int) Load 8(dti)
11: 6(int) Load 10(gti)
12: 6(int) ISub 9 11
Return
FunctionEnd

View File

@@ -9,7 +9,7 @@ output primitive = line_strip
0:16 Function Parameters:
0:16 'VertexID' (layout(location=0 ) in 3-element array of uint)
0:16 'test' (layout(location=3 ) in 3-element array of uint)
0:16 'OutputStream' (out structure{temp float myfloat, temp int something})
0:16 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:? Sequence
0:19 move second child to first child (temp float)
0:19 myfloat: direct index for structure (temp float)
@@ -43,20 +43,19 @@ output primitive = line_strip
0:20 0 (const int)
0:22 Sequence
0:22 move second child to first child (temp structure{temp float myfloat, temp int something})
0:22 'OutputStream' (out structure{temp float myfloat, temp int something})
0:22 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:22 'Vert' (temp structure{temp float myfloat, temp int something})
0:22 EmitVertex (temp void)
0:23 Sequence
0:23 move second child to first child (temp structure{temp float myfloat, temp int something})
0:23 'OutputStream' (out structure{temp float myfloat, temp int something})
0:23 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:23 'Vert' (temp structure{temp float myfloat, temp int something})
0:23 EmitVertex (temp void)
0:24 EndPrimitive (temp void)
0:? Linker Objects
0:? 'VertexID' (layout(location=0 ) in 3-element array of uint)
0:? 'test' (layout(location=3 ) in 3-element array of uint)
0:? 'myfloat' (layout(location=0 ) out float)
0:? 'something' (layout(location=1 ) out int)
0:? 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
Linked geometry stage:
@@ -72,7 +71,7 @@ output primitive = line_strip
0:16 Function Parameters:
0:16 'VertexID' (layout(location=0 ) in 3-element array of uint)
0:16 'test' (layout(location=3 ) in 3-element array of uint)
0:16 'OutputStream' (out structure{temp float myfloat, temp int something})
0:16 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:? Sequence
0:19 move second child to first child (temp float)
0:19 myfloat: direct index for structure (temp float)
@@ -106,29 +105,28 @@ output primitive = line_strip
0:20 0 (const int)
0:22 Sequence
0:22 move second child to first child (temp structure{temp float myfloat, temp int something})
0:22 'OutputStream' (out structure{temp float myfloat, temp int something})
0:22 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:22 'Vert' (temp structure{temp float myfloat, temp int something})
0:22 EmitVertex (temp void)
0:23 Sequence
0:23 move second child to first child (temp structure{temp float myfloat, temp int something})
0:23 'OutputStream' (out structure{temp float myfloat, temp int something})
0:23 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
0:23 'Vert' (temp structure{temp float myfloat, temp int something})
0:23 EmitVertex (temp void)
0:24 EndPrimitive (temp void)
0:? Linker Objects
0:? 'VertexID' (layout(location=0 ) in 3-element array of uint)
0:? 'test' (layout(location=3 ) in 3-element array of uint)
0:? 'myfloat' (layout(location=0 ) out float)
0:? 'something' (layout(location=1 ) out int)
0:? 'OutputStream' (layout(location=0 ) out structure{temp float myfloat, temp int something})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 45
// Id's are bound by 41
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 16 31 38 42 44
EntryPoint Geometry 4 "main" 16 31 38
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputLineStrip
@@ -141,12 +139,9 @@ output primitive = line_strip
Name 16 "test"
Name 31 "VertexID"
Name 38 "OutputStream"
Name 42 "myfloat"
Name 44 "something"
Decorate 16(test) Location 3
Decorate 31(VertexID) Location 0
Decorate 42(myfloat) Location 0
Decorate 44(something) Location 1
Decorate 38(OutputStream) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -167,10 +162,6 @@ output primitive = line_strip
35: TypePointer Function 7(int)
37: TypePointer Output 8(PSInput)
38(OutputStream): 37(ptr) Variable Output
41: TypePointer Output 6(float)
42(myfloat): 41(ptr) Variable Output
43: TypePointer Output 7(int)
44(something): 43(ptr) Variable Output
4(main): 2 Function None 3
5: Label
10(Vert): 9(ptr) Variable Function

View File

@@ -4,84 +4,48 @@ gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:8 Function Parameters:
0:8 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:8 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:? Sequence
0:9 Branch: Return with expression
0:9 add (temp float)
0:9 direct index (temp float)
0:9 v: direct index for structure (temp 2-component vector of float)
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 direct index (temp float)
0:9 fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0 (const int)
0:13 Function Definition: PixelShaderFunction(struct-InParam-vf2-vf4-vi21; (temp 4-component vector of float)
0:13 Function Parameters:
0:13 'i' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:13 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:? Sequence
0:15 Sequence
0:15 move second child to first child (temp 2-component vector of float)
0:15 v: direct index for structure (temp 2-component vector of float)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 0 (const int)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:15 move second child to first child (temp 4-component vector of float)
0:15 fragCoord: direct index for structure (temp 4-component vector of float)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 1 (const int)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:15 move second child to first child (temp 2-component vector of int)
0:15 i2: direct index for structure (temp 2-component vector of int)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 2 (const int)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:15 move second child to first child (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:15 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:16 Sequence
0:16 move second child to first child (temp float)
0:16 'ret1' (temp float)
0:16 Function Call: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:16 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:16 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:17 Sequence
0:17 move second child to first child (temp float)
0:17 'ret2' (temp float)
0:17 Function Call: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:17 Comma (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Sequence
0:17 move second child to first child (temp 2-component vector of float)
0:17 v: direct index for structure (temp 2-component vector of float)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 0 (const int)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:17 move second child to first child (temp 4-component vector of float)
0:17 fragCoord: direct index for structure (temp 4-component vector of float)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 1 (const int)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:17 move second child to first child (temp 2-component vector of int)
0:17 i2: direct index for structure (temp 2-component vector of int)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 2 (const int)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:19 vector-scale (temp 4-component vector of float)
0:19 vector-scale (temp 4-component vector of float)
0:19 fragCoord: direct index for structure (temp 4-component vector of float)
0:19 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:19 fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
0:19 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:19 Constant:
0:19 1 (const int)
0:19 'ret1' (temp float)
@@ -89,9 +53,7 @@ gl_FragCoord origin is upper left
0:19 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:? 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
Linked fragment stage:
@@ -102,84 +64,48 @@ gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:8 Function Parameters:
0:8 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:8 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:? Sequence
0:9 Branch: Return with expression
0:9 add (temp float)
0:9 direct index (temp float)
0:9 v: direct index for structure (temp 2-component vector of float)
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 direct index (temp float)
0:9 fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:9 'p' (in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0 (const int)
0:13 Function Definition: PixelShaderFunction(struct-InParam-vf2-vf4-vi21; (temp 4-component vector of float)
0:13 Function Parameters:
0:13 'i' (in structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:13 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:? Sequence
0:15 Sequence
0:15 move second child to first child (temp 2-component vector of float)
0:15 v: direct index for structure (temp 2-component vector of float)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 0 (const int)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:15 move second child to first child (temp 4-component vector of float)
0:15 fragCoord: direct index for structure (temp 4-component vector of float)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 1 (const int)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:15 move second child to first child (temp 2-component vector of int)
0:15 i2: direct index for structure (temp 2-component vector of int)
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:15 Constant:
0:15 2 (const int)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:15 move second child to first child (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:15 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:15 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:16 Sequence
0:16 move second child to first child (temp float)
0:16 'ret1' (temp float)
0:16 Function Call: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:16 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:16 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:17 Sequence
0:17 move second child to first child (temp float)
0:17 'ret2' (temp float)
0:17 Function Call: fun(struct-InParam-vf2-vf4-vi21; (temp float)
0:17 Comma (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Sequence
0:17 move second child to first child (temp 2-component vector of float)
0:17 v: direct index for structure (temp 2-component vector of float)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 0 (const int)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:17 move second child to first child (temp 4-component vector of float)
0:17 fragCoord: direct index for structure (temp 4-component vector of float)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 1 (const int)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:17 move second child to first child (temp 2-component vector of int)
0:17 i2: direct index for structure (temp 2-component vector of int)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 Constant:
0:17 2 (const int)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:17 'aggShadow' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:17 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:19 vector-scale (temp 4-component vector of float)
0:19 vector-scale (temp 4-component vector of float)
0:19 fragCoord: direct index for structure (temp 4-component vector of float)
0:19 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2})
0:19 fragCoord: direct index for structure (temp 4-component vector of float FragCoord)
0:19 'local' (temp structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
0:19 Constant:
0:19 1 (const int)
0:19 'ret1' (temp float)
@@ -187,18 +113,16 @@ gl_FragCoord origin is upper left
0:19 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'v' (layout(location=0 ) in 2-component vector of float)
0:? 'fragCoord' (in 4-component vector of float FragCoord)
0:? 'i2' (layout(location=1 ) in 2-component vector of int)
0:? 'i' (layout(location=0 ) in structure{temp 2-component vector of float v, temp 4-component vector of float FragCoord fragCoord, temp 2-component vector of int i2})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 71
// Id's are bound by 52
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 32 37 43 63
EntryPoint Fragment 4 "PixelShaderFunction" 32 43
ExecutionMode 4 OriginUpperLeft
Name 4 "PixelShaderFunction"
Name 11 "InParam"
@@ -208,19 +132,15 @@ gl_FragCoord origin is upper left
Name 15 "fun(struct-InParam-vf2-vf4-vi21;"
Name 14 "p"
Name 30 "local"
Name 32 "v"
Name 37 "fragCoord"
Name 43 "i2"
Name 47 "ret1"
Name 48 "param"
Name 51 "ret2"
Name 52 "aggShadow"
Name 59 "param"
Name 63 "@entryPointOutput"
Decorate 32(v) Location 0
Decorate 37(fragCoord) BuiltIn FragCoord
Decorate 43(i2) Location 1
Decorate 63(@entryPointOutput) Location 0
Name 32 "i"
Name 34 "ret1"
Name 35 "param"
Name 38 "ret2"
Name 39 "param"
Name 43 "@entryPointOutput"
MemberDecorate 11(InParam) 1 BuiltIn FragCoord
Decorate 32(i) Location 0
Decorate 43(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -237,59 +157,35 @@ gl_FragCoord origin is upper left
20: TypePointer Function 6(float)
23: 9(int) Constant 1
24: 18(int) Constant 0
31: TypePointer Input 7(fvec2)
32(v): 31(ptr) Variable Input
34: TypePointer Function 7(fvec2)
36: TypePointer Input 8(fvec4)
37(fragCoord): 36(ptr) Variable Input
39: TypePointer Function 8(fvec4)
41: 9(int) Constant 2
42: TypePointer Input 10(ivec2)
43(i2): 42(ptr) Variable Input
45: TypePointer Function 10(ivec2)
62: TypePointer Output 8(fvec4)
63(@entryPointOutput): 62(ptr) Variable Output
31: TypePointer Input 11(InParam)
32(i): 31(ptr) Variable Input
42: TypePointer Output 8(fvec4)
43(@entryPointOutput): 42(ptr) Variable Output
44: TypePointer Function 8(fvec4)
4(PixelShaderFunction): 2 Function None 3
5: Label
30(local): 12(ptr) Variable Function
47(ret1): 20(ptr) Variable Function
48(param): 12(ptr) Variable Function
51(ret2): 20(ptr) Variable Function
52(aggShadow): 12(ptr) Variable Function
59(param): 12(ptr) Variable Function
33: 7(fvec2) Load 32(v)
35: 34(ptr) AccessChain 30(local) 17
Store 35 33
38: 8(fvec4) Load 37(fragCoord)
40: 39(ptr) AccessChain 30(local) 23
Store 40 38
44: 10(ivec2) Load 43(i2)
46: 45(ptr) AccessChain 30(local) 41
Store 46 44
49: 11(InParam) Load 30(local)
Store 48(param) 49
50: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 48(param)
Store 47(ret1) 50
53: 7(fvec2) Load 32(v)
54: 34(ptr) AccessChain 52(aggShadow) 17
Store 54 53
55: 8(fvec4) Load 37(fragCoord)
56: 39(ptr) AccessChain 52(aggShadow) 23
Store 56 55
57: 10(ivec2) Load 43(i2)
58: 45(ptr) AccessChain 52(aggShadow) 41
Store 58 57
60: 11(InParam) Load 52(aggShadow)
Store 59(param) 60
61: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 59(param)
Store 51(ret2) 61
64: 39(ptr) AccessChain 30(local) 23
65: 8(fvec4) Load 64
66: 6(float) Load 47(ret1)
67: 8(fvec4) VectorTimesScalar 65 66
68: 6(float) Load 51(ret2)
69: 8(fvec4) VectorTimesScalar 67 68
Store 63(@entryPointOutput) 69
34(ret1): 20(ptr) Variable Function
35(param): 12(ptr) Variable Function
38(ret2): 20(ptr) Variable Function
39(param): 12(ptr) Variable Function
33: 11(InParam) Load 32(i)
Store 30(local) 33
36: 11(InParam) Load 30(local)
Store 35(param) 36
37: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 35(param)
Store 34(ret1) 37
40: 11(InParam) Load 32(i)
Store 39(param) 40
41: 6(float) FunctionCall 15(fun(struct-InParam-vf2-vf4-vi21;) 39(param)
Store 38(ret2) 41
45: 44(ptr) AccessChain 30(local) 23
46: 8(fvec4) Load 45
47: 6(float) Load 34(ret1)
48: 8(fvec4) VectorTimesScalar 46 47
49: 6(float) Load 38(ret2)
50: 8(fvec4) VectorTimesScalar 48 49
Store 43(@entryPointOutput) 50
Return
FunctionEnd
15(fun(struct-InParam-vf2-vf4-vi21;): 6(float) Function None 13

View File

@@ -1,7 +1,7 @@
hlsl.gather.basic.dx10.vert
Shader version: 450
0:? Sequence
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:28 Function Parameters:
0:? Sequence
0:33 Sequence
@@ -87,7 +87,6 @@ Shader version: 450
0:45 0 (const int)
0:45 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_sSamp2d' (uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -103,6 +102,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
@@ -110,7 +110,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:28 Function Parameters:
0:? Sequence
0:33 Sequence
@@ -196,7 +196,6 @@ Shader version: 450
0:45 0 (const int)
0:45 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_sSamp2d' (uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -212,6 +211,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@@ -1,7 +1,7 @@
hlsl.getdimensions.dx10.vert
Shader version: 450
0:? Sequence
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Parameters:
0:? Sequence
0:21 Sequence
@@ -46,9 +46,9 @@ Shader version: 450
0:26 0 (const int)
0:26 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
@@ -56,7 +56,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Parameters:
0:? Sequence
0:21 Sequence
@@ -101,9 +101,9 @@ Shader version: 450
0:26 0 (const int)
0:26 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@@ -0,0 +1,111 @@
hlsl.intrinsics.d3dcolortoubyte4.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:5 Function Definition: main( (temp 4-component vector of int)
0:5 Function Parameters:
0:? Sequence
0:6 Sequence
0:6 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:6 Convert float to int (temp 4-component vector of int)
0:6 vector-scale (temp 4-component vector of float)
0:6 Constant:
0:6 255.001953
0:6 vector swizzle (temp 4-component vector of float)
0:6 col4: direct index for structure (layout(offset=0 ) uniform 4-component vector of float)
0:6 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float col4})
0:6 Constant:
0:6 0 (const uint)
0:6 Sequence
0:6 Constant:
0:6 2 (const int)
0:6 Constant:
0:6 1 (const int)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 3 (const int)
0:6 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float col4})
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:5 Function Definition: main( (temp 4-component vector of int)
0:5 Function Parameters:
0:? Sequence
0:6 Sequence
0:6 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:6 Convert float to int (temp 4-component vector of int)
0:6 vector-scale (temp 4-component vector of float)
0:6 Constant:
0:6 255.001953
0:6 vector swizzle (temp 4-component vector of float)
0:6 col4: direct index for structure (layout(offset=0 ) uniform 4-component vector of float)
0:6 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float col4})
0:6 Constant:
0:6 0 (const uint)
0:6 Sequence
0:6 Constant:
0:6 2 (const int)
0:6 Constant:
0:6 1 (const int)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 3 (const int)
0:6 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float col4})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 24
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "@entryPointOutput"
Name 13 "$Global"
MemberName 13($Global) 0 "col4"
Name 15 ""
Decorate 9(@entryPointOutput) Location 0
MemberDecorate 13($Global) 0 Offset 0
Decorate 13($Global) Block
Decorate 15 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeVector 6(int) 4
8: TypePointer Output 7(ivec4)
9(@entryPointOutput): 8(ptr) Variable Output
10: TypeFloat 32
11: 10(float) Constant 1132396672
12: TypeVector 10(float) 4
13($Global): TypeStruct 12(fvec4)
14: TypePointer Uniform 13($Global)
15: 14(ptr) Variable Uniform
16: 6(int) Constant 0
17: TypePointer Uniform 12(fvec4)
4(main): 2 Function None 3
5: Label
18: 17(ptr) AccessChain 15 16
19: 12(fvec4) Load 18
20: 12(fvec4) VectorShuffle 19 19 2 1 0 3
21: 12(fvec4) VectorTimesScalar 20 11
22: 7(ivec4) ConvertFToS 21
Store 9(@entryPointOutput) 22
Return
FunctionEnd

View File

@@ -1,6 +1,10 @@
hlsl.intrinsics.negative.frag
ERROR: 0:10: 'determinant' : no matching overloaded function found
ERROR: 0:12: 'f32tof16' : unimplemented intrinsic: handle natively
ERROR: 0:23: 'length' : ambiguous best function under implicit type conversion
ERROR: 0:25: 'normalize' : ambiguous best function under implicit type conversion
ERROR: 0:26: 'reflect' : ambiguous best function under implicit type conversion
ERROR: 0:27: 'refract' : ambiguous best function under implicit type conversion
ERROR: 0:28: 'refract' : no matching overloaded function found
ERROR: 0:30: 'transpose' : no matching overloaded function found
ERROR: 0:39: 'GetRenderTargetSamplePosition' : no matching overloaded function found
@@ -59,7 +63,7 @@ ERROR: 0:133: 'normalize' : no matching overloaded function found
ERROR: 0:133: 'reflect' : no matching overloaded function found
ERROR: 0:133: 'refract' : no matching overloaded function found
ERROR: 0:133: 'reversebits' : no matching overloaded function found
ERROR: 60 compilation errors. No code generated.
ERROR: 64 compilation errors. No code generated.
Shader version: 450
@@ -89,9 +93,22 @@ ERROR: node is still EOpNull!
0:8 'inF0' (in float)
0:8 Construct vec3 (in 3-component vector of float)
0:8 'inF1' (in float)
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (temp 4-component vector of int)
0:9 Construct vec4 (in 4-component vector of float)
0:9 'inF0' (in float)
0:9 Convert float to int (temp 4-component vector of int)
0:9 vector-scale (temp 4-component vector of float)
0:9 Constant:
0:9 255.001953
0:9 vector swizzle (temp 4-component vector of float)
0:9 Construct vec4 (in 4-component vector of float)
0:9 'inF0' (in float)
0:9 Sequence
0:9 Constant:
0:9 2 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 3 (const int)
0:10 Constant:
0:10 0.000000
0:12 ERROR: Bad unary op
@@ -445,9 +462,22 @@ ERROR: node is still EOpNull!
0:8 'inF0' (in float)
0:8 Construct vec3 (in 3-component vector of float)
0:8 'inF1' (in float)
0:9 Function Call: D3DCOLORtoUBYTE4(vf4; (temp 4-component vector of int)
0:9 Construct vec4 (in 4-component vector of float)
0:9 'inF0' (in float)
0:9 Convert float to int (temp 4-component vector of int)
0:9 vector-scale (temp 4-component vector of float)
0:9 Constant:
0:9 255.001953
0:9 vector swizzle (temp 4-component vector of float)
0:9 Construct vec4 (in 4-component vector of float)
0:9 'inF0' (in float)
0:9 Sequence
0:9 Constant:
0:9 2 (const int)
0:9 Constant:
0:9 1 (const int)
0:9 Constant:
0:9 0 (const int)
0:9 Constant:
0:9 3 (const int)
0:10 Constant:
0:10 0.000000
0:12 ERROR: Bad unary op

View File

@@ -1,7 +1,7 @@
hlsl.load.basic.dx10.vert
Shader version: 450
0:? Sequence
0:47 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:47 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:47 Function Parameters:
0:? Sequence
0:51 textureFetch (temp 4-component vector of float)
@@ -195,7 +195,6 @@ Shader version: 450
0:69 0 (const int)
0:69 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'g_tTex1di4' (uniform itexture1D)
@@ -219,6 +218,7 @@ Shader version: 450
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4})
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
@@ -226,7 +226,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:47 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:47 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:47 Function Parameters:
0:? Sequence
0:51 textureFetch (temp 4-component vector of float)
@@ -420,7 +420,6 @@ Shader version: 450
0:69 0 (const int)
0:69 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'g_tTex1di4' (uniform itexture1D)
@@ -444,6 +443,7 @@ Shader version: 450
0:? 'g_tTexcdi4a' (uniform itextureCubeArray)
0:? 'g_tTexcdu4a' (uniform utextureCubeArray)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4})
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@@ -7,9 +7,9 @@ local_size = (4, 4, 2)
0:4 'tid' (in 3-component vector of uint)
0:9 Function Definition: main_aux1(vu3; (temp void)
0:9 Function Parameters:
0:9 'tid' (in 3-component vector of uint LocalInvocationID)
0:9 'tid' (in 3-component vector of uint GlobalInvocationID)
0:? Linker Objects
0:? 'tid' (in 3-component vector of uint LocalInvocationID)
0:? 'tid' (in 3-component vector of uint GlobalInvocationID)
Linked compute stage:
@@ -23,9 +23,9 @@ local_size = (4, 4, 2)
0:4 'tid' (in 3-component vector of uint)
0:9 Function Definition: main_aux1(vu3; (temp void)
0:9 Function Parameters:
0:9 'tid' (in 3-component vector of uint LocalInvocationID)
0:9 'tid' (in 3-component vector of uint GlobalInvocationID)
0:? Linker Objects
0:? 'tid' (in 3-component vector of uint LocalInvocationID)
0:? 'tid' (in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
// Generated by (magic number): 80001
@@ -40,7 +40,7 @@ local_size = (4, 4, 2)
Name 11 "main(vu3;"
Name 10 "tid"
Name 14 "tid"
Decorate 14(tid) BuiltIn LocalInvocationId
Decorate 14(tid) BuiltIn GlobalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@@ -0,0 +1,639 @@
hlsl.params.default.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:9 Function Definition: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:9 Function Parameters:
0:9 'p0' (in 4-component vector of int)
0:9 'b1' (in bool)
0:9 'b2' (in bool)
0:? Sequence
0:10 Branch: Return with expression
0:10 'p0' (in 4-component vector of int)
0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:17 Function Parameters:
0:17 'p0' (in 4-component vector of int)
0:17 'p1' (in 4-component vector of int)
0:17 'p2' (in 2-element array of int)
0:17 'p3' (in int)
0:? Sequence
0:18 Branch: Return with expression
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 'p0' (in 4-component vector of int)
0:18 'p1' (in 4-component vector of int)
0:18 direct index (temp int)
0:18 'p2' (in 2-element array of int)
0:18 Constant:
0:18 0 (const int)
0:18 'p3' (in int)
0:23 Function Definition: fn2(vi4;i1; (temp 4-component vector of int)
0:23 Function Parameters:
0:23 'p0' (in 4-component vector of int)
0:23 'x' (in int)
0:? Sequence
0:24 Branch: Return with expression
0:? Constant:
0:? 10 (const int)
0:? 11 (const int)
0:? 12 (const int)
0:? 13 (const int)
0:28 Function Definition: fn2(vi4;f1; (temp 4-component vector of int)
0:28 Function Parameters:
0:28 'p0' (in 4-component vector of int)
0:28 'x' (in float)
0:? Sequence
0:29 Branch: Return with expression
0:29 add (temp 4-component vector of int)
0:29 'p0' (in 4-component vector of int)
0:? Constant:
0:? 20 (const int)
0:? 21 (const int)
0:? 22 (const int)
0:? 23 (const int)
0:32 Function Definition: fn3(i1; (temp void)
0:32 Function Parameters:
0:32 'p0' (in int)
0:36 Function Definition: main( (temp 4-component vector of int)
0:36 Function Parameters:
0:? Sequence
0:37 Sequence
0:37 move second child to first child (temp 2-element array of int)
0:37 'myarray' (temp 2-element array of int)
0:37 Constant:
0:37 30 (const int)
0:37 31 (const int)
0:39 Function Call: fn3(i1; (temp void)
0:32 Constant:
0:32 3 (const int)
0:40 Function Call: fn3(i1; (temp void)
0:40 Constant:
0:40 5 (const int)
0:50 Sequence
0:50 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:49 add (temp 4-component vector of int)
0:47 add (temp 4-component vector of int)
0:46 add (temp 4-component vector of int)
0:45 add (temp 4-component vector of int)
0:44 add (temp 4-component vector of int)
0:43 add (temp 4-component vector of int)
0:42 add (temp 4-component vector of int)
0:42 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:42 Constant:
0:42 100 (const int)
0:42 100 (const int)
0:42 100 (const int)
0:42 100 (const int)
0:? Constant:
0:? -1 (const int)
0:? -2 (const int)
0:? -3 (const int)
0:? -4 (const int)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:43 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:43 Constant:
0:43 101 (const int)
0:43 101 (const int)
0:43 101 (const int)
0:43 101 (const int)
0:43 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:43 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:43 Constant:
0:43 0 (const uint)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:44 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:44 Constant:
0:44 102 (const int)
0:44 102 (const int)
0:44 102 (const int)
0:44 102 (const int)
0:44 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:44 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:44 Constant:
0:44 0 (const uint)
0:44 'myarray' (temp 2-element array of int)
0:16 Constant:
0:16 42 (const int)
0:45 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:45 Constant:
0:45 103 (const int)
0:45 103 (const int)
0:45 103 (const int)
0:45 103 (const int)
0:45 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:45 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:45 Constant:
0:45 0 (const uint)
0:45 'myarray' (temp 2-element array of int)
0:45 Constant:
0:45 99 (const int)
0:46 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:46 Constant:
0:46 104 (const int)
0:46 104 (const int)
0:46 104 (const int)
0:46 104 (const int)
0:46 Constant:
0:46 false (const bool)
0:9 Constant:
0:9 false (const bool)
0:47 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:47 Constant:
0:47 105 (const int)
0:47 105 (const int)
0:47 105 (const int)
0:47 105 (const int)
0:47 Constant:
0:47 false (const bool)
0:47 Constant:
0:47 true (const bool)
0:49 Function Call: fn2(vi4;f1; (temp 4-component vector of int)
0:49 Constant:
0:49 110 (const int)
0:49 110 (const int)
0:49 110 (const int)
0:49 110 (const int)
0:49 Constant:
0:49 11.110000
0:50 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:50 Constant:
0:50 111 (const int)
0:50 111 (const int)
0:50 111 (const int)
0:50 111 (const int)
0:50 Constant:
0:50 12 (const int)
0:50 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'cia' (const int)
0:? -4 (const int)
0:? 'cib' (const int)
0:? -42 (const int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:9 Function Definition: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:9 Function Parameters:
0:9 'p0' (in 4-component vector of int)
0:9 'b1' (in bool)
0:9 'b2' (in bool)
0:? Sequence
0:10 Branch: Return with expression
0:10 'p0' (in 4-component vector of int)
0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:17 Function Parameters:
0:17 'p0' (in 4-component vector of int)
0:17 'p1' (in 4-component vector of int)
0:17 'p2' (in 2-element array of int)
0:17 'p3' (in int)
0:? Sequence
0:18 Branch: Return with expression
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 'p0' (in 4-component vector of int)
0:18 'p1' (in 4-component vector of int)
0:18 direct index (temp int)
0:18 'p2' (in 2-element array of int)
0:18 Constant:
0:18 0 (const int)
0:18 'p3' (in int)
0:23 Function Definition: fn2(vi4;i1; (temp 4-component vector of int)
0:23 Function Parameters:
0:23 'p0' (in 4-component vector of int)
0:23 'x' (in int)
0:? Sequence
0:24 Branch: Return with expression
0:? Constant:
0:? 10 (const int)
0:? 11 (const int)
0:? 12 (const int)
0:? 13 (const int)
0:28 Function Definition: fn2(vi4;f1; (temp 4-component vector of int)
0:28 Function Parameters:
0:28 'p0' (in 4-component vector of int)
0:28 'x' (in float)
0:? Sequence
0:29 Branch: Return with expression
0:29 add (temp 4-component vector of int)
0:29 'p0' (in 4-component vector of int)
0:? Constant:
0:? 20 (const int)
0:? 21 (const int)
0:? 22 (const int)
0:? 23 (const int)
0:32 Function Definition: fn3(i1; (temp void)
0:32 Function Parameters:
0:32 'p0' (in int)
0:36 Function Definition: main( (temp 4-component vector of int)
0:36 Function Parameters:
0:? Sequence
0:37 Sequence
0:37 move second child to first child (temp 2-element array of int)
0:37 'myarray' (temp 2-element array of int)
0:37 Constant:
0:37 30 (const int)
0:37 31 (const int)
0:39 Function Call: fn3(i1; (temp void)
0:32 Constant:
0:32 3 (const int)
0:40 Function Call: fn3(i1; (temp void)
0:40 Constant:
0:40 5 (const int)
0:50 Sequence
0:50 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:49 add (temp 4-component vector of int)
0:47 add (temp 4-component vector of int)
0:46 add (temp 4-component vector of int)
0:45 add (temp 4-component vector of int)
0:44 add (temp 4-component vector of int)
0:43 add (temp 4-component vector of int)
0:42 add (temp 4-component vector of int)
0:42 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:42 Constant:
0:42 100 (const int)
0:42 100 (const int)
0:42 100 (const int)
0:42 100 (const int)
0:? Constant:
0:? -1 (const int)
0:? -2 (const int)
0:? -3 (const int)
0:? -4 (const int)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:43 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:43 Constant:
0:43 101 (const int)
0:43 101 (const int)
0:43 101 (const int)
0:43 101 (const int)
0:43 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:43 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:43 Constant:
0:43 0 (const uint)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:44 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:44 Constant:
0:44 102 (const int)
0:44 102 (const int)
0:44 102 (const int)
0:44 102 (const int)
0:44 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:44 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:44 Constant:
0:44 0 (const uint)
0:44 'myarray' (temp 2-element array of int)
0:16 Constant:
0:16 42 (const int)
0:45 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:45 Constant:
0:45 103 (const int)
0:45 103 (const int)
0:45 103 (const int)
0:45 103 (const int)
0:45 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:45 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
0:45 Constant:
0:45 0 (const uint)
0:45 'myarray' (temp 2-element array of int)
0:45 Constant:
0:45 99 (const int)
0:46 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:46 Constant:
0:46 104 (const int)
0:46 104 (const int)
0:46 104 (const int)
0:46 104 (const int)
0:46 Constant:
0:46 false (const bool)
0:9 Constant:
0:9 false (const bool)
0:47 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:47 Constant:
0:47 105 (const int)
0:47 105 (const int)
0:47 105 (const int)
0:47 105 (const int)
0:47 Constant:
0:47 false (const bool)
0:47 Constant:
0:47 true (const bool)
0:49 Function Call: fn2(vi4;f1; (temp 4-component vector of int)
0:49 Constant:
0:49 110 (const int)
0:49 110 (const int)
0:49 110 (const int)
0:49 110 (const int)
0:49 Constant:
0:49 11.110000
0:50 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:50 Constant:
0:50 111 (const int)
0:50 111 (const int)
0:50 111 (const int)
0:50 111 (const int)
0:50 Constant:
0:50 12 (const int)
0:50 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'cia' (const int)
0:? -4 (const int)
0:? 'cib' (const int)
0:? -42 (const int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 173
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 88
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 15 "fn1(vi4;b1;b1;"
Name 12 "p0"
Name 13 "b1"
Name 14 "b2"
Name 27 "fn1(vi4;vi4;i1[2];i1;"
Name 23 "p0"
Name 24 "p1"
Name 25 "p2"
Name 26 "p3"
Name 32 "fn2(vi4;i1;"
Name 30 "p0"
Name 31 "x"
Name 39 "fn2(vi4;f1;"
Name 37 "p0"
Name 38 "x"
Name 43 "fn3(i1;"
Name 42 "p0"
Name 77 "myarray"
Name 82 "param"
Name 85 "param"
Name 88 "@entryPointOutput"
Name 100 "param"
Name 101 "param"
Name 102 "param"
Name 103 "param"
Name 107 "$Global"
MemberName 107($Global) 0 "ui4"
Name 109 ""
Name 110 "param"
Name 111 "param"
Name 115 "param"
Name 116 "param"
Name 121 "param"
Name 122 "param"
Name 125 "param"
Name 127 "param"
Name 133 "param"
Name 134 "param"
Name 137 "param"
Name 139 "param"
Name 145 "param"
Name 146 "param"
Name 147 "param"
Name 153 "param"
Name 154 "param"
Name 155 "param"
Name 161 "param"
Name 162 "param"
Name 167 "param"
Name 168 "param"
Decorate 88(@entryPointOutput) Location 0
MemberDecorate 107($Global) 0 Offset 0
Decorate 107($Global) Block
Decorate 109 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeVector 6(int) 4
8: TypePointer Function 7(ivec4)
9: TypeBool
10: TypePointer Function 9(bool)
11: TypeFunction 7(ivec4) 8(ptr) 10(ptr) 10(ptr)
17: TypeInt 32 0
18: 17(int) Constant 2
19: TypeArray 6(int) 18
20: TypePointer Function 19
21: TypePointer Function 6(int)
22: TypeFunction 7(ivec4) 8(ptr) 8(ptr) 20(ptr) 21(ptr)
29: TypeFunction 7(ivec4) 8(ptr) 21(ptr)
34: TypeFloat 32
35: TypePointer Function 34(float)
36: TypeFunction 7(ivec4) 8(ptr) 35(ptr)
41: TypeFunction 2 21(ptr)
51: 6(int) Constant 0
61: 6(int) Constant 10
62: 6(int) Constant 11
63: 6(int) Constant 12
64: 6(int) Constant 13
65: 7(ivec4) ConstantComposite 61 62 63 64
69: 6(int) Constant 20
70: 6(int) Constant 21
71: 6(int) Constant 22
72: 6(int) Constant 23
73: 7(ivec4) ConstantComposite 69 70 71 72
78: 6(int) Constant 30
79: 6(int) Constant 31
80: 19 ConstantComposite 78 79
81: 6(int) Constant 3
84: 6(int) Constant 5
87: TypePointer Output 7(ivec4)
88(@entryPointOutput): 87(ptr) Variable Output
89: 6(int) Constant 100
90: 7(ivec4) ConstantComposite 89 89 89 89
91: 6(int) Constant 4294967295
92: 6(int) Constant 4294967294
93: 6(int) Constant 4294967293
94: 6(int) Constant 4294967292
95: 7(ivec4) ConstantComposite 91 92 93 94
96: 6(int) Constant 1
97: 6(int) Constant 2
98: 19 ConstantComposite 96 97
99: 6(int) Constant 42
105: 6(int) Constant 101
106: 7(ivec4) ConstantComposite 105 105 105 105
107($Global): TypeStruct 7(ivec4)
108: TypePointer Uniform 107($Global)
109: 108(ptr) Variable Uniform
112: TypePointer Uniform 7(ivec4)
119: 6(int) Constant 102
120: 7(ivec4) ConstantComposite 119 119 119 119
130: 6(int) Constant 103
131: 7(ivec4) ConstantComposite 130 130 130 130
132: 6(int) Constant 99
142: 6(int) Constant 104
143: 7(ivec4) ConstantComposite 142 142 142 142
144: 9(bool) ConstantFalse
150: 6(int) Constant 105
151: 7(ivec4) ConstantComposite 150 150 150 150
152: 9(bool) ConstantTrue
158: 6(int) Constant 110
159: 7(ivec4) ConstantComposite 158 158 158 158
160: 34(float) Constant 1093780111
165: 6(int) Constant 111
166: 7(ivec4) ConstantComposite 165 165 165 165
172: 6(int) Constant 4294967254
4(main): 2 Function None 3
5: Label
77(myarray): 20(ptr) Variable Function
82(param): 21(ptr) Variable Function
85(param): 21(ptr) Variable Function
100(param): 8(ptr) Variable Function
101(param): 8(ptr) Variable Function
102(param): 20(ptr) Variable Function
103(param): 21(ptr) Variable Function
110(param): 8(ptr) Variable Function
111(param): 8(ptr) Variable Function
115(param): 20(ptr) Variable Function
116(param): 21(ptr) Variable Function
121(param): 8(ptr) Variable Function
122(param): 8(ptr) Variable Function
125(param): 20(ptr) Variable Function
127(param): 21(ptr) Variable Function
133(param): 8(ptr) Variable Function
134(param): 8(ptr) Variable Function
137(param): 20(ptr) Variable Function
139(param): 21(ptr) Variable Function
145(param): 8(ptr) Variable Function
146(param): 10(ptr) Variable Function
147(param): 10(ptr) Variable Function
153(param): 8(ptr) Variable Function
154(param): 10(ptr) Variable Function
155(param): 10(ptr) Variable Function
161(param): 8(ptr) Variable Function
162(param): 35(ptr) Variable Function
167(param): 8(ptr) Variable Function
168(param): 21(ptr) Variable Function
Store 77(myarray) 80
Store 82(param) 81
83: 2 FunctionCall 43(fn3(i1;) 82(param)
Store 85(param) 84
86: 2 FunctionCall 43(fn3(i1;) 85(param)
Store 100(param) 90
Store 101(param) 95
Store 102(param) 98
Store 103(param) 99
104: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 100(param) 101(param) 102(param) 103(param)
Store 110(param) 106
113: 112(ptr) AccessChain 109 51
114: 7(ivec4) Load 113
Store 111(param) 114
Store 115(param) 98
Store 116(param) 99
117: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 110(param) 111(param) 115(param) 116(param)
118: 7(ivec4) IAdd 104 117
Store 121(param) 120
123: 112(ptr) AccessChain 109 51
124: 7(ivec4) Load 123
Store 122(param) 124
126: 19 Load 77(myarray)
Store 125(param) 126
Store 127(param) 99
128: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 121(param) 122(param) 125(param) 127(param)
129: 7(ivec4) IAdd 118 128
Store 133(param) 131
135: 112(ptr) AccessChain 109 51
136: 7(ivec4) Load 135
Store 134(param) 136
138: 19 Load 77(myarray)
Store 137(param) 138
Store 139(param) 132
140: 7(ivec4) FunctionCall 27(fn1(vi4;vi4;i1[2];i1;) 133(param) 134(param) 137(param) 139(param)
141: 7(ivec4) IAdd 129 140
Store 145(param) 143
Store 146(param) 144
Store 147(param) 144
148: 7(ivec4) FunctionCall 15(fn1(vi4;b1;b1;) 145(param) 146(param) 147(param)
149: 7(ivec4) IAdd 141 148
Store 153(param) 151
Store 154(param) 144
Store 155(param) 152
156: 7(ivec4) FunctionCall 15(fn1(vi4;b1;b1;) 153(param) 154(param) 155(param)
157: 7(ivec4) IAdd 149 156
Store 161(param) 159
Store 162(param) 160
163: 7(ivec4) FunctionCall 39(fn2(vi4;f1;) 161(param) 162(param)
164: 7(ivec4) IAdd 157 163
Store 167(param) 166
Store 168(param) 63
169: 7(ivec4) FunctionCall 32(fn2(vi4;i1;) 167(param) 168(param)
170: 7(ivec4) IAdd 164 169
Store 88(@entryPointOutput) 170
Return
FunctionEnd
15(fn1(vi4;b1;b1;): 7(ivec4) Function None 11
12(p0): 8(ptr) FunctionParameter
13(b1): 10(ptr) FunctionParameter
14(b2): 10(ptr) FunctionParameter
16: Label
45: 7(ivec4) Load 12(p0)
ReturnValue 45
FunctionEnd
27(fn1(vi4;vi4;i1[2];i1;): 7(ivec4) Function None 22
23(p0): 8(ptr) FunctionParameter
24(p1): 8(ptr) FunctionParameter
25(p2): 20(ptr) FunctionParameter
26(p3): 21(ptr) FunctionParameter
28: Label
48: 7(ivec4) Load 23(p0)
49: 7(ivec4) Load 24(p1)
50: 7(ivec4) IAdd 48 49
52: 21(ptr) AccessChain 25(p2) 51
53: 6(int) Load 52
54: 7(ivec4) CompositeConstruct 53 53 53 53
55: 7(ivec4) IAdd 50 54
56: 6(int) Load 26(p3)
57: 7(ivec4) CompositeConstruct 56 56 56 56
58: 7(ivec4) IAdd 55 57
ReturnValue 58
FunctionEnd
32(fn2(vi4;i1;): 7(ivec4) Function None 29
30(p0): 8(ptr) FunctionParameter
31(x): 21(ptr) FunctionParameter
33: Label
ReturnValue 65
FunctionEnd
39(fn2(vi4;f1;): 7(ivec4) Function None 36
37(p0): 8(ptr) FunctionParameter
38(x): 35(ptr) FunctionParameter
40: Label
68: 7(ivec4) Load 37(p0)
74: 7(ivec4) IAdd 68 73
ReturnValue 74
FunctionEnd
43(fn3(i1;): 2 Function None 41
42(p0): 21(ptr) FunctionParameter
44: Label
Return
FunctionEnd

View File

@@ -0,0 +1,379 @@
hlsl.params.default.negative.frag
ERROR: 0:27: '' : invalid default parameter value
ERROR: 0:32: 'p1' : invalid parameter after default value parameters
ERROR: 0:40: 'fn1' : ambiguous best function under implicit type conversion
ERROR: 0:47: 'fn2' : ambiguous best function under implicit type conversion
ERROR: 4 compilation errors. No code generated.
Shader version: 450
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
0:7 Function Definition: fn1(vi4; (temp 4-component vector of int)
0:7 Function Parameters:
0:7 'p0' (in 4-component vector of int)
0:? Sequence
0:7 Branch: Return with expression
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:9 Function Definition: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:9 Function Parameters:
0:9 'p0' (in 4-component vector of int)
0:9 'b1' (in bool)
0:9 'b2' (in bool)
0:? Sequence
0:10 Branch: Return with expression
0:10 'p0' (in 4-component vector of int)
0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:17 Function Parameters:
0:17 'p0' (in 4-component vector of int)
0:17 'p1' (in 4-component vector of int)
0:17 'p2' (in 2-element array of int)
0:17 'p3' (in int)
0:? Sequence
0:18 Branch: Return with expression
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 'p0' (in 4-component vector of int)
0:18 'p1' (in 4-component vector of int)
0:18 direct index (temp int)
0:18 'p2' (in 2-element array of int)
0:18 Constant:
0:18 0 (const int)
0:18 'p3' (in int)
0:23 Function Definition: fn2(vi4;i1; (temp 4-component vector of int)
0:23 Function Parameters:
0:23 'p0' (in 4-component vector of int)
0:23 'x' (in int)
0:? Sequence
0:24 Branch: Return with expression
0:? Constant:
0:? 10 (const int)
0:? 11 (const int)
0:? 12 (const int)
0:? 13 (const int)
0:28 Function Definition: fn2(vi4; (temp 4-component vector of int)
0:28 Function Parameters:
0:28 'p0' (in 4-component vector of int)
0:? Sequence
0:29 Branch: Return with expression
0:29 add (temp 4-component vector of int)
0:29 'p0' (in 4-component vector of int)
0:? Constant:
0:? 20 (const int)
0:? 21 (const int)
0:? 22 (const int)
0:? 23 (const int)
0:33 Function Definition: fn3(i1; (temp void)
0:33 Function Parameters:
0:33 'p0' (in int)
0:37 Function Definition: main( (temp 4-component vector of int)
0:37 Function Parameters:
0:? Sequence
0:38 Sequence
0:38 move second child to first child (temp 2-element array of int)
0:38 'myarray' (temp 2-element array of int)
0:38 Constant:
0:38 30 (const int)
0:38 31 (const int)
0:49 Sequence
0:49 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:48 add (temp 4-component vector of int)
0:47 add (temp 4-component vector of int)
0:45 add (temp 4-component vector of int)
0:44 add (temp 4-component vector of int)
0:43 add (temp 4-component vector of int)
0:42 add (temp 4-component vector of int)
0:41 add (temp 4-component vector of int)
0:40 add (temp 4-component vector of int)
0:40 Function Call: fn1(vi4; (temp 4-component vector of int)
0:40 Constant:
0:40 100 (const int)
0:40 100 (const int)
0:40 100 (const int)
0:40 100 (const int)
0:41 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:41 Constant:
0:41 101 (const int)
0:41 101 (const int)
0:41 101 (const int)
0:41 101 (const int)
0:41 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:41 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:41 Constant:
0:41 0 (const uint)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:42 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:42 Constant:
0:42 102 (const int)
0:42 102 (const int)
0:42 102 (const int)
0:42 102 (const int)
0:42 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:42 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:42 Constant:
0:42 0 (const uint)
0:42 'myarray' (temp 2-element array of int)
0:16 Constant:
0:16 42 (const int)
0:43 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:43 Constant:
0:43 103 (const int)
0:43 103 (const int)
0:43 103 (const int)
0:43 103 (const int)
0:43 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:43 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:43 Constant:
0:43 0 (const uint)
0:43 'myarray' (temp 2-element array of int)
0:43 Constant:
0:43 99 (const int)
0:44 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:44 Constant:
0:44 104 (const int)
0:44 104 (const int)
0:44 104 (const int)
0:44 104 (const int)
0:44 Constant:
0:44 false (const bool)
0:9 Constant:
0:9 false (const bool)
0:45 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:45 Constant:
0:45 105 (const int)
0:45 105 (const int)
0:45 105 (const int)
0:45 105 (const int)
0:45 Constant:
0:45 false (const bool)
0:45 Constant:
0:45 true (const bool)
0:47 Function Call: fn2(vi4; (temp 4-component vector of int)
0:47 Constant:
0:47 112 (const int)
0:47 112 (const int)
0:47 112 (const int)
0:47 112 (const int)
0:48 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:48 Constant:
0:48 110 (const int)
0:48 110 (const int)
0:48 110 (const int)
0:48 110 (const int)
0:48 Constant:
0:48 11 (const int)
0:49 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:49 Constant:
0:49 111 (const int)
0:49 111 (const int)
0:49 111 (const int)
0:49 111 (const int)
0:49 Constant:
0:49 12 (const int)
0:49 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'cia' (const int)
0:? -4 (const int)
0:? 'cib' (const int)
0:? -42 (const int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
0:7 Function Definition: fn1(vi4; (temp 4-component vector of int)
0:7 Function Parameters:
0:7 'p0' (in 4-component vector of int)
0:? Sequence
0:7 Branch: Return with expression
0:? Constant:
0:? 1 (const int)
0:? 2 (const int)
0:? 3 (const int)
0:? 4 (const int)
0:9 Function Definition: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:9 Function Parameters:
0:9 'p0' (in 4-component vector of int)
0:9 'b1' (in bool)
0:9 'b2' (in bool)
0:? Sequence
0:10 Branch: Return with expression
0:10 'p0' (in 4-component vector of int)
0:17 Function Definition: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:17 Function Parameters:
0:17 'p0' (in 4-component vector of int)
0:17 'p1' (in 4-component vector of int)
0:17 'p2' (in 2-element array of int)
0:17 'p3' (in int)
0:? Sequence
0:18 Branch: Return with expression
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 add (temp 4-component vector of int)
0:18 'p0' (in 4-component vector of int)
0:18 'p1' (in 4-component vector of int)
0:18 direct index (temp int)
0:18 'p2' (in 2-element array of int)
0:18 Constant:
0:18 0 (const int)
0:18 'p3' (in int)
0:23 Function Definition: fn2(vi4;i1; (temp 4-component vector of int)
0:23 Function Parameters:
0:23 'p0' (in 4-component vector of int)
0:23 'x' (in int)
0:? Sequence
0:24 Branch: Return with expression
0:? Constant:
0:? 10 (const int)
0:? 11 (const int)
0:? 12 (const int)
0:? 13 (const int)
0:28 Function Definition: fn2(vi4; (temp 4-component vector of int)
0:28 Function Parameters:
0:28 'p0' (in 4-component vector of int)
0:? Sequence
0:29 Branch: Return with expression
0:29 add (temp 4-component vector of int)
0:29 'p0' (in 4-component vector of int)
0:? Constant:
0:? 20 (const int)
0:? 21 (const int)
0:? 22 (const int)
0:? 23 (const int)
0:33 Function Definition: fn3(i1; (temp void)
0:33 Function Parameters:
0:33 'p0' (in int)
0:37 Function Definition: main( (temp 4-component vector of int)
0:37 Function Parameters:
0:? Sequence
0:38 Sequence
0:38 move second child to first child (temp 2-element array of int)
0:38 'myarray' (temp 2-element array of int)
0:38 Constant:
0:38 30 (const int)
0:38 31 (const int)
0:49 Sequence
0:49 move second child to first child (temp 4-component vector of int)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:48 add (temp 4-component vector of int)
0:47 add (temp 4-component vector of int)
0:45 add (temp 4-component vector of int)
0:44 add (temp 4-component vector of int)
0:43 add (temp 4-component vector of int)
0:42 add (temp 4-component vector of int)
0:41 add (temp 4-component vector of int)
0:40 add (temp 4-component vector of int)
0:40 Function Call: fn1(vi4; (temp 4-component vector of int)
0:40 Constant:
0:40 100 (const int)
0:40 100 (const int)
0:40 100 (const int)
0:40 100 (const int)
0:41 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:41 Constant:
0:41 101 (const int)
0:41 101 (const int)
0:41 101 (const int)
0:41 101 (const int)
0:41 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:41 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:41 Constant:
0:41 0 (const uint)
0:15 Constant:
0:15 1 (const int)
0:15 2 (const int)
0:16 Constant:
0:16 42 (const int)
0:42 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:42 Constant:
0:42 102 (const int)
0:42 102 (const int)
0:42 102 (const int)
0:42 102 (const int)
0:42 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:42 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:42 Constant:
0:42 0 (const uint)
0:42 'myarray' (temp 2-element array of int)
0:16 Constant:
0:16 42 (const int)
0:43 Function Call: fn1(vi4;vi4;i1[2];i1; (temp 4-component vector of int)
0:43 Constant:
0:43 103 (const int)
0:43 103 (const int)
0:43 103 (const int)
0:43 103 (const int)
0:43 ui4: direct index for structure (layout(offset=0 ) uniform 4-component vector of int)
0:43 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
0:43 Constant:
0:43 0 (const uint)
0:43 'myarray' (temp 2-element array of int)
0:43 Constant:
0:43 99 (const int)
0:44 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:44 Constant:
0:44 104 (const int)
0:44 104 (const int)
0:44 104 (const int)
0:44 104 (const int)
0:44 Constant:
0:44 false (const bool)
0:9 Constant:
0:9 false (const bool)
0:45 Function Call: fn1(vi4;b1;b1; (temp 4-component vector of int)
0:45 Constant:
0:45 105 (const int)
0:45 105 (const int)
0:45 105 (const int)
0:45 105 (const int)
0:45 Constant:
0:45 false (const bool)
0:45 Constant:
0:45 true (const bool)
0:47 Function Call: fn2(vi4; (temp 4-component vector of int)
0:47 Constant:
0:47 112 (const int)
0:47 112 (const int)
0:47 112 (const int)
0:47 112 (const int)
0:48 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:48 Constant:
0:48 110 (const int)
0:48 110 (const int)
0:48 110 (const int)
0:48 110 (const int)
0:48 Constant:
0:48 11 (const int)
0:49 Function Call: fn2(vi4;i1; (temp 4-component vector of int)
0:49 Constant:
0:49 111 (const int)
0:49 111 (const int)
0:49 111 (const int)
0:49 111 (const int)
0:49 Constant:
0:49 12 (const int)
0:49 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of int)
0:? 'cia' (const int)
0:? -4 (const int)
0:? 'cib' (const int)
0:? -42 (const int)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of int ui4, layout(offset=16 ) uniform float ufvar})
SPIR-V is not generated for failed compile or link

View File

@@ -1,4 +1,7 @@
hlsl.partialInit.frag
WARNING: 0:35: 'cgf2a' : variable with qualifier 'const' not initialized; zero initializing
WARNING: 0:36: 'ci' : variable with qualifier 'const' not initialized; zero initializing
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
@@ -109,32 +112,64 @@ gl_FragCoord origin is upper left
0:26 0.000000
0:26 false (const bool)
0:28 Sequence
0:28 Sequence
0:28 move second child to first child (temp int)
0:28 move second child to first child (temp 4-element array of 2-component vector of float)
0:28 'gf2a' (temp 4-element array of 2-component vector of float)
0:28 Constant:
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:29 Sequence
0:29 move second child to first child (temp int)
0:29 'cgi' (temp int)
0:29 Constant:
0:29 0 (const int)
0:30 move second child to first child (temp float)
0:30 b: direct index for structure (temp float)
0:30 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:30 Constant:
0:30 1 (const int)
0:30 component-wise multiply (temp float)
0:30 direct index (temp float)
0:30 direct index (temp 2-component vector of float)
0:30 'gf2a' (temp 4-element array of 2-component vector of float)
0:30 Constant:
0:30 2 (const int)
0:30 Constant:
0:30 1 (const int)
0:30 Convert int to float (temp float)
0:30 'cgi' (temp int)
0:32 Sequence
0:32 Sequence
0:32 move second child to first child (temp int)
0:? 'a' (layout(location=0 ) out int)
0:28 a: direct index for structure (temp int)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 0 (const int)
0:28 move second child to first child (temp float)
0:32 a: direct index for structure (temp int)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 0 (const int)
0:32 move second child to first child (temp float)
0:? 'b' (layout(location=1 ) out float)
0:28 b: direct index for structure (temp float)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 1 (const int)
0:28 move second child to first child (temp bool)
0:32 b: direct index for structure (temp float)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 1 (const int)
0:32 move second child to first child (temp bool)
0:? 'c' (layout(location=2 ) out bool)
0:28 c: direct index for structure (temp bool)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 2 (const int)
0:28 move second child to first child (temp 4-component vector of float)
0:32 c: direct index for structure (temp bool)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 2 (const int)
0:32 move second child to first child (temp 4-component vector of float)
0:? 'v' (layout(location=3 ) out 4-component vector of float)
0:28 v: direct index for structure (temp 4-component vector of float)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 3 (const int)
0:28 Branch: Return
0:32 v: direct index for structure (temp 4-component vector of float)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 3 (const int)
0:32 Branch: Return
0:? Linker Objects
0:? 'a' (layout(location=0 ) out int)
0:? 'b' (layout(location=1 ) out float)
@@ -143,6 +178,15 @@ gl_FragCoord origin is upper left
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 'gv' (global 4-component vector of float)
0:? 'gfa' (global 3-element array of float)
0:? 'cgf2a' (const 3-element array of 2-component vector of float)
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 'ci' (const int)
0:? 0 (const int)
Linked fragment stage:
@@ -258,32 +302,64 @@ gl_FragCoord origin is upper left
0:26 0.000000
0:26 false (const bool)
0:28 Sequence
0:28 Sequence
0:28 move second child to first child (temp int)
0:28 move second child to first child (temp 4-element array of 2-component vector of float)
0:28 'gf2a' (temp 4-element array of 2-component vector of float)
0:28 Constant:
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:28 0.000000
0:29 Sequence
0:29 move second child to first child (temp int)
0:29 'cgi' (temp int)
0:29 Constant:
0:29 0 (const int)
0:30 move second child to first child (temp float)
0:30 b: direct index for structure (temp float)
0:30 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:30 Constant:
0:30 1 (const int)
0:30 component-wise multiply (temp float)
0:30 direct index (temp float)
0:30 direct index (temp 2-component vector of float)
0:30 'gf2a' (temp 4-element array of 2-component vector of float)
0:30 Constant:
0:30 2 (const int)
0:30 Constant:
0:30 1 (const int)
0:30 Convert int to float (temp float)
0:30 'cgi' (temp int)
0:32 Sequence
0:32 Sequence
0:32 move second child to first child (temp int)
0:? 'a' (layout(location=0 ) out int)
0:28 a: direct index for structure (temp int)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 0 (const int)
0:28 move second child to first child (temp float)
0:32 a: direct index for structure (temp int)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 0 (const int)
0:32 move second child to first child (temp float)
0:? 'b' (layout(location=1 ) out float)
0:28 b: direct index for structure (temp float)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 1 (const int)
0:28 move second child to first child (temp bool)
0:32 b: direct index for structure (temp float)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 1 (const int)
0:32 move second child to first child (temp bool)
0:? 'c' (layout(location=2 ) out bool)
0:28 c: direct index for structure (temp bool)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 2 (const int)
0:28 move second child to first child (temp 4-component vector of float)
0:32 c: direct index for structure (temp bool)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 2 (const int)
0:32 move second child to first child (temp 4-component vector of float)
0:? 'v' (layout(location=3 ) out 4-component vector of float)
0:28 v: direct index for structure (temp 4-component vector of float)
0:28 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:28 Constant:
0:28 3 (const int)
0:28 Branch: Return
0:32 v: direct index for structure (temp 4-component vector of float)
0:32 'o4' (temp structure{temp int a, temp float b, temp bool c, temp 4-component vector of float v})
0:32 Constant:
0:32 3 (const int)
0:32 Branch: Return
0:? Linker Objects
0:? 'a' (layout(location=0 ) out int)
0:? 'b' (layout(location=1 ) out float)
@@ -292,15 +368,24 @@ gl_FragCoord origin is upper left
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 'gv' (global 4-component vector of float)
0:? 'gfa' (global 3-element array of float)
0:? 'cgf2a' (const 3-element array of 2-component vector of float)
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 'ci' (const int)
0:? 0 (const int)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 75
// Id's are bound by 92
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 54 59 65 69 74
EntryPoint Fragment 4 "PixelShaderFunction" 72 76 80 84 89
ExecutionMode 4 OriginUpperLeft
Name 4 "PixelShaderFunction"
Name 9 "gv"
@@ -319,16 +404,18 @@ gl_FragCoord origin is upper left
MemberName 47(Nest) 1 "os"
MemberName 47(Nest) 2 "b"
Name 49 "nest"
Name 54 "a"
Name 59 "b"
Name 65 "c"
Name 69 "v"
Name 74 "input"
Decorate 54(a) Location 0
Decorate 59(b) Location 1
Decorate 65(c) Location 2
Decorate 69(v) Location 3
Decorate 74(input) Location 0
Name 57 "gf2a"
Name 61 "cgi"
Name 72 "a"
Name 76 "b"
Name 80 "c"
Name 84 "v"
Name 89 "input"
Decorate 72(a) Location 0
Decorate 76(b) Location 1
Decorate 80(c) Location 2
Decorate 84(v) Location 3
Decorate 89(input) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -365,19 +452,28 @@ gl_FragCoord origin is upper left
50: 45(fvec3) ConstantComposite 10 10 10
51: 46 ConstantComposite 50 50 50 50
52: 47(Nest) ConstantComposite 51 39 25
53: TypePointer Output 19(int)
54(a): 53(ptr) Variable Output
55: TypePointer Function 19(int)
58: TypePointer Output 6(float)
59(b): 58(ptr) Variable Output
60: 19(int) Constant 1
61: TypePointer Function 6(float)
64: TypePointer Output 20(bool)
65(c): 64(ptr) Variable Output
68: TypePointer Output 7(fvec4)
69(v): 68(ptr) Variable Output
73: TypePointer Input 7(fvec4)
74(input): 73(ptr) Variable Input
53: TypeVector 6(float) 2
54: 13(int) Constant 4
55: TypeArray 53(fvec2) 54
56: TypePointer Function 55
58: 53(fvec2) ConstantComposite 10 10
59: 55 ConstantComposite 58 58 58 58
60: TypePointer Function 19(int)
62: 19(int) Constant 1
63: 13(int) Constant 1
64: TypePointer Function 6(float)
71: TypePointer Output 19(int)
72(a): 71(ptr) Variable Output
75: TypePointer Output 6(float)
76(b): 75(ptr) Variable Output
79: TypePointer Output 20(bool)
80(c): 79(ptr) Variable Output
83: TypePointer Output 7(fvec4)
84(v): 83(ptr) Variable Output
88: TypePointer Input 7(fvec4)
89(input): 88(ptr) Variable Input
90: TypeArray 53(fvec2) 14
91: 90 ConstantComposite 58 58 58
4(PixelShaderFunction): 2 Function None 3
5: Label
23(o2): 22(ptr) Variable Function
@@ -385,6 +481,8 @@ gl_FragCoord origin is upper left
37(o1): 22(ptr) Variable Function
40(o3): 22(ptr) Variable Function
49(nest): 48(ptr) Variable Function
57(gf2a): 56(ptr) Variable Function
61(cgi): 60(ptr) Variable Function
Store 9(gv) 12
Store 17(gfa) 18
Store 23(o2) 27
@@ -402,17 +500,26 @@ gl_FragCoord origin is upper left
44: 41(ptr) AccessChain 28(o4) 30
Store 44 43
Store 49(nest) 52
56: 55(ptr) AccessChain 28(o4) 38
57: 19(int) Load 56
Store 54(a) 57
62: 61(ptr) AccessChain 28(o4) 60
63: 6(float) Load 62
Store 59(b) 63
66: 41(ptr) AccessChain 28(o4) 30
67: 20(bool) Load 66
Store 65(c) 67
70: 35(ptr) AccessChain 28(o4) 24
71: 7(fvec4) Load 70
Store 69(v) 71
Store 57(gf2a) 59
Store 61(cgi) 38
65: 64(ptr) AccessChain 57(gf2a) 30 63
66: 6(float) Load 65
67: 19(int) Load 61(cgi)
68: 6(float) ConvertSToF 67
69: 6(float) FMul 66 68
70: 64(ptr) AccessChain 28(o4) 62
Store 70 69
73: 60(ptr) AccessChain 28(o4) 38
74: 19(int) Load 73
Store 72(a) 74
77: 64(ptr) AccessChain 28(o4) 62
78: 6(float) Load 77
Store 76(b) 78
81: 41(ptr) AccessChain 28(o4) 30
82: 20(bool) Load 81
Store 80(c) 82
85: 35(ptr) AccessChain 28(o4) 24
86: 7(fvec4) Load 85
Store 84(v) 86
Return
FunctionEnd

View File

@@ -1,7 +1,7 @@
hlsl.samplegrad.basic.dx10.vert
Shader version: 450
0:? Sequence
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:27 Function Parameters:
0:? Sequence
0:30 Sequence
@@ -225,7 +225,6 @@ Shader version: 450
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -240,6 +239,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
@@ -247,7 +247,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:27 Function Parameters:
0:? Sequence
0:30 Sequence
@@ -471,7 +471,6 @@ Shader version: 450
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -486,6 +485,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@@ -1,7 +1,7 @@
hlsl.samplelevel.basic.dx10.vert
Shader version: 450
0:? Sequence
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:27 Function Parameters:
0:? Sequence
0:30 Sequence
@@ -171,7 +171,6 @@ Shader version: 450
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -186,6 +185,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
@@ -193,7 +193,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Pos})
0:27 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:27 Function Parameters:
0:? Sequence
0:30 Sequence
@@ -363,7 +363,6 @@ Shader version: 450
0:48 0 (const int)
0:48 Branch: Return
0:? Linker Objects
0:? 'Pos' (out 4-component vector of float Position)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@@ -378,6 +377,7 @@ Shader version: 450
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001

View File

@@ -9,7 +9,7 @@ gl_FragCoord origin is upper left
0:34 Function Definition: PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; (temp 4-component vector of float)
0:34 Function Parameters:
0:34 'input' (layout(location=0 ) in 4-component vector of float)
0:34 's' (in structure{temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4})
0:34 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? Sequence
0:39 Compare Equal (temp bool)
0:39 's3' (temp structure{temp 3-component vector of bool b3})
@@ -19,7 +19,10 @@ gl_FragCoord origin is upper left
0:40 's2' (global structure{temp 4-component vector of float i})
0:40 Constant:
0:40 0 (const int)
0:? 'ff4' (layout(location=7 binding=0 offset=4 ) in 4-component vector of float)
0:40 ff4: direct index for structure (layout(binding=0 offset=4 ) temp 4-component vector of float)
0:40 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:40 Constant:
0:40 7 (const int)
0:42 Sequence
0:42 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
@@ -28,14 +31,7 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 'a' (layout(location=1 ) smooth in 4-component vector of float)
0:? 'b' (layout(location=2 ) flat in bool)
0:? 'c' (layout(location=3 ) centroid noperspective in 1-component vector of float)
0:? 'd' (layout(location=4 ) centroid sample in 2-component vector of float)
0:? 'ff1' (in bool Face)
0:? 'ff2' (layout(location=5 offset=4 ) in bool)
0:? 'ff3' (layout(location=6 binding=0 offset=4 ) in bool)
0:? 'ff4' (layout(location=7 binding=0 offset=4 ) in 4-component vector of float)
0:? 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? 's2' (global structure{temp 4-component vector of float i})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(binding=5 offset=1620 ) uniform float ff5, layout(binding=8 offset=1636 ) uniform float ff6})
@@ -49,7 +45,7 @@ gl_FragCoord origin is upper left
0:34 Function Definition: PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; (temp 4-component vector of float)
0:34 Function Parameters:
0:34 'input' (layout(location=0 ) in 4-component vector of float)
0:34 's' (in structure{temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4})
0:34 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? Sequence
0:39 Compare Equal (temp bool)
0:39 's3' (temp structure{temp 3-component vector of bool b3})
@@ -59,7 +55,10 @@ gl_FragCoord origin is upper left
0:40 's2' (global structure{temp 4-component vector of float i})
0:40 Constant:
0:40 0 (const int)
0:? 'ff4' (layout(location=7 binding=0 offset=4 ) in 4-component vector of float)
0:40 ff4: direct index for structure (layout(binding=0 offset=4 ) temp 4-component vector of float)
0:40 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:40 Constant:
0:40 7 (const int)
0:42 Sequence
0:42 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
@@ -68,25 +67,18 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 'a' (layout(location=1 ) smooth in 4-component vector of float)
0:? 'b' (layout(location=2 ) flat in bool)
0:? 'c' (layout(location=3 ) centroid noperspective in 1-component vector of float)
0:? 'd' (layout(location=4 ) centroid sample in 2-component vector of float)
0:? 'ff1' (in bool Face)
0:? 'ff2' (layout(location=5 offset=4 ) in bool)
0:? 'ff3' (layout(location=6 binding=0 offset=4 ) in bool)
0:? 'ff4' (layout(location=7 binding=0 offset=4 ) in 4-component vector of float)
0:? 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, temp bool Face ff1, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? 's2' (global structure{temp 4-component vector of float i})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(binding=5 offset=1620 ) uniform float ff5, layout(binding=8 offset=1636 ) uniform float ff6})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 50
// Id's are bound by 44
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 25 30 31 34 36 38 41 42 43 44
EntryPoint Fragment 4 "PixelShaderFunction" 27 35 36
ExecutionMode 4 OriginUpperLeft
Name 4 "PixelShaderFunction"
Name 8 "FS"
@@ -95,54 +87,41 @@ gl_FragCoord origin is upper left
Name 19 ""
MemberName 19 0 "i"
Name 21 "s2"
Name 25 "ff4"
Name 30 "@entryPointOutput"
Name 31 "input"
Name 34 "a"
Name 36 "b"
Name 38 "c"
Name 41 "d"
Name 42 "ff1"
Name 43 "ff2"
Name 44 "ff3"
Name 46 "myS"
MemberName 46(myS) 0 "b"
MemberName 46(myS) 1 "c"
MemberName 46(myS) 2 "a"
MemberName 46(myS) 3 "d"
Name 47 "$Global"
MemberName 47($Global) 0 "s1"
MemberName 47($Global) 1 "ff5"
MemberName 47($Global) 2 "ff6"
Name 49 ""
Decorate 25(ff4) Offset 4
Decorate 25(ff4) Location 7
Decorate 25(ff4) Binding 0
Decorate 30(@entryPointOutput) Location 0
Decorate 31(input) Location 0
Decorate 34(a) Location 1
Decorate 36(b) Flat
Decorate 36(b) Location 2
Decorate 38(c) NoPerspective
Decorate 38(c) Centroid
Decorate 38(c) Location 3
Decorate 41(d) Centroid
Decorate 41(d) Location 4
Decorate 42(ff1) BuiltIn FrontFacing
Decorate 43(ff2) Offset 4
Decorate 43(ff2) Location 5
Decorate 44(ff3) Offset 4
Decorate 44(ff3) Location 6
Decorate 44(ff3) Binding 0
MemberDecorate 46(myS) 0 Offset 0
MemberDecorate 46(myS) 1 Offset 4
MemberDecorate 46(myS) 2 Offset 16
MemberDecorate 46(myS) 3 Offset 32
MemberDecorate 47($Global) 0 Offset 0
MemberDecorate 47($Global) 1 Offset 1620
MemberDecorate 47($Global) 2 Offset 1636
Decorate 47($Global) Block
Decorate 49 DescriptorSet 0
Name 25 "IN_S"
MemberName 25(IN_S) 0 "a"
MemberName 25(IN_S) 1 "b"
MemberName 25(IN_S) 2 "c"
MemberName 25(IN_S) 3 "d"
MemberName 25(IN_S) 4 "ff1"
MemberName 25(IN_S) 5 "ff2"
MemberName 25(IN_S) 6 "ff3"
MemberName 25(IN_S) 7 "ff4"
Name 27 "s"
Name 35 "@entryPointOutput"
Name 36 "input"
Name 40 "myS"
MemberName 40(myS) 0 "b"
MemberName 40(myS) 1 "c"
MemberName 40(myS) 2 "a"
MemberName 40(myS) 3 "d"
Name 41 "$Global"
MemberName 41($Global) 0 "s1"
MemberName 41($Global) 1 "ff5"
MemberName 41($Global) 2 "ff6"
Name 43 ""
MemberDecorate 25(IN_S) 4 BuiltIn FrontFacing
Decorate 27(s) Location 1
Decorate 35(@entryPointOutput) Location 0
Decorate 36(input) Location 0
MemberDecorate 40(myS) 0 Offset 0
MemberDecorate 40(myS) 1 Offset 4
MemberDecorate 40(myS) 2 Offset 16
MemberDecorate 40(myS) 3 Offset 32
MemberDecorate 41($Global) 0 Offset 0
MemberDecorate 41($Global) 1 Offset 1620
MemberDecorate 41($Global) 2 Offset 1636
Decorate 41($Global) Block
Decorate 43 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeBool
@@ -156,28 +135,21 @@ gl_FragCoord origin is upper left
21(s2): 20(ptr) Variable Private
22: TypeInt 32 1
23: 22(int) Constant 0
24: TypePointer Input 18(fvec4)
25(ff4): 24(ptr) Variable Input
27: TypePointer Private 18(fvec4)
29: TypePointer Output 18(fvec4)
30(@entryPointOutput): 29(ptr) Variable Output
31(input): 24(ptr) Variable Input
34(a): 24(ptr) Variable Input
35: TypePointer Input 6(bool)
36(b): 35(ptr) Variable Input
37: TypePointer Input 17(float)
38(c): 37(ptr) Variable Input
39: TypeVector 17(float) 2
40: TypePointer Input 39(fvec2)
41(d): 40(ptr) Variable Input
42(ff1): 35(ptr) Variable Input
43(ff2): 35(ptr) Variable Input
44(ff3): 35(ptr) Variable Input
45: TypeInt 32 0
46(myS): TypeStruct 45(int) 45(int) 18(fvec4) 18(fvec4)
47($Global): TypeStruct 46(myS) 17(float) 17(float)
48: TypePointer Uniform 47($Global)
49: 48(ptr) Variable Uniform
24: TypeVector 17(float) 2
25(IN_S): TypeStruct 18(fvec4) 6(bool) 17(float) 24(fvec2) 6(bool) 6(bool) 6(bool) 18(fvec4)
26: TypePointer Input 25(IN_S)
27(s): 26(ptr) Variable Input
28: 22(int) Constant 7
29: TypePointer Input 18(fvec4)
32: TypePointer Private 18(fvec4)
34: TypePointer Output 18(fvec4)
35(@entryPointOutput): 34(ptr) Variable Output
36(input): 29(ptr) Variable Input
39: TypeInt 32 0
40(myS): TypeStruct 39(int) 39(int) 18(fvec4) 18(fvec4)
41($Global): TypeStruct 40(myS) 17(float) 17(float)
42: TypePointer Uniform 41($Global)
43: 42(ptr) Variable Uniform
4(PixelShaderFunction): 2 Function None 3
5: Label
10(s3): 9(ptr) Variable Function
@@ -187,10 +159,11 @@ gl_FragCoord origin is upper left
14: 7(bvec3) CompositeExtract 12 0
15: 7(bvec3) LogicalEqual 13 14
16: 6(bool) All 15
26: 18(fvec4) Load 25(ff4)
28: 27(ptr) AccessChain 21(s2) 23
Store 28 26
32: 18(fvec4) Load 31(input)
Store 30(@entryPointOutput) 32
30: 29(ptr) AccessChain 27(s) 28
31: 18(fvec4) Load 30
33: 32(ptr) AccessChain 21(s2) 23
Store 33 31
37: 18(fvec4) Load 36(input)
Store 35(@entryPointOutput) 37
Return
FunctionEnd

View File

@@ -0,0 +1,209 @@
hlsl.struct.split-1.vert
Shader version: 450
0:? Sequence
0:17 Function Definition: main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Parameters:
0:17 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'Pos_loose' (in 4-component vector of float Position)
0:? Sequence
0:20 move second child to first child (temp int)
0:20 x0_out: direct index for structure (temp int)
0:20 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:20 Constant:
0:20 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:21 move second child to first child (temp 4-component vector of float)
0:21 Pos_out: direct index for structure (temp 4-component vector of float)
0:21 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:21 Constant:
0:21 1 (const int)
0:21 add (temp 4-component vector of float)
0:? 'Pos_in' (in 4-component vector of float Position)
0:21 'Pos_loose' (in 4-component vector of float Position)
0:22 move second child to first child (temp int)
0:22 x1_out: direct index for structure (temp int)
0:22 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:22 Constant:
0:22 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:24 Sequence
0:24 Sequence
0:24 move second child to first child (temp int)
0:24 x0_out: direct index for structure (temp int)
0:24 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:24 Constant:
0:24 0 (const int)
0:24 x0_out: direct index for structure (temp int)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 0 (const int)
0:24 move second child to first child (temp 4-component vector of float)
0:? 'Pos_out' (out 4-component vector of float Position)
0:24 Pos_out: direct index for structure (temp 4-component vector of float)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 1 (const int)
0:24 move second child to first child (temp int)
0:24 x1_out: direct index for structure (temp int)
0:24 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:24 Constant:
0:24 1 (const int)
0:24 x1_out: direct index for structure (temp int)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 2 (const int)
0:24 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos_out' (out 4-component vector of float Position)
Linked vertex stage:
Shader version: 450
0:? Sequence
0:17 Function Definition: main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Parameters:
0:17 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'Pos_loose' (in 4-component vector of float Position)
0:? Sequence
0:20 move second child to first child (temp int)
0:20 x0_out: direct index for structure (temp int)
0:20 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:20 Constant:
0:20 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:21 move second child to first child (temp 4-component vector of float)
0:21 Pos_out: direct index for structure (temp 4-component vector of float)
0:21 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:21 Constant:
0:21 1 (const int)
0:21 add (temp 4-component vector of float)
0:? 'Pos_in' (in 4-component vector of float Position)
0:21 'Pos_loose' (in 4-component vector of float Position)
0:22 move second child to first child (temp int)
0:22 x1_out: direct index for structure (temp int)
0:22 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:22 Constant:
0:22 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:24 Sequence
0:24 Sequence
0:24 move second child to first child (temp int)
0:24 x0_out: direct index for structure (temp int)
0:24 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:24 Constant:
0:24 0 (const int)
0:24 x0_out: direct index for structure (temp int)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 0 (const int)
0:24 move second child to first child (temp 4-component vector of float)
0:? 'Pos_out' (out 4-component vector of float Position)
0:24 Pos_out: direct index for structure (temp 4-component vector of float)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 1 (const int)
0:24 move second child to first child (temp int)
0:24 x1_out: direct index for structure (temp int)
0:24 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:24 Constant:
0:24 1 (const int)
0:24 x1_out: direct index for structure (temp int)
0:24 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:24 Constant:
0:24 2 (const int)
0:24 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos_out' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 46
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 14 20 22 28 33 39
Name 4 "main"
Name 9 "VS_OUTPUT"
MemberName 9(VS_OUTPUT) 0 "x0_out"
MemberName 9(VS_OUTPUT) 1 "Pos_out"
MemberName 9(VS_OUTPUT) 2 "x1_out"
Name 11 "vsout"
Name 14 "x0_in"
Name 20 "Pos_in"
Name 22 "Pos_loose"
Name 28 "x1_in"
Name 31 "VS_OUTPUT"
MemberName 31(VS_OUTPUT) 0 "x0_out"
MemberName 31(VS_OUTPUT) 1 "x1_out"
Name 33 "@entryPointOutput"
Name 39 "Pos_out"
Decorate 14(x0_in) Location 0
Decorate 20(Pos_in) BuiltIn Position
Decorate 22(Pos_loose) BuiltIn Position
Decorate 28(x1_in) Location 1
Decorate 33(@entryPointOutput) Location 0
Decorate 39(Pos_out) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeFloat 32
8: TypeVector 7(float) 4
9(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int)
10: TypePointer Function 9(VS_OUTPUT)
12: 6(int) Constant 0
13: TypePointer Input 6(int)
14(x0_in): 13(ptr) Variable Input
16: TypePointer Function 6(int)
18: 6(int) Constant 1
19: TypePointer Input 8(fvec4)
20(Pos_in): 19(ptr) Variable Input
22(Pos_loose): 19(ptr) Variable Input
25: TypePointer Function 8(fvec4)
27: 6(int) Constant 2
28(x1_in): 13(ptr) Variable Input
31(VS_OUTPUT): TypeStruct 6(int) 6(int)
32: TypePointer Output 31(VS_OUTPUT)
33(@entryPointOutput): 32(ptr) Variable Output
36: TypePointer Output 6(int)
38: TypePointer Output 8(fvec4)
39(Pos_out): 38(ptr) Variable Output
4(main): 2 Function None 3
5: Label
11(vsout): 10(ptr) Variable Function
15: 6(int) Load 14(x0_in)
17: 16(ptr) AccessChain 11(vsout) 12
Store 17 15
21: 8(fvec4) Load 20(Pos_in)
23: 8(fvec4) Load 22(Pos_loose)
24: 8(fvec4) FAdd 21 23
26: 25(ptr) AccessChain 11(vsout) 18
Store 26 24
29: 6(int) Load 28(x1_in)
30: 16(ptr) AccessChain 11(vsout) 27
Store 30 29
34: 16(ptr) AccessChain 11(vsout) 12
35: 6(int) Load 34
37: 36(ptr) AccessChain 33(@entryPointOutput) 12
Store 37 35
40: 25(ptr) AccessChain 11(vsout) 18
41: 8(fvec4) Load 40
Store 39(Pos_out) 41
42: 16(ptr) AccessChain 11(vsout) 27
43: 6(int) Load 42
44: 36(ptr) AccessChain 33(@entryPointOutput) 18
Store 44 43
Return
FunctionEnd

View File

@@ -0,0 +1,295 @@
hlsl.struct.split.array.geom
Shader version: 450
invocations = -1
max_vertices = 4
input primitive = points
output primitive = triangle_strip
0:? Sequence
0:13 Function Definition: main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; (temp void)
0:13 Function Parameters:
0:13 'v' (layout(location=0 ) in 1-element array of uint)
0:13 'OutputStream' (out structure{temp 4-component vector of float Position Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? Sequence
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:16 'Out' (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:16 Constant:
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0 (const uint)
0:18 Sequence
0:18 move second child to first child (temp int)
0:18 'x' (temp int)
0:18 Constant:
0:18 0 (const int)
0:18 Loop with condition tested first
0:18 Loop Condition
0:18 Compare Less Than (temp bool)
0:18 'x' (temp int)
0:18 Constant:
0:18 2 (const int)
0:18 Loop Body
0:19 Sequence
0:19 move second child to first child (temp int)
0:19 'y' (temp int)
0:19 Constant:
0:19 0 (const int)
0:19 Loop with condition tested first
0:19 Loop Condition
0:19 Compare Less Than (temp bool)
0:19 'y' (temp int)
0:19 Constant:
0:19 2 (const int)
0:19 Loop Body
0:20 move second child to first child (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 indirect index (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 indirect index (temp 3-element array of structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 'Verts' (temp 2-element array of 3-element array of structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 'x' (temp int)
0:20 'y' (temp int)
0:20 'Out' (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:19 Loop Terminal Expression
0:19 Pre-Increment (temp int)
0:19 'y' (temp int)
0:18 Loop Terminal Expression
0:18 Pre-Increment (temp int)
0:18 'x' (temp int)
0:? Linker Objects
0:? 'v' (layout(location=0 ) in 1-element array of uint)
0:? 'OutputStream' (layout(location=0 ) out structure{temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? 'OutputStream.Pos' (out 4-component vector of float Position)
Linked geometry stage:
Shader version: 450
invocations = 1
max_vertices = 4
input primitive = points
output primitive = triangle_strip
0:? Sequence
0:13 Function Definition: main(u1[1];struct-PSInput-vf4-vf2-vf3-u11; (temp void)
0:13 Function Parameters:
0:13 'v' (layout(location=0 ) in 1-element array of uint)
0:13 'OutputStream' (out structure{temp 4-component vector of float Position Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? Sequence
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:16 'Out' (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:16 Constant:
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 0 (const uint)
0:18 Sequence
0:18 move second child to first child (temp int)
0:18 'x' (temp int)
0:18 Constant:
0:18 0 (const int)
0:18 Loop with condition tested first
0:18 Loop Condition
0:18 Compare Less Than (temp bool)
0:18 'x' (temp int)
0:18 Constant:
0:18 2 (const int)
0:18 Loop Body
0:19 Sequence
0:19 move second child to first child (temp int)
0:19 'y' (temp int)
0:19 Constant:
0:19 0 (const int)
0:19 Loop with condition tested first
0:19 Loop Condition
0:19 Compare Less Than (temp bool)
0:19 'y' (temp int)
0:19 Constant:
0:19 2 (const int)
0:19 Loop Body
0:20 move second child to first child (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 indirect index (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 indirect index (temp 3-element array of structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 'Verts' (temp 2-element array of 3-element array of structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:20 'x' (temp int)
0:20 'y' (temp int)
0:20 'Out' (temp structure{temp 4-component vector of float Pos, temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:19 Loop Terminal Expression
0:19 Pre-Increment (temp int)
0:19 'y' (temp int)
0:18 Loop Terminal Expression
0:18 Pre-Increment (temp int)
0:18 'x' (temp int)
0:? Linker Objects
0:? 'v' (layout(location=0 ) in 1-element array of uint)
0:? 'OutputStream' (layout(location=0 ) out structure{temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID})
0:? 'OutputStream.Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 89
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 83 86 88
ExecutionMode 4 InputPoints
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 4
Name 4 "main"
Name 11 "PSInput"
MemberName 11(PSInput) 0 "Pos"
MemberName 11(PSInput) 1 "TexCoord"
MemberName 11(PSInput) 2 "TerrainPos"
MemberName 11(PSInput) 3 "VertexID"
Name 13 "Out"
Name 14 "PSInput"
MemberName 14(PSInput) 0 "Pos"
MemberName 14(PSInput) 1 "TexCoord"
MemberName 14(PSInput) 2 "TerrainPos"
MemberName 14(PSInput) 3 "VertexID"
Name 39 "x"
Name 48 "y"
Name 56 "PSInput"
MemberName 56(PSInput) 0 "Pos"
MemberName 56(PSInput) 1 "TexCoord"
MemberName 56(PSInput) 2 "TerrainPos"
MemberName 56(PSInput) 3 "VertexID"
Name 62 "Verts"
Name 83 "v"
Name 84 "PSInput"
MemberName 84(PSInput) 0 "TexCoord"
MemberName 84(PSInput) 1 "TerrainPos"
MemberName 84(PSInput) 2 "VertexID"
Name 86 "OutputStream"
Name 88 "OutputStream.Pos"
MemberDecorate 14(PSInput) 0 BuiltIn Position
Decorate 83(v) Location 0
Decorate 86(OutputStream) Location 0
Decorate 88(OutputStream.Pos) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeVector 6(float) 2
9: TypeVector 6(float) 3
10: TypeInt 32 0
11(PSInput): TypeStruct 7(fvec4) 8(fvec2) 9(fvec3) 10(int)
12: TypePointer Function 11(PSInput)
14(PSInput): TypeStruct 7(fvec4) 8(fvec2) 9(fvec3) 10(int)
15: 6(float) Constant 0
16: 7(fvec4) ConstantComposite 15 15 15 15
17: 8(fvec2) ConstantComposite 15 15
18: 9(fvec3) ConstantComposite 15 15 15
19: 10(int) Constant 0
20: 14(PSInput) ConstantComposite 16 17 18 19
22: TypeInt 32 1
23: 22(int) Constant 0
24: TypePointer Function 7(fvec4)
27: 22(int) Constant 1
28: TypePointer Function 8(fvec2)
31: 22(int) Constant 2
32: TypePointer Function 9(fvec3)
35: 22(int) Constant 3
36: TypePointer Function 10(int)
38: TypePointer Function 22(int)
46: TypeBool
56(PSInput): TypeStruct 7(fvec4) 8(fvec2) 9(fvec3) 10(int)
57: 10(int) Constant 3
58: TypeArray 56(PSInput) 57
59: 10(int) Constant 2
60: TypeArray 58 59
61: TypePointer Function 60
66: TypePointer Function 56(PSInput)
80: 10(int) Constant 1
81: TypeArray 10(int) 80
82: TypePointer Input 81
83(v): 82(ptr) Variable Input
84(PSInput): TypeStruct 8(fvec2) 9(fvec3) 10(int)
85: TypePointer Output 84(PSInput)
86(OutputStream): 85(ptr) Variable Output
87: TypePointer Output 7(fvec4)
88(OutputStream.Pos): 87(ptr) Variable Output
4(main): 2 Function None 3
5: Label
13(Out): 12(ptr) Variable Function
39(x): 38(ptr) Variable Function
48(y): 38(ptr) Variable Function
62(Verts): 61(ptr) Variable Function
21: 7(fvec4) CompositeExtract 20 0
25: 24(ptr) AccessChain 13(Out) 23
Store 25 21
26: 8(fvec2) CompositeExtract 20 1
29: 28(ptr) AccessChain 13(Out) 27
Store 29 26
30: 9(fvec3) CompositeExtract 20 2
33: 32(ptr) AccessChain 13(Out) 31
Store 33 30
34: 10(int) CompositeExtract 20 3
37: 36(ptr) AccessChain 13(Out) 35
Store 37 34
Store 39(x) 23
Branch 40
40: Label
LoopMerge 42 43 None
Branch 44
44: Label
45: 22(int) Load 39(x)
47: 46(bool) SLessThan 45 31
BranchConditional 47 41 42
41: Label
Store 48(y) 23
Branch 49
49: Label
LoopMerge 51 52 None
Branch 53
53: Label
54: 22(int) Load 48(y)
55: 46(bool) SLessThan 54 31
BranchConditional 55 50 51
50: Label
63: 22(int) Load 39(x)
64: 22(int) Load 48(y)
65: 11(PSInput) Load 13(Out)
67: 66(ptr) AccessChain 62(Verts) 63 64
68: 7(fvec4) CompositeExtract 65 0
69: 24(ptr) AccessChain 67 23
Store 69 68
70: 8(fvec2) CompositeExtract 65 1
71: 28(ptr) AccessChain 67 27
Store 71 70
72: 9(fvec3) CompositeExtract 65 2
73: 32(ptr) AccessChain 67 31
Store 73 72
74: 10(int) CompositeExtract 65 3
75: 36(ptr) AccessChain 67 35
Store 75 74
Branch 52
52: Label
76: 22(int) Load 48(y)
77: 22(int) IAdd 76 27
Store 48(y) 77
Branch 49
51: Label
Branch 43
43: Label
78: 22(int) Load 39(x)
79: 22(int) IAdd 78 27
Store 39(x) 79
Branch 40
42: Label
Return
FunctionEnd

View File

@@ -0,0 +1,317 @@
hlsl.struct.split.call.vert
Shader version: 450
0:? Sequence
0:17 Function Definition: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; (temp void)
0:17 Function Parameters:
0:17 'fn1_in' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'fn1_out' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:? Sequence
0:18 add (temp 4-component vector of float)
0:18 Pos_in: direct index for structure (temp 4-component vector of float)
0:18 'fn1_in' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:18 Constant:
0:18 1 (const int)
0:18 Pos_out: direct index for structure (temp 4-component vector of float)
0:18 'fn1_out' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:18 Constant:
0:18 1 (const int)
0:22 Function Definition: main(struct-VS_INPUT-i1-vf4-i11; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:22 Function Parameters:
0:22 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:? Sequence
0:25 move second child to first child (temp int)
0:25 x0_out: direct index for structure (temp int)
0:25 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:25 Constant:
0:25 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:26 move second child to first child (temp 4-component vector of float)
0:26 Pos_out: direct index for structure (temp 4-component vector of float)
0:26 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:26 Constant:
0:26 1 (const int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:27 move second child to first child (temp int)
0:27 x1_out: direct index for structure (temp int)
0:27 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:27 Constant:
0:27 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:29 Function Call: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; (temp void)
0:29 Comma (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Sequence
0:29 move second child to first child (temp int)
0:29 x0_in: direct index for structure (temp int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:29 move second child to first child (temp 4-component vector of float)
0:29 Pos_in: direct index for structure (temp 4-component vector of float)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 1 (const int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:29 move second child to first child (temp int)
0:29 x1_in: direct index for structure (temp int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Sequence
0:31 Sequence
0:31 move second child to first child (temp int)
0:31 x0_out: direct index for structure (temp int)
0:31 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:31 Constant:
0:31 0 (const int)
0:31 x0_out: direct index for structure (temp int)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 0 (const int)
0:31 move second child to first child (temp 4-component vector of float)
0:? 'Pos_out' (out 4-component vector of float Position)
0:31 Pos_out: direct index for structure (temp 4-component vector of float)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 1 (const int)
0:31 move second child to first child (temp int)
0:31 x1_out: direct index for structure (temp int)
0:31 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:31 Constant:
0:31 1 (const int)
0:31 x1_out: direct index for structure (temp int)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 2 (const int)
0:31 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_out' (out 4-component vector of float Position)
Linked vertex stage:
Shader version: 450
0:? Sequence
0:17 Function Definition: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; (temp void)
0:17 Function Parameters:
0:17 'fn1_in' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'fn1_out' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:? Sequence
0:18 add (temp 4-component vector of float)
0:18 Pos_in: direct index for structure (temp 4-component vector of float)
0:18 'fn1_in' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:18 Constant:
0:18 1 (const int)
0:18 Pos_out: direct index for structure (temp 4-component vector of float)
0:18 'fn1_out' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:18 Constant:
0:18 1 (const int)
0:22 Function Definition: main(struct-VS_INPUT-i1-vf4-i11; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:22 Function Parameters:
0:22 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:? Sequence
0:25 move second child to first child (temp int)
0:25 x0_out: direct index for structure (temp int)
0:25 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:25 Constant:
0:25 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:26 move second child to first child (temp 4-component vector of float)
0:26 Pos_out: direct index for structure (temp 4-component vector of float)
0:26 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:26 Constant:
0:26 1 (const int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:27 move second child to first child (temp int)
0:27 x1_out: direct index for structure (temp int)
0:27 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:27 Constant:
0:27 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:29 Function Call: Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11; (temp void)
0:29 Comma (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Sequence
0:29 move second child to first child (temp int)
0:29 x0_in: direct index for structure (temp int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 0 (const int)
0:? 'x0_in' (layout(location=0 ) in int)
0:29 move second child to first child (temp 4-component vector of float)
0:29 Pos_in: direct index for structure (temp 4-component vector of float)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 1 (const int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:29 move second child to first child (temp int)
0:29 x1_in: direct index for structure (temp int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 Constant:
0:29 2 (const int)
0:? 'x1_in' (layout(location=1 ) in int)
0:29 'aggShadow' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:29 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Sequence
0:31 Sequence
0:31 move second child to first child (temp int)
0:31 x0_out: direct index for structure (temp int)
0:31 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:31 Constant:
0:31 0 (const int)
0:31 x0_out: direct index for structure (temp int)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 0 (const int)
0:31 move second child to first child (temp 4-component vector of float)
0:? 'Pos_out' (out 4-component vector of float Position)
0:31 Pos_out: direct index for structure (temp 4-component vector of float)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 1 (const int)
0:31 move second child to first child (temp int)
0:31 x1_out: direct index for structure (temp int)
0:31 '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:31 Constant:
0:31 1 (const int)
0:31 x1_out: direct index for structure (temp int)
0:31 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:31 Constant:
0:31 2 (const int)
0:31 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp int x0_out, temp int x1_out})
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_out' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 69
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 28 33 37 56 62
Name 4 "main"
Name 9 "VS_INPUT"
MemberName 9(VS_INPUT) 0 "x0_in"
MemberName 9(VS_INPUT) 1 "Pos_in"
MemberName 9(VS_INPUT) 2 "x1_in"
Name 11 "VS_OUTPUT"
MemberName 11(VS_OUTPUT) 0 "x0_out"
MemberName 11(VS_OUTPUT) 1 "Pos_out"
MemberName 11(VS_OUTPUT) 2 "x1_out"
Name 16 "Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;"
Name 14 "fn1_in"
Name 15 "fn1_out"
Name 25 "vsout"
Name 28 "x0_in"
Name 33 "Pos_in"
Name 37 "x1_in"
Name 40 "VS_INPUT"
MemberName 40(VS_INPUT) 0 "x0_in"
MemberName 40(VS_INPUT) 1 "Pos_in"
MemberName 40(VS_INPUT) 2 "x1_in"
Name 42 "aggShadow"
Name 49 "param"
Name 51 "param"
Name 54 "VS_OUTPUT"
MemberName 54(VS_OUTPUT) 0 "x0_out"
MemberName 54(VS_OUTPUT) 1 "x1_out"
Name 56 "@entryPointOutput"
Name 62 "Pos_out"
Decorate 28(x0_in) Location 0
Decorate 33(Pos_in) BuiltIn Position
Decorate 37(x1_in) Location 1
Decorate 56(@entryPointOutput) Location 0
Decorate 62(Pos_out) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeFloat 32
8: TypeVector 7(float) 4
9(VS_INPUT): TypeStruct 6(int) 8(fvec4) 6(int)
10: TypePointer Function 9(VS_INPUT)
11(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int)
12: TypePointer Function 11(VS_OUTPUT)
13: TypeFunction 2 10(ptr) 12(ptr)
18: 6(int) Constant 1
19: TypePointer Function 8(fvec4)
26: 6(int) Constant 0
27: TypePointer Input 6(int)
28(x0_in): 27(ptr) Variable Input
30: TypePointer Function 6(int)
32: TypePointer Input 8(fvec4)
33(Pos_in): 32(ptr) Variable Input
36: 6(int) Constant 2
37(x1_in): 27(ptr) Variable Input
40(VS_INPUT): TypeStruct 6(int) 8(fvec4) 6(int)
41: TypePointer Function 40(VS_INPUT)
54(VS_OUTPUT): TypeStruct 6(int) 6(int)
55: TypePointer Output 54(VS_OUTPUT)
56(@entryPointOutput): 55(ptr) Variable Output
59: TypePointer Output 6(int)
61: TypePointer Output 8(fvec4)
62(Pos_out): 61(ptr) Variable Output
4(main): 2 Function None 3
5: Label
25(vsout): 12(ptr) Variable Function
42(aggShadow): 41(ptr) Variable Function
49(param): 41(ptr) Variable Function
51(param): 12(ptr) Variable Function
29: 6(int) Load 28(x0_in)
31: 30(ptr) AccessChain 25(vsout) 26
Store 31 29
34: 8(fvec4) Load 33(Pos_in)
35: 19(ptr) AccessChain 25(vsout) 18
Store 35 34
38: 6(int) Load 37(x1_in)
39: 30(ptr) AccessChain 25(vsout) 36
Store 39 38
43: 6(int) Load 28(x0_in)
44: 30(ptr) AccessChain 42(aggShadow) 26
Store 44 43
45: 8(fvec4) Load 33(Pos_in)
46: 19(ptr) AccessChain 42(aggShadow) 18
Store 46 45
47: 6(int) Load 37(x1_in)
48: 30(ptr) AccessChain 42(aggShadow) 36
Store 48 47
50:40(VS_INPUT) Load 42(aggShadow)
Store 49(param) 50
52:11(VS_OUTPUT) Load 25(vsout)
Store 51(param) 52
53: 2 FunctionCall 16(Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;) 49(param) 51(param)
57: 30(ptr) AccessChain 25(vsout) 26
58: 6(int) Load 57
60: 59(ptr) AccessChain 56(@entryPointOutput) 26
Store 60 58
63: 19(ptr) AccessChain 25(vsout) 18
64: 8(fvec4) Load 63
Store 62(Pos_out) 64
65: 30(ptr) AccessChain 25(vsout) 36
66: 6(int) Load 65
67: 59(ptr) AccessChain 56(@entryPointOutput) 18
Store 67 66
Return
FunctionEnd
16(Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;): 2 Function None 13
14(fn1_in): 10(ptr) FunctionParameter
15(fn1_out): 12(ptr) FunctionParameter
17: Label
20: 19(ptr) AccessChain 14(fn1_in) 18
21: 8(fvec4) Load 20
22: 19(ptr) AccessChain 15(fn1_out) 18
23: 8(fvec4) Load 22
24: 8(fvec4) FAdd 21 23
Return
FunctionEnd

View File

@@ -0,0 +1,271 @@
hlsl.struct.split.nested.geom
Shader version: 450
invocations = -1
max_vertices = 3
input primitive = triangles
output primitive = triangle_strip
0:? Sequence
0:24 Function Definition: main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; (temp void)
0:24 Function Parameters:
0:24 'tin' (in 3-element array of structure{temp 4-component vector of float Position pos, temp 2-component vector of float tc})
0:24 'ts' (out structure{temp structure{temp 4-component vector of float Position pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:27 pos: direct index for structure (temp 4-component vector of float)
0:27 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:27 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 move second child to first child (temp 2-component vector of float)
0:28 tc: direct index for structure (temp 2-component vector of float)
0:28 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:28 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:? Constant:
0:? 5.000000
0:? 6.000000
0:30 Sequence
0:30 Sequence
0:30 move second child to first child (temp 4-component vector of float)
0:? 'ts.psIn.pos' (out 4-component vector of float Position)
0:30 pos: direct index for structure (temp 4-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 0 (const int)
0:30 move second child to first child (temp 2-component vector of float)
0:30 tc: direct index for structure (temp 2-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 2-component vector of float tc})
0:30 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 0 (const int)
0:30 tc: direct index for structure (temp 2-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 1 (const int)
0:30 move second child to first child (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 contains_no_builtin_io: direct index for structure (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 1 (const int)
0:30 contains_no_builtin_io: direct index for structure (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 1 (const int)
0:30 EmitVertex (temp void)
0:? Linker Objects
0:? 'tin' (layout(location=0 ) in 3-element array of structure{temp 2-component vector of float tc})
0:? 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? 'tin.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.psIn.pos' (out 4-component vector of float Position)
Linked geometry stage:
Shader version: 450
invocations = 1
max_vertices = 3
input primitive = triangles
output primitive = triangle_strip
0:? Sequence
0:24 Function Definition: main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111; (temp void)
0:24 Function Parameters:
0:24 'tin' (in 3-element array of structure{temp 4-component vector of float Position pos, temp 2-component vector of float tc})
0:24 'ts' (out structure{temp structure{temp 4-component vector of float Position pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:27 pos: direct index for structure (temp 4-component vector of float)
0:27 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:27 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:28 move second child to first child (temp 2-component vector of float)
0:28 tc: direct index for structure (temp 2-component vector of float)
0:28 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:28 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:? Constant:
0:? 5.000000
0:? 6.000000
0:30 Sequence
0:30 Sequence
0:30 move second child to first child (temp 4-component vector of float)
0:? 'ts.psIn.pos' (out 4-component vector of float Position)
0:30 pos: direct index for structure (temp 4-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 0 (const int)
0:30 move second child to first child (temp 2-component vector of float)
0:30 tc: direct index for structure (temp 2-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 2-component vector of float tc})
0:30 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 0 (const int)
0:30 tc: direct index for structure (temp 2-component vector of float)
0:30 psIn: direct index for structure (temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 0 (const int)
0:30 Constant:
0:30 1 (const int)
0:30 move second child to first child (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 contains_no_builtin_io: direct index for structure (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 1 (const int)
0:30 contains_no_builtin_io: direct index for structure (temp structure{temp 2-element array of float m0_array, temp int m1})
0:30 'o' (temp structure{temp structure{temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:30 Constant:
0:30 1 (const int)
0:30 EmitVertex (temp void)
0:? Linker Objects
0:? 'tin' (layout(location=0 ) in 3-element array of structure{temp 2-component vector of float tc})
0:? 'ts' (layout(location=0 ) out structure{temp structure{temp 2-component vector of float tc} psIn, temp structure{temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? 'tin.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.psIn.pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 64
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 33 40 60 63
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 3
Name 4 "main"
Name 9 "PS_IN"
MemberName 9(PS_IN) 0 "pos"
MemberName 9(PS_IN) 1 "tc"
Name 14 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO"
MemberName 14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array"
MemberName 14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1"
Name 15 "GS_OUT"
MemberName 15(GS_OUT) 0 "psIn"
MemberName 15(GS_OUT) 1 "contains_no_builtin_io"
Name 17 "o"
Name 33 "ts.psIn.pos"
Name 36 "PS_IN"
MemberName 36(PS_IN) 0 "tc"
Name 37 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO"
MemberName 37(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array"
MemberName 37(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1"
Name 38 "GS_OUT"
MemberName 38(GS_OUT) 0 "psIn"
MemberName 38(GS_OUT) 1 "contains_no_builtin_io"
Name 40 "ts"
Name 56 "PS_IN"
MemberName 56(PS_IN) 0 "tc"
Name 60 "tin"
Name 63 "tin.pos"
Decorate 33(ts.psIn.pos) BuiltIn Position
Decorate 40(ts) Location 0
Decorate 60(tin) Location 0
Decorate 63(tin.pos) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeVector 6(float) 2
9(PS_IN): TypeStruct 7(fvec4) 8(fvec2)
10: TypeInt 32 0
11: 10(int) Constant 2
12: TypeArray 6(float) 11
13: TypeInt 32 1
14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 12 13(int)
15(GS_OUT): TypeStruct 9(PS_IN) 14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
16: TypePointer Function 15(GS_OUT)
18: 13(int) Constant 0
19: 6(float) Constant 1065353216
20: 6(float) Constant 1073741824
21: 6(float) Constant 1077936128
22: 6(float) Constant 1082130432
23: 7(fvec4) ConstantComposite 19 20 21 22
24: TypePointer Function 7(fvec4)
26: 13(int) Constant 1
27: 6(float) Constant 1084227584
28: 6(float) Constant 1086324736
29: 8(fvec2) ConstantComposite 27 28
30: TypePointer Function 8(fvec2)
32: TypePointer Output 7(fvec4)
33(ts.psIn.pos): 32(ptr) Variable Output
36(PS_IN): TypeStruct 8(fvec2)
37(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 12 13(int)
38(GS_OUT): TypeStruct 36(PS_IN) 37(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
39: TypePointer Output 38(GS_OUT)
40(ts): 39(ptr) Variable Output
43: TypePointer Output 8(fvec2)
45: TypePointer Function 14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
48: TypePointer Output 37(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
51: TypePointer Output 12
54: TypePointer Output 13(int)
56(PS_IN): TypeStruct 8(fvec2)
57: 10(int) Constant 3
58: TypeArray 56(PS_IN) 57
59: TypePointer Input 58
60(tin): 59(ptr) Variable Input
61: TypeArray 7(fvec4) 57
62: TypePointer Input 61
63(tin.pos): 62(ptr) Variable Input
4(main): 2 Function None 3
5: Label
17(o): 16(ptr) Variable Function
25: 24(ptr) AccessChain 17(o) 18 18
Store 25 23
31: 30(ptr) AccessChain 17(o) 18 26
Store 31 29
34: 24(ptr) AccessChain 17(o) 18 18
35: 7(fvec4) Load 34
Store 33(ts.psIn.pos) 35
41: 30(ptr) AccessChain 17(o) 18 26
42: 8(fvec2) Load 41
44: 43(ptr) AccessChain 40(ts) 18 18
Store 44 42
46: 45(ptr) AccessChain 17(o) 26
47:14(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 46
49: 48(ptr) AccessChain 40(ts) 26
50: 12 CompositeExtract 47 0
52: 51(ptr) AccessChain 49 18
Store 52 50
53: 13(int) CompositeExtract 47 1
55: 54(ptr) AccessChain 49 26
Store 55 53
EmitVertex
Return
FunctionEnd

View File

@@ -0,0 +1,175 @@
hlsl.struct.split.trivial.geom
Shader version: 450
invocations = -1
max_vertices = 3
input primitive = triangles
output primitive = triangle_strip
0:? Sequence
0:14 Function Definition: main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; (temp void)
0:14 Function Parameters:
0:14 'i' (in 3-element array of structure{temp 4-component vector of float Position pos})
0:14 'ts' (out structure{temp 4-component vector of float Position pos})
0:? Sequence
0:17 Sequence
0:17 move second child to first child (temp int)
0:17 'x' (temp int)
0:17 Constant:
0:17 0 (const int)
0:17 Loop with condition tested first
0:17 Loop Condition
0:17 Compare Less Than (temp bool)
0:17 'x' (temp int)
0:17 Constant:
0:17 3 (const int)
0:17 Loop Body
0:? Sequence
0:18 move second child to first child (temp 4-component vector of float)
0:18 pos: direct index for structure (temp 4-component vector of float)
0:18 'o' (temp structure{temp 4-component vector of float pos})
0:18 Constant:
0:18 0 (const int)
0:18 indirect index (temp 4-component vector of float Position)
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
0:18 'x' (temp int)
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'ts.pos' (out 4-component vector of float Position)
0:19 pos: direct index for structure (temp 4-component vector of float)
0:19 'o' (temp structure{temp 4-component vector of float pos})
0:19 Constant:
0:19 0 (const int)
0:19 EmitVertex (temp void)
0:17 Loop Terminal Expression
0:17 Pre-Increment (temp int)
0:17 'x' (temp int)
0:? Linker Objects
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.pos' (out 4-component vector of float Position)
Linked geometry stage:
Shader version: 450
invocations = 1
max_vertices = 3
input primitive = triangles
output primitive = triangle_strip
0:? Sequence
0:14 Function Definition: main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; (temp void)
0:14 Function Parameters:
0:14 'i' (in 3-element array of structure{temp 4-component vector of float Position pos})
0:14 'ts' (out structure{temp 4-component vector of float Position pos})
0:? Sequence
0:17 Sequence
0:17 move second child to first child (temp int)
0:17 'x' (temp int)
0:17 Constant:
0:17 0 (const int)
0:17 Loop with condition tested first
0:17 Loop Condition
0:17 Compare Less Than (temp bool)
0:17 'x' (temp int)
0:17 Constant:
0:17 3 (const int)
0:17 Loop Body
0:? Sequence
0:18 move second child to first child (temp 4-component vector of float)
0:18 pos: direct index for structure (temp 4-component vector of float)
0:18 'o' (temp structure{temp 4-component vector of float pos})
0:18 Constant:
0:18 0 (const int)
0:18 indirect index (temp 4-component vector of float Position)
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
0:18 'x' (temp int)
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'ts.pos' (out 4-component vector of float Position)
0:19 pos: direct index for structure (temp 4-component vector of float)
0:19 'o' (temp structure{temp 4-component vector of float pos})
0:19 Constant:
0:19 0 (const int)
0:19 EmitVertex (temp void)
0:17 Loop Terminal Expression
0:17 Pre-Increment (temp int)
0:17 'x' (temp int)
0:? Linker Objects
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 42
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 28 36
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 3
Name 4 "main"
Name 8 "x"
Name 21 "GS_OUT"
MemberName 21(GS_OUT) 0 "pos"
Name 23 "o"
Name 28 "i.pos"
Name 36 "ts.pos"
Decorate 28(i.pos) BuiltIn Position
Decorate 36(ts.pos) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
9: 6(int) Constant 0
16: 6(int) Constant 3
17: TypeBool
19: TypeFloat 32
20: TypeVector 19(float) 4
21(GS_OUT): TypeStruct 20(fvec4)
22: TypePointer Function 21(GS_OUT)
24: TypeInt 32 0
25: 24(int) Constant 3
26: TypeArray 20(fvec4) 25
27: TypePointer Input 26
28(i.pos): 27(ptr) Variable Input
30: TypePointer Input 20(fvec4)
33: TypePointer Function 20(fvec4)
35: TypePointer Output 20(fvec4)
36(ts.pos): 35(ptr) Variable Output
40: 6(int) Constant 1
4(main): 2 Function None 3
5: Label
8(x): 7(ptr) Variable Function
23(o): 22(ptr) Variable Function
Store 8(x) 9
Branch 10
10: Label
LoopMerge 12 13 None
Branch 14
14: Label
15: 6(int) Load 8(x)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label
29: 6(int) Load 8(x)
31: 30(ptr) AccessChain 28(i.pos) 29
32: 20(fvec4) Load 31
34: 33(ptr) AccessChain 23(o) 9
Store 34 32
37: 33(ptr) AccessChain 23(o) 9
38: 20(fvec4) Load 37
Store 36(ts.pos) 38
EmitVertex
Branch 13
13: Label
39: 6(int) Load 8(x)
41: 6(int) IAdd 39 40
Store 8(x) 41
Branch 10
12: Label
Return
FunctionEnd

View File

@@ -0,0 +1,108 @@
hlsl.struct.split.trivial.vert
Shader version: 450
0:? Sequence
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Function Parameters:
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:16 'Pos_loose' (in 4-component vector of float Position)
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:19 Pos: direct index for structure (temp 4-component vector of float)
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
0:19 Constant:
0:19 0 (const int)
0:19 add (temp 4-component vector of float)
0:? 'Pos_in' (in 4-component vector of float Position)
0:19 'Pos_loose' (in 4-component vector of float Position)
0:21 Sequence
0:21 Sequence
0:21 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:21 Pos: direct index for structure (temp 4-component vector of float)
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
0:21 Constant:
0:21 0 (const int)
0:21 Branch: Return
0:? Linker Objects
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos' (out 4-component vector of float Position)
Linked vertex stage:
Shader version: 450
0:? Sequence
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Function Parameters:
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:16 'Pos_loose' (in 4-component vector of float Position)
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:19 Pos: direct index for structure (temp 4-component vector of float)
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
0:19 Constant:
0:19 0 (const int)
0:19 add (temp 4-component vector of float)
0:? 'Pos_in' (in 4-component vector of float Position)
0:19 'Pos_loose' (in 4-component vector of float Position)
0:21 Sequence
0:21 Sequence
0:21 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:21 Pos: direct index for structure (temp 4-component vector of float)
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
0:21 Constant:
0:21 0 (const int)
0:21 Branch: Return
0:? Linker Objects
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos' (out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 26
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 14 16 22
Name 4 "main"
Name 8 "VS_OUTPUT"
MemberName 8(VS_OUTPUT) 0 "Pos"
Name 10 "vsout"
Name 14 "Pos_in"
Name 16 "Pos_loose"
Name 22 "Pos"
Decorate 14(Pos_in) BuiltIn Position
Decorate 16(Pos_loose) BuiltIn Position
Decorate 22(Pos) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(VS_OUTPUT): TypeStruct 7(fvec4)
9: TypePointer Function 8(VS_OUTPUT)
11: TypeInt 32 1
12: 11(int) Constant 0
13: TypePointer Input 7(fvec4)
14(Pos_in): 13(ptr) Variable Input
16(Pos_loose): 13(ptr) Variable Input
19: TypePointer Function 7(fvec4)
21: TypePointer Output 7(fvec4)
22(Pos): 21(ptr) Variable Output
4(main): 2 Function None 3
5: Label
10(vsout): 9(ptr) Variable Function
15: 7(fvec4) Load 14(Pos_in)
17: 7(fvec4) Load 16(Pos_loose)
18: 7(fvec4) FAdd 15 17
20: 19(ptr) AccessChain 10(vsout) 12
Store 20 18
23: 19(ptr) AccessChain 10(vsout) 12
24: 7(fvec4) Load 23
Store 22(Pos) 24
Return
FunctionEnd

View File

@@ -1,52 +1,82 @@
hlsl.structarray.flatten.geom
ERROR: 0:10: 'vin' : recursive type not yet supported in GS input
ERROR: 1 compilation errors. No code generated.
Shader version: 450
invocations = -1
max_vertices = 4
input primitive = lines
output primitive = triangle_strip
ERROR: node is still EOpNull!
0:10 Function Definition: main(struct-VertexData-vf4-vf4-vf21[2];struct-VertexData-vf4-vf4-vf21; (temp void)
0:10 Function Parameters:
0:10 'vin' (in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:10 'outStream' (out structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Sequence
0:16 Function Definition: main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; (temp void)
0:16 Function Parameters:
0:16 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'outStream' (out structure{temp 4-component vector of float Position position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:13 color: direct index for structure (temp 4-component vector of float)
0:13 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:13 Constant:
0:13 1 (const int)
0:? 'vin[0].color' (layout(location=1 ) in 4-component vector of float)
0:14 move second child to first child (temp 2-component vector of float)
0:14 uv: direct index for structure (temp 2-component vector of float)
0:14 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:14 Constant:
0:14 2 (const int)
0:? 'vin[0].uv' (layout(location=2 ) in 2-component vector of float)
0:15 move second child to first child (temp 4-component vector of float)
0:15 position: direct index for structure (temp 4-component vector of float)
0:15 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:15 Constant:
0:15 0 (const int)
0:? 'vin[0].position' (layout(location=0 ) in 4-component vector of float)
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'outStream' (out structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 EmitVertex (temp void)
0:19 move second child to first child (temp 4-component vector of float)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 Constant:
0:19 1 (const int)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 Constant:
0:19 1 (const int)
0:19 Constant:
0:19 1 (const int)
0:20 move second child to first child (temp 2-component vector of float)
0:20 uv: direct index for structure (temp 2-component vector of float)
0:20 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 Constant:
0:20 2 (const int)
0:20 uv: direct index for structure (temp 2-component vector of float)
0:20 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 Constant:
0:20 1 (const int)
0:20 Constant:
0:20 2 (const int)
0:21 move second child to first child (temp 4-component vector of float)
0:21 position: direct index for structure (temp 4-component vector of float)
0:21 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 Constant:
0:21 0 (const int)
0:21 position: direct index for structure (temp 4-component vector of float)
0:21 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 Constant:
0:21 1 (const int)
0:21 Constant:
0:21 0 (const int)
0:22 Sequence
0:22 Sequence
0:22 move second child to first child (temp 4-component vector of float)
0:? 'outStream.position' (out 4-component vector of float Position)
0:22 position: direct index for structure (temp 4-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 0 (const int)
0:22 move second child to first child (temp 4-component vector of float)
0:22 color: direct index for structure (temp 4-component vector of float)
0:22 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 0 (const int)
0:22 color: direct index for structure (temp 4-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 1 (const int)
0:22 move second child to first child (temp 2-component vector of float)
0:22 uv: direct index for structure (temp 2-component vector of float)
0:22 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 1 (const int)
0:22 uv: direct index for structure (temp 2-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 2 (const int)
0:22 EmitVertex (temp void)
0:? Linker Objects
0:? 'vin[0].position' (layout(location=0 ) in 4-component vector of float)
0:? 'vin[0].color' (layout(location=1 ) in 4-component vector of float)
0:? 'vin[0].uv' (layout(location=2 ) in 2-component vector of float)
0:? 'vin[1].position' (layout(location=3 ) in 4-component vector of float)
0:? 'vin[1].color' (layout(location=4 ) in 4-component vector of float)
0:? 'vin[1].uv' (layout(location=5 ) in 2-component vector of float)
0:? 'position' (layout(location=0 ) out 4-component vector of float)
0:? 'color' (layout(location=1 ) out 4-component vector of float)
0:? 'uv' (layout(location=2 ) out 2-component vector of float)
0:? 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream.position' (out 4-component vector of float Position)
Linked geometry stage:
@@ -57,44 +87,164 @@ invocations = 1
max_vertices = 4
input primitive = lines
output primitive = triangle_strip
ERROR: node is still EOpNull!
0:10 Function Definition: main(struct-VertexData-vf4-vf4-vf21[2];struct-VertexData-vf4-vf4-vf21; (temp void)
0:10 Function Parameters:
0:10 'vin' (in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:10 'outStream' (out structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Sequence
0:16 Function Definition: main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21; (temp void)
0:16 Function Parameters:
0:16 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'outStream' (out structure{temp 4-component vector of float Position position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:13 color: direct index for structure (temp 4-component vector of float)
0:13 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:13 Constant:
0:13 1 (const int)
0:? 'vin[0].color' (layout(location=1 ) in 4-component vector of float)
0:14 move second child to first child (temp 2-component vector of float)
0:14 uv: direct index for structure (temp 2-component vector of float)
0:14 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:14 Constant:
0:14 2 (const int)
0:? 'vin[0].uv' (layout(location=2 ) in 2-component vector of float)
0:15 move second child to first child (temp 4-component vector of float)
0:15 position: direct index for structure (temp 4-component vector of float)
0:15 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:15 Constant:
0:15 0 (const int)
0:? 'vin[0].position' (layout(location=0 ) in 4-component vector of float)
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'outStream' (out structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:16 EmitVertex (temp void)
0:19 move second child to first child (temp 4-component vector of float)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 Constant:
0:19 1 (const int)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:19 Constant:
0:19 1 (const int)
0:19 Constant:
0:19 1 (const int)
0:20 move second child to first child (temp 2-component vector of float)
0:20 uv: direct index for structure (temp 2-component vector of float)
0:20 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 Constant:
0:20 2 (const int)
0:20 uv: direct index for structure (temp 2-component vector of float)
0:20 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:20 Constant:
0:20 1 (const int)
0:20 Constant:
0:20 2 (const int)
0:21 move second child to first child (temp 4-component vector of float)
0:21 position: direct index for structure (temp 4-component vector of float)
0:21 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 Constant:
0:21 0 (const int)
0:21 position: direct index for structure (temp 4-component vector of float)
0:21 direct index (layout(location=0 ) temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:21 Constant:
0:21 1 (const int)
0:21 Constant:
0:21 0 (const int)
0:22 Sequence
0:22 Sequence
0:22 move second child to first child (temp 4-component vector of float)
0:? 'outStream.position' (out 4-component vector of float Position)
0:22 position: direct index for structure (temp 4-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 0 (const int)
0:22 move second child to first child (temp 4-component vector of float)
0:22 color: direct index for structure (temp 4-component vector of float)
0:22 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 0 (const int)
0:22 color: direct index for structure (temp 4-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 1 (const int)
0:22 move second child to first child (temp 2-component vector of float)
0:22 uv: direct index for structure (temp 2-component vector of float)
0:22 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 1 (const int)
0:22 uv: direct index for structure (temp 2-component vector of float)
0:22 'vout' (temp structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:22 Constant:
0:22 2 (const int)
0:22 EmitVertex (temp void)
0:? Linker Objects
0:? 'vin[0].position' (layout(location=0 ) in 4-component vector of float)
0:? 'vin[0].color' (layout(location=1 ) in 4-component vector of float)
0:? 'vin[0].uv' (layout(location=2 ) in 2-component vector of float)
0:? 'vin[1].position' (layout(location=3 ) in 4-component vector of float)
0:? 'vin[1].color' (layout(location=4 ) in 4-component vector of float)
0:? 'vin[1].uv' (layout(location=5 ) in 2-component vector of float)
0:? 'position' (layout(location=0 ) out 4-component vector of float)
0:? 'color' (layout(location=1 ) out 4-component vector of float)
0:? 'uv' (layout(location=2 ) out 2-component vector of float)
0:? 'vin' (layout(location=0 ) in 2-element array of structure{temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream' (layout(location=0 ) out structure{temp 4-component vector of float color, temp 2-component vector of float uv})
0:? 'outStream.position' (out 4-component vector of float Position)
SPIR-V is not generated for failed compile or link
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 49
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 19 36 41
ExecutionMode 4 InputLines
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 4
Name 4 "main"
Name 9 "PS_IN"
MemberName 9(PS_IN) 0 "position"
MemberName 9(PS_IN) 1 "color"
MemberName 9(PS_IN) 2 "uv"
Name 11 "vout"
Name 14 "VertexData"
MemberName 14(VertexData) 0 "position"
MemberName 14(VertexData) 1 "color"
MemberName 14(VertexData) 2 "uv"
Name 19 "vin"
Name 36 "outStream.position"
Name 39 "PS_IN"
MemberName 39(PS_IN) 0 "color"
MemberName 39(PS_IN) 1 "uv"
Name 41 "outStream"
Decorate 19(vin) Location 0
Decorate 36(outStream.position) BuiltIn Position
Decorate 41(outStream) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeVector 6(float) 2
9(PS_IN): TypeStruct 7(fvec4) 7(fvec4) 8(fvec2)
10: TypePointer Function 9(PS_IN)
12: TypeInt 32 1
13: 12(int) Constant 1
14(VertexData): TypeStruct 7(fvec4) 7(fvec4) 8(fvec2)
15: TypeInt 32 0
16: 15(int) Constant 2
17: TypeArray 14(VertexData) 16
18: TypePointer Input 17
19(vin): 18(ptr) Variable Input
20: TypePointer Input 7(fvec4)
23: TypePointer Function 7(fvec4)
25: 12(int) Constant 2
26: TypePointer Input 8(fvec2)
29: TypePointer Function 8(fvec2)
31: 12(int) Constant 0
35: TypePointer Output 7(fvec4)
36(outStream.position): 35(ptr) Variable Output
39(PS_IN): TypeStruct 7(fvec4) 8(fvec2)
40: TypePointer Output 39(PS_IN)
41(outStream): 40(ptr) Variable Output
47: TypePointer Output 8(fvec2)
4(main): 2 Function None 3
5: Label
11(vout): 10(ptr) Variable Function
21: 20(ptr) AccessChain 19(vin) 13 13
22: 7(fvec4) Load 21
24: 23(ptr) AccessChain 11(vout) 13
Store 24 22
27: 26(ptr) AccessChain 19(vin) 13 25
28: 8(fvec2) Load 27
30: 29(ptr) AccessChain 11(vout) 25
Store 30 28
32: 20(ptr) AccessChain 19(vin) 13 31
33: 7(fvec4) Load 32
34: 23(ptr) AccessChain 11(vout) 31
Store 34 33
37: 23(ptr) AccessChain 11(vout) 31
38: 7(fvec4) Load 37
Store 36(outStream.position) 38
42: 23(ptr) AccessChain 11(vout) 13
43: 7(fvec4) Load 42
44: 35(ptr) AccessChain 41(outStream) 31
Store 44 43
45: 29(ptr) AccessChain 11(vout) 25
46: 8(fvec2) Load 45
48: 47(ptr) AccessChain 41(outStream) 13
Store 48 46
EmitVertex
Return
FunctionEnd

View File

@@ -28,50 +28,42 @@ Shader version: 450
0:11 'e' (layout(location=5 ) in 4-component vector of float)
0:13 Sequence
0:13 Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:13 direct index (temp 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 2-element array of 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:13 direct index (temp 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 2-component vector of uint)
0:13 coord: direct index for structure (temp 2-component vector of uint)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 1 (const int)
0:13 move second child to first child (temp 2-component vector of uint)
0:? 'coord' (layout(location=2 ) out 2-component vector of uint)
0:13 coord: direct index for structure (temp 2-component vector of uint)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 1 (const int)
0:13 move second child to first child (temp 4-component vector of float)
0:? 'b' (layout(location=3 ) smooth out 4-component vector of float)
0:13 b: direct index for structure (smooth temp 4-component vector of float)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 2 (const int)
0:13 b: direct index for structure (temp 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 2 (const int)
0:13 Branch: Return
0:? Linker Objects
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:? 'coord' (layout(location=2 ) out 2-component vector of uint)
0:? 'b' (layout(location=3 ) smooth out 4-component vector of float)
0:? '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:? 'd' (layout(location=0 ) in 4-component vector of float)
0:? 'm[0]' (layout(location=1 ) in 4-component vector of float)
0:? 'm[1]' (layout(location=2 ) in 4-component vector of float)
0:? 'coord' (layout(location=3 ) in 2-component vector of uint)
0:? 'b' (layout(location=4 ) in 4-component vector of float)
0:? 'b' (layout(location=4 ) smooth in 4-component vector of float)
0:? 'e' (layout(location=5 ) in 4-component vector of float)
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:? 'm[0]' (layout(location=1 ) in 4-component vector of float)
0:? 'm[1]' (layout(location=2 ) in 4-component vector of float)
@@ -108,61 +100,53 @@ Shader version: 450
0:11 'e' (layout(location=5 ) in 4-component vector of float)
0:13 Sequence
0:13 Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:13 direct index (temp 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 2-element array of 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:13 direct index (temp 4-component vector of float)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 m: direct index for structure (temp 2-element array of 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 0 (const int)
0:13 move second child to first child (temp 2-component vector of uint)
0:13 coord: direct index for structure (temp 2-component vector of uint)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 1 (const int)
0:13 move second child to first child (temp 2-component vector of uint)
0:? 'coord' (layout(location=2 ) out 2-component vector of uint)
0:13 coord: direct index for structure (temp 2-component vector of uint)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 1 (const int)
0:13 move second child to first child (temp 4-component vector of float)
0:? 'b' (layout(location=3 ) smooth out 4-component vector of float)
0:13 b: direct index for structure (smooth temp 4-component vector of float)
0:13 '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:13 Constant:
0:13 2 (const int)
0:13 b: direct index for structure (temp 4-component vector of float)
0:13 'local' (temp structure{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, temp 4-component vector of float b})
0:13 Constant:
0:13 2 (const int)
0:13 Branch: Return
0:? Linker Objects
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:? 'coord' (layout(location=2 ) out 2-component vector of uint)
0:? 'b' (layout(location=3 ) smooth out 4-component vector of float)
0:? '@entryPointOutput' (out structure Position{temp 2-element array of 4-component vector of float m, temp 2-component vector of uint coord, smooth temp 4-component vector of float b})
0:? 'd' (layout(location=0 ) in 4-component vector of float)
0:? 'm[0]' (layout(location=1 ) in 4-component vector of float)
0:? 'm[1]' (layout(location=2 ) in 4-component vector of float)
0:? 'coord' (layout(location=3 ) in 2-component vector of uint)
0:? 'b' (layout(location=4 ) in 4-component vector of float)
0:? 'b' (layout(location=4 ) smooth in 4-component vector of float)
0:? 'e' (layout(location=5 ) in 4-component vector of float)
0:? 'm[0]' (layout(location=0 ) out 4-component vector of float)
0:? 'm[1]' (layout(location=1 ) out 4-component vector of float)
0:? 'm[0]' (layout(location=1 ) in 4-component vector of float)
0:? 'm[1]' (layout(location=2 ) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 59
// Id's are bound by 61
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 18 20 24 32 35 41 45 50 54 58
EntryPoint Vertex 4 "main" 18 20 24 32 35 42 60
Name 4 "main"
Name 12 "VI"
MemberName 12(VI) 0 "m"
@@ -174,21 +158,19 @@ Shader version: 450
Name 24 "coord"
Name 32 "d"
Name 35 "e"
Name 41 "m[0]"
Name 45 "m[1]"
Name 50 "coord"
Name 54 "b"
Name 58 "b"
Name 40 "VI"
MemberName 40(VI) 0 "m"
MemberName 40(VI) 1 "coord"
MemberName 40(VI) 2 "b"
Name 42 "@entryPointOutput"
Name 60 "b"
Decorate 18(m[1]) Location 2
Decorate 20(m[0]) Location 1
Decorate 24(coord) Location 3
Decorate 32(d) Location 0
Decorate 35(e) Location 5
Decorate 41(m[0]) Location 0
Decorate 45(m[1]) Location 1
Decorate 50(coord) Location 2
Decorate 54(b) Location 3
Decorate 58(b) Location 4
Decorate 42(@entryPointOutput) BuiltIn Position
Decorate 60(b) Location 4
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -211,16 +193,17 @@ Shader version: 450
32(d): 17(ptr) Variable Input
35(e): 17(ptr) Variable Input
38: TypePointer Function 7(fvec4)
40: TypePointer Output 7(fvec4)
41(m[0]): 40(ptr) Variable Output
42: 15(int) Constant 0
45(m[1]): 40(ptr) Variable Output
46: 15(int) Constant 1
49: TypePointer Output 11(ivec2)
50(coord): 49(ptr) Variable Output
51: TypePointer Function 11(ivec2)
54(b): 40(ptr) Variable Output
58(b): 17(ptr) Variable Input
40(VI): TypeStruct 10 11(ivec2) 7(fvec4)
41: TypePointer Output 40(VI)
42(@entryPointOutput): 41(ptr) Variable Output
43: 15(int) Constant 0
44: TypePointer Function 10
47: TypePointer Output 10
49: 15(int) Constant 1
50: TypePointer Function 11(ivec2)
53: TypePointer Output 11(ivec2)
57: TypePointer Output 7(fvec4)
60(b): 17(ptr) Variable Input
4(main): 2 Function None 3
5: Label
14(local): 13(ptr) Variable Function
@@ -238,17 +221,17 @@ Shader version: 450
37: 7(fvec4) FAdd 34 36
39: 38(ptr) AccessChain 14(local) 16
Store 39 37
43: 38(ptr) AccessChain 14(local) 42 42
44: 7(fvec4) Load 43
Store 41(m[0]) 44
47: 38(ptr) AccessChain 14(local) 42 46
48: 7(fvec4) Load 47
Store 45(m[1]) 48
52: 51(ptr) AccessChain 14(local) 46
53: 11(ivec2) Load 52
Store 50(coord) 53
45: 44(ptr) AccessChain 14(local) 43
46: 10 Load 45
48: 47(ptr) AccessChain 42(@entryPointOutput) 43
Store 48 46
51: 50(ptr) AccessChain 14(local) 49
52: 11(ivec2) Load 51
54: 53(ptr) AccessChain 42(@entryPointOutput) 49
Store 54 52
55: 38(ptr) AccessChain 14(local) 16
56: 7(fvec4) Load 55
Store 54(b) 56
58: 57(ptr) AccessChain 42(@entryPointOutput) 16
Store 58 56
Return
FunctionEnd

View File

@@ -0,0 +1,161 @@
hlsl.type.half.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:3 Function Definition: main( (temp 4-component vector of float)
0:3 Function Parameters:
0:? Sequence
0:4 Sequence
0:4 move second child to first child (temp mediump float)
0:4 'h0' (temp mediump float)
0:4 Constant:
0:4 0.000000
0:5 Sequence
0:5 move second child to first child (temp mediump 1-component vector of float)
0:5 'h1' (temp mediump 1-component vector of float)
0:5 Constant:
0:5 1.000000
0:6 Sequence
0:6 move second child to first child (temp mediump 2-component vector of float)
0:6 'h2' (temp mediump 2-component vector of float)
0:6 Constant:
0:6 2.000000
0:6 2.000000
0:7 Sequence
0:7 move second child to first child (temp mediump 3-component vector of float)
0:7 'h3' (temp mediump 3-component vector of float)
0:7 Constant:
0:7 3.000000
0:7 3.000000
0:7 3.000000
0:8 Sequence
0:8 move second child to first child (temp mediump 4-component vector of float)
0:8 'h4' (temp mediump 4-component vector of float)
0:8 Constant:
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:10 Sequence
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:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:3 Function Definition: main( (temp 4-component vector of float)
0:3 Function Parameters:
0:? Sequence
0:4 Sequence
0:4 move second child to first child (temp mediump float)
0:4 'h0' (temp mediump float)
0:4 Constant:
0:4 0.000000
0:5 Sequence
0:5 move second child to first child (temp mediump 1-component vector of float)
0:5 'h1' (temp mediump 1-component vector of float)
0:5 Constant:
0:5 1.000000
0:6 Sequence
0:6 move second child to first child (temp mediump 2-component vector of float)
0:6 'h2' (temp mediump 2-component vector of float)
0:6 Constant:
0:6 2.000000
0:6 2.000000
0:7 Sequence
0:7 move second child to first child (temp mediump 3-component vector of float)
0:7 'h3' (temp mediump 3-component vector of float)
0:7 Constant:
0:7 3.000000
0:7 3.000000
0:7 3.000000
0:8 Sequence
0:8 move second child to first child (temp mediump 4-component vector of float)
0:8 'h4' (temp mediump 4-component vector of float)
0:8 Constant:
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:10 Sequence
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:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 31
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 28
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "h0"
Name 10 "h1"
Name 14 "h2"
Name 19 "h3"
Name 24 "h4"
Name 28 "@entryPointOutput"
Decorate 8(h0) RelaxedPrecision
Decorate 10(h1) RelaxedPrecision
Decorate 14(h2) RelaxedPrecision
Decorate 19(h3) RelaxedPrecision
Decorate 24(h4) RelaxedPrecision
Decorate 28(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
9: 6(float) Constant 0
11: 6(float) Constant 1065353216
12: TypeVector 6(float) 2
13: TypePointer Function 12(fvec2)
15: 6(float) Constant 1073741824
16: 12(fvec2) ConstantComposite 15 15
17: TypeVector 6(float) 3
18: TypePointer Function 17(fvec3)
20: 6(float) Constant 1077936128
21: 17(fvec3) ConstantComposite 20 20 20
22: TypeVector 6(float) 4
23: TypePointer Function 22(fvec4)
25: 6(float) Constant 1082130432
26: 22(fvec4) ConstantComposite 25 25 25 25
27: TypePointer Output 22(fvec4)
28(@entryPointOutput): 27(ptr) Variable Output
29: 22(fvec4) ConstantComposite 9 9 9 9
4(main): 2 Function None 3
5: Label
8(h0): 7(ptr) Variable Function
10(h1): 7(ptr) Variable Function
14(h2): 13(ptr) Variable Function
19(h3): 18(ptr) Variable Function
24(h4): 23(ptr) Variable Function
Store 8(h0) 9
Store 10(h1) 11
Store 14(h2) 16
Store 19(h3) 21
Store 24(h4) 26
Store 28(@entryPointOutput) 29
Return
FunctionEnd

View File

@@ -0,0 +1,382 @@
hlsl.type.identifier.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:6 Function Definition: fn(f1; (temp float)
0:6 Function Parameters:
0:6 'float' (in float)
0:? Sequence
0:6 Branch: Return with expression
0:6 'float' (in float)
0:9 Function Definition: main( (temp 4-component vector of float)
0:9 Function Parameters:
0:? Sequence
0:10 Sequence
0:10 move second child to first child (temp float)
0:10 'float' (temp float)
0:10 Constant:
0:10 7.000000
0:11 Sequence
0:11 move second child to first child (temp 2-element array of bool)
0:11 'bool' (temp 2-element array of bool)
0:11 Construct bool (temp 2-element array of bool)
0:11 Convert float to bool (temp bool)
0:11 'float' (temp float)
0:11 Convert float to bool (temp bool)
0:11 'float' (temp float)
0:12 Sequence
0:12 move second child to first child (temp int)
0:12 'int' (temp int)
0:12 Convert bool to int (temp int)
0:12 direct index (temp bool)
0:12 'bool' (temp 2-element array of bool)
0:12 Constant:
0:12 1 (const int)
0:13 Sequence
0:13 move second child to first child (temp uint)
0:13 'uint' (temp uint)
0:13 Convert float to uint (temp uint)
0:13 add (temp float)
0:13 'float' (temp float)
0:13 Convert int to float (temp float)
0:13 'int' (temp int)
0:14 Sequence
0:14 move second child to first child (temp mediump float)
0:14 'min16float' (temp mediump float)
0:14 Convert uint to float (temp mediump float)
0:14 'uint' (temp mediump uint)
0:15 Sequence
0:15 move second child to first child (temp mediump float)
0:15 'min10float' (temp mediump float)
0:15 'min16float' (temp mediump float)
0:16 Sequence
0:16 move second child to first child (temp mediump float)
0:16 'half' (temp mediump float)
0:16 Constant:
0:16 0.500000
0:? Sequence
0:20 move second child to first child (temp float)
0:20 float: direct index for structure (temp float)
0:20 'float' (temp structure{temp float float})
0:20 Constant:
0:20 0 (const int)
0:20 Constant:
0:20 42.000000
0:23 move second child to first child (temp bool)
0:23 direct index (temp bool)
0:23 'bool' (temp 2-element array of bool)
0:23 Constant:
0:23 0 (const int)
0:23 direct index (temp bool)
0:23 'bool' (temp 2-element array of bool)
0:23 Constant:
0:23 1 (const int)
0:25 move second child to first child (temp mediump float)
0:25 'float' (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 'float' (temp mediump float)
0:25 Convert int to float (temp mediump float)
0:25 'int' (temp mediump int)
0:25 Convert uint to float (temp mediump float)
0:25 'uint' (temp mediump uint)
0:25 'min16float' (temp mediump float)
0:25 'min10float' (temp mediump float)
0:25 Test condition and select (temp mediump float)
0:25 Condition
0:25 direct index (temp bool)
0:25 'bool' (temp 2-element array of bool)
0:25 Constant:
0:25 0 (const int)
0:25 true case
0:25 Convert int to float (temp mediump float)
0:25 'int' (temp mediump int)
0:25 false case
0:25 'float' (temp mediump float)
0:25 Function Call: fn(f1; (temp mediump float)
0:25 'float' (temp mediump float)
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:27 Construct vec4 (temp 4-component vector of float)
0:27 'float' (temp float)
0:27 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:6 Function Definition: fn(f1; (temp float)
0:6 Function Parameters:
0:6 'float' (in float)
0:? Sequence
0:6 Branch: Return with expression
0:6 'float' (in float)
0:9 Function Definition: main( (temp 4-component vector of float)
0:9 Function Parameters:
0:? Sequence
0:10 Sequence
0:10 move second child to first child (temp float)
0:10 'float' (temp float)
0:10 Constant:
0:10 7.000000
0:11 Sequence
0:11 move second child to first child (temp 2-element array of bool)
0:11 'bool' (temp 2-element array of bool)
0:11 Construct bool (temp 2-element array of bool)
0:11 Convert float to bool (temp bool)
0:11 'float' (temp float)
0:11 Convert float to bool (temp bool)
0:11 'float' (temp float)
0:12 Sequence
0:12 move second child to first child (temp int)
0:12 'int' (temp int)
0:12 Convert bool to int (temp int)
0:12 direct index (temp bool)
0:12 'bool' (temp 2-element array of bool)
0:12 Constant:
0:12 1 (const int)
0:13 Sequence
0:13 move second child to first child (temp uint)
0:13 'uint' (temp uint)
0:13 Convert float to uint (temp uint)
0:13 add (temp float)
0:13 'float' (temp float)
0:13 Convert int to float (temp float)
0:13 'int' (temp int)
0:14 Sequence
0:14 move second child to first child (temp mediump float)
0:14 'min16float' (temp mediump float)
0:14 Convert uint to float (temp mediump float)
0:14 'uint' (temp mediump uint)
0:15 Sequence
0:15 move second child to first child (temp mediump float)
0:15 'min10float' (temp mediump float)
0:15 'min16float' (temp mediump float)
0:16 Sequence
0:16 move second child to first child (temp mediump float)
0:16 'half' (temp mediump float)
0:16 Constant:
0:16 0.500000
0:? Sequence
0:20 move second child to first child (temp float)
0:20 float: direct index for structure (temp float)
0:20 'float' (temp structure{temp float float})
0:20 Constant:
0:20 0 (const int)
0:20 Constant:
0:20 42.000000
0:23 move second child to first child (temp bool)
0:23 direct index (temp bool)
0:23 'bool' (temp 2-element array of bool)
0:23 Constant:
0:23 0 (const int)
0:23 direct index (temp bool)
0:23 'bool' (temp 2-element array of bool)
0:23 Constant:
0:23 1 (const int)
0:25 move second child to first child (temp mediump float)
0:25 'float' (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 add (temp mediump float)
0:25 'float' (temp mediump float)
0:25 Convert int to float (temp mediump float)
0:25 'int' (temp mediump int)
0:25 Convert uint to float (temp mediump float)
0:25 'uint' (temp mediump uint)
0:25 'min16float' (temp mediump float)
0:25 'min10float' (temp mediump float)
0:25 Test condition and select (temp mediump float)
0:25 Condition
0:25 direct index (temp bool)
0:25 'bool' (temp 2-element array of bool)
0:25 Constant:
0:25 0 (const int)
0:25 true case
0:25 Convert int to float (temp mediump float)
0:25 'int' (temp mediump int)
0:25 false case
0:25 'float' (temp mediump float)
0:25 Function Call: fn(f1; (temp mediump float)
0:25 'float' (temp mediump float)
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:27 Construct vec4 (temp 4-component vector of float)
0:27 'float' (temp float)
0:27 Branch: Return
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 92
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 88
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 10 "fn(f1;"
Name 9 "float"
Name 15 "float"
Name 22 "bool"
Name 31 "int"
Name 39 "uint"
Name 45 "min16float"
Name 48 "min10float"
Name 50 "half"
Name 52 "foo_t"
MemberName 52(foo_t) 0 "float"
Name 54 "float"
Name 82 "param"
Name 88 "@entryPointOutput"
Decorate 45(min16float) RelaxedPrecision
Decorate 46 RelaxedPrecision
Decorate 47 RelaxedPrecision
Decorate 48(min10float) RelaxedPrecision
Decorate 49 RelaxedPrecision
Decorate 50(half) RelaxedPrecision
Decorate 60 RelaxedPrecision
Decorate 61 RelaxedPrecision
Decorate 62 RelaxedPrecision
Decorate 63 RelaxedPrecision
Decorate 64 RelaxedPrecision
Decorate 65 RelaxedPrecision
Decorate 66 RelaxedPrecision
Decorate 67 RelaxedPrecision
Decorate 68 RelaxedPrecision
Decorate 69 RelaxedPrecision
Decorate 70 RelaxedPrecision
Decorate 76 RelaxedPrecision
Decorate 77 RelaxedPrecision
Decorate 79 RelaxedPrecision
Decorate 80 RelaxedPrecision
Decorate 81 RelaxedPrecision
Decorate 83 RelaxedPrecision
Decorate 84 RelaxedPrecision
Decorate 85 RelaxedPrecision
Decorate 88(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr)
16: 6(float) Constant 1088421888
17: TypeBool
18: TypeInt 32 0
19: 18(int) Constant 2
20: TypeArray 17(bool) 19
21: TypePointer Function 20
24: 6(float) Constant 0
29: TypeInt 32 1
30: TypePointer Function 29(int)
32: 29(int) Constant 1
33: TypePointer Function 17(bool)
36: 29(int) Constant 0
38: TypePointer Function 18(int)
51: 6(float) Constant 1056964608
52(foo_t): TypeStruct 6(float)
53: TypePointer Function 52(foo_t)
55: 6(float) Constant 1109917696
86: TypeVector 6(float) 4
87: TypePointer Output 86(fvec4)
88(@entryPointOutput): 87(ptr) Variable Output
4(main): 2 Function None 3
5: Label
15(float): 7(ptr) Variable Function
22(bool): 21(ptr) Variable Function
31(int): 30(ptr) Variable Function
39(uint): 38(ptr) Variable Function
45(min16float): 7(ptr) Variable Function
48(min10float): 7(ptr) Variable Function
50(half): 7(ptr) Variable Function
54(float): 53(ptr) Variable Function
71: 7(ptr) Variable Function
82(param): 7(ptr) Variable Function
Store 15(float) 16
23: 6(float) Load 15(float)
25: 17(bool) FOrdNotEqual 23 24
26: 6(float) Load 15(float)
27: 17(bool) FOrdNotEqual 26 24
28: 20 CompositeConstruct 25 27
Store 22(bool) 28
34: 33(ptr) AccessChain 22(bool) 32
35: 17(bool) Load 34
37: 29(int) Select 35 32 36
Store 31(int) 37
40: 6(float) Load 15(float)
41: 29(int) Load 31(int)
42: 6(float) ConvertSToF 41
43: 6(float) FAdd 40 42
44: 18(int) ConvertFToU 43
Store 39(uint) 44
46: 18(int) Load 39(uint)
47: 6(float) ConvertUToF 46
Store 45(min16float) 47
49: 6(float) Load 45(min16float)
Store 48(min10float) 49
Store 50(half) 51
56: 7(ptr) AccessChain 54(float) 36
Store 56 55
57: 33(ptr) AccessChain 22(bool) 32
58: 17(bool) Load 57
59: 33(ptr) AccessChain 22(bool) 36
Store 59 58
60: 6(float) Load 15(float)
61: 29(int) Load 31(int)
62: 6(float) ConvertSToF 61
63: 6(float) FAdd 60 62
64: 18(int) Load 39(uint)
65: 6(float) ConvertUToF 64
66: 6(float) FAdd 63 65
67: 6(float) Load 45(min16float)
68: 6(float) FAdd 66 67
69: 6(float) Load 48(min10float)
70: 6(float) FAdd 68 69
72: 33(ptr) AccessChain 22(bool) 36
73: 17(bool) Load 72
SelectionMerge 75 None
BranchConditional 73 74 78
74: Label
76: 29(int) Load 31(int)
77: 6(float) ConvertSToF 76
Store 71 77
Branch 75
78: Label
79: 6(float) Load 15(float)
Store 71 79
Branch 75
75: Label
80: 6(float) Load 71
81: 6(float) FAdd 70 80
83: 6(float) Load 15(float)
Store 82(param) 83
84: 6(float) FunctionCall 10(fn(f1;) 82(param)
85: 6(float) FAdd 81 84
Store 15(float) 85
89: 6(float) Load 15(float)
90: 86(fvec4) CompositeConstruct 89 89 89 89
Store 88(@entryPointOutput) 90
Return
FunctionEnd
10(fn(f1;): 6(float) Function None 8
9(float): 7(ptr) FunctionParameter
11: Label
12: 6(float) Load 9(float)
ReturnValue 12
FunctionEnd

View File

@@ -1,13 +1,13 @@
ERROR: 0:8000: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:8000: '#include' : must be followed by a file designation
ERROR: 0:8000: '#include' : must be followed by a header name
ERROR: 0:8001: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:8001: '#include' : must be followed by a file designation
ERROR: 0:8001: '#include' : must be followed by a header name
ERROR: 0:8002: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:8002: '#include' : unexpected include directive
ERROR: 0:8003: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:8003: '#include' : extra content after file designation
ERROR: 0:8003: '#include' : extra content after header name
ERROR: 0:8004: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:8004: '#include' : unexpected include directive
ERROR: 0:8004: '#include' : expected newline
ERROR: 10 compilation errors. No code generated.

View File

@@ -1,8 +1,13 @@
ERROR: 0:8000: '#include' : must be followed by a file designation
ERROR: 0:8001: '#include' : must be followed by a file designation
ERROR: 0:8000: '#include' : must be followed by a header name
ERROR: 0:8001: '#include' : must be followed by a header name
ERROR: 0:8002: '#include' : unexpected include directive
ERROR: 0:8003: '#include' : extra content after file designation
ERROR: 0:8004: '#include' : unexpected include directive
ERROR: 5 compilation errors. No code generated.
ERROR: 0:8003: '#include' : unexpected include directive
ERROR: 0:8004: '#include' : extra content after header name
ERROR: 0:8005: '#include' : extra content after header name
ERROR: 0:8007: '#include' : unexpected include directive
ERROR: 0:8009: '' : header name too long
ERROR: 0:8009: '#include' : unexpected include directive
ERROR: 0:8010: '#include' : expected newline
ERROR: 10 compilation errors. No code generated.

View File

@@ -40,7 +40,8 @@ ERROR: 0:92: 'call argument' : sampler constructor must appear at point of use
ERROR: 0:93: ',' : sampler constructor must appear at point of use
ERROR: 0:94: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type 'temp sampler2D' and a right operand of type 'temp sampler2D' (or there is no acceptable conversion)
ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use
ERROR: 38 compilation errors. No code generated.
ERROR: 0:96: 'gl_NumSamples' : undeclared identifier
ERROR: 39 compilation errors. No code generated.
ERROR: Linking fragment stage: Only one push_constant block is allowed per stage

3
3rdparty/glslang/Test/cppBad2.vert vendored Executable file
View File

@@ -0,0 +1,3 @@
#define a b(
#define b(x)
b(a)

View File

@@ -1,6 +1,6 @@
groupshared float4 a[100];
void main(int dti : SV_DispatchThreadID)
void main(int dti : SV_DispatchThreadID, int gti : SV_GroupThreadID)
{
dti;
dti - gti;
}

View File

@@ -9,7 +9,7 @@ struct PS_OUTPUT
PS_OUTPUT Func1()
{
return PS_OUTPUT(float4(1), 2, 3, 4);
return PS_OUTPUT(float4(1,1,1,1), 2, 3, 4);
}
PS_OUTPUT main()

View File

@@ -0,0 +1,7 @@
uniform float4 col4;
int4 main() : SV_Target0
{
return D3DCOLORtoUBYTE4(col4);
}

View File

@@ -0,0 +1,51 @@
uniform int4 ui4;
static const int cia = -4;
static const int cib = -42;
// ERROR: Ambiguous with fn1 below.
// int4 fn1(int4 p0) { return int4(1,2,3,4); }
int4 fn1(int4 p0, bool b1, bool b2 = false) {
return p0;
}
int4 fn1(int4 p0,
int4 p1 : FOO = int4(-1,-2,-3, cia),
int p2[2] : BAR = { int(1), 2 },
int p3 = abs(cib) )
{
return p0 + p1 + p2[0] + p3;
}
// These should not be ambiguous if given either an int or a float explicit second parameter.
int4 fn2(int4 p0, int x = 3)
{
return int4(10,11,12,13);
}
int4 fn2(int4 p0, float x = sin(3.3)) // OK to have a const expression as a default value
{
return p0 + int4(20,21,22,23);
}
void fn3(int p0 = 3) { }
int4 main() : SV_Target0
{
int myarray[2] = {30,31};
fn3();
fn3(5);
return fn1(100) +
fn1(101, ui4) +
fn1(102, ui4, myarray) +
fn1(103, ui4, myarray, 99) +
fn1(104, false) +
fn1(105, false, true) +
fn2(110, 11.11) + // calls int4, float form
fn2(111, 12); // calls int4, int form
}

View File

@@ -0,0 +1,50 @@
uniform int4 ui4;
uniform float ufvar;
static const int cia = -4;
static const int cib = -42;
int4 fn1(int4 p0) { return int4(1,2,3,4); }
int4 fn1(int4 p0, bool b1, bool b2 = false) {
return p0;
}
int4 fn1(int4 p0,
int4 p1 : FOO = int4(-1,-2,-3, cia),
int p2[2] : BAR = { int(1), 2 },
int p3 = abs(cib) )
{
return p0 + p1 + p2[0] + p3;
}
// These should not be ambiguous if given either an int or a float explicit second parameter.
int4 fn2(int4 p0, int x = 3)
{
return int4(10,11,12,13);
}
int4 fn2(int4 p0, float x = ufvar) // ERROR: non-const expression
{
return p0 + int4(20,21,22,23);
}
void fn3(int p0 = 5, int p1) // ERROR no-default param after default param
{
}
int4 main() : SV_Target0
{
int myarray[2] = {30,31};
return fn1(100) + // ERROR: ambiguous
fn1(101, ui4) +
fn1(102, ui4, myarray) +
fn1(103, ui4, myarray, 99) +
fn1(104, false) +
fn1(105, false, true) +
fn2(112) + // ERROR: ambiguous
fn2(110, 11.11) + // calls int4, float form
fn2(111, 12); // calls int4, int form
}

View File

@@ -25,5 +25,12 @@ outs PixelShaderFunction(float4 input) : COLOR0
o4.c = o1.c;
Nest nest = (Nest)0;
float2 gf2a[4] = { };
int cgi = { };
o4.b = gf2a[2].y * cgi;
return o4;
}
}
static const float2 cgf2a[3];
static const int ci;

View File

@@ -0,0 +1,18 @@
#define foobarblee zzzz
#define ar qqqq
#define MACRO1(x,y) foo##x##y
// #define MACRO2 abc##def
// #define SPACE_IN_MACRO int var1
float4 main() : SV_Target0
{
// float MACRO2 = 10;
float MACRO1(b##ar,blee) = 3;
return float4(foobarblee,0,0,0);
}

View File

@@ -0,0 +1,25 @@
struct VS_INPUT
{
int x0_in : foo0;
float4 Pos_in : SV_Position;
int x1_in : foo1;
};
struct VS_OUTPUT
{
int x0_out : foo0;
float4 Pos_out : SV_Position;
int x1_out : foo1;
};
VS_OUTPUT main(VS_INPUT vsin, float4 Pos_loose : SV_Position)
{
VS_OUTPUT vsout;
vsout.x0_out = vsin.x0_in;
vsout.Pos_out = vsin.Pos_in + Pos_loose;
vsout.x1_out = vsin.x1_in;
return vsout;
}

View File

@@ -0,0 +1,21 @@
struct PSInput
{
float4 Pos : SV_POSITION;
float2 TexCoord : TEXCOORD;
float3 TerrainPos : TERRAINPOS;
uint VertexID : VertexID;
};
typedef PSInput foo_t[2][3];
[maxvertexcount(4)]
void main(point uint v[1] : VertexID, inout TriangleStream<PSInput> OutputStream)
{
foo_t Verts;
PSInput Out = (PSInput) 0;
for (int x=0; x<2; ++x)
for (int y=0; y<2; ++y)
Verts[x][y] = Out;
}

View File

@@ -0,0 +1,32 @@
// Test passing split structs to functions.
struct VS_INPUT
{
int x0_in : foo0;
float4 Pos_in : SV_Position;
int x1_in : foo1;
};
struct VS_OUTPUT
{
int x0_out : foo0;
float4 Pos_out : SV_Position;
int x1_out : foo1;
};
void Fn1(VS_INPUT fn1_in, VS_OUTPUT fn1_out) {
fn1_in.Pos_in + fn1_out.Pos_out;
}
VS_OUTPUT main(VS_INPUT vsin)
{
VS_OUTPUT vsout;
vsout.x0_out = vsin.x0_in;
vsout.Pos_out = vsin.Pos_in;
vsout.x1_out = vsin.x1_in;
Fn1(vsin, vsout);
return vsout;
}

View File

@@ -0,0 +1,31 @@
struct STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO
{
float m0_array[2];
int m1;
};
struct PS_IN
{
float4 pos : SV_Position;
float2 tc : TEXCOORD0;
// float c : SV_ClipDistance0;
};
struct GS_OUT
{
PS_IN psIn;
STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO contains_no_builtin_io;
};
[maxvertexcount(3)]
void main(triangle PS_IN tin[3], inout TriangleStream <GS_OUT> ts )
{
GS_OUT o;
o.psIn.pos = float4(1,2,3,4);
o.psIn.tc = float2(5,6);
ts.Append(o);
}

View File

@@ -0,0 +1,21 @@
struct PS_IN
{
float4 pos : SV_Position;
};
struct GS_OUT
{
float4 pos : SV_Position;
};
[maxvertexcount(3)]
void main(triangle PS_IN i[3], inout TriangleStream <GS_OUT> ts)
{
GS_OUT o;
for (int x=0; x<3; ++x) {
o.pos = i[x].pos;
ts.Append(o);
}
}

View File

@@ -0,0 +1,22 @@
// Test trivial case for structure splitting: the IN and OUT structs have ONLY an interstage IO.
// This should fall back to flattening, and not produce any empty structures.
struct VS_INPUT
{
float4 Pos_in : SV_Position;
};
struct VS_OUTPUT
{
float4 Pos : SV_Position;
};
VS_OUTPUT main(VS_INPUT vsin, float4 Pos_loose : SV_Position)
{
VS_OUTPUT vsout;
vsout.Pos = vsin.Pos_in + Pos_loose;
return vsout;
}

View File

@@ -1,17 +1,23 @@
struct VertexData {
float4 position : POSITION;
float4 color : COLOR0;
float2 uv : TEXCOORD0;
float4 position : POSITION;
float4 color : COLOR0;
float2 uv : TEXCOORD0;
};
struct PS_IN {
float4 position : SV_POSITION;
float4 color : COLOR0;
float2 uv : TEXCOORD0;
};
[maxvertexcount(4)]
void main(line VertexData vin[2], inout TriangleStream<VertexData> outStream)
void main(line VertexData vin[2], inout TriangleStream<PS_IN> outStream)
{
VertexData vout;
PS_IN vout;
vout.color = vin[0].color;
vout.uv = vin[0].uv;
vout.position = vin[0].position;
vout.color = vin[1].color;
vout.uv = vin[1].uv;
vout.position = vin[1].position;
outStream.Append(vout);
}

View File

@@ -0,0 +1,11 @@
float4 main() : SV_Target0
{
half h0 = 0;
half1 h1 = 1;
half2 h2 = 2;
half3 h3 = 3;
half4 h4 = 4;
return 0.0;
}

View File

@@ -0,0 +1,28 @@
struct foo_t {
float float;
};
float fn(float float) { return float; }
float4 main() : SV_Target0
{
float float = 7;
bool bool[2] = { float, float };
int int = bool[1];
uint uint = float + int;
min16float min16float = uint;
min10float min10float = min16float;
half half = 0.5;
{
foo_t float;
float.float = 42;
}
bool[0] = bool[1];
float = float + int + uint + min16float + min10float + (bool[0] ? int : float) + fn(float);
return float;
}

View File

@@ -3,5 +3,4 @@
#include 123
#include "foo"
#include "foo" garbage
#include "no-eol"
#include "no-eol"

View File

@@ -3,5 +3,11 @@
#include
#include 123
#include "foo"
#include <foo>
#include "foo" garbage
#include "no-eol"
#include <foo> garbage
// max length
#include <ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789>
// too long
#include <ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF01234567890>
#include "no-eol"

View File

@@ -92,4 +92,6 @@ void callUserTexture()
userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use
userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use
userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use
gl_NumSamples; // ERROR, not for Vulkan
}

View File

@@ -1223,6 +1223,16 @@ public:
typeName = NewPoolTString(copyOf.typeName->c_str());
}
// Recursively make temporary
void makeTemporary()
{
getQualifier().makeTemporary();
if (isStruct())
for (unsigned int i = 0; i < structure->size(); ++i)
(*structure)[i].type->makeTemporary();
}
TType* clone() const
{
TType *newType = new TType();
@@ -1309,6 +1319,20 @@ public:
virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); }
virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); }
// Return true if this is interstage IO
virtual bool isBuiltInInterstageIO() const
{
switch (getQualifier().builtIn) {
case EbvPosition:
case EbvPointSize:
case EbvClipDistance:
case EbvCullDistance:
return true;
default:
return false;
}
}
// Recursively checks if the type contains the given basic type
virtual bool containsBasicType(TBasicType checkType) const
{
@@ -1376,6 +1400,34 @@ public:
return false;
}
// Recursively checks if the type contains an interstage IO builtin
virtual bool containsBuiltInInterstageIO() const
{
if (isBuiltInInterstageIO())
return true;
if (! structure)
return false;
for (unsigned int i = 0; i < structure->size(); ++i) {
if ((*structure)[i].type->containsBuiltInInterstageIO())
return true;
}
return false;
}
// Recursively checks whether a struct contains only interstage IO
virtual bool containsOnlyBuiltInInterstageIO() const
{
if (! structure)
return isBuiltInInterstageIO();
for (unsigned int i = 0; i < structure->size(); ++i) {
if (!(*structure)[i].type->containsOnlyBuiltInInterstageIO())
return false;
}
return true;
}
virtual bool containsNonOpaque() const
{
// list all non-opaque types

View File

@@ -597,6 +597,7 @@ enum TOperator {
EOpLit, // HLSL lighting coefficient vector
EOpTextureBias, // HLSL texture bias: will be lowered to EOpTexture
EOpAsDouble, // slightly different from EOpUint64BitsToDouble
EOpD3DCOLORtoUBYTE4, // convert and swizzle 4-component color to UBYTE4 range
EOpMethodSample, // Texture object methods. These are translated to existing
EOpMethodSampleBias, // AST methods, and exist to represent HLSL semantics until that

View File

@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1721"
#define GLSLANG_DATE "21-Dec-2016"
#define GLSLANG_REVISION "Overload400-PrecQual.1730"
#define GLSLANG_DATE "03-Jan-2017"

View File

@@ -629,6 +629,9 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
//
TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
{
if (aggrNode == nullptr)
return aggrNode;
if (! areAllChildConst(aggrNode))
return aggrNode;

View File

@@ -3010,14 +3010,18 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"flat in int gl_PrimitiveID;"
);
if (version >= 400)
if (version >= 400) {
stageBuiltins[EShLangFragment].append(
"flat in int gl_SampleID;"
" in vec2 gl_SamplePosition;"
"flat in int gl_SampleMaskIn[];"
" out int gl_SampleMask[];"
"uniform int gl_NumSamples;"
);
if (spvVersion.spv == 0)
stageBuiltins[EShLangFragment].append(
"uniform int gl_NumSamples;"
);
}
if (version >= 430)
stageBuiltins[EShLangFragment].append(
@@ -3074,8 +3078,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
" in mediump vec2 gl_SamplePosition;"
"flat in highp int gl_SampleMaskIn[];"
" out highp int gl_SampleMask[];"
"uniform lowp int gl_NumSamples;"
);
if (spvVersion.spv == 0)
stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables
"uniform lowp int gl_NumSamples;"
);
}
stageBuiltins[EShLangFragment].append(
"highp float gl_FragDepthEXT;" // GL_EXT_frag_depth

View File

@@ -348,13 +348,18 @@ const TFunction* TParseContextBase::selectFunction(
for (auto it = candidateList.begin(); it != candidateList.end(); ++it) {
const TFunction& candidate = *(*it);
// to even be a potential match, number of arguments has to match
if (call.getParamCount() != candidate.getParamCount())
// to even be a potential match, number of arguments must be >= the number of
// fixed (non-default) parameters, and <= the total (including parameter with defaults).
if (call.getParamCount() < candidate.getFixedParamCount() ||
call.getParamCount() > candidate.getParamCount())
continue;
// see if arguments are convertible
bool viable = true;
for (int param = 0; param < candidate.getParamCount(); ++param) {
// The call can have fewer parameters than the candidate, if some have defaults.
const int paramCount = std::min(call.getParamCount(), candidate.getParamCount());
for (int param = 0; param < paramCount; ++param) {
if (candidate[param].type->getQualifier().isParamInput()) {
if (! convertible(*call[param].type, *candidate[param].type, candidate.getBuiltInOp(), param)) {
viable = false;
@@ -382,7 +387,7 @@ const TFunction* TParseContextBase::selectFunction(
return viableCandidates.front();
// 4. find best...
auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool {
const auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool {
// is call -> can2 better than call -> can1 for any parameter
bool hasBetterParam = false;
for (int param = 0; param < call.getParamCount(); ++param) {
@@ -394,6 +399,16 @@ const TFunction* TParseContextBase::selectFunction(
return hasBetterParam;
};
const auto equivalentParams = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool {
// is call -> can2 equivalent to call -> can1 for all the call parameters?
for (int param = 0; param < call.getParamCount(); ++param) {
if (better(*call[param].type, *can1[param].type, *can2[param].type) ||
better(*call[param].type, *can2[param].type, *can1[param].type))
return false;
}
return true;
};
const TFunction* incumbent = viableCandidates.front();
for (auto it = viableCandidates.begin() + 1; it != viableCandidates.end(); ++it) {
const TFunction& candidate = *(*it);
@@ -406,7 +421,10 @@ const TFunction* TParseContextBase::selectFunction(
if (incumbent == *it)
continue;
const TFunction& candidate = *(*it);
if (betterParam(*incumbent, candidate))
// In the case of default parameters, it may have an identical initial set, which is
// also ambiguous
if (betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate))
tie = true;
}

View File

@@ -2502,7 +2502,6 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co
void TParseContext::transparentCheck(const TSourceLoc& loc, const TType& type, const TString& /*identifier*/)
{
// double standard due to gl_NumSamples
if (parsingBuiltins)
return;
@@ -3255,7 +3254,7 @@ bool TParseContext::lineDirectiveShouldSetNextLine() const
void TParseContext::nonInitConstCheck(const TSourceLoc& loc, TString& identifier, TType& type)
{
//
// Make the qualifier make sense, given that there is an initializer.
// Make the qualifier make sense, given that there is not an initializer.
//
if (type.getQualifier().storage == EvqConst ||
type.getQualifier().storage == EvqConstReadOnly) {
@@ -5007,7 +5006,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
if (voidErrorCheck(loc, identifier, type.getBasicType()))
return nullptr;
if (initializer)
if (initializer)
rValueErrorCheck(loc, "initializer", initializer);
else
nonInitConstCheck(loc, identifier, type);

View File

@@ -295,6 +295,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
op = copyOf.op;
defined = copyOf.defined;
prototyped = copyOf.prototyped;
defaultParamCount = copyOf.defaultParamCount;
}
TFunction* TFunction::clone() const

View File

@@ -191,6 +191,7 @@ protected:
struct TParameter {
TString *name;
TType* type;
TIntermTyped* defaultValue;
void copyParam(const TParameter& param)
{
if (param.name)
@@ -198,6 +199,7 @@ struct TParameter {
else
name = 0;
type = param.type->clone();
defaultValue = param.defaultValue;
}
};
@@ -209,12 +211,12 @@ public:
explicit TFunction(TOperator o) :
TSymbol(0),
op(o),
defined(false), prototyped(false) { }
defined(false), prototyped(false), defaultParamCount(0) { }
TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) :
TSymbol(name),
mangledName(*name + '('),
op(tOp),
defined(false), prototyped(false) { returnType.shallowCopy(retType); }
defined(false), prototyped(false), defaultParamCount(0) { returnType.shallowCopy(retType); }
virtual TFunction* clone() const;
virtual ~TFunction();
@@ -226,6 +228,9 @@ public:
assert(writable);
parameters.push_back(p);
p.type->appendMangledName(mangledName);
if (p.defaultValue != nullptr)
defaultParamCount++;
}
virtual const TString& getMangledName() const { return mangledName; }
@@ -238,7 +243,13 @@ public:
virtual void setPrototyped() { assert(writable); prototyped = true; }
virtual bool isPrototyped() const { return prototyped; }
// Return total number of parameters
virtual int getParamCount() const { return static_cast<int>(parameters.size()); }
// Return number of parameters with default values.
virtual int getDefaultParamCount() const { return defaultParamCount; }
// Return number of fixed parameters (without default values)
virtual int getFixedParamCount() const { return getParamCount() - getDefaultParamCount(); }
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
virtual const TParameter& operator[](int i) const { return parameters[i]; }
@@ -255,6 +266,7 @@ protected:
TOperator op;
bool defined;
bool prototyped;
int defaultParamCount;
};
//

View File

@@ -571,46 +571,61 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken)
return token;
}
// Handle #include
// Handle #include ...
// TODO: Handle macro expansions for the header name
int TPpContext::CPPinclude(TPpToken* ppToken)
{
const TSourceLoc directiveLoc = ppToken->loc;
TShader::Includer::IncludeType includeType = TShader::Includer::EIncludeRelative;
int token = scanToken(ppToken);
// handle <header-name>-style #include
if (token == '<') {
includeType = TShader::Includer::EIncludeStandard;
token = scanHeaderName(ppToken, '>');
}
// otherwise ppToken already has the header name and it was "header-name" style
if (token != PpAtomConstString) {
// TODO: handle angle brackets.
parseContext.ppError(directiveLoc, "must be followed by a file designation", "#include", "");
parseContext.ppError(directiveLoc, "must be followed by a header name", "#include", "");
return token;
}
// Make a copy of the name because it will be overwritten by the next token scan.
const std::string filename = ppToken->name;
token = scanToken(ppToken);
if (token != '\n') {
if (token == EndOfInput)
parseContext.ppError(ppToken->loc, "expected newline", "#include", "");
else
parseContext.ppError(ppToken->loc, "extra content after header name", "#include", "");
} else {
// Make a copy of the name because it will be overwritten by the next token scan.
const std::string filename = ppToken->name;
token = scanToken(ppToken);
if (token != '\n' && token != EndOfInput) {
parseContext.ppError(ppToken->loc, "extra content after file designation", "#include", "");
TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), includeType, currentSourceFile.c_str(), includeStack.size() + 1);
if (res && !res->file_name.empty()) {
if (res->file_data && res->file_length) {
const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine();
std::ostringstream prologue;
std::ostringstream epilogue;
prologue << "#line " << forNextLine << " " << "\"" << res->file_name << "\"\n";
epilogue << (res->file_data[res->file_length - 1] == '\n'? "" : "\n") << "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n";
pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this));
}
// At EOF, there's no "current" location anymore.
if (token != EndOfInput)
parseContext.setCurrentColumn(0);
// Don't accidentally return EndOfInput, which will end all preprocessing.
return '\n';
} else {
TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), TShader::Includer::EIncludeRelative, currentSourceFile.c_str(), includeStack.size() + 1);
if (res && !res->file_name.empty()) {
if (res->file_data && res->file_length) {
const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine();
std::ostringstream prologue;
std::ostringstream epilogue;
prologue << "#line " << forNextLine << " " << "\"" << res->file_name << "\"\n";
epilogue << (res->file_data[res->file_length - 1] == '\n'? "" : "\n") << "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n";
pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this));
}
// At EOF, there's no "current" location anymore.
if (token != EndOfInput) parseContext.setCurrentColumn(0);
// Don't accidentally return EndOfInput, which will end all preprocessing.
return '\n';
} else {
std::string message =
res ? std::string(res->file_data, res->file_length)
: std::string("Could not process include directive");
parseContext.ppError(directiveLoc, message.c_str(), "#include", "");
if (res) {
includer.releaseInclude(res);
}
std::string message =
res ? std::string(res->file_data, res->file_length)
: std::string("Could not process include directive");
parseContext.ppError(directiveLoc, message.c_str(), "#include", "");
if (res) {
includer.releaseInclude(res);
}
}
}
return token;
}
@@ -911,6 +926,38 @@ int TPpContext::readCPPline(TPpToken* ppToken)
return token;
}
// Context-dependent parsing of a #include <header-name>.
// Assumes no macro expansions etc. are being done; the name is just on the current input.
// Always creates a name and returns PpAtomicConstString, unless we run out of input.
int TPpContext::scanHeaderName(TPpToken* ppToken, char delimit)
{
bool tooLong = false;
if (inputStack.empty())
return EndOfInput;
int len = 0;
ppToken->name[0] = '\0';
do {
int ch = inputStack.back()->getch();
// done yet?
if (ch == delimit) {
ppToken->name[len] = '\0';
if (tooLong)
parseContext.ppError(ppToken->loc, "header name too long", "", "");
return PpAtomConstString;
} else if (ch == EndOfInput)
return EndOfInput;
// found a character to expand the name with
if (len < MaxTokenLength)
ppToken->name[len++] = ch;
else
tooLong = true;
} while (true);
}
// Macro-expand a macro argument 'arg' to create 'expandedArg'.
// Does not replace 'arg'.
// Returns nullptr if no expanded argument is created.
@@ -934,12 +981,20 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken*
TokenStream* expandedArg = new TokenStream;
pushInput(new tMarkerInput(this));
pushTokenStreamInput(arg);
while ((token = scanToken(ppToken)) != tMarkerInput::marker) {
while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) {
if (token == PpAtomIdentifier && MacroExpand(ppToken, false, newLineOkay) != 0)
continue;
RecordToken(*expandedArg, token, ppToken);
}
popInput();
if (token == EndOfInput) {
// MacroExpand ate the marker, so had bad input, recover
delete expandedArg;
expandedArg = nullptr;
} else {
// remove the marker
popInput();
}
return expandedArg;
}
@@ -1133,7 +1188,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
depth = 0;
while (1) {
token = scanToken(ppToken);
if (token == EndOfInput) {
if (token == EndOfInput || token == tMarkerInput::marker) {
parseContext.ppError(loc, "End of input in macro", "macro expansion", atomStrings.getString(macroAtom));
delete in;
return 0;

View File

@@ -368,6 +368,7 @@ protected:
int CPPversion(TPpToken * ppToken);
int CPPextension(TPpToken * ppToken);
int readCPPline(TPpToken * ppToken);
int scanHeaderName(TPpToken* ppToken, char delimit);
TokenStream* PrescanMacroArg(TokenStream&, TPpToken*, bool newLineOkay);
int MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOkay);

View File

@@ -688,6 +688,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
}
break;
case '"':
// TODO: If this gets enhanced to handle escape sequences, or
// anything that is different than what #include needs, then
// #include needs to use scanHeaderName() for this.
ch = getch();
while (ch != '"' && ch != '\n' && ch != EndOfInput) {
if (len < MaxTokenLength) {

View File

@@ -79,6 +79,7 @@ INSTANTIATE_TEST_CASE_P(
"cppIndent.vert",
"cppNest.vert",
"cppBad.vert",
"cppBad2.vert",
"cppComplexExpr.vert",
"badChars.frag",
"pointCoord.frag",

View File

@@ -127,6 +127,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.evalfns.frag", "main"},
{"hlsl.intrinsics.d3dcolortoubyte4.frag", "main"},
{"hlsl.intrinsics.double.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.f1632.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.frag", "main"},
@@ -160,6 +161,8 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.numericsuffixes.frag", "main"},
{"hlsl.numthreads.comp", "main_aux1"},
{"hlsl.overload.frag", "PixelShaderFunction"},
{"hlsl.params.default.frag", "main"},
{"hlsl.params.default.negative.frag", "main"},
{"hlsl.partialInit.frag", "PixelShaderFunction"},
{"hlsl.pp.line.frag", "main"},
{"hlsl.precise.frag", "main"},
@@ -204,6 +207,12 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.shapeConvRet.frag", "main"},
{"hlsl.stringtoken.frag", "main"},
{"hlsl.string.frag", "main"},
{"hlsl.struct.split-1.vert", "main"},
{"hlsl.struct.split.array.geom", "main"},
{"hlsl.struct.split.call.vert", "main"},
{"hlsl.struct.split.nested.geom", "main"},
{"hlsl.struct.split.trivial.geom", "main"},
{"hlsl.struct.split.trivial.vert", "main"},
{"hlsl.structarray.flatten.frag", "main"},
{"hlsl.structarray.flatten.geom", "main"},
{"hlsl.structin.vert", "main"},
@@ -221,6 +230,8 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.swizzle.frag", "PixelShaderFunction"},
{"hlsl.templatetypes.frag", "PixelShaderFunction"},
{"hlsl.tx.bracket.frag", "main"},
{"hlsl.type.half.frag", "main"},
{"hlsl.type.identifier.frag", "main"},
{"hlsl.typedef.frag", "PixelShaderFunction"},
{"hlsl.whileLoop.frag", "PixelShaderFunction"},
{"hlsl.void.frag", "PixelShaderFunction"},

View File

@@ -85,21 +85,36 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken)
return true;
}
// Even though "sample" is a keyword (for interpolation modifiers), it IS still accepted as
// an identifier. This appears to be a solitary exception: other interp modifier keywords such
// as "linear" or "centroid" NOT valid identifiers. This code special cases "sample",
// so e.g, "int sample;" is accepted.
if (peekTokenClass(EHTokSample)) {
token.string = NewPoolTString("sample");
token.tokenClass = EHTokIdentifier;
token.symbol = nullptr;
idToken = token;
advanceToken();
return true;
// Even though "sample", "bool", "float", etc keywords (for types, interpolation modifiers),
// they ARE still accepted as identifiers. This is not a dense space: e.g, "void" is not a
// valid identifier, nor is "linear". This code special cases the known instances of this, so
// e.g, "int sample;" or "float float;" is accepted. Other cases can be added here if needed.
TString* idString = nullptr;
switch (peek()) {
case EHTokSample: idString = NewPoolTString("sample"); break;
case EHTokHalf: idString = NewPoolTString("half"); break;
case EHTokBool: idString = NewPoolTString("bool"); break;
case EHTokFloat: idString = NewPoolTString("float"); break;
case EHTokDouble: idString = NewPoolTString("double"); break;
case EHTokInt: idString = NewPoolTString("int"); break;
case EHTokUint: idString = NewPoolTString("uint"); break;
case EHTokMin16float: idString = NewPoolTString("min16float"); break;
case EHTokMin10float: idString = NewPoolTString("min10float"); break;
case EHTokMin16int: idString = NewPoolTString("min16int"); break;
case EHTokMin12int: idString = NewPoolTString("min12int"); break;
default:
return false;
}
return false;
token.string = idString;
token.tokenClass = EHTokIdentifier;
token.symbol = nullptr;
idToken = token;
advanceToken();
return true;
}
// compilationUnit
@@ -418,7 +433,15 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node)
// SEMICOLON
if (! acceptTokenClass(EHTokSemicolon)) {
expected(";");
// This may have been a false detection of what appeared to be a declaration, but
// was actually an assignment such as "float = 4", where "float" is an identifier.
// We put the token back to let further parsing happen for cases where that may
// happen. This errors on the side of caution, and mostly triggers the error.
if (peek() == EHTokAssign || peek() == EHTokLeftBracket || peek() == EHTokDot || peek() == EHTokComma)
recedeToken();
else
expected(";");
return false;
}
@@ -478,7 +501,7 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type)
// type_specifier
if (! acceptType(type)) {
// If this is not a type, we may have inadvertently gone down a wrong path
// py parsing "sample", which can be treated like either an identifier or a
// by parsing "sample", which can be treated like either an identifier or a
// qualifier. Back it out, if we did.
if (qualifier.sample)
recedeToken();
@@ -1086,6 +1109,7 @@ bool HlslGrammar::acceptType(TType& type)
// changes, e.g, to use native halfs.
static const TBasicType min16float_bt = EbtFloat;
static const TBasicType min10float_bt = EbtFloat;
static const TBasicType half_bt = EbtFloat;
static const TBasicType min16int_bt = EbtInt;
static const TBasicType min12int_bt = EbtInt;
static const TBasicType min16uint_bt = EbtUint;
@@ -1255,6 +1279,23 @@ bool HlslGrammar::acceptType(TType& type)
new(&type) TType(EbtBool, EvqTemporary, 4);
break;
case EHTokHalf:
new(&type) TType(half_bt, EvqTemporary, EpqMedium);
break;
case EHTokHalf1:
new(&type) TType(half_bt, EvqTemporary, EpqMedium);
type.makeVector();
break;
case EHTokHalf2:
new(&type) TType(half_bt, EvqTemporary, EpqMedium, 2);
break;
case EHTokHalf3:
new(&type) TType(half_bt, EvqTemporary, EpqMedium, 3);
break;
case EHTokHalf4:
new(&type) TType(half_bt, EvqTemporary, EpqMedium, 4);
break;
case EHTokMin16float:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium);
break;
@@ -1683,6 +1724,7 @@ bool HlslGrammar::acceptStruct(TType& type)
bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
{
typeList = new TTypeList();
HlslToken idToken;
do {
// success on seeing the RIGHT_BRACE coming up
@@ -1700,8 +1742,7 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
// struct_declarator COMMA struct_declarator ...
do {
// peek IDENTIFIER
if (! peekTokenClass(EHTokIdentifier)) {
if (! acceptIdentifier(idToken)) {
expected("member name");
return false;
}
@@ -1709,12 +1750,9 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
// add it to the list of members
TTypeLoc member = { new TType(EbtVoid), token.loc };
member.type->shallowCopy(memberType);
member.type->setFieldName(*token.string);
member.type->setFieldName(*idToken.string);
typeList->push_back(member);
// accept IDENTIFIER
advanceToken();
// array_specifier
TArraySizes* arraySizes = nullptr;
acceptArraySpecifier(arraySizes);
@@ -1776,9 +1814,55 @@ bool HlslGrammar::acceptFunctionParameters(TFunction& function)
return true;
}
// default_parameter_declaration
// : EQUAL conditional_expression
// : EQUAL initializer
bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTyped*& node)
{
node = nullptr;
// Valid not to have a default_parameter_declaration
if (!acceptTokenClass(EHTokAssign))
return true;
if (!acceptConditionalExpression(node)) {
if (!acceptInitializer(node))
return false;
// For initializer lists, we have to const-fold into a constructor for the type, so build
// that.
TFunction* constructor = parseContext.handleConstructorCall(token.loc, type);
if (constructor == nullptr) // cannot construct
return false;
TIntermTyped* arguments = nullptr;
for (int i=0; i<int(node->getAsAggregate()->getSequence().size()); i++)
parseContext.handleFunctionArgument(constructor, arguments, node->getAsAggregate()->getSequence()[i]->getAsTyped());
node = parseContext.handleFunctionCall(token.loc, constructor, node);
}
// If this is simply a constant, we can use it directly.
if (node->getAsConstantUnion())
return true;
// Otherwise, it has to be const-foldable.
TIntermTyped* origNode = node;
node = intermediate.fold(node->getAsAggregate());
if (node != nullptr && origNode != node)
return true;
parseContext.error(token.loc, "invalid default parameter value", "", "");
return false;
}
// parameter_declaration
// : fully_specified_type post_decls
// | fully_specified_type identifier array_specifier post_decls
// : fully_specified_type post_decls [ = default_parameter_declaration ]
// | fully_specified_type identifier array_specifier post_decls [ = default_parameter_declaration ]
//
bool HlslGrammar::acceptParameterDeclaration(TFunction& function)
{
@@ -1806,9 +1890,19 @@ bool HlslGrammar::acceptParameterDeclaration(TFunction& function)
// post_decls
acceptPostDecls(type->getQualifier());
TIntermTyped* defaultValue;
if (!acceptDefaultParameterDeclaration(*type, defaultValue))
return false;
parseContext.paramFix(*type);
TParameter param = { idToken.string, type };
// If any prior parameters have default values, all the parameters after that must as well.
if (defaultValue == nullptr && function.getDefaultParamCount() > 0) {
parseContext.error(idToken.loc, "invalid parameter after default value parameters", idToken.string->c_str(), "");
return false;
}
TParameter param = { idToken.string, type, defaultValue };
function.addParameter(param);
return true;
@@ -2322,7 +2416,9 @@ bool HlslGrammar::acceptConstructor(TIntermTyped*& node)
// arguments
TIntermTyped* arguments = nullptr;
if (! acceptArguments(constructorFunction, arguments)) {
expected("constructor arguments");
// It's possible this is a type keyword used as an identifier. Put the token back
// for later use.
recedeToken();
return false;
}

View File

@@ -111,6 +111,7 @@ namespace glslang {
bool acceptDefaultLabel(TIntermNode*&);
void acceptArraySpecifier(TArraySizes*&);
void acceptPostDecls(TQualifier&);
bool acceptDefaultParameterDeclaration(const TType&, TIntermTyped*&);
HlslParseContext& parseContext; // state of parsing and helper functions for building the intermediate
TIntermediate& intermediate; // the final product, the intermediate representation, includes the AST

View File

@@ -59,9 +59,12 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
postEntryPointReturn(false),
limits(resources.limits),
inEntryPoint(false),
entryPointOutput(nullptr),
nextInLocation(0), nextOutLocation(0),
sourceEntryPointName(sourceEntryPointName)
sourceEntryPointName(sourceEntryPointName),
builtInIoIndex(nullptr),
builtInIoBase(nullptr)
{
globalUniformDefaults.clear();
globalUniformDefaults.layoutMatrix = ElmRowMajor;
@@ -656,11 +659,13 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
if (base->getAsSymbolNode() && (wasFlattened(base) || shouldFlatten(base->getType()))) {
if (index->getQualifier().storage != EvqConst)
error(loc, "Invalid variable index to flattened uniform array", base->getAsSymbolNode()->getName().c_str(), "");
error(loc, "Invalid variable index to flattened array", base->getAsSymbolNode()->getName().c_str(), "");
result = flattenAccess(loc, base, indexValue);
result = flattenAccess(base, indexValue);
flattened = (result != base);
} else {
splitAccessArray(loc, base, index);
if (index->getQualifier().storage == EvqConst) {
if (base->getType().isImplicitlySizedArray())
updateImplicitArraySize(loc, base, indexValue);
@@ -765,11 +770,9 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
}
} else if (field == "Append" ||
field == "RestartStrip") {
// These methods only valid on stage in variables
// TODO: ... which are stream out types, if there's any way to test that here.
if (base->getType().getQualifier().storage == EvqVaryingOut) {
return intermediate.addMethod(base, TType(EbtVoid), &field, loc);
}
// We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but
// the code is around in the shader source.
return intermediate.addMethod(base, TType(EbtVoid), &field, loc);
}
// It's not .length() if we get to here.
@@ -834,15 +837,21 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
}
}
if (fieldFound) {
if (base->getAsSymbolNode() && (wasFlattened(base) || shouldFlatten(base->getType())))
result = flattenAccess(loc, base, member);
else {
if (base->getType().getQualifier().storage == EvqConst)
result = intermediate.foldDereference(base, member, loc);
else {
TIntermTyped* index = intermediate.addConstantUnion(member, loc);
result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc);
result->setType(*(*fields)[member].type);
if (base->getAsSymbolNode() && (wasFlattened(base) || shouldFlatten(base->getType()))) {
result = flattenAccess(base, member);
} else {
// Update the base and member to access if this was a split structure.
result = splitAccessStruct(loc, base, member);
fields = base->getType().getStruct();
if (result == nullptr) {
if (base->getType().getQualifier().storage == EvqConst)
result = intermediate.foldDereference(base, member, loc);
else {
TIntermTyped* index = intermediate.addConstantUnion(member, loc);
result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc);
result->setType(*(*fields)[member].type);
}
}
}
} else
@@ -853,6 +862,102 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
return result;
}
// Determine whether we should split this type
bool HlslParseContext::shouldSplit(const TType& type)
{
if (! inEntryPoint)
return false;
const TStorageQualifier qualifier = type.getQualifier().storage;
// If it contains interstage IO, but not ONLY interstage IO, split the struct.
return type.isStruct() && type.containsBuiltInInterstageIO() &&
(qualifier == EvqVaryingIn || qualifier == EvqVaryingOut);
}
// Split the type of the given node into two structs:
// 1. interstage IO
// 2. everything else
// IO members are put into the ioStruct. The type is modified to remove them.
void HlslParseContext::split(TIntermTyped* node)
{
if (node == nullptr)
return;
TIntermSymbol* symNode = node->getAsSymbolNode();
if (symNode == nullptr)
return;
// Create a new variable:
TType& splitType = split(*symNode->getType().clone(), symNode->getName());
splitIoVars[symNode->getId()] = makeInternalVariable(symNode->getName(), splitType);
}
// Split the type of the given variable into two structs:
void HlslParseContext::split(const TVariable& variable)
{
const TType& type = variable.getType();
TString name = (&variable == entryPointOutput) ? "" : variable.getName();
// Create a new variable:
TType& splitType = split(*type.clone(), name);
splitIoVars[variable.getUniqueId()] = makeInternalVariable(variable.getName(), splitType);
}
// Recursive implementation of split(const TVariable& variable).
// Returns reference to the modified type.
TType& HlslParseContext::split(TType& type, TString name, const TType* outerStructType)
{
const TArraySizes* arraySizes = nullptr;
// At the outer-most scope, remember the struct type so we can examine its storage class
// at deeper levels.
if (outerStructType == nullptr)
outerStructType = &type;
if (type.isArray())
arraySizes = &type.getArraySizes();
// We can ignore arrayness: it's uninvolved.
if (type.isStruct()) {
TTypeList* userStructure = type.getWritableStruct();
// Get iterator to (now at end) set of builtin iterstage IO members
const auto firstIo = std::stable_partition(userStructure->begin(), userStructure->end(),
[](const TTypeLoc& t) {return !t.type->isBuiltInInterstageIO();});
// Move those to the builtin IO. However, we also propagate arrayness (just one level is handled
// now) to this variable.
for (auto ioType = firstIo; ioType != userStructure->end(); ++ioType) {
const TType& memberType = *ioType->type;
TVariable* ioVar = makeInternalVariable(name + (name.empty() ? "" : ".") + memberType.getFieldName(), memberType);
if (arraySizes)
ioVar->getWritableType().newArraySizes(*arraySizes);
interstageBuiltInIo[tInterstageIoData(memberType, *outerStructType)] = ioVar;
// Merge qualifier from the user structure
mergeQualifiers(ioVar->getWritableType().getQualifier(), outerStructType->getQualifier());
}
// Erase the IO vars from the user structure.
userStructure->erase(firstIo, userStructure->end());
// Recurse further into the members.
for (unsigned int i = 0; i < userStructure->size(); ++i)
split(*(*userStructure)[i].type,
name + (name.empty() ? "" : ".") + (*userStructure)[i].type->getFieldName(),
outerStructType);
}
return type;
}
// Determine whether we should flatten an arbitrary type.
bool HlslParseContext::shouldFlatten(const TType& type) const
{
@@ -868,9 +973,11 @@ bool HlslParseContext::shouldFlattenIO(const TType& type) const
const TStorageQualifier qualifier = type.getQualifier().storage;
return type.isStruct() &&
(qualifier == EvqVaryingIn ||
qualifier == EvqVaryingOut);
if (!type.isStruct())
return false;
return ((language == EShLangVertex && qualifier == EvqVaryingIn) ||
(language == EShLangFragment && qualifier == EvqVaryingOut));
}
// Is this a uniform array which should be flattened?
@@ -891,7 +998,7 @@ void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
// emplace gives back a pair whose .first is an iterator to the item...
auto entry = flattenMap.emplace(variable.getUniqueId(),
TFlattenData(type.getQualifier().layoutBinding));
// ... and the item is a map pair, so first->second is the TFlattenData itself.
flatten(loc, variable, type, entry.first->second, "");
}
@@ -926,13 +1033,6 @@ void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
int HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable, const TType& type,
TFlattenData& flattenData, TString name)
{
// TODO: when struct splitting is in place we can remove this restriction.
if (language == EShLangGeometry) {
const TType derefType(type, 0);
if (!isFinalFlattening(derefType) && type.getQualifier().storage == EvqVaryingIn)
error(loc, "recursive type not yet supported in GS input", variable.getName().c_str(), "");
}
// If something is an arrayed struct, the array flattener will recursively call flatten()
// to then flatten the struct, so this is an "if else": we don't do both.
if (type.isArray())
@@ -953,7 +1053,7 @@ int HlslParseContext::addFlattenedMember(const TSourceLoc& loc,
{
if (isFinalFlattening(type)) {
// This is as far as we flatten. Insert the variable.
TVariable* memberVariable = makeInternalVariable(memberName.c_str(), type);
TVariable* memberVariable = makeInternalVariable(memberName, type);
mergeQualifiers(memberVariable->getWritableType().getQualifier(), variable.getType().getQualifier());
if (flattenData.nextBinding != TQualifier::layoutBindingEnd)
@@ -1043,16 +1143,22 @@ int HlslParseContext::flattenArray(const TSourceLoc& loc, const TVariable& varia
// Return true if we have flattened this node.
bool HlslParseContext::wasFlattened(const TIntermTyped* node) const
{
return node != nullptr &&
node->getAsSymbolNode() != nullptr &&
return node != nullptr && node->getAsSymbolNode() != nullptr &&
wasFlattened(node->getAsSymbolNode()->getId());
}
// Return true if we have split this structure
bool HlslParseContext::wasSplit(const TIntermTyped* node) const
{
return node != nullptr && node->getAsSymbolNode() != nullptr &&
wasSplit(node->getAsSymbolNode()->getId());
}
// Turn an access into an aggregate that was flattened to instead be
// an access to the individual variable the member was flattened to.
// Assumes shouldFlatten() or equivalent was called first.
TIntermTyped* HlslParseContext::flattenAccess(const TSourceLoc&, TIntermTyped* base, int member)
TIntermTyped* HlslParseContext::flattenAccess(TIntermTyped* base, int member)
{
const TType dereferencedType(base->getType(), member); // dereferenced type
@@ -1078,6 +1184,115 @@ TIntermTyped* HlslParseContext::flattenAccess(const TSourceLoc&, TIntermTyped* b
}
}
// Find and return the split IO TVariable for id, or nullptr if none.
TVariable* HlslParseContext::getSplitIoVar(int id) const
{
const auto splitIoVar = splitIoVars.find(id);
if (splitIoVar == splitIoVars.end())
return nullptr;
return splitIoVar->second;
}
// Find and return the split IO TVariable for variable, or nullptr if none.
TVariable* HlslParseContext::getSplitIoVar(const TVariable* var) const
{
if (var == nullptr)
return nullptr;
return getSplitIoVar(var->getUniqueId());
}
// Find and return the split IO TVariable for symbol in this node, or nullptr if none.
TVariable* HlslParseContext::getSplitIoVar(const TIntermTyped* node) const
{
if (node == nullptr)
return nullptr;
const TIntermSymbol* symbolNode = node->getAsSymbolNode();
if (symbolNode == nullptr)
return nullptr;
return getSplitIoVar(symbolNode->getId());
}
// Remember the index used to dereference into this structure, in case it has to be moved to a
// split-off builtin IO member.
void HlslParseContext::splitAccessArray(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
{
const TVariable* splitIoVar = getSplitIoVar(base);
// Not a split structure
if (splitIoVar == nullptr)
return;
if (builtInIoBase) {
error(loc, "only one array dimension supported for builtIn IO variable", "", "");
return;
}
builtInIoBase = base;
builtInIoIndex = index;
}
// Turn an access into an struct that was split to instead be an
// access to either the modified structure, or a direct reference to
// one of the split member variables.
TIntermTyped* HlslParseContext::splitAccessStruct(const TSourceLoc& loc, TIntermTyped*& base, int& member)
{
// nothing to do
if (base == nullptr)
return nullptr;
// We have a pending bracket reference to an outer struct that we may want to move to an inner member.
if (builtInIoBase)
base = builtInIoBase;
const TVariable* splitIoVar = getSplitIoVar(base);
if (splitIoVar == nullptr)
return nullptr;
const TTypeList& members = *base->getType().getStruct();
const TType& memberType = *members[member].type;
if (memberType.isBuiltInInterstageIO()) {
// It's one of the interstage IO variables we split off.
TIntermTyped* builtIn = intermediate.addSymbol(*interstageBuiltInIo[tInterstageIoData(memberType, base->getType())], loc);
// If there's an array reference to an outer split struct, we re-apply it here.
if (builtInIoIndex != nullptr) {
if (builtInIoIndex->getQualifier().storage == EvqConst)
builtIn = intermediate.addIndex(EOpIndexDirect, builtIn, builtInIoIndex, loc);
else
builtIn = intermediate.addIndex(EOpIndexIndirect, builtIn, builtInIoIndex, loc);
builtIn->setType(memberType);
builtInIoIndex = nullptr;
builtInIoBase = nullptr;
}
return builtIn;
} else {
// It's not an IO variable. Find the equivalent index into the new variable.
base = intermediate.addSymbol(*splitIoVar, loc);
int newMember = 0;
for (int m=0; m<member; ++m)
if (!members[m].type->isBuiltInInterstageIO())
++newMember;
member = newMember;
return nullptr;
}
}
// Variables that correspond to the user-interface in and out of a stage
// (not the built-in interface) are assigned locations and
// registered as a linkage node (part of the stage's external interface).
@@ -1105,8 +1320,17 @@ void HlslParseContext::assignLocations(TVariable& variable)
auto& memberList = flattenMap[variable.getUniqueId()].members;
for (auto member = memberList.begin(); member != memberList.end(); ++member)
assignLocation(**member);
} else
} else if (wasSplit(variable.getUniqueId())) {
TVariable* splitIoVar = getSplitIoVar(&variable);
const TTypeList* structure = splitIoVar->getType().getStruct();
// Struct splitting can produce empty structures if the only members of the
// struct were builtin interstage IO types. Only assign locations if it
// isn't a struct, or is a non-empty struct.
if (structure == nullptr || !structure->empty())
assignLocation(*splitIoVar);
} else {
assignLocation(variable);
}
}
//
@@ -1150,6 +1374,23 @@ TFunction& HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFu
return function;
}
// Add interstage IO variables to the linkage in canonical order.
void HlslParseContext::addInterstageIoToLinkage()
{
std::vector<tInterstageIoData> io;
io.reserve(interstageBuiltInIo.size());
for (auto ioVar = interstageBuiltInIo.begin(); ioVar != interstageBuiltInIo.end(); ++ioVar)
io.push_back(ioVar->first);
// Our canonical order is the TBuiltInVariable numeric order.
std::sort(io.begin(), io.end());
for (int idx = 0; idx < int(io.size()); ++idx)
trackLinkageDeferred(*interstageBuiltInIo[io[idx]]);
}
//
// Handle seeing the function prototype in front of a function definition in the grammar.
// The body is handled after this function returns.
@@ -1188,6 +1429,8 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
if (entryPointOutput) {
if (shouldFlatten(entryPointOutput->getType()))
flatten(loc, *entryPointOutput);
if (shouldSplit(entryPointOutput->getType()))
split(*entryPointOutput);
assignLocations(*entryPointOutput);
}
} else
@@ -1215,7 +1458,15 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
for (int i = 0; i < function.getParamCount(); i++) {
TParameter& param = function[i];
if (param.name != nullptr) {
TVariable *variable = new TVariable(param.name, *param.type);
TType* sanitizedType;
// If we're not in the entry point, parameters are sanitized types.
if (inEntryPoint)
sanitizedType = param.type;
else
sanitizedType = sanitizeType(param.type);
TVariable *variable = new TVariable(param.name, *sanitizedType);
// Insert the parameters with name in the symbol table.
if (! symbolTable.insert(*variable))
@@ -1225,6 +1476,8 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
if (inEntryPoint) {
if (shouldFlatten(*param.type))
flatten(loc, *variable);
if (shouldSplit(*param.type))
split(*variable);
assignLocations(*variable);
}
@@ -1239,6 +1492,7 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
} else
paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc);
}
intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc);
loopNestingLevel = 0;
controlFlowNestingLevel = 0;
@@ -1373,10 +1627,12 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT
return intermediate.addBranch(EOpReturn, value, loc);
}
void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermTyped*& arguments, TIntermTyped* newArg)
void HlslParseContext::handleFunctionArgument(TFunction* function,
TIntermTyped*& arguments, TIntermTyped* newArg)
{
TParameter param = { 0, new TType };
TParameter param = { 0, new TType, nullptr };
param.type->shallowCopy(newArg->getType());
function->addParameter(param);
if (arguments)
arguments = intermediate.growAggregate(arguments, newArg);
@@ -1392,14 +1648,15 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
if (left == nullptr || right == nullptr)
return nullptr;
const auto mustFlatten = [&](const TIntermTyped& node) {
return wasFlattened(&node) && node.getAsSymbolNode() &&
flattenMap.find(node.getAsSymbolNode()->getId()) != flattenMap.end();
};
const bool isSplitLeft = wasSplit(left);
const bool isSplitRight = wasSplit(right);
const bool flattenLeft = mustFlatten(*left);
const bool flattenRight = mustFlatten(*right);
if (! flattenLeft && ! flattenRight)
const bool isFlattenLeft = wasFlattened(left);
const bool isFlattenRight = wasFlattened(right);
// OK to do a single assign if both are split, or both are unsplit. But if one is and the other
// isn't, we fall back to a memberwise copy.
if (! isFlattenLeft && ! isFlattenRight && !isSplitLeft && !isSplitRight)
return intermediate.addAssign(op, left, right, loc);
TIntermAggregate* assignList = nullptr;
@@ -1425,10 +1682,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
if (left->getType().isArray())
memberCount = left->getType().getCumulativeArraySize();
if (flattenLeft)
if (isFlattenLeft)
leftVariables = &flattenMap.find(left->getAsSymbolNode()->getId())->second.members;
if (flattenRight) {
if (isFlattenRight) {
rightVariables = &flattenMap.find(right->getAsSymbolNode()->getId())->second.members;
} else {
// The RHS is not flattened. There are several cases:
@@ -1456,73 +1713,118 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
int memberIdx = 0;
const auto getMember = [&](bool flatten, TIntermTyped* node,
const TVector<TVariable*>& memberVariables, int member,
TOperator op, const TType& memberType) -> TIntermTyped * {
// We track the outer-most aggregate, so that we can use its storage class later.
const TIntermTyped* outerLeft = left;
const TIntermTyped* outerRight = right;
const auto getMember = [&](bool isLeft, TIntermTyped* node, int member, TIntermTyped* splitNode, int splitMember) -> TIntermTyped * {
TIntermTyped* subTree;
if (flatten && isFinalFlattening(memberType)) {
subTree = intermediate.addSymbol(*memberVariables[memberIdx++]);
const bool flattened = isLeft ? isFlattenLeft : isFlattenRight;
const bool split = isLeft ? isSplitLeft : isSplitRight;
const TIntermTyped* outer = isLeft ? outerLeft : outerRight;
const TVector<TVariable*>& flatVariables = isLeft ? *leftVariables : *rightVariables;
const TOperator op = node->getType().isArray() ? EOpIndexDirect : EOpIndexDirectStruct;
const TType derefType(node->getType(), member);
if (split && derefType.isBuiltInInterstageIO()) {
// copy from interstage IO builtin if needed
subTree = intermediate.addSymbol(*interstageBuiltInIo.find(tInterstageIoData(derefType, outer->getType()))->second);
} else if (flattened && isFinalFlattening(derefType)) {
subTree = intermediate.addSymbol(*flatVariables[memberIdx++]);
} else {
subTree = intermediate.addIndex(op, node, intermediate.addConstantUnion(member, loc), loc);
subTree->setType(memberType);
const TType splitDerefType(splitNode->getType(), splitMember);
subTree = intermediate.addIndex(op, splitNode, intermediate.addConstantUnion(splitMember, loc), loc);
subTree->setType(splitDerefType);
}
return subTree;
};
// Cannot use auto here, because this is recursive, and auto can't work out the type without seeing the
// whole thing. So, we'll resort to an explicit type via std::function.
const std::function<void(TIntermTyped* left, TIntermTyped* right)>
traverse = [&](TIntermTyped* left, TIntermTyped* right) -> void {
// If we get here, we are assigning to or from a whole array or struct that must be
// flattened, so have to do member-by-member assignment:
if (left->getType().isArray()) {
// array case
const TType dereferencedType(left->getType(), 0);
for (int element=0; element < left->getType().getOuterArraySize(); ++element) {
// Add a new AST symbol node if we have a temp variable holding a complex RHS.
TIntermTyped* subRight = getMember(flattenRight, right, *rightVariables, element,
EOpIndexDirect, dereferencedType);
TIntermTyped* subLeft = getMember(flattenLeft, left, *leftVariables, element,
EOpIndexDirect, dereferencedType);
if (isFinalFlattening(dereferencedType))
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subLeft, subRight, loc), loc);
else
traverse(subLeft, subRight);
}
} else if (left->getType().isStruct()) {
// struct case
const auto& members = *left->getType().getStruct();
for (int member = 0; member < (int)members.size(); ++member) {
TIntermTyped* subRight = getMember(flattenRight, right, *rightVariables, member,
EOpIndexDirectStruct, *members[member].type);
TIntermTyped* subLeft = getMember(flattenLeft, left, *leftVariables, member,
EOpIndexDirectStruct, *members[member].type);
if (isFinalFlattening(*members[member].type))
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subLeft, subRight, loc), loc);
else
traverse(subLeft, subRight);
}
} else {
assert(0); // we should never be called on a non-flattenable thing, because
// that case bails out above to a simple copy.
}
};
// Use the proper RHS node: a new symbol from a TVariable, copy
// of an TIntermSymbol node, or sometimes the right node directly.
right = rhsTempVar ? intermediate.addSymbol(*rhsTempVar, loc) :
cloneSymNode ? intermediate.addSymbol(*cloneSymNode) :
right;
// Cannot use auto here, because this is recursive, and auto can't work out the type without seeing the
// whole thing. So, we'll resort to an explicit type via std::function.
const std::function<void(TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight)>
traverse = [&](TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight) -> void {
// If we get here, we are assigning to or from a whole array or struct that must be
// flattened, so have to do member-by-member assignment:
if (left->getType().isArray()) {
const TType dereferencedType(left->getType(), 0);
// array case
for (int element=0; element < left->getType().getOuterArraySize(); ++element) {
// Add a new AST symbol node if we have a temp variable holding a complex RHS.
TIntermTyped* subLeft = getMember(true, left, element, left, element);
TIntermTyped* subRight = getMember(false, right, element, right, element);
if (isFinalFlattening(dereferencedType))
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subLeft, subRight, loc), loc);
else
traverse(subLeft, subRight, splitLeft, splitRight);
}
} else if (left->getType().isStruct()) {
// struct case
const auto& membersL = *left->getType().getStruct();
const auto& membersR = *right->getType().getStruct();
// These track the members in the split structures corresponding to the same in the unsplit structures,
// which we traverse in parallel.
int memberL = 0;
int memberR = 0;
for (int member = 0; member < int(membersL.size()); ++member) {
const TType& typeL = *membersL[member].type;
const TType& typeR = *membersR[member].type;
TIntermTyped* subLeft = getMember(true, left, member, left, member);
TIntermTyped* subRight = getMember(false, right, member, right, member);
// If there is no splitting, use the same values to avoid inefficiency.
TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left, member, splitLeft, memberL) : subLeft;
TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR) : subRight;
// If this is the final flattening (no nested types below to flatten) we'll copy the member, else
// recurse into the type hierarchy. However, if splitting the struct, that means we can copy a whole
// subtree here IFF it does not itself contain any interstage built-in IO variables, so we only have to
// recurse into it if there's something for splitting to do. That can save a lot of AST verbosity for
// a bunch of memberwise copies.
if (isFinalFlattening(typeL) || (!isFlattenLeft && !isFlattenRight &&
!typeL.containsBuiltInInterstageIO() && !typeR.containsBuiltInInterstageIO())) {
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), loc);
} else {
traverse(subLeft, subRight, subSplitLeft, subSplitRight);
}
memberL += (typeL.isBuiltInInterstageIO() ? 0 : 1);
memberR += (typeR.isBuiltInInterstageIO() ? 0 : 1);
}
} else {
assert(0); // we should never be called on a non-flattenable thing, because
// that case bails out above to a simple copy.
}
};
TIntermTyped* splitLeft = left;
TIntermTyped* splitRight = right;
// If either left or right was a split structure, we must read or write it, but still have to
// parallel-recurse through the unsplit structure to identify the builtin IO vars.
if (isSplitLeft)
splitLeft = intermediate.addSymbol(*getSplitIoVar(left), loc);
if (isSplitRight)
splitRight = intermediate.addSymbol(*getSplitIoVar(right), loc);
// This makes the whole assignment, recursing through subtypes as needed.
traverse(left, right);
traverse(left, right, splitLeft, splitRight);
assert(assignList != nullptr);
assignList->setOperator(EOpSequence);
@@ -2214,9 +2516,9 @@ void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTy
emit->setType(TType(EbtVoid));
sequence = intermediate.growAggregate(sequence,
intermediate.addAssign(EOpAssign,
argAggregate->getSequence()[0]->getAsTyped(),
argAggregate->getSequence()[1]->getAsTyped(), loc),
handleAssign(loc, EOpAssign,
argAggregate->getSequence()[0]->getAsTyped(),
argAggregate->getSequence()[1]->getAsTyped()),
loc);
sequence = intermediate.growAggregate(sequence, emit);
@@ -2629,6 +2931,27 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
break;
}
case EOpD3DCOLORtoUBYTE4:
{
// ivec4 ( x.zyxw * 255.001953 );
TIntermTyped* arg0 = node->getAsUnaryNode()->getOperand();
TVectorFields fields(2,1,0,3);
TIntermTyped* swizzleIdx = intermediate.addSwizzle(fields, loc);
TIntermTyped* swizzled = intermediate.addIndex(EOpVectorSwizzle, arg0, swizzleIdx, loc);
swizzled->setType(arg0->getType());
swizzled->getWritableType().getQualifier().makeTemporary();
TIntermTyped* conversion = intermediate.addConstantUnion(255.001953f, EbtFloat, loc, true);
TIntermTyped* rangeConverted = handleBinaryMath(loc, "mul", EOpMul, conversion, swizzled);
rangeConverted->setType(arg0->getType());
rangeConverted->getWritableType().getQualifier().makeTemporary();
node = intermediate.addConversion(EOpConstructInt, TType(EbtInt, EvqTemporary, 4), rangeConverted);
node->setLoc(loc);
node->setType(TType(EbtInt, EvqTemporary, 4));
break;
}
default:
break; // most pass through unchanged
}
@@ -2643,7 +2966,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
// - user function
// - subroutine call (not implemented yet)
//
TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermNode* arguments)
TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermTyped* arguments)
{
TIntermTyped* result = nullptr;
@@ -2783,10 +3106,10 @@ TIntermTyped* HlslParseContext::handleLengthMethod(const TSourceLoc& loc, TFunct
//
// Add any needed implicit conversions for function-call arguments to input parameters.
//
void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermNode*& arguments)
void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermTyped*& arguments)
{
TIntermAggregate* aggregate = arguments->getAsAggregate();
const auto setArg = [&](int argNum, TIntermNode* arg) {
const auto setArg = [&](int argNum, TIntermTyped* arg) {
if (function.getParamCount() == 1)
arguments = arg;
else {
@@ -2819,7 +3142,7 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
else
error(arg->getLoc(), "cannot convert input argument, argument", "", "%d", i);
} else {
if (wasFlattened(arg)) {
if (wasFlattened(arg) || wasSplit(arg)) {
// Will make a two-level subtree.
// The deepest will copy member-by-member to build the structure to pass.
// The level above that will be a two-operand EOpComma sequence that follows the copy by the
@@ -3195,7 +3518,7 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
else if (semanticUpperCase == "SV_GSINSTANCEID")
qualifier.builtIn = EbvInvocationId;
else if (semanticUpperCase == "SV_DISPATCHTHREADID")
qualifier.builtIn = EbvLocalInvocationId;
qualifier.builtIn = EbvGlobalInvocationId;
else if (semanticUpperCase == "SV_GROUPTHREADID")
qualifier.builtIn = EbvLocalInvocationId;
else if (semanticUpperCase == "SV_GROUPID")
@@ -3892,6 +4215,23 @@ void HlslParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNod
symbol->getWritableType().setImplicitArraySize(index + 1);
}
//
// Enforce non-initializer type/qualifier rules.
//
void HlslParseContext::fixConstInit(const TSourceLoc& loc, TString& identifier, TType& type, TIntermTyped*& initializer)
{
//
// Make the qualifier make sense, given that there is an initializer.
//
if (initializer == nullptr) {
if (type.getQualifier().storage == EvqConst ||
type.getQualifier().storage == EvqConstReadOnly) {
initializer = intermediate.makeAggregate(loc);
warn(loc, "variable with qualifier 'const' not initialized; zero initializing", identifier.c_str(), "");
}
}
}
//
// See if the identifier is a built-in symbol that can be redeclared, and if so,
// copy the symbol table's read-only built-in variable to the current
@@ -4483,8 +4823,8 @@ void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQuali
//
// Return the function symbol if found, otherwise nullptr.
//
const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn,
TIntermNode* args)
const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn,
TIntermTyped*& args)
{
// const TFunction* function = nullptr;
@@ -4583,6 +4923,22 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
return false;
}
// Handle sampler betterness: An exact sampler match beats a non-exact match.
// (If we just looked at basic type, all EbtSamplers would look the same).
// If any type is not a sampler, just use the linearize function below.
if (from.getBasicType() == EbtSampler && to1.getBasicType() == EbtSampler && to2.getBasicType() == EbtSampler) {
// We can ignore the vector size in the comparison.
TSampler to1Sampler = to1.getSampler();
TSampler to2Sampler = to2.getSampler();
to1Sampler.vectorSize = to2Sampler.vectorSize = from.getSampler().vectorSize;
if (from.getSampler() == to2Sampler)
return from.getSampler() != to1Sampler;
if (from.getSampler() == to1Sampler)
return false;
}
// Might or might not be changing shape, which means basic type might
// or might not match, so within that, the question is how big a
// basic-type conversion is being done.
@@ -4672,18 +5028,18 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
// Handle aggregates: put all args into the new function call
for (int arg=0; arg<int(args->getAsAggregate()->getSequence().size()); ++arg) {
// TODO: But for constness, we could avoid the new & shallowCopy, and use the pointer directly.
TParameter param = { 0, new TType };
TParameter param = { 0, new TType, nullptr };
param.type->shallowCopy(args->getAsAggregate()->getSequence()[arg]->getAsTyped()->getType());
convertedCall.addParameter(param);
}
} else if (args->getAsUnaryNode()) {
// Handle unaries: put all args into the new function call
TParameter param = { 0, new TType };
TParameter param = { 0, new TType, nullptr };
param.type->shallowCopy(args->getAsUnaryNode()->getOperand()->getAsTyped()->getType());
convertedCall.addParameter(param);
} else if (args->getAsTyped()) {
// Handle bare e.g, floats, not in an aggregate.
TParameter param = { 0, new TType };
TParameter param = { 0, new TType, nullptr };
param.type->shallowCopy(args->getAsTyped()->getType());
convertedCall.addParameter(param);
} else {
@@ -4701,6 +5057,13 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
if (tie)
error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), "");
// Append default parameter values if needed
if (!tie && bestMatch != nullptr) {
for (int defParam = call.getParamCount(); defParam < bestMatch->getParamCount(); ++defParam) {
handleFunctionArgument(&call, args, (*bestMatch)[defParam].defaultValue);
}
}
return bestMatch;
}
@@ -4720,6 +5083,43 @@ void HlslParseContext::declareTypedef(const TSourceLoc& loc, TString& identifier
error(loc, "name already defined", "typedef", identifier.c_str());
}
// Type sanitization: return existing sanitized (temporary) type if there is one, else make new one.
TType* HlslParseContext::sanitizeType(TType* type)
{
// We only do this for structs.
if (!type->isStruct())
return type;
// Type sanitization: if this is declaring a variable of a type that contains
// interstage IO, we want to make it a temporary.
const auto sanitizedTypeIter = sanitizedTypeMap.find(type->getStruct());
if (sanitizedTypeIter != sanitizedTypeMap.end()) {
// We've sanitized this before. Use that one.
TType* sanitizedType = new TType();
sanitizedType->shallowCopy(*sanitizedTypeIter->second);
// Arrayness is not part of the sanitized type. Use the input type's arrayness.
if (type->isArray())
sanitizedType->newArraySizes(type->getArraySizes());
else
sanitizedType->clearArraySizes();
return sanitizedType;
} else {
if (type->containsBuiltInInterstageIO()) {
// This means the type contains interstage IO, but we've never encountered it before.
// Copy it, sanitize it, and remember it in the sanitizedTypeMap
TType* sanitizedType = type->clone();
sanitizedType->makeTemporary();
sanitizedTypeMap[type->getStruct()] = sanitizedType;
return sanitizedType;
} else {
// This means the type has no interstage IO, so we can use it as is.
return type;
}
}
}
//
// Do everything necessary to handle a variable (non-block) declaration.
// Either redeclaring a variable, or making a new one, updating the symbol
@@ -4736,21 +5136,29 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, TString& i
if (voidErrorCheck(loc, identifier, type.getBasicType()))
return nullptr;
// make const and initialization consistent
fixConstInit(loc, identifier, type, initializer);
// Check for redeclaration of built-ins and/or attempting to declare a reserved name
TSymbol* symbol = nullptr;
inheritGlobalDefaults(type.getQualifier());
const bool flattenVar = shouldFlatten(type);
const bool splitVar = shouldSplit(type);
// Type sanitization: if this is declaring a variable of a type that contains
// interstage IO, we want to make it a temporary.
TType* sanitizedType = sanitizeType(&type);
// Declare the variable
if (type.isArray()) {
// array case
declareArray(loc, identifier, type, symbol, !flattenVar);
declareArray(loc, identifier, *sanitizedType, symbol, !flattenVar);
} else {
// non-array case
if (! symbol)
symbol = declareNonArray(loc, identifier, type, !flattenVar);
symbol = declareNonArray(loc, identifier, *sanitizedType, !flattenVar);
else if (type != symbol->getType())
error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str());
}
@@ -4758,6 +5166,9 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, TString& i
if (flattenVar)
flatten(loc, *symbol->getAsVariable());
if (splitVar)
split(*symbol->getAsVariable());
if (! symbol)
return nullptr;
@@ -4960,12 +5371,16 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co
// edit array sizes to fill in unsized dimensions
if (type.isImplicitlySizedArray())
arrayType.changeOuterArraySize((int)initList->getSequence().size());
TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped();
if (arrayType.isArrayOfArrays() && firstInit->getType().isArray() &&
arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) {
for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) {
if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize)
arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1));
// set unsized array dimensions that can be derived from the initializer's first element
if (arrayType.isArrayOfArrays() && initList->getSequence().size() > 0) {
TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped();
if (firstInit->getType().isArray() &&
arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) {
for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) {
if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize)
arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1));
}
}
}
@@ -5024,6 +5439,9 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co
return nullptr;
}
} else if (type.isScalar()) {
// lengthen list to be long enough
lengthenList(loc, initList->getSequence(), 1);
if ((int)initList->getSequence().size() != 1) {
error(loc, "scalar expected one element:", "initializer list", type.getCompleteString().c_str());
return nullptr;
@@ -5792,4 +6210,13 @@ void HlslParseContext::renameShaderFunction(TString*& name) const
name = new TString(intermediate.getEntryPointName().c_str());
}
// post-processing
void HlslParseContext::finish()
{
addInterstageIoToLinkage();
TParseContextBase::finish();
}
} // end namespace glslang

View File

@@ -79,12 +79,12 @@ public:
TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*);
void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg);
TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right) const;
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*);
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeGeometryMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*);
void addInputArgumentConversions(const TFunction&, TIntermNode*&);
void addInputArgumentConversions(const TFunction&, TIntermTyped*&);
TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermOperator&);
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
@@ -126,7 +126,7 @@ public:
void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly);
void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&);
const TFunction* findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn, TIntermNode* args);
const TFunction* findFunction(const TSourceLoc& loc, TFunction& call, bool& builtIn, TIntermTyped*& args);
void declareTypedef(const TSourceLoc&, TString& identifier, const TType&, TArraySizes* typeArray = 0);
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, TType&, TIntermTyped* initializer = 0);
void lengthenList(const TSourceLoc&, TIntermSequence& list, int size);
@@ -183,8 +183,12 @@ protected:
int nextBinding; // next binding to use.
};
void fixConstInit(const TSourceLoc&, TString& identifier, TType& type, TIntermTyped*& initializer);
void inheritGlobalDefaults(TQualifier& dst) const;
TVariable* makeInternalVariable(const char* name, const TType&) const;
TVariable* makeInternalVariable(const TString& name, const TType& type) const {
return makeInternalVariable(name.c_str(), type);
}
TVariable* declareNonArray(const TSourceLoc&, TString& identifier, TType&, bool track);
void declareArray(const TSourceLoc&, TString& identifier, const TType&, TSymbol*&, bool track);
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
@@ -197,7 +201,7 @@ protected:
// Array and struct flattening
bool shouldFlatten(const TType& type) const;
TIntermTyped* flattenAccess(const TSourceLoc&, TIntermTyped* base, int member);
TIntermTyped* flattenAccess(TIntermTyped* base, int member);
bool shouldFlattenIO(const TType&) const;
bool shouldFlattenUniform(const TType&) const;
bool wasFlattened(const TIntermTyped* node) const;
@@ -205,11 +209,30 @@ protected:
int addFlattenedMember(const TSourceLoc& loc, const TVariable&, const TType&, TFlattenData&, const TString& name, bool track);
bool isFinalFlattening(const TType& type) const { return !(type.isStruct() || type.isArray()); }
// Structure splitting (splits interstage builtin types into its own struct)
bool shouldSplit(const TType&);
TIntermTyped* splitAccessStruct(const TSourceLoc& loc, TIntermTyped*& base, int& member);
void splitAccessArray(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index);
TType& split(TType& type, TString name, const TType* outerStructType = nullptr);
void split(TIntermTyped*);
void split(const TVariable&);
bool wasSplit(const TIntermTyped* node) const;
bool wasSplit(int id) const { return splitIoVars.find(id) != splitIoVars.end(); }
TVariable* getSplitIoVar(const TIntermTyped* node) const;
TVariable* getSplitIoVar(const TVariable* var) const;
TVariable* getSplitIoVar(int id) const;
void addInterstageIoToLinkage();
void flatten(const TSourceLoc& loc, const TVariable& variable);
int flatten(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
int flattenStruct(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
int flattenArray(const TSourceLoc& loc, const TVariable& variable, const TType&, TFlattenData&, TString name);
// Type sanitization: return existing sanitized (temporary) type if there is one, else make new one.
TType* sanitizeType(TType*);
void finish(); // post-processing
// Current state of parsing
struct TPragma contextPragma;
int loopNestingLevel; // 0 if outside all loops
@@ -275,6 +298,38 @@ protected:
TVector<int> flattenLevel; // nested postfix operator level for flattening
TVector<int> flattenOffset; // cumulative offset for flattening
// Sanitized type map. During declarations we use the sanitized form of the type
// if it exists.
TMap<const TTypeList*, TType*> sanitizedTypeMap;
// Structure splitting data:
TMap<int, TVariable*> splitIoVars; // variables with the builtin interstage IO removed, indexed by unique ID.
// The builtin interstage IO map considers e.g, EvqPosition on input and output separately, so that we
// can build the linkage correctly if position appears on both sides. Otherwise, multiple positions
// are considered identical.
struct tInterstageIoData {
tInterstageIoData(const TType& memberType, const TType& storageType) :
builtIn(memberType.getQualifier().builtIn),
storage(storageType.getQualifier().storage) { }
TBuiltInVariable builtIn;
TStorageQualifier storage;
// ordering for maps
bool operator<(const tInterstageIoData d) const {
return (builtIn != d.builtIn) ? (builtIn < d.builtIn) : (storage < d.storage);
}
};
TMap<tInterstageIoData, TVariable*> interstageBuiltInIo; // individual builtin interstage IO vars, inxed by builtin type.
// We have to move array references to structs containing builtin interstage IO to the split variables.
// This is only handled for one level. This stores the index, because we'll need it in the future, since
// unlike normal array references, here the index happens before we discover what it applies to.
TIntermTyped* builtInIoIndex;
TIntermTyped* builtInIoBase;
unsigned int nextInLocation;
unsigned int nextOutLocation;

View File

@@ -586,7 +586,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "DeviceMemoryBarrier", nullptr, nullptr, "-", "-", EShLangPSCS },
{ "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS },
{ "distance", "S", "F", "V,", "F,", EShLangAll },
{ "dot", "S", nullptr, "V,", "FI,", EShLangAll },
{ "dot", "S", nullptr, "SV,", "FI,", EShLangAll },
{ "dst", nullptr, nullptr, "V4,", "F,", EShLangAll },
// { "errorf", "-", "-", "", "", EShLangAll }, TODO: varargs
{ "EvaluateAttributeAtCentroid", nullptr, nullptr, "SVM", "F", EShLangPS },
@@ -1022,7 +1022,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
symbolTable.relateToOperator("cosh", EOpCosh);
symbolTable.relateToOperator("countbits", EOpBitCount);
symbolTable.relateToOperator("cross", EOpCross);
// symbolTable.relateToOperator("D3DCOLORtoUBYTE4", EOpD3DCOLORtoUBYTE4);
symbolTable.relateToOperator("D3DCOLORtoUBYTE4", EOpD3DCOLORtoUBYTE4);
symbolTable.relateToOperator("ddx", EOpDPdx);
symbolTable.relateToOperator("ddx_coarse", EOpDPdxCoarse);
symbolTable.relateToOperator("ddx_fine", EOpDPdxFine);

View File

@@ -169,6 +169,10 @@ void HlslScanContext::fillInKeywordMap()
(*KeywordMap)["uint3"] = EHTokUint3;
(*KeywordMap)["uint4"] = EHTokUint4;
(*KeywordMap)["half1"] = EHTokHalf1;
(*KeywordMap)["half2"] = EHTokHalf2;
(*KeywordMap)["half3"] = EHTokHalf3;
(*KeywordMap)["half4"] = EHTokHalf4;
(*KeywordMap)["min16float1"] = EHTokMin16float1;
(*KeywordMap)["min16float2"] = EHTokMin16float2;
(*KeywordMap)["min16float3"] = EHTokMin16float3;
@@ -579,6 +583,10 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
case EHTokUint2:
case EHTokUint3:
case EHTokUint4:
case EHTokHalf1:
case EHTokHalf2:
case EHTokHalf3:
case EHTokHalf4:
case EHTokMin16float1:
case EHTokMin16float2:
case EHTokMin16float3:

View File

@@ -120,6 +120,10 @@ enum EHlslTokenClass {
EHTokUint2,
EHTokUint3,
EHTokUint4,
EHTokHalf1,
EHTokHalf2,
EHTokHalf3,
EHTokHalf4,
EHTokMin16float1,
EHTokMin16float2,
EHTokMin16float3,