genxml: Make 3DSTATE_CONSTANT_BODY on Gen7+ use arrays.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 15 May 2017 23:15:13 +0000 (16:15 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Jun 2017 18:49:46 +0000 (11:49 -0700)
This will let us initialize the constant buffers with loops.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/genxml/gen7.xml
src/intel/genxml/gen75.xml
src/intel/genxml/gen8.xml
src/intel/genxml/gen9.xml
src/intel/vulkan/genX_cmd_buffer.c
src/mesa/drivers/dri/i965/genX_state_upload.c

index c98327a1915be246e23d8ac7ed68d5961128221e..2c297f3b95b00258cc2efbc039af545a9e71751d 100644 (file)
   </struct>
 
   <struct name="3DSTATE_CONSTANT_BODY" length="6">
-    <field name="Constant Buffer 1 Read Length" start="16" end="31" type="uint"/>
-    <field name="Constant Buffer 0 Read Length" start="0" end="15" type="uint"/>
-    <field name="Constant Buffer 3 Read Length" start="48" end="63" type="uint"/>
-    <field name="Constant Buffer 2 Read Length" start="32" end="47" type="uint"/>
-    <field name="Pointer To Constant Buffer 0" start="69" end="95" type="address"/>
+    <group count="4" start="0" size="16">
+      <field name="Read Length" start="0" end="15" type="uint"/>
+    </group>
     <field name="Constant Buffer Object Control State" start="64" end="68" type="MEMORY_OBJECT_CONTROL_STATE"/>
-    <field name="Pointer To Constant Buffer 1" start="101" end="127" type="address"/>
-    <field name="Pointer To Constant Buffer 2" start="133" end="159" type="address"/>
-    <field name="Pointer To Constant Buffer 3" start="165" end="191" type="address"/>
+    <group count="4" start="64" size="32">
+      <field name="Buffer" start="5" end="31" type="address"/>
+    </group>
   </struct>
 
   <struct name="VERTEX_BUFFER_STATE" length="4">
index 11f1462cd1fe666082dd6fdaa345dcfc7cccc3a7..e7c06dc58193b009b3cf45d80af2ea8daaff030a 100644 (file)
   </struct>
 
   <struct name="3DSTATE_CONSTANT_BODY" length="6">
-    <field name="Constant Buffer 1 Read Length" start="16" end="31" type="uint"/>
-    <field name="Constant Buffer 0 Read Length" start="0" end="15" type="uint"/>
-    <field name="Constant Buffer 3 Read Length" start="48" end="63" type="uint"/>
-    <field name="Constant Buffer 2 Read Length" start="32" end="47" type="uint"/>
-    <field name="Pointer To Constant Buffer 0" start="69" end="95" type="address"/>
+    <group count="4" start="0" size="16">
+      <field name="Read Length" start="0" end="15" type="uint"/>
+    </group>
     <field name="Constant Buffer Object Control State" start="64" end="68" type="MEMORY_OBJECT_CONTROL_STATE"/>
-    <field name="Pointer To Constant Buffer 1" start="101" end="127" type="address"/>
-    <field name="Pointer To Constant Buffer 2" start="133" end="159" type="address"/>
-    <field name="Pointer To Constant Buffer 3" start="165" end="191" type="address"/>
+    <group count="4" start="64" size="32">
+      <field name="Buffer" start="5" end="31" type="address"/>
+    </group>
   </struct>
 
   <struct name="BINDING_TABLE_EDIT_ENTRY" length="1">
index 541a788c82c133582b85e4ebe6fdfe37cd6b23a8..2fd796a2e241f961a6e3836eed25c5d58512def2 100644 (file)
   </enum>
 
   <struct name="3DSTATE_CONSTANT_BODY" length="10">
-    <field name="Constant Buffer 1 Read Length" start="16" end="31" type="uint"/>
-    <field name="Constant Buffer 0 Read Length" start="0" end="15" type="uint"/>
-    <field name="Constant Buffer 3 Read Length" start="48" end="63" type="uint"/>
-    <field name="Constant Buffer 2 Read Length" start="32" end="47" type="uint"/>
-    <field name="Pointer To Constant Buffer 0" start="69" end="127" type="address"/>
-    <field name="Pointer To Constant Buffer 1" start="133" end="191" type="address"/>
-    <field name="Pointer To Constant Buffer 2" start="197" end="255" type="address"/>
-    <field name="Pointer To Constant Buffer 3" start="261" end="319" type="address"/>
+    <group count="4" start="0" size="16">
+      <field name="Read Length" start="0" end="15" type="uint"/>
+    </group>
+    <group count="4" start="64" size="64">
+      <field name="Buffer" start="5" end="63" type="address"/>
+    </group>
   </struct>
 
   <struct name="BINDING_TABLE_EDIT_ENTRY" length="1">
index 3e9e88e219a8be156191873d0b945e80187182ef..af40e66077125bf1b987e6c65e16c4a899669f12 100644 (file)
   </enum>
 
   <struct name="3DSTATE_CONSTANT_BODY" length="10">
-    <field name="Constant Buffer 1 Read Length" start="16" end="31" type="uint"/>
-    <field name="Constant Buffer 0 Read Length" start="0" end="15" type="uint"/>
-    <field name="Constant Buffer 3 Read Length" start="48" end="63" type="uint"/>
-    <field name="Constant Buffer 2 Read Length" start="32" end="47" type="uint"/>
-    <field name="Pointer To Constant Buffer 0" start="69" end="127" type="address"/>
-    <field name="Pointer To Constant Buffer 1" start="133" end="191" type="address"/>
-    <field name="Pointer To Constant Buffer 2" start="197" end="255" type="address"/>
-    <field name="Pointer To Constant Buffer 3" start="261" end="319" type="address"/>
+    <group count="4" start="0" size="16">
+      <field name="Read Length" start="0" end="15" type="uint"/>
+    </group>
+    <group count="4" start="64" size="64">
+      <field name="Buffer" start="5" end="63" type="address"/>
+    </group>
   </struct>
 
   <struct name="BINDING_TABLE_EDIT_ENTRY" length="1">
index 0bb6d8e782c312ee740079530305b39f328e24dd..072d0d50325f0afaa2902ab7bfdaeb24d6c62f99 100644 (file)
@@ -1482,11 +1482,11 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer)
             c._3DCommandSubOpcode = push_constant_opcodes[stage],
             c.ConstantBody = (struct GENX(3DSTATE_CONSTANT_BODY)) {
 #if GEN_GEN >= 9
-               .PointerToConstantBuffer2 = { &cmd_buffer->device->dynamic_state_pool.block_pool.bo, state.offset },
-               .ConstantBuffer2ReadLength = DIV_ROUND_UP(state.alloc_size, 32),
+               .Buffer[2] = { &cmd_buffer->device->dynamic_state_pool.block_pool.bo, state.offset },
+               .ReadLength[2] = DIV_ROUND_UP(state.alloc_size, 32),
 #else
-               .PointerToConstantBuffer0 = { .offset = state.offset },
-               .ConstantBuffer0ReadLength = DIV_ROUND_UP(state.alloc_size, 32),
+               .Buffer[0] = { .offset = state.offset },
+               .ReadLength[0] = DIV_ROUND_UP(state.alloc_size, 32),
 #endif
             };
          }
index 1f05eea4426d1fea27826489395ed15808b80bc8..cc6542163ebb66930c83e103a3f397dedaca8fd5 100644 (file)
@@ -2674,14 +2674,12 @@ upload_constant_state(struct brw_context *brw,
       pkt._3DCommandSubOpcode = push_constant_opcodes[stage];
       if (active) {
 #if GEN_GEN >= 8 || GEN_IS_HASWELL
-         pkt.ConstantBody.ConstantBuffer2ReadLength =
-            stage_state->push_const_size;
-         pkt.ConstantBody.PointerToConstantBuffer2 =
+         pkt.ConstantBody.ReadLength[2] = stage_state->push_const_size;
+         pkt.ConstantBody.Buffer[2] =
             render_ro_bo(brw->curbe.curbe_bo, stage_state->push_const_offset);
 #else
-         pkt.ConstantBody.ConstantBuffer0ReadLength =
-            stage_state->push_const_size;
-         pkt.ConstantBody.PointerToConstantBuffer0.offset =
+         pkt.ConstantBody.ReadLength[0] = stage_state->push_const_size;
+         pkt.ConstantBody.Buffer[0].offset =
             stage_state->push_const_offset | mocs;
 #endif
       }