Group Group Group Group Group Group Group Group Group

Rebuilding a Triangle Acceleration Structure

Hi - I continue to enjoy learning from Metal by Tutorials with the 2nd Edition!

I have begun to adapt the Ray Tracing Project ( Chapter 21 ) to handle vertex connecting & merging which has opened up a bunch of new ideas and questions, but when I loaded my project onto a recently purchased 16" MacBook Pro, I got a crash when “rebuilding” the MPSTriangleAcclerationStructure during the initial setup.

I thought I had broken the vertex buffer.

Next, I tried a fresh copy of the Ray Tracing project from Metal by Tutorials, I got the same issue - There is a complete freeze up at the acceleration structure rebuild call.

The installed Catalina OS and Xcode are fully up to date. Is this a real issue and if so, could there be a work around? It is tragic not to be able to try these things right now.

Thanks again for all of the care put into your publications,
John Lobe

@johnlobe sorry for the inconvenience. I have a few questions:

  1. does that happen if you switch to your Intel GPU as well?
  2. do you see the same behavior with the starter code and final code?
  3. what about V1 vs V2 of the book/code?

Hey, thanks for your response/questions:

  1. The problem is only happening on my 16" MacBook Pro ( AMD Radeon Pro 5500M ). Both the code from the book and my project run fine on an older iMac ( Mojave ) and an older MacBook ( Catalina ). Also, I can look into using the integrated graphics card as my device. I didn’t know that was possible

  2. The Starter Code runs fine on the AMD card, displays a cyan sort of screen. But I don’t think it calls the Acceleration Structure

  3. I made sure I was using the latest version of the projects

Perhaps this is an issue that Apple will need to address, but that seems kind of like a drastic bug!

Thanks so much, I will continue to try a few things,
Any further thought would be much appreciated!
John Lobe

Just a quick followup - I tried simplifying the number of vertices/triangles in my arrays and the acceleration structure rebuilds successfully in my project. I will slowly re-add objects and see where the problem was introduced.

I will also retry the Metals by Tutorials raytracing project. I likely misunderstood what was happening or had left the graphics state in some ungodly mess from my own code.

Sorry for any confusion and thanks again for your response,
John L