else
printf(".interp%d", param.interpolation);
}
- } else if (param.flat || param.interpolation) {
+
+ if (param.modifier != midgard_varying_mod_none) {
+ if (param.modifier == midgard_varying_mod_perspective_w)
+ printf(".perspectivew");
+ else if (param.modifier == midgard_varying_mod_perspective_z)
+ printf(".perspectivez");
+ else
+ printf(".mod%d", param.modifier);
+ }
+ } else if (param.flat || param.interpolation || param.modifier) {
printf(" /* is_varying not set but varying metadata attached */");
}
- if (param.zero1 || param.zero2)
- printf(" /* zero tripped, %d %d */ ", param.zero1, param.zero2);
+ if (param.zero0 || param.zero1 || param.zero2)
+ printf(" /* zero tripped, %d %d %d */ ", param.zero0, param.zero1, param.zero2);
}
static bool
midgard_interp_default = 2
} midgard_interpolation;
+typedef enum {
+ midgard_varying_mod_none = 0,
+
+ /* Other values unknown */
+
+ /* Take the would-be result and divide all components by its z/w
+ * (perspective division baked in with the load) */
+ midgard_varying_mod_perspective_z = 2,
+ midgard_varying_mod_perspective_w = 3,
+} midgard_varying_modifier;
+
typedef struct
__attribute__((__packed__))
{
- unsigned zero1 : 4; /* Always zero */
+ unsigned zero0 : 1; /* Always zero */
+
+ midgard_varying_modifier modifier : 2;
+
+ unsigned zero1: 1; /* Always zero */
/* Varying qualifiers, zero if not a varying */
unsigned flat : 1;