Skip to content

Instantly share code, notes, and snippets.

@Popov72
Last active June 29, 2024 20:18
Show Gist options
  • Save Popov72/41f71cbf8d55f2cb8cae93f439eee347 to your computer and use it in GitHub Desktop.
Save Popov72/41f71cbf8d55f2cb8cae93f439eee347 to your computer and use it in GitHub Desktop.
Using PIX with Chrome

In PIX, Select Target Process => Launch Win32 and set the following 2 entries according to where Canary / Chrome is installed:

  • Path to executable: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
  • Working directory: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application"
  • Command line arguments: --disable-gpu-sandbox --disable-direct-composition
    • You can add those arguments if you want to be able to see the disassembled shader code: --enable-dawn-features=emit_hlsl_debug_symbols,disable_symbol_renaming
  • Launch Suspended unchecked, Launch for GPU capture and Force D3D11On12 checked

Then click on "Launch".

Important: you should close all your Canary / Chrome windows/processes before clicking on the "Launch" button!

To Capture a frame (GPU Capture frame):

  • Choose Present-to-Present
  • Click on the Capture icon
    • You probably need to set Capture frame count to 2 (I had to), otherwise the capture won't contain your commands, only those of Canary / Chrome
  • If you do other captures you can get an "An error occurred during capture" popup: just close it, the capture does work (at least it works for me).

If you want the debug markers to work inside PIX, you need to perform those steps: https://dawn.googlesource.com/dawn/+/refs/heads/main/docs/debug_markers.md

Notes:

  • I could not locate the libdawn_native.dll file: I have simply copied the WinPixEventRuntime.dll file into "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application<version>" and it did work
  • If you update Canary / Chrome, this file will be removed, you will have to copy it again
@Aaron-Bird
Copy link

PIX outputs the following error in the shader option of the pipeline.
2024-02-09 203559

Do I need to create a PDB with a shader file according to this tutorial?
https://devblogs.microsoft.com/pix/using-automatic-shader-pdb-resolution-in-pix/

@Popov72
Copy link
Author

Popov72 commented Feb 10, 2024

I'm not a PIX expert, unfortunately. However, I don't understand why it wouldn't work for you if it works for me. I see that you don't have dump_shaders in the list of parameters: have you tried using exactly the same parameters as me?

@Aaron-Bird
Copy link

I tested many parameters (including dump_shaders), but it still doesn't work.
Thank you again for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment