ir3: add debug option to override shader assembly
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Fri, 8 Jan 2021 13:09:30 +0000 (15:09 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 14 Jan 2021 21:51:16 +0000 (21:51 +0000)
commit39a2da738d85adca0fef6ee8fa7363836be3401a
tree703480c700162db4691392292a077c4dce652664
parent64f939020d8dbe23e5230369488e18fb983559dd
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.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8388>
src/freedreno/ir3/ir3_compiler.c
src/freedreno/ir3/ir3_compiler.h
src/freedreno/ir3/ir3_shader.c