forked from KhronosGroup/glslang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
4a57dce
commit 6c8aaac
Showing
18 changed files
with
252 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 450 | ||
|
||
#extension GL_KHX_device_group : enable | ||
|
||
out vec4 color; | ||
|
||
void main() { | ||
color = vec4(gl_DeviceIndexKHR, 0, 0, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 450 | ||
|
||
#extension GL_ARB_shader_draw_parameters : enable | ||
|
||
out vec3 pos; | ||
|
||
void main() | ||
{ | ||
int a = gl_BaseVertexARB; | ||
int b = gl_BaseInstanceARB; | ||
int c = gl_DrawIDARB; | ||
pos = vec3(a, b, c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 450 | ||
|
||
#extension GL_KHX_multiview : enable | ||
|
||
out vec4 color; | ||
|
||
void main() { | ||
color = vec4(gl_ViewIndexKHR, 0, 0, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.