Another Debug Fragment Shader question

I had introduced a bug into my fragment shader (Ch 21 - I eventually found my error - cut and paste), but I thought maybe I could use “capture the GPU workload” and debug the fragment shader. Alas, I couldn’t figure out how to debug this, and I was hoping maybe you can point me to a “real” resource that might be able to walk me through debugging a shader. I’ve been through the web and I just can’t find a resource that’ll really help - either the site is too old or doesn’t come close to matching Xcode semantics or contains things like “select draw command then click Shader Debugger button…” without any idiot pictures with arrows and circles for idiots like me.
Alternatively, maybe you can just throw me some crumbs if I give you some screen shot specifics. So, attached is a screen shot of what I got hitting the little “bug” and up comes the Display Drawable image with the “Fragment” icon selected. If I hit this window’s little “bug” icon, it’ll dump me into the fragment shader and I can start rooting around. My issue is that, in the image, there is an area hilighted by a green outline (the windsheild), and it appears that this is the place where I can select pixels and muck around. However, that’s not where I want to be. I want to be around the rims (where my “bug” is). I thinking (always bad) that if I can move that green “area of interest”, then I can poke around where I know things are “off” and see what the fragment debugger will show me. Maybe I’m wrong about what that green area means.
And/or maybe I’m misunderstanding what the fragment shader debugger is capable of.
So, any suggestions on how to debug this type of problem, where I want to look at what the fragment shader is doing in certain parts of the model? Or is this not possible and I am really just got my head up my rear?

The ultimate reference is Apple’s own videos and documentation, which is quite thorough, and hopefully you have enough of a grounding now to be able to understand them.

This is the base page that links to the debugger sessions: Metal debugger | Apple Developer Documentation

As to your screenshot, I can’t see, but would guess that you have the Transparency group highlighted. In the Debug Navigator, you highlight the draw call (or group) that you want to debug.

For example, if you select the group racing-car.usdz, and go into the Shader (ladybug) part of the debugger, when you click on fragments outside of the car, the bug will be disabled and you won’t be able to debug that fragment.

Terrific (and patient, as always). The pointer to the docs is where I’ll start.

Of course, I poked around a lot more with the image and I think I finally understand just a little bit more on how the navigation works and I was able to “identify” my issue via the debugger.

Thanks again!

1 Like