mach icon indicating copy to clipboard operation
mach copied to clipboard

gpu-dawn: Renderdoc integration

Open silversquirl opened this issue 3 years ago • 4 comments

It'd be nice if mach had some integration with graphics debuggers like RenderDoc.

RenderDoc has a C API for applications, which could be wrapped as part of a debug package in mach. It's useful for things like recording specific parts of a frame, allowing the application to hide or modify the RenderDoc overlay, triggering captures based on application-specific events, etc.

silversquirl avatar Apr 07 '22 23:04 silversquirl

I'd love to have something like this. I think debugging WebGPU is still a bit of an up-in-the-air topic, I haven't had time to look into this deeply at all yet, though.

emidoots avatar Apr 08 '22 01:04 emidoots

Having spent the last few days playing with mach/gpu, I can at least say that RenderDoc works great with Dawn's Vulkan backend on Linux :) I imagine it'd be the same with the DirectX backend on Windows, but if not, using Vulkan is always an option there too.

Unfortunately, RenderDoc doesn't support macOS - maybe there's another option that could be used there?

One thing that was slightly annoying is that Dawn doesn't appear to include user-defined labels in debug names by default - looks like there's a toggle for it (use_user_defined_labels_in_backend), but I'm not sure how feasible it is for mach to expose that option. Perhaps mach/gpu-dawn could just set it unconditionally? Maybe just in debug mode.

silversquirl avatar Apr 08 '22 08:04 silversquirl

Looks like it does indeed just work with DirectX on Windows:

image

emidoots avatar Apr 09 '22 00:04 emidoots

Looks like Dawn now hides this behind a #define DAWN_USE_VKTRACE and DAWN_USE_RENDERDOC, should add these to our builds

emidoots avatar Aug 25 '22 03:08 emidoots