This is a Visual Studio Code extension for the Radeon GPU Analyzer (RGA). It aims to make RGA usable directly from within VSCode. For now RGA 2.3 is supported. Later versions may work out of the box.
Features
View the disassembly from compiling HLSL, SPIR-V and Vulkan (GLSL) shaders down to AMD IL and AMD GCN/RDNA ISA.
View the disassembly from compiling AMD IL shaders to AMD GCN/RDNA ISA.
The current word selection is used as entry function of your shader.
The shader model / shader type and the target architecture are chosen via drop down menus.
The last command per shader is saved and can be replayed. This allows you to spot the impact your code changes have on the ISA.
If you open the shader in a VSCode project, created files will open in a new view.
Usage
All commands are accessible from the command palette (Ctrl+Shift+P).
Supported commands:
Call RGA: Vulkan
Call RGA: SPIR-V
Call RGA: AMD IL
Call RGA: DX11
Call RGA: DX12
Replay RGA (default key binding: F7)
E.g. to compile an HLSL shader for the use on RX 5700 XT:
Open VSCode in a parent directory of your shader.
Open your shader in VSCode.
Select the entry function name of your shader.
Ctrl+Shift+P
Enter the command "Call RGA: DX12"
Choose your preferred shader profile from the drop down. E.g. cs_6_0 for a compute shader on Shader Model 6.0.
Choose your preferred target architecture. For RX 5700 XT that would be gfx1010 - call RGA.exe directly to show the full list of supported ASICs.
If your shader compiles successfully, the resulting AMD IL and AMD GCN/RDNA ISA disassembly will open in separate views.
Notes
AMD IL does not require an entry point, no need to do step 3 in that case.
All files are created next to the shader source file.
RGA will prefix the generated ISA and IL filenames with the name of the GPU family you are compiling for, and the function entry point if that applies.
RGA does not support AMD IL for DX12 shaders as of version 2.2 - the compiled DXIL is shown instead.
DX12 shaders must define and reference the root signature through the [RootSignature()] attribute or use --rs-bin as a custom argument.
Compiling DX12 graphics (= non-compute) pipelines requires to select multiple entry points beforehand. The standard keyboard shortcut in VS Code for multi selection is Alt.
Compiling DX12 graphics pipelines also requires a gpso file that provides additional information about the pipeline. For compute shaders just leave the selection empty.
Requirements
To use this extension you have to download RGA separately and point to the rga.exe in your settings.
Download RGA from Github. Note that for now version 2.3 is supported. Later versions may work out of the box.