Frame capture shows broken buffers/textures with argument buffer.

Hi, I'm developing game app in metal and trying to change shaders to use argument buffer.

Without argument buffer, frame capture shows the correct buffer/texture datas. But with argument buffer, frame capture shows broken buffers/textures(such as all green textures), even I can see the correct result while game running.

Is there any possibility that I'm missing to call important API for argument buffer? I call useResource for buffers/textures in argument buffer.

It's hard to tell without more details. One possibility is forgetting to call useResource: as you have already suspected. Another possibility is using MTLStorageModeManaged and forgetting to call didModifyRange: after encoding the argument buffer. It may help to also try Metal API Validation in case it identifies any issues if you aren't already using it. We can take a better look if you are able to export and share the gputrace or the sample project as well as your macOS version / hardware configuration through a Feedback Assistant report; please repost the feedback report ID to us if you create a report.

Thank you for your advice. I tested some cases, and it seems occur when scene have too many drawn objects. (I have almost same code path to draw each objects and capture result was changed by object count.) And I got same capture when I use MTLStorageModeShared instead MTLStorageModeManaged. And metal API validation does not report any error in that scene.

Below is my environment. macOS Big Sur 11.6 Mac mini(M1, 2020) 16GB Xcode 12.2.1(13C100)

I need more time regarding gputrace or sample project.

Frame capture shows broken buffers/textures with argument buffer.
 
 
Q