@@ -117,21 +117,21 @@ if #available(OSX 10.14, iOS 12.0, tvOS 12.0, *){
117
117
icbDesc. inheritBuffers = false
118
118
icbDesc. maxVertexBufferBindCount = 1
119
119
icbDesc. maxFragmentBufferBindCount = 1
120
- let icb = device. makeIndirectCommandBuffer ( descriptor: icbDesc, maxCommandCount: 4 , options: MTLResourceOptions . storageModeShared ) !
120
+ let icb = device. makeIndirectCommandBuffer ( descriptor: icbDesc, maxCommandCount: 4 , options: MTLResourceOptions . storageModeShared ) !
121
121
122
122
/* Call APIs */
123
123
124
124
let encoder = cmdBuf. makeRenderCommandEncoder ( descriptor: rpDesc) !
125
- let cmd = icb. indirectRenderCommandAt ( 0 ) !
126
- cmd. setVertexBuffer ( buf, offset: 0 , at: 0 )
127
- cmd. setFragmentBuffer ( buf, offset: 0 , at: 0 )
128
- cmd. drawPrimitives ( MTLPrimitiveType . triangle, vertexStart: 0 , vertexCount: 0 , instanceCount: 0 , baseInstance: 0 )
129
- let cmd2 = icb. indirectRenderCommandAt ( 1 ) !
125
+ let cmd = icb. indirectRenderCommandAt ( 0 )
126
+ cmd. setVertexBuffer ( buf, offset: 0 , at: 0 )
127
+ cmd. setFragmentBuffer ( buf, offset: 0 , at: 0 )
128
+ cmd. drawPrimitives ( MTLPrimitiveType . triangle, vertexStart: 0 , vertexCount: 0 , instanceCount: 0 , baseInstance: 0 )
129
+ let cmd2 = icb. indirectRenderCommandAt ( 1 )
130
130
cmd2. drawIndexedPrimitives ( MTLPrimitiveType . triangle, indexCount: 0 , indexType: MTLIndexType . uint16, indexBuffer: buf, indexBufferOffset: 0 , instanceCount: 0 , baseVertex: 0 , baseInstance: 0 )
131
- let cmd3 = icb. indirectRenderCommandAt ( 2 ) !
131
+ let cmd3 = icb. indirectRenderCommandAt ( 2 )
132
132
cmd3. reset ( )
133
133
icb. reset ( 0 ..< 5 )
134
- encoder. executeCommandsInBuffer ( icb, range: 0 ..< 5 )
134
+ encoder. executeCommandsInBuffer ( icb, range: 0 ..< 5 )
135
135
encoder. endEncoding ( )
136
136
}
137
137
0 commit comments