[09/18] panfrost/midgard: Add varying divide-by-z mode

Submitted by Alyssa Rosenzweig on June 10, 2019, 10:01 p.m.

Details

Message ID 20190610220146.7832-10-alyssa.rosenzweig@collabora.com
State New
Headers show
Series "panfrost/midgard: Decode GLES3 texture op" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig June 10, 2019, 10:01 p.m.
Turns out this modifier field is the same as Utgard-PP.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
---
 src/gallium/drivers/panfrost/midgard/disassemble.c | 6 ++++--
 src/gallium/drivers/panfrost/midgard/midgard.h     | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c
index 5f553ba27a0..6be262f7ba0 100644
--- a/src/gallium/drivers/panfrost/midgard/disassemble.c
+++ b/src/gallium/drivers/panfrost/midgard/disassemble.c
@@ -926,8 +926,10 @@  print_varying_parameters(midgard_load_store_word *word)
                 }
 
                 if (param.modifier != midgard_varying_mod_none) {
-                        if (param.modifier == midgard_varying_mod_perspective)
-                                printf(".perspective");
+                        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);
                 }
diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h
index ef06e298010..354d611e9df 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard.h
+++ b/src/gallium/drivers/panfrost/midgard/midgard.h
@@ -440,9 +440,10 @@  typedef enum {
 
         /* Other values unknown */
 
-        /* Take the would-be result and divide all components by its w
+        /* Take the would-be result and divide all components by its z/w
          * (perspective division baked in with the load)  */
-        midgard_varying_mod_perspective = 3,
+        midgard_varying_mod_perspective_z = 2,
+        midgard_varying_mod_perspective_w = 3,
 } midgard_varying_modifier;
 
 typedef struct