Load resources faster with Metal 3

RSS for tag

Discuss the WWDC22 Session Load resources faster with Metal 3

Posts under wwdc2022-10104 tag

3 Posts
Sort by:
Post not yet marked as solved
0 Replies
121 Views
Is there a limit to the number MTLIO load texture commands that can safely be executed in a single command buffer? When I tried loading each face (6) of a cube texture using a single command buffer, some of the faces will have bad data. Basically... let cmdBuf = ioCommandQueue.makeCommandBuffer() for slice in 0...5 { cmdBuf.load(cubeTexture, slice: slice, level: 0, size: size, sourceBytesPerRow:bytesPerRow, sourceBytesPerImage: bytesPerImage, destinationOrigin: destOrigin, sourceHandle: fileHandles[slice], sourceHandleOffset: 0) } cmdBuf.commit() cmdBuf.waitUntilCompleted() /* This passes, even though my texture is messed up...? */ assert(cmdBuf.status == .complete) // Also, no errors or warnings when XCode Diagnostics / Metal Validation is turned on. If I use multiple command buffers (one load texture command each), everything is fine... for slice in 0...5 { // IMPORTANT: Moved inside the LOOP let cmdBuf = ioCommandQueue.makeCommandBuffer() cmdBuf.load(cubeTexture, slice: slice, level: 0, size: size, sourceBytesPerRow:bytesPerRow, sourceBytesPerImage: bytesPerImage, destinationOrigin: destOrigin, sourceHandle: fileHandles[slice], sourceHandleOffset: 0) // IMPORTANT: Moved inside the LOOP cmdBuf.commit() cmdBuf.waitUntilCompleted() assert(cmdBuf.status == .complete) } I'm assuming this a bug (opened FB10582329)... Or at the very least, some documentation or Metal Validation log would be helpful to understanding what's going wrong/workaround. I've uploaded reduced reproduction (Single Swift file, command line application, XCode project) to this GitHub Repository: https://github.com/peterwmwong/x-mtlio-load-multiple-textures Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
102 Views
As we get MTLBuffer when loading a file(which can contain lighting, animation, materials), like typeless memory blob, how can we get a MTDMesh with sub meshes from the buffer? Thanks in advance!
Posted
by ensoreus.
Last updated
.