- Set the environment variable RENDERDOC_HOOK_EGL to 0. I use the Windows Settings to set this in my User Environment Variables.
- Launch RenderDoc
- In RenderDoc, navigate to Tools -> Settings, then on the General page, check "Enable process injection (restart required)". Restart RenderDoc.
- Grab a copy of WinPixEventRuntime.dll from https://devblogs.microsoft.com/pix/winpixeventruntime/ (rename the .nupkg to a zip, it's in bin/x64), and copy it over to
%LocalAppData%\Local\Google\Chrome SxS\Application\$CurrentVersion. Unfortunately this step needs to be repeated every time Chrome updates, since it wipes the current directory. Would be nice if it shipped with Chrome Canary / Chrome Dev (or was statically linked into Chrome) - Launch Chrome with the arguments
--disable-gpu-sandbox --gpu-startup-dialog --disable-direct-composition=1 --enable-dawn-features=use_user_defined_labels_in_backend,emit_hlsl_debug_symbols,disable_symbol_renaming. It should pop up a modal dialog with a PID on it. - In RenderDoc, File -> Inject into Process. Find the PID mentioned on Chrome's GPU startup dialog, and click "Inject".
- Click OK on Chrome's GPU Startup Dialog.
- If everything was successful, RenderDoc will say "API: D3D11 (Active), D3D12 (Active)" when navigating to a page using WebGPU. You need to press F11 to switch the capture API from D3D11 to D3D12. Yes, that makes your browser window fullscreen, unfortunately. After that, you can take a capture by pressing the button in RenderDoc. If it says D3D12 underneath the capture thumbnail, then you captured the right thing. The thumbnnail does not appear to be representative of the final image.
- The PR to RenderDoc to fix ID3D12SharingContract is here. baldurk/renderdoc#3749
- This still isn't enough to get proper capturing, since Dawn/Chromium doesn't send down the right HWND to ID3D12SharingContract::Present. That can hopefully be fixed on the Chromium side, but for now I have hacked around it on the RenderDoc side (https://github.com/magcius/renderdoc/commit/1da43b1cb181c26ec3d5dea9cf03ef6e51251b53).
- Grab a copy of WinPixEventRuntime.dll from https://devblogs.microsoft.com/pix/winpixeventruntime/ (rename the .nupkg to a zip, it's in bin/x64), and copy it over to
%LocalAppData%\Local\Google\Chrome SxS\Application\$CurrentVersion. This gets you the debug groups and debug markers. Unfortunately this step needs to be repeated every time Chrome updates, since it wipes the current directory. Would be nice if it shipped with Chrome Canary / Chrome Dev (or was statically linked into Chrome) - Launch Chrome with additional flags:
--enable-dawn-features=use_user_defined_labels_in_backend,emit_hlsl_debug_symbols,disable_symbol_renaming. This gets you object labels and shader source debugging. - When you get in, RenderDoc will hopefully say D3D11 (Active), D3D12 (Active). You need to press F11 to switch the capture API from D3D11 to D3D12. Yes, that makes your browser window fullscreen, unfortunately. After that, you can take a capture by pressing the button in RenderDoc. If it says D3D12, then you captured the right thing.