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 1.2 is supported. Later versions may work out of the box.
View the disassembly from compiling HLSL, SPIR-V and Vulkan (GLSL) shaders down to AMD IL and AMD GCN ISA.
View the disassembly from compiling AMD IL shaders to AMD GCN ISA.
The current word selection is used as entry function of your shader.
The shader model / shader type and the target architecture can be easily used from 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.
See all compiler errors and warnings in the VSCode terminal.
You can add language specific command line arguments via settings.
All commands are accessible from the command palette (Ctrl+Shift+P).
Call RGA: Vulkan
Call RGA: SPIR-V
Call RGA: AMD IL
Call RGA: HLSL
Replay RGA (default key binding: F7)
E.g. to compile an HLSL shader for the use on RX Vega:
Open VSCode in a parent directory of your shader.
Open your shader in VSCode.
Select the entry function name of your shader.
Enter the command "Call RGA: HLSL"
Choose your preferred shader profile from the drop down. E.g. cs_5_0 for a compute shader on Shader Model 5.
Choose your preferred target architecture. For RX Vega that would be gfx900.
If your shader compiles successfully, the resulting AMD IL and AMD GCN ISA will open in separate views.
For HLSL the file extension .hlsl is recognized automatically. You can skip steps 4 and 5 and only use the key binding instead (defaults to Ctrl+.).
AMD IL does not require an entry point, no need to do step 3 in that case.
You can only build for GPUs that the compiler knows about in the driver you have installed.
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.
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 1.2 is supported. Later versions may work out of the box.