i965/nir: Add OPT() and OPT_V() macros for invoking NIR passes.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 3 Nov 2015 08:31:15 +0000 (00:31 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 18 Nov 2015 20:28:32 +0000 (12:28 -0800)
commit7bc097899924f40140981567c7bb52297dd801f2
treee017f1fc674da77a45f6a4eec305ccad164441b0
parentd27ae2cf8cd548fe822ae9bcf11ead1dadfed744
i965/nir: Add OPT() and OPT_V() macros for invoking NIR passes.

OPT() is the normal macro for passes that return booleans, while OPT_V()
is a variant that works for passes that don't properly report progress.
(Such passes should be fixed to return a boolean, eventually.)

These macros take care of calling nir_validate_shader() and setting
progress appropriately.  In the future, it would be easy to add shader
dumping similar to INTEL_DEBUG=optimizer by extending the macro.

v2 (Jason Ekstrand):
 - Fix an unused variable warning

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_nir.c