Skip to content

Shader compilation using the open source OpenGL driver

Yours3lf edited this page Jun 23, 2020 · 1 revision

You can compile GLSL shaders to Broadcom Videocore IV assembly using the open source OpenGL driver by setting an environment variable. See here: https://github.com/anholt/mesa/blob/4a50bae1250ab776fab289df3ca16ba13e432d62/docs/envvars.html#L357

export VC4_DEBUG=qpu

This will make the OpenGL driver dump assembly in the form of 64 bit hexadecimal numbers that you can just load using rpi-vk-driver. You will need to create a mapping table between the Vulkan descriptors/push constants and the assembly, take a look at the tests that come with the driver for examples on how to do that.

Clone this wiki locally