Skip to content

ir3: add debug option to override shader assembly

IR3_SHADER_DEBUG=vs,tcs,tes... now also prints shader's sha1.

When there is a file named %sha1%.asm in IR3_SHADER_OVERRIDE_PATH directory - ir3 assembly from file would be parsed, assembled, and will override the shader with corresponding sha1 hash.

Parsing failure is considered unrecoverable error. Upon successful override shader's assembly is printed with:

 "Native code (overridden) for unnamed ..."

This debug option allows easier testing of small changes in assembly without modifying the compiler or using computerator.

It is similar to a shader override I did for Intel's shader assembly in !955 (merged) (also only now I found that there is a similar debug option in radeonsi RADEON_REPLACE_SHADERS). Personally, when I debugged issues on Intel GPUs I occasionally found it incredibly useful.

Merge request reports