if (quirks & MIDGARD_BROKEN_LOD)
NIR_PASS_V(nir, midgard_nir_lod_errata);
+ NIR_PASS(progress, nir, midgard_nir_lower_algebraic_early);
+
do {
progress = false;
#include <stdbool.h>
#include "nir.h"
+bool midgard_nir_lower_algebraic_early(nir_shader *shader);
bool midgard_nir_lower_algebraic_late(nir_shader *shader);
bool midgard_nir_scale_trig(nir_shader *shader);
bool midgard_nir_cancel_inot(nir_shader *shader);
b = 'b'
c = 'c'
+algebraic = [
+ (('pack_unorm_4x8', a), ('pack_32_4x8', ('f2u8', ('fround_even', ('fmul', ('fsat', a), 255.0)))))
+]
+
algebraic_late = [
# ineg must be lowered late, but only for integers; floats will try to
# have modifiers attached... hence why this has to be here rather than
print('#include "midgard_nir.h"')
+ print(nir_algebraic.AlgebraicPass("midgard_nir_lower_algebraic_early",
+ algebraic).render())
+
print(nir_algebraic.AlgebraicPass("midgard_nir_lower_algebraic_late",
algebraic_late + converts + constant_switch).render())