asahi: Identify object type field via PowerVR
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 4 Sep 2022 18:43:18 +0000 (14:43 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Sep 2022 21:01:28 +0000 (21:01 +0000)
src/imagination/csbgen/rogue_ppp.xml STATE_ISPA bits 28. Looks like that
got split into two structs in AGX (with info duplicated?) but yeah I
have a lot to work with here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18421>

src/asahi/lib/cmdbuf.xml
src/gallium/drivers/asahi/agx_state.c

index 246b778..3eb4d52 100644 (file)
     <value name="Quad strip" value="15"/> <!-- guess, confirm with piglit later XXX -->
   </enum>
 
+  <enum name="Object Type">
+    <value name="Triangle" value="0"/>
+    <value name="Line" value="1"/>
+    <value name="Point sprite UV=10" value="2"/>
+    <value name="Point sprite UV=01" value="4"/>
+  </enum>
+
   <enum name="Layout">
     <value name="Linear" value="0"/>
     <!-- Default layout if no other layout is set -->
 
   <struct name="Unknown face" size="4">
     <field name="Unknown" size="8" start="0:20" type="hex" default="0x7e"/>
-    <field name="Lines" size="1" start="0:28" type="bool"/>
-    <field name="Points" size="1" start="0:30" type="bool"/>
+    <field name="Object type" size="4" start="0:28" type="Object Type"/>
   </struct>
 
   <struct name="Unknown 4a" size="20">
index 909729a..33b1d56 100644 (file)
@@ -1537,8 +1537,10 @@ demo_unk11(struct agx_pool *pool, bool prim_lines, bool prim_points, bool
       cfg.reads_tilebuffer = reads_tib;
       cfg.sample_mask_from_shader = sample_mask_from_shader;
 
-      cfg.front.lines = cfg.back.lines = prim_lines;
-      cfg.front.points = cfg.back.points = prim_points;
+      cfg.front.object_type = cfg.back.object_type =
+         prim_points ? AGX_OBJECT_TYPE_POINT_SPRITE_UV01 :
+         prim_lines ? AGX_OBJECT_TYPE_LINE :
+         AGX_OBJECT_TYPE_TRIANGLE;
    };
 
    return T.gpu;