Graphics APIs are complex and it’s easy to get something wrong. This can often lead to frustrating and time-consuming debugging sessions.
Most graphics APIs provide some mechanism to turn on additional runtime checking
Set the environment variable METAL_DEVICE_WRAPPER_TYPE=1
Set RafxApiDef::validation_mode
to the desired setting.
RafxApiDefVulkan
in the futureMost APIs have tools in their ecosystem to help diagnose problems
XCode includes a metal debugger. To use it with a rust program, create a dummy project and manually change the “scheme” to run your binary in the correct current directory. Unfortunately xcode may crash when trying to do a capture, but when it works, it has a very complete feature set including shader debugging.
Renderdoc is a good tool for windows and linux. Other tools from nvidia and AMD can be useful too.