SPV: Implement new extensions GL_KHX_device_group and GL_KHX_multiview.

These correspond to SPV_KHR_device_group and SPV_KHR_multiview.
Also, bring tests up to date with Khronos internals, and some misc. related changes.
This commit is contained in:
John Kessenich
2017-02-27 01:20:51 -07:00
parent 4a57dced66
commit 6c8aaacd28
18 changed files with 252 additions and 26 deletions

View File

@@ -0,0 +1,38 @@
spv.deviceGroup.frag
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 17
Capability Shader
Capability DeviceGroup
Extension "SPV_KHR_device_group"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_KHX_device_group"
Name 4 "main"
Name 9 "color"
Name 12 "gl_DeviceIndexKHR"
Decorate 12(gl_DeviceIndexKHR) BuiltIn DeviceIndex
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(color): 8(ptr) Variable Output
10: TypeInt 32 1
11: TypePointer UniformConstant 10(int)
12(gl_DeviceIndexKHR): 11(ptr) Variable UniformConstant
15: 6(float) Constant 0
4(main): 2 Function None 3
5: Label
13: 10(int) Load 12(gl_DeviceIndexKHR)
14: 6(float) ConvertSToF 13
16: 7(fvec4) CompositeConstruct 14 15 15 15
Store 9(color) 16
Return
FunctionEnd

View File

@@ -0,0 +1,59 @@
spv.drawParams.vert
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 29
Capability Shader
Capability DrawParameters
Extension "SPV_KHR_shader_draw_parameters"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 10 13 16 21
Source GLSL 450
SourceExtension "GL_ARB_shader_draw_parameters"
Name 4 "main"
Name 8 "a"
Name 10 "gl_BaseVertexARB"
Name 12 "b"
Name 13 "gl_BaseInstanceARB"
Name 15 "c"
Name 16 "gl_DrawIDARB"
Name 21 "pos"
Decorate 10(gl_BaseVertexARB) BuiltIn BaseVertex
Decorate 13(gl_BaseInstanceARB) BuiltIn BaseInstance
Decorate 16(gl_DrawIDARB) BuiltIn DrawIndex
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
9: TypePointer Input 6(int)
10(gl_BaseVertexARB): 9(ptr) Variable Input
13(gl_BaseInstanceARB): 9(ptr) Variable Input
16(gl_DrawIDARB): 9(ptr) Variable Input
18: TypeFloat 32
19: TypeVector 18(float) 3
20: TypePointer Output 19(fvec3)
21(pos): 20(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(a): 7(ptr) Variable Function
12(b): 7(ptr) Variable Function
15(c): 7(ptr) Variable Function
11: 6(int) Load 10(gl_BaseVertexARB)
Store 8(a) 11
14: 6(int) Load 13(gl_BaseInstanceARB)
Store 12(b) 14
17: 6(int) Load 16(gl_DrawIDARB)
Store 15(c) 17
22: 6(int) Load 8(a)
23: 18(float) ConvertSToF 22
24: 6(int) Load 12(b)
25: 18(float) ConvertSToF 24
26: 6(int) Load 15(c)
27: 18(float) ConvertSToF 26
28: 19(fvec3) CompositeConstruct 23 25 27
Store 21(pos) 28
Return
FunctionEnd

View File

@@ -0,0 +1,38 @@
spv.multiView.frag
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 17
Capability Shader
Capability MultiView
Extension "SPV_KHR_multiview"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_KHX_multiview"
Name 4 "main"
Name 9 "color"
Name 12 "gl_ViewIndexKHR"
Decorate 12(gl_ViewIndexKHR) BuiltIn ViewIndex
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(color): 8(ptr) Variable Output
10: TypeInt 32 1
11: TypePointer UniformConstant 10(int)
12(gl_ViewIndexKHR): 11(ptr) Variable UniformConstant
15: 6(float) Constant 0
4(main): 2 Function None 3
5: Label
13: 10(int) Load 12(gl_ViewIndexKHR)
14: 6(float) ConvertSToF 13
16: 7(fvec4) CompositeConstruct 14 15 15 15
Store 9(color) 16
Return
FunctionEnd

View File

@@ -13,7 +13,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Source GLSL 400
Name 4 "main"
Name 9 "arraySize"
Name 14 "foo(vf4[s1516];"
Name 14 "foo(vf4[s1518];"
Name 13 "p"
Name 17 "builtin_spec_constant("
Name 20 "color"
@@ -104,10 +104,10 @@ Warning, version 400 is not yet complete; most version-specific features are pre
Store 20(color) 46
48: 10 Load 22(ucol)
Store 47(param) 48
49: 2 FunctionCall 14(foo(vf4[s1516];) 47(param)
49: 2 FunctionCall 14(foo(vf4[s1518];) 47(param)
Return
FunctionEnd
14(foo(vf4[s1516];): 2 Function None 12
14(foo(vf4[s1518];): 2 Function None 12
13(p): 11(ptr) FunctionParameter
15: Label
54: 24(ptr) AccessChain 53(dupUcol) 23