[Mesa-dev] [PATCH 4/9] genxml: Make a SCISSOR_RECT structure on Gen4-5.

Kenneth Graunke kenneth at whitecape.org
Thu May 11 23:32:01 UTC 2017


Gen6+ support multiple scissor rectangles, and define a SCISSOR_RECT
structure containing their dimensions.  On Gen4-5, those same fields
exist in SF_VIEWPORT.

This patch extracts the SF_VIEWPORT fields into a SCISSOR_RECT
structure.  Although not a named concept on Gen4-5, it works just
as well, and gives us a consistent SCISSOR_RECT structure across
all generations, making it easier to reuse code.
---
 src/intel/genxml/gen4.xml  | 12 ++++++++----
 src/intel/genxml/gen45.xml | 12 ++++++++----
 src/intel/genxml/gen5.xml  | 12 ++++++++----
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/intel/genxml/gen4.xml b/src/intel/genxml/gen4.xml
index d3a2f9264e1..bd90764cc64 100644
--- a/src/intel/genxml/gen4.xml
+++ b/src/intel/genxml/gen4.xml
@@ -401,6 +401,13 @@
     <field name="YMax Clip Guardband" start="96" end="127" type="float"/>
   </struct>
 
+  <struct name="SCISSOR_RECT" length="2">
+    <field name="Scissor Rectangle Y Min" start="16" end="31" type="uint"/>
+    <field name="Scissor Rectangle X Min" start="0" end="15" type="uint"/>
+    <field name="Scissor Rectangle Y Max" start="48" end="63" type="uint"/>
+    <field name="Scissor Rectangle X Max" start="32" end="47" type="uint"/>
+  </struct>
+
   <struct name="COLOR_CALC_STATE" length="8">
     <field name="Stencil Test Enable" start="31" end="31" type="bool"/>
     <field name="Stencil Test Function" start="28" end="30" type="3D_Compare_Function"/>
@@ -693,10 +700,7 @@
     <field name="Viewport Matrix Element m30" start="96" end="127" type="float"/>
     <field name="Viewport Matrix Element m31" start="128" end="159" type="float"/>
     <field name="Viewport Matrix Element m32" start="160" end="191" type="float"/>
-    <field name="Scissor Rectangle Y Min" start="208" end="223" type="uint"/>
-    <field name="Scissor Rectangle X Min" start="192" end="207" type="uint"/>
-    <field name="Scissor Rectangle Y Max" start="240" end="255" type="uint"/>
-    <field name="Scissor Rectangle X Max" start="224" end="239" type="uint"/>
+    <field name="Scissor Rectangle" start="192" end="255" type="SCISSOR_RECT"/>
   </struct>
 
   <struct name="VERTEX_BUFFER_STATE" length="4">
diff --git a/src/intel/genxml/gen45.xml b/src/intel/genxml/gen45.xml
index 547e2785444..87d5c2fdda6 100644
--- a/src/intel/genxml/gen45.xml
+++ b/src/intel/genxml/gen45.xml
@@ -402,6 +402,13 @@
     <field name="YMax Clip Guardband" start="96" end="127" type="float"/>
   </struct>
 
+  <struct name="SCISSOR_RECT" length="2">
+    <field name="Scissor Rectangle Y Min" start="16" end="31" type="uint"/>
+    <field name="Scissor Rectangle X Min" start="0" end="15" type="uint"/>
+    <field name="Scissor Rectangle Y Max" start="48" end="63" type="uint"/>
+    <field name="Scissor Rectangle X Max" start="32" end="47" type="uint"/>
+  </struct>
+
   <struct name="COLOR_CALC_STATE" length="8">
     <field name="Stencil Test Enable" start="31" end="31" type="bool"/>
     <field name="Stencil Test Function" start="28" end="30" type="3D_Compare_Function"/>
@@ -644,10 +651,7 @@
     <field name="Viewport Matrix Element m30" start="96" end="127" type="float"/>
     <field name="Viewport Matrix Element m31" start="128" end="159" type="float"/>
     <field name="Viewport Matrix Element m32" start="160" end="191" type="float"/>
-    <field name="Scissor Rectangle Y Min" start="208" end="223" type="uint"/>
-    <field name="Scissor Rectangle X Min" start="192" end="207" type="uint"/>
-    <field name="Scissor Rectangle Y Max" start="240" end="255" type="uint"/>
-    <field name="Scissor Rectangle X Max" start="224" end="239" type="uint"/>
+    <field name="Scissor Rectangle" start="192" end="255" type="SCISSOR_RECT"/>
   </struct>
 
   <struct name="VERTEX_BUFFER_STATE" length="4">
diff --git a/src/intel/genxml/gen5.xml b/src/intel/genxml/gen5.xml
index 447499ca8c7..a3a2aa2c713 100644
--- a/src/intel/genxml/gen5.xml
+++ b/src/intel/genxml/gen5.xml
@@ -400,6 +400,13 @@
     <field name="YMax Clip Guardband" start="96" end="127" type="float"/>
   </struct>
 
+  <struct name="SCISSOR_RECT" length="2">
+    <field name="Scissor Rectangle Y Min" start="16" end="31" type="uint"/>
+    <field name="Scissor Rectangle X Min" start="0" end="15" type="uint"/>
+    <field name="Scissor Rectangle Y Max" start="48" end="63" type="uint"/>
+    <field name="Scissor Rectangle X Max" start="32" end="47" type="uint"/>
+  </struct>
+
   <struct name="COLOR_CALC_STATE" length="8">
     <field name="Stencil Test Enable" start="31" end="31" type="bool"/>
     <field name="Stencil Test Function" start="28" end="30" type="3D_Compare_Function"/>
@@ -799,10 +806,7 @@
     <field name="Viewport Matrix Element m30" start="96" end="127" type="float"/>
     <field name="Viewport Matrix Element m31" start="128" end="159" type="float"/>
     <field name="Viewport Matrix Element m32" start="160" end="191" type="float"/>
-    <field name="Scissor Rectangle Y Min" start="208" end="223" type="uint"/>
-    <field name="Scissor Rectangle X Min" start="192" end="207" type="uint"/>
-    <field name="Scissor Rectangle Y Max" start="240" end="255" type="uint"/>
-    <field name="Scissor Rectangle X Max" start="224" end="239" type="uint"/>
+    <field name="Scissor Rectangle" start="192" end="255" type="SCISSOR_RECT"/>
   </struct>
 
   <struct name="VERTEX_BUFFER_STATE" length="4">
-- 
2.12.2



More information about the mesa-dev mailing list