RenderDoc is a fantastic tool to debug your graphics application, with broad support for many graphics APIs. Sometimes however it’s impossible for RenderDoc to figure out what you’re doing. Point in case: I was recently debugging some shader compiler issue, for which I’ve been using a small test harness which does one submission with one dispatch. That’s not how any game looks like, there is no real frame beginning nor end, and I really only care about capturing the dispatch, so how do I tell RenderDoc that’s what I’m up to?
Fortunately, this is fairly easy, thanks to the RenderDoc API. It requires only a few small code changes, no extra linking step, and does not impact anything else when RenderDoc is not used. What do we need to do? It’s fairly simple: If we’re running with RenderDoc enabled, the
will be present, so we can query the API off that. We then use it to manually start/stop a capture. If you already read the API documentation then you’re probably all set, if you haven’t, please stay around 😊
It’s quite easy in practice, all you need is to get hold of the RenderDoc API pointer, and once you have it, use the API to control RenderDoc. For the API you need to include the
header (which is in your RenderDoc installation directory), from there on it’s smooth sailing:
This can be done any time in your application. Once you have your device ready, you can then trigger the capture using:
and stop it using:
Note that if your app exists super-fast, like mine did – it only ran a few milliseconds — the UI may not keep up with it. An easy fix is to wait for a keypress before exiting. This is also just the start of what you can do with the RenderDoc API. Make sure to check the documentation for more details and advanced use cases!
Other content by Matthaüs Chajdas
Asynchronous compute can help you to get the maximum GPU usage. I’ll be explaining the details based on the nBodyGravity sample from Microsoft.
GCN hardware supports a special out-of-order rasterization mode which relaxes the ordering guarantee, and allows fragments to be produced out-of-order.
With cluster culling, GeometryFX is able to reject large chunks of the geometry – with corresponding performance increases.
With shader extensions, we provide access to a much better tool to get compaction done: GCN provides a special op-code for compaction within a wavefront.
One of the mandates of GPUOpen is to give developers better access to the hardware, and this post details extensions for Vulkan and Direct3D12 that expose additional GCN features to developers.
Vulkan barriers are unique as they requires you to provide what resources are transitioning and also specify a source and destination pipeline stage.
One thing which is often forgotten is shadow map rendering. As the tessellation level of the terrain is not optimized for the shadow camera, but for the primary camera, this often results in a very strong mismatch and shadow maps end up getting extremely over-tessellated.
mGPU isn’t just for gamers – if you’re a developer working on a game, you should think of using mGPU to make your life easier.