panfrost: XMLify Midgard properties
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 19 Aug 2020 20:32:26 +0000 (16:32 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:35 +0000 (17:05 +0200)
In a long journey to a full XML representation of mali_shader_meta,
let's start with the fourth word, containing some shader properties.
This is a translation from panfrost-job.h, with the exception of
widening the uniform buffer count field [1]

The other noteworthy change is combining the unknown 0x20 flag with the
WRITES_Z flag to form a 2-bit depth source. This papers over the fact
that the blob zeroes this field for non-fragment shaders. Given the
proximity, this is a reasonable guess and avoids an ugly "is_fragment"
bit.

[1] Justified by the increased limit advertised by the Vulkan blob
(maxDescriptorSetUniformBuffers on
https://vulkan.gpuinfo.org/displayreport.php?id=5602#limits). Not
actually supported in Panfrost right now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>

src/panfrost/lib/midgard.xml

index 60782ae301ed5c82dc7f08d1a84a192888c76c12..42e26232b29d30e4779687fd3545bc88fcf81f7c 100644 (file)
     <value name="0" value="4"/>
     <value name="1" value="5"/>
   </enum>
     <value name="0" value="4"/>
     <value name="1" value="5"/>
   </enum>
+
+  <enum name="Depth Source">
+    <value name="None" value="0"/>
+    <value name="Fixed function" value="2"/>
+    <value name="Shader" value="3"/>
+  </enum>
  
   <enum name="Job Type">
     <value name="Not started" value="0"/>
  
   <enum name="Job Type">
     <value name="Not started" value="0"/>
     <field name="Surfaces" size="64" start="4:0" type="address"/>
   </struct>
 
     <field name="Surfaces" size="64" start="4:0" type="address"/>
   </struct>
 
+  <struct name="Midgard Properties" size="1">
+    <field name="Uniform buffer count" size="8" start="0" type="uint"/>
+    <field name="Depth source" size="2" start="8" type="Depth Source" default="None"/>
+    <field name="Early-z enable" size="1" start="10" type="bool" default="false"/>
+    <field name="Helper invocation enable" size="1" start="11" type="bool" default="false"/>
+    <field name="Reads depth/stencil" size="1" start="12" type="bool" default="false"/>
+    <field name="Writes globals" size="1" start="13" type="bool" default="false"/>
+    <field name="Reads tilebuffer" size="1" start="14" type="bool" default="false"/>
+    <field name="Work register count" size="5" start="16" type="uint"/>
+    <field name="Uniform count" size="5" start="21" type="uint"/>
+    <field name="Stencil from shader" size="1" start="28" type="bool"/>
+    <field name="Suppress Inf/NaN" size="1" start="29" type="bool"/>
+  </struct>
+
   <struct name="Stencil">
     <field name="Reference Value" size="8" start="0" type="uint"/>
     <field name="Mask" size="8" start="8" type="uint" default="0xFF"/>
   <struct name="Stencil">
     <field name="Reference Value" size="8" start="0" type="uint"/>
     <field name="Mask" size="8" start="8" type="uint" default="0xFF"/>