Skip to content

lavapipe: consistently use nir macros

Erik Faye-Lund requested to merge kusma/mesa:lavapipe-nir-validation into master

NIR provides two helper macros to run transformation passes correctly, NIR_PASS() and NIR_PASS_V(). So far we've seemingly been a bit haphazard about when to use them.

Let's correct that, and consistently use the NIR helpers here. This helps us in two ways:

  1. We now run nir_validate_shader after each pass, ensuring we didn't break the shader
  2. We now respect the NIR_PRINT environment variable for all NIR passes, making debugging much less surprising.

In addition, we had an OPT()-macro that doesn't seem to provide much help other than to hiding some trivial details. But they make our code different to other users of NIR, which doesn't seem ideal. So let's drop that macro while we're at it.

Merge request reports

Loading