I'm currently trying to create an amateur game engine, and I often run into very basic bugs (eg I change the node hierarchy code and suddenly nothing is displayed). Some of the methods I will use include to track down these bugs include:
Use my IDE's debugger and lots of
printfcalls to look at what's in memory.
Make lots of tests with different parameters, placing the camera in different positions, to get a better feel of what the code is doing.
Just brute force my way through by re-reading each line of code until I find the one that's misbehaving.
These methods all seem sluggish and inefficient to me. The problem is, that 3D rendering involves a lot of unintuitive operations with not much to visualize except the final "product"; when I'm running into a bug (especially "nothing is displayed" types of bugs), I often feel like I'm fumbling around blindly.
Let's say you're a developer working on Unity, Godot, or some other 3D engine, and you just changed some steps in your rendering pipeline, and now, for whatever reason, the wireframe renderer displays incoherent results when entity batching is activated. The "wires" are crisscrossing all over the screen instead of representing the edges of the batched entity's triangles.
How do you track down and fix that bug? Do you have a specific workflow? Do you use some kind of GPU analysis tool? Or do you just fumble around blindly?
In other words, what methods, tools and best practices can engine developers (not engine users) use to analyze the data and behavior of their 3D graphics code (not just its performance) to efficiently address defects and bugs?