aco: add a helper for building a trap handler shader
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Aug 2020 16:39:20 +0000 (18:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 11:08:24 +0000 (11:08 +0000)
commit9c46e6fca323390f3cb74d6e865d2883a4fbd453
treee8900c895f767cdf59a10444bfbe3520bdc54ca6
parenta6146aa5980f972a11ee054a49bba9dc79b8bbd4
aco: add a helper for building a trap handler shader

It's way easier to write a trap handler shader using ACO IR
instead of writing disassembly by hand + clrxasm + copy&paste.

This trap handler is quite simple for now, it just loads a
buffer descriptor from the TMA BO, it saves ttmp0-1 which
contain various info about the faulty instruction, and it
stores some hw registers about the wave/trap status.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6384>
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_ir.h