Skip to content

nir, spirv: Add nir_print_options and use to make a helper printing NIR control flow

Caio Oliveira requested to merge cmarcelo/mesa:nir-print-options into main

When working on SPIR-V structured control flow, many times I changed the code locally to bypass printing most of the instructions in a NIR print so I could see the "relevant" parts for my problem.

This MR creates a mechanism to allow that via the nir_print_options, and then uses it in SPIR-V to filter out only the "relevant" parts for printing the resulting NIR control flow after the SPIR-V parsing.

This could be useful to create all sorts of ad-hoc / local helpers to debug/filter other aspects of NIR shaders that are relevant to other passes. But regardless, it is already a good help for the SPIR-V CFG case.

Merge request reports