Write wrappers that unify the output of the compilers below, usable with Vim’s QuickFix list (TODO: we have some of those, document).
TODO: Look at other compilers supported by Shader Playground and see if they can easily be installed on Linux:
TODO: I have much more documentation about this in ~/.local/bin/glsl-dump
.
As far as I can see these are not standalone executables which I think means you need the relevant hardware in order for the driver to even load so that you can make it print debug shader assembly with environment variables. We should be able to fork and add small(?) source files to create standalone executables. Most backends have this environment variable, look for it in documentation, search the source and replicate what’s been done up to that point in a main()
. https://docs.mesa3d.org/envvars.html
Here is someone looking at shader assembly:
Includes glslangValidator
.
sudo apt-get install glslang-tools
Includes the Cg (and GLSL) compiler cgc
. Writing a wrapper that autodetects the GLSL shader type based on file extension (compatible with glslangValidator
) is recommended (TODO: we have one of those, document).
sudo apt-get install nvidia-cg-toolkit
Cross-platform, cross-hardware.
sudo apt-get install renderdoc
Alternatively, build from source: https://github.com/GPUOpen-Tools/radeon_gpu_analyzer#building-on-ubuntu
# TODO: Does `build/fetch_dependencies.py` not download these locally? Probably
# use the system-provided ones if possible. Any GUI-related packages
# (`lib{x11,gtk,qt}*`) can probably be omitted. Look at
# `build/dependency_map.py` for needed dependencies.
sudo apt-get install libboost-all-dev
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install libglu1-mesa-dev mesa-common-dev libgtk2.0-dev
sudo apt-get install zlib1g-dev libx11-dev:i386
sudo apt-get install qtbase5-dev
git clone 'https://github.com/GPUOpen-Tools/radeon_gpu_analyzer' '.'
python3 'build/fetch_dependencies.py'
rm -rf '_build'
cmake -B '_build' -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI_ONLY=ON -DRGA_ENABLE_VULKAN=OFF -DCMAKE_CXX_FLAGS='-Wno-narrowing'
cmake --build '_build'
# https://gpuopen.com/introducing-radeon-developer-tool-suite/
# https://gpuopen.com/rdts-linux/
# ./utils/{glc,amdllpc,shae}
Support for Linux (nominally Ubuntu) seems to have been removed in 2024:
The latest 2023 version (2023-4) still has support though:
Version 2023-2 is avaiable in the Arch User Repository (AUR):
The following installs the latest supported version (with option to install earlier versions):
# url='https://registrationcenter-download.intel.com/akdlm/IRC_NAS/46f856a1-7346-4305-b47f-b38b1a2dd9f9/gpa_23.2.1686276958_release_m64_deb_install.sh'
# url='https://registrationcenter-download.intel.com/akdlm/IRC_NAS/59672f9d-18fd-483d-a0bd-88faf52877f6/gpa_23.3.1694629450_release_m64_deb_install.sh'
url='https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ec2a7b31-5184-49b8-9b85-5dc28e73e990/gpa_23.4.1702630016_release_m64_deb_install.sh'
gpa-monitor $executable
# Press Ctrl-Shift-C.
frame-analyzer $capture
There is also Intel VTune, which can do some graphics profiling.