lavapipe: consistently use nir macros
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 3 May 2021 09:42:35 +0000 (11:42 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 May 2021 07:18:55 +0000 (07:18 +0000)
commit301ceab7ce2c9afd86fb2870d0a05a0ef030b9fd
treeb82e6ba5fda07728b0f3336872f8b0e322773dc6
parent53fe74bbb1606ddb8666095521926370c6079e2d
lavapipe: consistently use nir macros

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.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10585>
src/gallium/frontends/lavapipe/lvp_pipeline.c