Skip to content

Provide shader assembly dumps via KHR_debug

Mark Janes requested to merge majanes/mesa:shader_assemby_debug into main

Currently, tools that want shader dumps need to parse stderr. This is problematic, because pattern-matching breaks when shader assembly format changes slightly (eg: enabling dumps for programs in the shader cache). KHR_debug provides a synchronous callback mechanism with stable identifiers which facilitates matching shader dumps with the source programs.

This series also makes a few improvements:

  • When a client has registered a callback for KHR_debug, pre-formatted messages may be arbitrarily long. KHR_debug limits the length of cached messages that can be queried asynchronously.
  • Iris debug handling had a subtle memory error that has been fixed (intel/blorp: maintain a debug context)
  • Iris nir/assembly dumps enabled for programs retrieved from the shader cache
  • Several intel KHR_debug messages have stable id's instead of monotonically incrementing id's.

Changes to stderr and existing KHR_debug messages are minimized to preserve functionality of existing tools (eg shaderdb). At some point, it may be desirable to disable redundant shader dumping to stderr.

Merge request reports