diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-10 11:18:41 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-11 08:44:18 -0700 |
commit | 109460f03a1f1b09411c1be3b3eb7c6a3a63d754 (patch) | |
tree | fd95d074ddbc6803ad109e4f43b318f7f8da848e /src/gallium/drivers | |
parent | fc472007e7a2d2f33fbf9692355d4b6ece73b49a (diff) |
panfrost/midgard/disasm: Varying perspective divides
With an extra flag, we're able to do a perspective division "for free"
while loading a varying.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/disassemble.c | 15 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard.h | 17 |
2 files changed, 28 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c index 9796eaa2d09..084064eb615 100644 --- a/src/gallium/drivers/panfrost/midgard/disassemble.c +++ b/src/gallium/drivers/panfrost/midgard/disassemble.c @@ -924,12 +924,21 @@ print_varying_parameters(midgard_load_store_word *word) 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 diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h index 980a968cbe9..c8331f64a67 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard.h +++ b/src/gallium/drivers/panfrost/midgard/midgard.h @@ -435,10 +435,25 @@ typedef enum { 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; |