-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1523 from sparmarNV/fix-SPV_NV_mesh_shader
Allow redeclaration of builtin interface blocks in mesh shader
- vulkan-sdk-1.4.304.1
- vulkan-sdk-1.4.304.0
- vulkan-sdk-1.3.296.0
- vulkan-sdk-1.3.290.0
- vulkan-sdk-1.3.283.0
- vulkan-sdk-1.3.280.0
- vulkan-sdk-1.3.275.0
- vulkan-sdk-1.3.268.0
- untagged-305dd8c44fedc0e7814b
- untagged-048c4dbc7f021224a933
- untagged-3d696f0be7ba2beffc6a
- untagged-3b4adc8786f8261f953a
- show
- sdk-1.3.261.1
- sdk-1.3.261.0
- sdk-1.3.250.1
- sdk-1.3.250.0
- sdk-1.3.246.1
- sdk-1.3.246.0
- sdk-1.3.243.0
- sdk-1.3.239.0
- sdk-1.3.236.0
- sdk-1.3.231.1
- sdk-1.3.231.0
- sdk-1.3.224.1
- sdk-1.3.224.0
- sdk-1.3.216.0
- sdk-1.3.211.0
- sdk-1.3.204.1
- sdk-1.3.204.0
- sdk-1.2.198.0
- master-tot
- main-tot
- SDK-candidate-26-Jul-2020
- SDK-candidate-2
- SDK-candidate
- GL_EXT_shader_subgroup_extended_types-2016-05-10
- 15.1.0
- 15.0.0
- 14.3.0
- 14.2.0
- 14.1.0
- 14.0.0
- 13.1.1
- 13.1.0
- 13.0.0
- 12.3.1
- 12.3.0
- 12.2.0
- 12.1.0
- 12.0.0
- 11.13.0
- 11.12.0
- 11.11.0
- 11.10.0
- 11.9.0
- 11.8.0
- 11.7.1
- 11.7.0
- 11.6.0
- 11.5.0
- 11.4.0
- 11.3.0
- 11.2.0
- 11.1.0
- 11.0.0
- 8.13.3743
- 8.13.3559
- 7.13.3496
- 7.12.3352
- 7.11.3214
- 7.11.3188
- 7.11.3113
- 7.10.2984
Showing
13 changed files
with
875 additions
and
305 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
Large diffs are not rendered by default.
Oops, something went wrong.
294 changes: 148 additions & 146 deletions
294
Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out
Large diffs are not rendered by default.
Oops, something went wrong.
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,201 @@ | ||
spv.meshShaderRedeclBuiltins.mesh | ||
// Module Version 10000 | ||
// Generated by (magic number): 80007 | ||
// Id's are bound by 120 | ||
|
||
Capability ClipDistance | ||
Capability CullDistance | ||
Capability MultiViewport | ||
Capability ShaderViewportMaskNV | ||
Capability MeshShadingNV | ||
Extension "SPV_NV_mesh_shader" | ||
Extension "SPV_NV_viewport_array2" | ||
1: ExtInstImport "GLSL.std.450" | ||
MemoryModel Logical GLSL450 | ||
EntryPoint MeshNV 4 "main" 11 17 28 81 | ||
ExecutionMode 4 LocalSize 32 1 1 | ||
ExecutionMode 4 OutputVertices 81 | ||
ExecutionMode 4 OutputPrimitivesNV 32 | ||
ExecutionMode 4 OutputTrianglesNV | ||
Source GLSL 460 | ||
SourceExtension "GL_NV_mesh_shader" | ||
Name 4 "main" | ||
Name 8 "iid" | ||
Name 11 "gl_LocalInvocationID" | ||
Name 16 "gid" | ||
Name 17 "gl_WorkGroupID" | ||
Name 24 "gl_MeshPerVertexNV" | ||
MemberName 24(gl_MeshPerVertexNV) 0 "gl_Position" | ||
MemberName 24(gl_MeshPerVertexNV) 1 "gl_PointSize" | ||
MemberName 24(gl_MeshPerVertexNV) 2 "gl_ClipDistance" | ||
MemberName 24(gl_MeshPerVertexNV) 3 "gl_CullDistance" | ||
Name 28 "gl_MeshVerticesNV" | ||
Name 77 "gl_MeshPerPrimitiveNV" | ||
MemberName 77(gl_MeshPerPrimitiveNV) 0 "gl_PrimitiveID" | ||
MemberName 77(gl_MeshPerPrimitiveNV) 1 "gl_Layer" | ||
MemberName 77(gl_MeshPerPrimitiveNV) 2 "gl_ViewportIndex" | ||
MemberName 77(gl_MeshPerPrimitiveNV) 3 "gl_ViewportMask" | ||
Name 81 "gl_MeshPrimitivesNV" | ||
Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId | ||
Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId | ||
MemberDecorate 24(gl_MeshPerVertexNV) 0 BuiltIn Position | ||
MemberDecorate 24(gl_MeshPerVertexNV) 1 BuiltIn PointSize | ||
MemberDecorate 24(gl_MeshPerVertexNV) 2 BuiltIn ClipDistance | ||
MemberDecorate 24(gl_MeshPerVertexNV) 3 BuiltIn CullDistance | ||
Decorate 24(gl_MeshPerVertexNV) Block | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 0 BuiltIn PrimitiveId | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 1 BuiltIn Layer | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 2 PerPrimitiveNV | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 2 BuiltIn ViewportIndex | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 PerPrimitiveNV | ||
MemberDecorate 77(gl_MeshPerPrimitiveNV) 3 BuiltIn ViewportMaskNV | ||
Decorate 77(gl_MeshPerPrimitiveNV) Block | ||
Decorate 119 BuiltIn WorkgroupSize | ||
2: TypeVoid | ||
3: TypeFunction 2 | ||
6: TypeInt 32 0 | ||
7: TypePointer Function 6(int) | ||
9: TypeVector 6(int) 3 | ||
10: TypePointer Input 9(ivec3) | ||
11(gl_LocalInvocationID): 10(ptr) Variable Input | ||
12: 6(int) Constant 0 | ||
13: TypePointer Input 6(int) | ||
17(gl_WorkGroupID): 10(ptr) Variable Input | ||
20: TypeFloat 32 | ||
21: TypeVector 20(float) 4 | ||
22: 6(int) Constant 4 | ||
23: TypeArray 20(float) 22 | ||
24(gl_MeshPerVertexNV): TypeStruct 21(fvec4) 20(float) 23 23 | ||
25: 6(int) Constant 81 | ||
26: TypeArray 24(gl_MeshPerVertexNV) 25 | ||
27: TypePointer Output 26 | ||
28(gl_MeshVerticesNV): 27(ptr) Variable Output | ||
30: TypeInt 32 1 | ||
31: 30(int) Constant 0 | ||
32: 20(float) Constant 1065353216 | ||
33: 21(fvec4) ConstantComposite 32 32 32 32 | ||
34: TypePointer Output 21(fvec4) | ||
37: 30(int) Constant 1 | ||
38: 20(float) Constant 1073741824 | ||
39: TypePointer Output 20(float) | ||
42: 30(int) Constant 2 | ||
43: 30(int) Constant 3 | ||
44: 20(float) Constant 1077936128 | ||
47: 20(float) Constant 1082130432 | ||
49: 6(int) Constant 1 | ||
50: 6(int) Constant 264 | ||
51: 6(int) Constant 2 | ||
76: TypeArray 30(int) 49 | ||
77(gl_MeshPerPrimitiveNV): TypeStruct 30(int) 30(int) 30(int) 76 | ||
78: 6(int) Constant 32 | ||
79: TypeArray 77(gl_MeshPerPrimitiveNV) 78 | ||
80: TypePointer Output 79 | ||
81(gl_MeshPrimitivesNV): 80(ptr) Variable Output | ||
83: 30(int) Constant 6 | ||
84: TypePointer Output 30(int) | ||
87: 30(int) Constant 7 | ||
90: 30(int) Constant 8 | ||
93: 30(int) Constant 9 | ||
119: 9(ivec3) ConstantComposite 78 49 49 | ||
4(main): 2 Function None 3 | ||
5: Label | ||
8(iid): 7(ptr) Variable Function | ||
16(gid): 7(ptr) Variable Function | ||
14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 | ||
15: 6(int) Load 14 | ||
Store 8(iid) 15 | ||
18: 13(ptr) AccessChain 17(gl_WorkGroupID) 12 | ||
19: 6(int) Load 18 | ||
Store 16(gid) 19 | ||
29: 6(int) Load 8(iid) | ||
35: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 29 31 | ||
Store 35 33 | ||
36: 6(int) Load 8(iid) | ||
40: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 36 37 | ||
Store 40 38 | ||
41: 6(int) Load 8(iid) | ||
45: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 41 42 43 | ||
Store 45 44 | ||
46: 6(int) Load 8(iid) | ||
48: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 46 43 42 | ||
Store 48 47 | ||
MemoryBarrier 49 50 | ||
ControlBarrier 51 51 50 | ||
52: 6(int) Load 8(iid) | ||
53: 6(int) IAdd 52 49 | ||
54: 6(int) Load 8(iid) | ||
55: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 54 31 | ||
56: 21(fvec4) Load 55 | ||
57: 34(ptr) AccessChain 28(gl_MeshVerticesNV) 53 31 | ||
Store 57 56 | ||
58: 6(int) Load 8(iid) | ||
59: 6(int) IAdd 58 49 | ||
60: 6(int) Load 8(iid) | ||
61: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 60 37 | ||
62: 20(float) Load 61 | ||
63: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 59 37 | ||
Store 63 62 | ||
64: 6(int) Load 8(iid) | ||
65: 6(int) IAdd 64 49 | ||
66: 6(int) Load 8(iid) | ||
67: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 66 42 43 | ||
68: 20(float) Load 67 | ||
69: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 65 42 43 | ||
Store 69 68 | ||
70: 6(int) Load 8(iid) | ||
71: 6(int) IAdd 70 49 | ||
72: 6(int) Load 8(iid) | ||
73: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 72 43 42 | ||
74: 20(float) Load 73 | ||
75: 39(ptr) AccessChain 28(gl_MeshVerticesNV) 71 43 42 | ||
Store 75 74 | ||
MemoryBarrier 49 50 | ||
ControlBarrier 51 51 50 | ||
82: 6(int) Load 8(iid) | ||
85: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 82 31 | ||
Store 85 83 | ||
86: 6(int) Load 8(iid) | ||
88: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 86 37 | ||
Store 88 87 | ||
89: 6(int) Load 8(iid) | ||
91: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 89 42 | ||
Store 91 90 | ||
92: 6(int) Load 8(iid) | ||
94: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 92 43 31 | ||
Store 94 93 | ||
MemoryBarrier 49 50 | ||
ControlBarrier 51 51 50 | ||
95: 6(int) Load 8(iid) | ||
96: 6(int) IAdd 95 49 | ||
97: 6(int) Load 8(iid) | ||
98: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 97 31 | ||
99: 30(int) Load 98 | ||
100: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 96 31 | ||
Store 100 99 | ||
101: 6(int) Load 8(iid) | ||
102: 6(int) IAdd 101 49 | ||
103: 6(int) Load 8(iid) | ||
104: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 103 37 | ||
105: 30(int) Load 104 | ||
106: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 102 37 | ||
Store 106 105 | ||
107: 6(int) Load 8(iid) | ||
108: 6(int) IAdd 107 49 | ||
109: 6(int) Load 8(iid) | ||
110: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 109 42 | ||
111: 30(int) Load 110 | ||
112: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 108 42 | ||
Store 112 111 | ||
113: 6(int) Load 8(iid) | ||
114: 6(int) IAdd 113 49 | ||
115: 6(int) Load 8(iid) | ||
116: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 115 43 31 | ||
117: 30(int) Load 116 | ||
118: 84(ptr) AccessChain 81(gl_MeshPrimitivesNV) 114 43 31 | ||
Store 118 117 | ||
MemoryBarrier 49 50 | ||
ControlBarrier 51 51 50 | ||
Return | ||
FunctionEnd |
187 changes: 187 additions & 0 deletions
187
Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
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,187 @@ | ||
spv.meshShaderRedeclPerViewBuiltins.mesh | ||
// Module Version 10000 | ||
// Generated by (magic number): 80007 | ||
// Id's are bound by 120 | ||
|
||
Capability PerViewAttributesNV | ||
Capability MeshShadingNV | ||
Extension "SPV_NVX_multiview_per_view_attributes" | ||
Extension "SPV_NV_mesh_shader" | ||
1: ExtInstImport "GLSL.std.450" | ||
MemoryModel Logical GLSL450 | ||
EntryPoint MeshNV 4 "main" 11 20 21 35 67 | ||
ExecutionMode 4 LocalSize 32 1 1 | ||
ExecutionMode 4 OutputVertices 81 | ||
ExecutionMode 4 OutputPrimitivesNV 32 | ||
ExecutionMode 4 OutputTrianglesNV | ||
Source GLSL 450 | ||
SourceExtension "GL_NV_mesh_shader" | ||
Name 4 "main" | ||
Name 8 "iid" | ||
Name 11 "gl_LocalInvocationID" | ||
Name 16 "viewID" | ||
Name 20 "gl_MeshViewIndicesNV" | ||
Name 21 "gl_MeshViewCountNV" | ||
Name 31 "gl_MeshPerVertexNV" | ||
MemberName 31(gl_MeshPerVertexNV) 0 "gl_PositionPerViewNV" | ||
MemberName 31(gl_MeshPerVertexNV) 1 "gl_ClipDistancePerViewNV" | ||
MemberName 31(gl_MeshPerVertexNV) 2 "gl_CullDistancePerViewNV" | ||
Name 35 "gl_MeshVerticesNV" | ||
Name 63 "gl_MeshPerPrimitiveNV" | ||
MemberName 63(gl_MeshPerPrimitiveNV) 0 "gl_LayerPerViewNV" | ||
MemberName 63(gl_MeshPerPrimitiveNV) 1 "gl_ViewportMaskPerViewNV" | ||
Name 67 "gl_MeshPrimitivesNV" | ||
Decorate 11(gl_LocalInvocationID) BuiltIn LocalInvocationId | ||
Decorate 20(gl_MeshViewIndicesNV) BuiltIn MeshViewIndicesNV | ||
Decorate 21(gl_MeshViewCountNV) BuiltIn MeshViewCountNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 0 PerViewNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 0 BuiltIn PositionPerViewNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 1 PerViewNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 1 BuiltIn ClipDistancePerViewNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 2 PerViewNV | ||
MemberDecorate 31(gl_MeshPerVertexNV) 2 BuiltIn CullDistancePerViewNV | ||
Decorate 31(gl_MeshPerVertexNV) Block | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerPrimitiveNV | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 PerViewNV | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 0 BuiltIn LayerPerViewNV | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerPrimitiveNV | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 PerViewNV | ||
MemberDecorate 63(gl_MeshPerPrimitiveNV) 1 BuiltIn ViewportMaskPerViewNV | ||
Decorate 63(gl_MeshPerPrimitiveNV) Block | ||
Decorate 119 BuiltIn WorkgroupSize | ||
2: TypeVoid | ||
3: TypeFunction 2 | ||
6: TypeInt 32 0 | ||
7: TypePointer Function 6(int) | ||
9: TypeVector 6(int) 3 | ||
10: TypePointer Input 9(ivec3) | ||
11(gl_LocalInvocationID): 10(ptr) Variable Input | ||
12: 6(int) Constant 0 | ||
13: TypePointer Input 6(int) | ||
17: 6(int) Constant 4 | ||
18: TypeArray 6(int) 17 | ||
19: TypePointer Input 18 | ||
20(gl_MeshViewIndicesNV): 19(ptr) Variable Input | ||
21(gl_MeshViewCountNV): 13(ptr) Variable Input | ||
26: TypeFloat 32 | ||
27: TypeVector 26(float) 4 | ||
28: TypeArray 27(fvec4) 17 | ||
29: TypeArray 26(float) 17 | ||
30: TypeArray 29 17 | ||
31(gl_MeshPerVertexNV): TypeStruct 28 30 30 | ||
32: 6(int) Constant 81 | ||
33: TypeArray 31(gl_MeshPerVertexNV) 32 | ||
34: TypePointer Output 33 | ||
35(gl_MeshVerticesNV): 34(ptr) Variable Output | ||
37: TypeInt 32 1 | ||
38: 37(int) Constant 0 | ||
40: 26(float) Constant 1065353216 | ||
41: 26(float) Constant 1073741824 | ||
42: 26(float) Constant 1077936128 | ||
43: 26(float) Constant 1082130432 | ||
44: 27(fvec4) ConstantComposite 40 41 42 43 | ||
45: TypePointer Output 27(fvec4) | ||
48: 37(int) Constant 1 | ||
50: 37(int) Constant 2 | ||
51: 26(float) Constant 1084227584 | ||
52: TypePointer Output 26(float) | ||
56: 37(int) Constant 3 | ||
57: 26(float) Constant 1086324736 | ||
59: TypeArray 37(int) 17 | ||
60: 6(int) Constant 1 | ||
61: TypeArray 37(int) 60 | ||
62: TypeArray 61 17 | ||
63(gl_MeshPerPrimitiveNV): TypeStruct 59 62 | ||
64: 6(int) Constant 32 | ||
65: TypeArray 63(gl_MeshPerPrimitiveNV) 64 | ||
66: TypePointer Output 65 | ||
67(gl_MeshPrimitivesNV): 66(ptr) Variable Output | ||
70: 37(int) Constant 7 | ||
71: TypePointer Output 37(int) | ||
75: 37(int) Constant 8 | ||
77: 6(int) Constant 264 | ||
78: 6(int) Constant 2 | ||
119: 9(ivec3) ConstantComposite 64 60 60 | ||
4(main): 2 Function None 3 | ||
5: Label | ||
8(iid): 7(ptr) Variable Function | ||
16(viewID): 7(ptr) Variable Function | ||
14: 13(ptr) AccessChain 11(gl_LocalInvocationID) 12 | ||
15: 6(int) Load 14 | ||
Store 8(iid) 15 | ||
22: 6(int) Load 21(gl_MeshViewCountNV) | ||
23: 6(int) UMod 22 17 | ||
24: 13(ptr) AccessChain 20(gl_MeshViewIndicesNV) 23 | ||
25: 6(int) Load 24 | ||
Store 16(viewID) 25 | ||
36: 6(int) Load 8(iid) | ||
39: 6(int) Load 16(viewID) | ||
46: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 36 38 39 | ||
Store 46 44 | ||
47: 6(int) Load 8(iid) | ||
49: 6(int) Load 16(viewID) | ||
53: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 47 48 49 50 | ||
Store 53 51 | ||
54: 6(int) Load 8(iid) | ||
55: 6(int) Load 16(viewID) | ||
58: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 54 50 55 56 | ||
Store 58 57 | ||
68: 6(int) Load 8(iid) | ||
69: 6(int) Load 16(viewID) | ||
72: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 68 38 69 | ||
Store 72 70 | ||
73: 6(int) Load 8(iid) | ||
74: 6(int) Load 16(viewID) | ||
76: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 73 48 74 38 | ||
Store 76 75 | ||
MemoryBarrier 60 77 | ||
ControlBarrier 78 78 77 | ||
79: 6(int) Load 8(iid) | ||
80: 6(int) IAdd 79 60 | ||
81: 6(int) Load 16(viewID) | ||
82: 6(int) Load 8(iid) | ||
83: 6(int) Load 16(viewID) | ||
84: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 82 38 83 | ||
85: 27(fvec4) Load 84 | ||
86: 45(ptr) AccessChain 35(gl_MeshVerticesNV) 80 38 81 | ||
Store 86 85 | ||
87: 6(int) Load 8(iid) | ||
88: 6(int) IAdd 87 60 | ||
89: 6(int) Load 16(viewID) | ||
90: 6(int) Load 8(iid) | ||
91: 6(int) Load 16(viewID) | ||
92: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 90 48 91 50 | ||
93: 26(float) Load 92 | ||
94: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 88 48 89 50 | ||
Store 94 93 | ||
95: 6(int) Load 8(iid) | ||
96: 6(int) IAdd 95 60 | ||
97: 6(int) Load 16(viewID) | ||
98: 6(int) Load 8(iid) | ||
99: 6(int) Load 16(viewID) | ||
100: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 98 50 99 56 | ||
101: 26(float) Load 100 | ||
102: 52(ptr) AccessChain 35(gl_MeshVerticesNV) 96 50 97 56 | ||
Store 102 101 | ||
103: 6(int) Load 8(iid) | ||
104: 6(int) IAdd 103 60 | ||
105: 6(int) Load 16(viewID) | ||
106: 6(int) Load 8(iid) | ||
107: 6(int) Load 16(viewID) | ||
108: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 106 38 107 | ||
109: 37(int) Load 108 | ||
110: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 104 38 105 | ||
Store 110 109 | ||
111: 6(int) Load 8(iid) | ||
112: 6(int) IAdd 111 60 | ||
113: 6(int) Load 16(viewID) | ||
114: 6(int) Load 8(iid) | ||
115: 6(int) Load 16(viewID) | ||
116: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 114 48 115 38 | ||
117: 37(int) Load 116 | ||
118: 71(ptr) AccessChain 67(gl_MeshPrimitivesNV) 112 48 113 38 | ||
Store 118 117 | ||
MemoryBarrier 60 77 | ||
ControlBarrier 78 78 77 | ||
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,66 @@ | ||
#version 460 | ||
|
||
#define MAX_VER 81 | ||
#define MAX_PRIM 32 | ||
|
||
#define BARRIER() \ | ||
memoryBarrierShared(); \ | ||
barrier(); | ||
|
||
#extension GL_NV_mesh_shader : enable | ||
|
||
layout(local_size_x = 32) in; | ||
|
||
layout(max_vertices=MAX_VER) out; | ||
layout(max_primitives=MAX_PRIM) out; | ||
layout(triangles) out; | ||
|
||
// test use of redeclared single-view builtins in mesh shaders: | ||
|
||
out gl_MeshPerVertexNV { | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[4]; | ||
float gl_CullDistance[4]; | ||
} gl_MeshVerticesNV[]; | ||
|
||
perprimitiveNV out gl_MeshPerPrimitiveNV { | ||
int gl_PrimitiveID; | ||
int gl_Layer; | ||
int gl_ViewportIndex; | ||
int gl_ViewportMask[]; | ||
} gl_MeshPrimitivesNV[]; | ||
|
||
void main() | ||
{ | ||
uint iid = gl_LocalInvocationID.x; | ||
uint gid = gl_WorkGroupID.x; | ||
|
||
gl_MeshVerticesNV[iid].gl_Position = vec4(1.0); | ||
gl_MeshVerticesNV[iid].gl_PointSize = 2.0; | ||
gl_MeshVerticesNV[iid].gl_ClipDistance[3] = 3.0; | ||
gl_MeshVerticesNV[iid].gl_CullDistance[2] = 4.0; | ||
|
||
BARRIER(); | ||
|
||
gl_MeshVerticesNV[iid+1].gl_Position = gl_MeshVerticesNV[iid].gl_Position; | ||
gl_MeshVerticesNV[iid+1].gl_PointSize = gl_MeshVerticesNV[iid].gl_PointSize; | ||
gl_MeshVerticesNV[iid+1].gl_ClipDistance[3] = gl_MeshVerticesNV[iid].gl_ClipDistance[3]; | ||
gl_MeshVerticesNV[iid+1].gl_CullDistance[2] = gl_MeshVerticesNV[iid].gl_CullDistance[2]; | ||
|
||
BARRIER(); | ||
|
||
gl_MeshPrimitivesNV[iid].gl_PrimitiveID = 6; | ||
gl_MeshPrimitivesNV[iid].gl_Layer = 7; | ||
gl_MeshPrimitivesNV[iid].gl_ViewportIndex = 8; | ||
gl_MeshPrimitivesNV[iid].gl_ViewportMask[0] = 9; | ||
|
||
BARRIER(); | ||
|
||
gl_MeshPrimitivesNV[iid+1].gl_PrimitiveID = gl_MeshPrimitivesNV[iid].gl_PrimitiveID; | ||
gl_MeshPrimitivesNV[iid+1].gl_Layer = gl_MeshPrimitivesNV[iid].gl_Layer; | ||
gl_MeshPrimitivesNV[iid+1].gl_ViewportIndex = gl_MeshPrimitivesNV[iid].gl_ViewportIndex; | ||
gl_MeshPrimitivesNV[iid+1].gl_ViewportMask[0] = gl_MeshPrimitivesNV[iid].gl_ViewportMask[0]; | ||
|
||
BARRIER(); | ||
} |
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,53 @@ | ||
#version 450 | ||
|
||
#define MAX_VER 81 | ||
#define MAX_PRIM 32 | ||
#define MAX_VIEWS gl_MaxMeshViewCountNV | ||
|
||
#define BARRIER() \ | ||
memoryBarrierShared(); \ | ||
barrier(); | ||
|
||
#extension GL_NV_mesh_shader : enable | ||
|
||
layout(local_size_x = 32) in; | ||
|
||
layout(max_vertices=MAX_VER) out; | ||
layout(max_primitives=MAX_PRIM) out; | ||
layout(triangles) out; | ||
|
||
// test use of redeclared per-view builtin attributes | ||
|
||
out gl_MeshPerVertexNV { | ||
perviewNV vec4 gl_PositionPerViewNV[MAX_VIEWS]; // explicitly sized view dim | ||
perviewNV float gl_ClipDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim | ||
perviewNV float gl_CullDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim | ||
} gl_MeshVerticesNV[]; | ||
|
||
perprimitiveNV out gl_MeshPerPrimitiveNV { | ||
perviewNV int gl_LayerPerViewNV[]; // implicitly sized view dim | ||
perviewNV int gl_ViewportMaskPerViewNV[][1]; // implicitly sized view dim | ||
} gl_MeshPrimitivesNV[]; | ||
|
||
void main() | ||
{ | ||
uint iid = gl_LocalInvocationID.x; | ||
uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; | ||
|
||
gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0); | ||
gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0; | ||
gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0; | ||
gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7; | ||
gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8; | ||
|
||
BARRIER(); | ||
|
||
gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID]; | ||
gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2]; | ||
gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3]; | ||
gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID]; | ||
gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0]; | ||
|
||
BARRIER(); | ||
} | ||
|
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