glslang/Test/baseResults/spv.ext.meshShaderBuiltins.mesh.out
Pankaj Mistry 228c67228a GL_EXT_mesh_shader/SPV_EXT_mesh_shader implementation
Added following updates to GL_EXT_mesh_shader implementation:

1. Added SPIRV and GLSL test cases
2. Added checks to ensure NV and EXT mesh shader builtins cannot be used interchangeably.
3. Updated the language name by removing the postfix "NV" to MeshShader and TaskShader.
4. Added checks for grammar checking to comply with the spec.

5. Added gl_NumWorkGroups builtin to Mesh shader
6. Fixed data type of gl_PrimitiveLineIndicesEXT and gl_PrimitiveTriangleIndicesEXT
7. Added new constants to the resources table
8. Updates to handle new storage qualifier "taskPayloadSharedEXT"
9. Updated test cases by replacing "taskEXT" with storage qualifier "taskPayloadSharedEXT"

Addressed  Review comments
1. Fixed instruction description used by glslang disassembly.
2. Updated OpEmitMeshTasksEXT as per spec update
3. Fixed implementation that errors out if there are more then one taskPayloadSharedEXT varjables.
4. Fixed miscellaneous error logs and removed unwanted code.

SPIRV 1.6 related build failure fixes
- Update SPIRV header to 1.6
- Fix conflict wiht SPIRV 1.6 change, where localSizeId is used for execution mode for mesh/task shaders

Enable SPIRV generated for EXT_mesh_shader to be version 1.4

GL_EXT_mesh_shader: Add checks for atomic support and corresponding test cases
2022-09-01 18:02:21 -07:00

274 lines
15 KiB
Plaintext

spv.ext.meshShaderBuiltins.mesh
// Module Version 10400
// Generated by (magic number): 8000a
// Id's are bound by 159
Capability ClipDistance
Capability CullDistance
Capability FragmentShadingRateKHR
Capability DrawParameters
Capability MultiView
Capability MeshShadingEXT
Extension "SPV_EXT_mesh_shader"
Extension "SPV_KHR_fragment_shading_rate"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint MeshEXT 4 "main" 13 19 24 41 93 135 153 156
ExecutionMode 4 LocalSize 32 1 1
ExecutionMode 4 OutputVertices 81
ExecutionMode 4 OutputPrimitivesNV 32
ExecutionMode 4 OutputTrianglesNV
Source GLSL 460
SourceExtension "GL_ARB_shader_draw_parameters"
SourceExtension "GL_EXT_mesh_shader"
SourceExtension "GL_EXT_multiview"
Name 4 "main"
Name 6 "testAdditionalBuiltins("
Name 10 "iid"
Name 13 "gl_LocalInvocationID"
Name 18 "gid"
Name 19 "gl_WorkGroupID"
Name 23 "numWorkGrous"
Name 24 "gl_NumWorkGroups"
Name 26 "vertexCount"
Name 28 "primitiveCount"
Name 38 "gl_MeshPerVertexEXT"
MemberName 38(gl_MeshPerVertexEXT) 0 "gl_Position"
MemberName 38(gl_MeshPerVertexEXT) 1 "gl_PointSize"
MemberName 38(gl_MeshPerVertexEXT) 2 "gl_ClipDistance"
MemberName 38(gl_MeshPerVertexEXT) 3 "gl_CullDistance"
Name 41 "gl_MeshVerticesEXT"
Name 90 "gl_MeshPerPrimitiveEXT"
MemberName 90(gl_MeshPerPrimitiveEXT) 0 "gl_PrimitiveID"
MemberName 90(gl_MeshPerPrimitiveEXT) 1 "gl_Layer"
MemberName 90(gl_MeshPerPrimitiveEXT) 2 "gl_ViewportIndex"
MemberName 90(gl_MeshPerPrimitiveEXT) 3 "gl_CullPrimitiveEXT"
MemberName 90(gl_MeshPerPrimitiveEXT) 4 "gl_PrimitiveShadingRateEXT"
Name 93 "gl_MeshPrimitivesEXT"
Name 135 "gl_PrimitiveTriangleIndicesEXT"
Name 151 "id"
Name 153 "gl_DrawIDARB"
Name 155 "viewIdx"
Name 156 "gl_ViewIndex"
Decorate 13(gl_LocalInvocationID) BuiltIn LocalInvocationId
Decorate 19(gl_WorkGroupID) BuiltIn WorkgroupId
Decorate 24(gl_NumWorkGroups) BuiltIn NumWorkgroups
MemberDecorate 38(gl_MeshPerVertexEXT) 0 BuiltIn Position
MemberDecorate 38(gl_MeshPerVertexEXT) 1 BuiltIn PointSize
MemberDecorate 38(gl_MeshPerVertexEXT) 2 BuiltIn ClipDistance
MemberDecorate 38(gl_MeshPerVertexEXT) 3 BuiltIn CullDistance
Decorate 38(gl_MeshPerVertexEXT) Block
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 0 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 0 BuiltIn PrimitiveId
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 1 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 1 BuiltIn Layer
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 2 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 2 BuiltIn ViewportIndex
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 3 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 3 BuiltIn CullPrimitiveEXT
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 4 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 4 BuiltIn PrimitiveShadingRateKHR
Decorate 90(gl_MeshPerPrimitiveEXT) Block
Decorate 135(gl_PrimitiveTriangleIndicesEXT) BuiltIn PrimitiveTriangleIndicesEXT
Decorate 153(gl_DrawIDARB) BuiltIn DrawIndex
Decorate 156(gl_ViewIndex) BuiltIn ViewIndex
Decorate 158 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
8: TypeInt 32 0
9: TypePointer Function 8(int)
11: TypeVector 8(int) 3
12: TypePointer Input 11(ivec3)
13(gl_LocalInvocationID): 12(ptr) Variable Input
14: 8(int) Constant 0
15: TypePointer Input 8(int)
19(gl_WorkGroupID): 12(ptr) Variable Input
22: TypePointer Function 11(ivec3)
24(gl_NumWorkGroups): 12(ptr) Variable Input
27: 8(int) Constant 81
29: 8(int) Constant 32
32: TypeFloat 32
33: TypeVector 32(float) 4
34: 8(int) Constant 4
35: TypeArray 32(float) 34
36: 8(int) Constant 3
37: TypeArray 32(float) 36
38(gl_MeshPerVertexEXT): TypeStruct 33(fvec4) 32(float) 35 37
39: TypeArray 38(gl_MeshPerVertexEXT) 27
40: TypePointer Output 39
41(gl_MeshVerticesEXT): 40(ptr) Variable Output
43: TypeInt 32 1
44: 43(int) Constant 0
45: 32(float) Constant 1065353216
46: 33(fvec4) ConstantComposite 45 45 45 45
47: TypePointer Output 33(fvec4)
50: 43(int) Constant 1
51: 32(float) Constant 1073741824
52: TypePointer Output 32(float)
55: 43(int) Constant 2
56: 43(int) Constant 3
57: 32(float) Constant 1077936128
60: 32(float) Constant 1082130432
62: 8(int) Constant 1
63: 8(int) Constant 264
64: 8(int) Constant 2
89: TypeBool
90(gl_MeshPerPrimitiveEXT): TypeStruct 43(int) 43(int) 43(int) 89(bool) 43(int)
91: TypeArray 90(gl_MeshPerPrimitiveEXT) 29
92: TypePointer Output 91
93(gl_MeshPrimitivesEXT): 92(ptr) Variable Output
95: 43(int) Constant 6
96: TypePointer Output 43(int)
99: 43(int) Constant 7
102: 43(int) Constant 8
105: 89(bool) ConstantFalse
106: TypePointer Output 89(bool)
132: 8(int) Constant 96
133: TypeArray 11(ivec3) 132
134: TypePointer Output 133
135(gl_PrimitiveTriangleIndicesEXT): 134(ptr) Variable Output
136: 8(int) Constant 257
137: 11(ivec3) ConstantComposite 136 136 136
138: TypePointer Output 11(ivec3)
142: 11(ivec3) ConstantComposite 64 64 64
150: TypePointer Function 43(int)
152: TypePointer Input 43(int)
153(gl_DrawIDARB): 152(ptr) Variable Input
156(gl_ViewIndex): 152(ptr) Variable Input
158: 11(ivec3) ConstantComposite 29 62 62
4(main): 2 Function None 3
5: Label
10(iid): 9(ptr) Variable Function
18(gid): 9(ptr) Variable Function
23(numWorkGrous): 22(ptr) Variable Function
26(vertexCount): 9(ptr) Variable Function
28(primitiveCount): 9(ptr) Variable Function
16: 15(ptr) AccessChain 13(gl_LocalInvocationID) 14
17: 8(int) Load 16
Store 10(iid) 17
20: 15(ptr) AccessChain 19(gl_WorkGroupID) 14
21: 8(int) Load 20
Store 18(gid) 21
25: 11(ivec3) Load 24(gl_NumWorkGroups)
Store 23(numWorkGrous) 25
Store 26(vertexCount) 27
Store 28(primitiveCount) 29
30: 8(int) Load 26(vertexCount)
31: 8(int) Load 28(primitiveCount)
SetMeshOutputsEXT 30 31
42: 8(int) Load 10(iid)
48: 47(ptr) AccessChain 41(gl_MeshVerticesEXT) 42 44
Store 48 46
49: 8(int) Load 10(iid)
53: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 49 50
Store 53 51
54: 8(int) Load 10(iid)
58: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 54 55 56
Store 58 57
59: 8(int) Load 10(iid)
61: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 59 56 55
Store 61 60
MemoryBarrier 62 63
ControlBarrier 64 64 63
65: 8(int) Load 10(iid)
66: 8(int) IAdd 65 62
67: 8(int) Load 10(iid)
68: 47(ptr) AccessChain 41(gl_MeshVerticesEXT) 67 44
69: 33(fvec4) Load 68
70: 47(ptr) AccessChain 41(gl_MeshVerticesEXT) 66 44
Store 70 69
71: 8(int) Load 10(iid)
72: 8(int) IAdd 71 62
73: 8(int) Load 10(iid)
74: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 73 50
75: 32(float) Load 74
76: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 72 50
Store 76 75
77: 8(int) Load 10(iid)
78: 8(int) IAdd 77 62
79: 8(int) Load 10(iid)
80: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 79 55 56
81: 32(float) Load 80
82: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 78 55 56
Store 82 81
83: 8(int) Load 10(iid)
84: 8(int) IAdd 83 62
85: 8(int) Load 10(iid)
86: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 85 56 55
87: 32(float) Load 86
88: 52(ptr) AccessChain 41(gl_MeshVerticesEXT) 84 56 55
Store 88 87
MemoryBarrier 62 63
ControlBarrier 64 64 63
94: 8(int) Load 10(iid)
97: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 94 44
Store 97 95
98: 8(int) Load 10(iid)
100: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 98 50
Store 100 99
101: 8(int) Load 10(iid)
103: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 101 55
Store 103 102
104: 8(int) Load 10(iid)
107: 106(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 104 56
Store 107 105
MemoryBarrier 62 63
ControlBarrier 64 64 63
108: 8(int) Load 10(iid)
109: 8(int) IAdd 108 62
110: 8(int) Load 10(iid)
111: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 110 44
112: 43(int) Load 111
113: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 109 44
Store 113 112
114: 8(int) Load 10(iid)
115: 8(int) IAdd 114 62
116: 8(int) Load 10(iid)
117: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 116 50
118: 43(int) Load 117
119: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 115 50
Store 119 118
120: 8(int) Load 10(iid)
121: 8(int) IAdd 120 62
122: 8(int) Load 10(iid)
123: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 122 55
124: 43(int) Load 123
125: 96(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 121 55
Store 125 124
126: 8(int) Load 10(iid)
127: 8(int) IAdd 126 62
128: 8(int) Load 10(iid)
129: 106(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 128 56
130: 89(bool) Load 129
131: 106(ptr) AccessChain 93(gl_MeshPrimitivesEXT) 127 56
Store 131 130
MemoryBarrier 62 63
ControlBarrier 64 64 63
139: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 44
Store 139 137
140: 8(int) Load 28(primitiveCount)
141: 8(int) ISub 140 62
143: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 141
Store 143 142
144: 8(int) Load 18(gid)
145: 8(int) Load 18(gid)
146: 8(int) ISub 145 62
147: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 146
148: 11(ivec3) Load 147
149: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 144
Store 149 148
MemoryBarrier 62 63
ControlBarrier 64 64 63
Return
FunctionEnd
6(testAdditionalBuiltins(): 2 Function None 3
7: Label
151(id): 150(ptr) Variable Function
155(viewIdx): 150(ptr) Variable Function
154: 43(int) Load 153(gl_DrawIDARB)
Store 151(id) 154
157: 43(int) Load 156(gl_ViewIndex)
Store 155(viewIdx) 157
Return
FunctionEnd