vk: Update to header files with nested struct support
authorKristian Høgsberg <kristian.h.kristensen@intel.com>
Thu, 21 May 2015 21:34:55 +0000 (14:34 -0700)
committerKristian Høgsberg <kristian.h.kristensen@intel.com>
Tue, 26 May 2015 03:20:31 +0000 (20:20 -0700)
This will let us do MOCS settings right.

src/vulkan/gen75_pack.h
src/vulkan/gen7_pack.h
src/vulkan/gen8_pack.h

index ed4ab2e52c639f285584f579e2b6115c73c250d9..4978d5977b70bfdc16bdb9215f54d1f73cba8d62 100644 (file)
@@ -248,6 +248,24 @@ GEN75_PIPELINE_SELECT_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  =  1,                  \
    .DwordLength          =  8
 
+struct GEN75_MEMORY_OBJECT_CONTROL_STATE {
+   uint32_t                                     LLCeLLCCacheabilityControlLLCCC;
+   uint32_t                                     L3CacheabilityControlL3CC;
+};
+
+static inline void
+GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
+                                     const struct GEN75_MEMORY_OBJECT_CONTROL_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->LLCeLLCCacheabilityControlLLCCC, 1, 2) |
+      __gen_field(values->L3CacheabilityControlL3CC, 0, 0) |
+      0;
+
+}
+
 struct GEN75_STATE_BASE_ADDRESS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -255,20 +273,20 @@ struct GEN75_STATE_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           GeneralStateBaseAddress;
-   uint32_t                                     GeneralStateMemoryObjectControlState;
-   uint32_t                                     StatelessDataPortAccessMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     GeneralStateMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     StatelessDataPortAccessMemoryObjectControlState;
    uint32_t                                     GeneralStateBaseAddressModifyEnable;
    __gen_address_type                           SurfaceStateBaseAddress;
-   uint32_t                                     SurfaceStateMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     SurfaceStateMemoryObjectControlState;
    uint32_t                                     SurfaceStateBaseAddressModifyEnable;
    __gen_address_type                           DynamicStateBaseAddress;
-   uint32_t                                     DynamicStateMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     DynamicStateMemoryObjectControlState;
    uint32_t                                     DynamicStateBaseAddressModifyEnable;
    __gen_address_type                           IndirectObjectBaseAddress;
-   uint32_t                                     IndirectObjectMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     IndirectObjectMemoryObjectControlState;
    uint32_t                                     IndirectObjectBaseAddressModifyEnable;
    __gen_address_type                           InstructionBaseAddress;
-   uint32_t                                     InstructionMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     InstructionMemoryObjectControlState;
    uint32_t                                     InstructionBaseAddressModifyEnable;
    __gen_address_type                           GeneralStateAccessUpperBound;
    uint32_t                                     GeneralStateAccessUpperBoundModifyEnable;
@@ -294,41 +312,59 @@ GEN75_STATE_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_GeneralStateMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_GeneralStateMemoryObjectControlState, &values->GeneralStateMemoryObjectControlState);
+   uint32_t dw_StatelessDataPortAccessMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StatelessDataPortAccessMemoryObjectControlState, &values->StatelessDataPortAccessMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  GeneralStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-   /* Struct  StatelessDataPortAccessMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  GeneralStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_GeneralStateMemoryObjectControlState, 8, 11) |
+      /* Struct  StatelessDataPortAccessMemoryObjectControlState (4..7): */
+      __gen_field(dw_StatelessDataPortAccessMemoryObjectControlState, 4, 7) |
       __gen_field(values->GeneralStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[1] =
       __gen_combine_address(data, &dw[1], values->GeneralStateBaseAddress, dw1);
 
+   uint32_t dw_SurfaceStateMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceStateMemoryObjectControlState, &values->SurfaceStateMemoryObjectControlState);
    uint32_t dw2 =
-   /* Struct  SurfaceStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_SurfaceStateMemoryObjectControlState, 8, 11) |
       __gen_field(values->SurfaceStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[2] =
       __gen_combine_address(data, &dw[2], values->SurfaceStateBaseAddress, dw2);
 
+   uint32_t dw_DynamicStateMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DynamicStateMemoryObjectControlState, &values->DynamicStateMemoryObjectControlState);
    uint32_t dw3 =
-   /* Struct  DynamicStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DynamicStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_DynamicStateMemoryObjectControlState, 8, 11) |
       __gen_field(values->DynamicStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[3] =
       __gen_combine_address(data, &dw[3], values->DynamicStateBaseAddress, dw3);
 
+   uint32_t dw_IndirectObjectMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_IndirectObjectMemoryObjectControlState, &values->IndirectObjectMemoryObjectControlState);
    uint32_t dw4 =
-   /* Struct  IndirectObjectMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  IndirectObjectMemoryObjectControlState (8..11): */
+      __gen_field(dw_IndirectObjectMemoryObjectControlState, 8, 11) |
       __gen_field(values->IndirectObjectBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[4] =
       __gen_combine_address(data, &dw[4], values->IndirectObjectBaseAddress, dw4);
 
+   uint32_t dw_InstructionMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_InstructionMemoryObjectControlState, &values->InstructionMemoryObjectControlState);
    uint32_t dw5 =
-   /* Struct  InstructionMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  InstructionMemoryObjectControlState (8..11): */
+      __gen_field(dw_InstructionMemoryObjectControlState, 8, 11) |
       __gen_field(values->InstructionBaseAddressModifyEnable, 0, 0) |
       0;
 
@@ -461,7 +497,7 @@ struct GEN75_SWTESS_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           SWTessellationBaseAddress;
-   uint32_t                                     SWTessellationMemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     SWTessellationMemoryObjectControlState;
 };
 
 static inline void
@@ -478,8 +514,11 @@ GEN75_SWTESS_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SWTessellationMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SWTessellationMemoryObjectControlState, &values->SWTessellationMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  SWTessellationMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SWTessellationMemoryObjectControlState (8..11): */
+      __gen_field(dw_SWTessellationMemoryObjectControlState, 8, 11) |
       0;
 
    dw[1] =
@@ -616,6 +655,24 @@ GEN75_3DSTATE_AA_LINE_PARAMETERS_pack(__gen_user_data *data, void * restrict dst
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  = 70
 
+struct GEN75_BINDING_TABLE_EDIT_ENTRY {
+   uint32_t                                     BindingTableIndex;
+   uint32_t                                     SurfaceStatePointer;
+};
+
+static inline void
+GEN75_BINDING_TABLE_EDIT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                                  const struct GEN75_BINDING_TABLE_EDIT_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->BindingTableIndex, 16, 23) |
+      __gen_offset(values->SurfaceStatePointer, 0, 15) |
+      0;
+
+}
+
 struct GEN75_3DSTATE_BINDING_TABLE_EDIT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -1031,7 +1088,7 @@ struct GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC {
    uint32_t                                     DwordLength;
    __gen_address_type                           BindingTablePoolBaseAddress;
    uint32_t                                     BindingTablePoolEnable;
-   uint32_t                                     SurfaceObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     SurfaceObjectControlState;
    __gen_address_type                           BindingTablePoolUpperBound;
 };
 
@@ -1049,9 +1106,12 @@ GEN75_3DSTATE_BINDING_TABLE_POOL_ALLOC_pack(__gen_user_data *data, void * restri
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SurfaceObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceObjectControlState, &values->SurfaceObjectControlState);
    uint32_t dw1 =
       __gen_field(values->BindingTablePoolEnable, 11, 11) |
-   /* Struct  SurfaceObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceObjectControlState (7..10): */
+      __gen_field(dw_SurfaceObjectControlState, 7, 10) |
       0;
 
    dw[1] =
@@ -1343,13 +1403,71 @@ GEN75_3DSTATE_CLIP_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  = 26,                  \
    .DwordLength          =  5
 
+struct GEN75_3DSTATE_CONSTANT_BODY {
+   uint32_t                                     ConstantBuffer1ReadLength;
+   uint32_t                                     ConstantBuffer0ReadLength;
+   uint32_t                                     ConstantBuffer3ReadLength;
+   uint32_t                                     ConstantBuffer2ReadLength;
+   __gen_address_type                           PointerToConstantBuffer0;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     ConstantBufferObjectControlState;
+   __gen_address_type                           PointerToConstantBuffer1;
+   __gen_address_type                           PointerToConstantBuffer2;
+   __gen_address_type                           PointerToConstantBuffer3;
+};
+
+static inline void
+GEN75_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
+                               const struct GEN75_3DSTATE_CONSTANT_BODY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
+      0;
+
+   dw[1] =
+      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
+      0;
+
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
+   uint32_t dw2 =
+      /* Struct  ConstantBufferObjectControlState (0..4): */
+      __gen_field(dw_ConstantBufferObjectControlState, 0, 4) |
+      0;
+
+   dw[2] =
+      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
+
+   uint32_t dw3 =
+      0;
+
+   dw[3] =
+      __gen_combine_address(data, &dw[3], values->PointerToConstantBuffer1, dw3);
+
+   uint32_t dw4 =
+      0;
+
+   dw[4] =
+      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer2, dw4);
+
+   uint32_t dw5 =
+      0;
+
+   dw[5] =
+      __gen_combine_address(data, &dw[5], values->PointerToConstantBuffer3, dw5);
+
+}
+
 struct GEN75_3DSTATE_CONSTANT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN75_3DSTATE_CONSTANT_BODY           ConstantBody;
 };
 
 static inline void
@@ -1366,10 +1484,7 @@ GEN75_3DSTATE_CONSTANT_DS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN75_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN75_3DSTATE_CONSTANT_GS_length 0x00000007
@@ -1387,7 +1502,7 @@ struct GEN75_3DSTATE_CONSTANT_GS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN75_3DSTATE_CONSTANT_BODY           ConstantBody;
 };
 
 static inline void
@@ -1404,10 +1519,7 @@ GEN75_3DSTATE_CONSTANT_GS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN75_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN75_3DSTATE_CONSTANT_HS_length 0x00000007
@@ -1425,7 +1537,7 @@ struct GEN75_3DSTATE_CONSTANT_HS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN75_3DSTATE_CONSTANT_BODY           ConstantBody;
 };
 
 static inline void
@@ -1442,10 +1554,7 @@ GEN75_3DSTATE_CONSTANT_HS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN75_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN75_3DSTATE_CONSTANT_PS_length 0x00000007
@@ -1463,7 +1572,7 @@ struct GEN75_3DSTATE_CONSTANT_PS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN75_3DSTATE_CONSTANT_BODY           ConstantBody;
 };
 
 static inline void
@@ -1480,10 +1589,7 @@ GEN75_3DSTATE_CONSTANT_PS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN75_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN75_3DSTATE_CONSTANT_VS_length 0x00000007
@@ -1501,7 +1607,7 @@ struct GEN75_3DSTATE_CONSTANT_VS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN75_3DSTATE_CONSTANT_BODY           ConstantBody;
 };
 
 static inline void
@@ -1518,10 +1624,7 @@ GEN75_3DSTATE_CONSTANT_VS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN75_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN75_3DSTATE_DEPTH_BUFFER_length 0x00000007
@@ -1560,7 +1663,7 @@ struct GEN75_3DSTATE_DEPTH_BUFFER {
 #define     SURFTYPE_CUBEmustbezero                            0
    uint32_t                                     Depth;
    uint32_t                                     MinimumArrayElement;
-   uint32_t                                     DepthBufferObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     DepthBufferObjectControlState;
    uint32_t                                     DepthCoordinateOffsetY;
    uint32_t                                     DepthCoordinateOffsetX;
    uint32_t                                     RenderTargetViewExtent;
@@ -1601,10 +1704,13 @@ GEN75_3DSTATE_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->LOD, 0, 3) |
       0;
 
+   uint32_t dw_DepthBufferObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DepthBufferObjectControlState, &values->DepthBufferObjectControlState);
    dw[4] =
       __gen_field(values->Depth, 21, 31) |
       __gen_field(values->MinimumArrayElement, 10, 20) |
-   /* Struct  DepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DepthBufferObjectControlState (0..3): */
+      __gen_field(dw_DepthBufferObjectControlState, 0, 3) |
       0;
 
    dw[5] =
@@ -1823,6 +1929,26 @@ GEN75_3DSTATE_DS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  = 55
 
+struct GEN75_GATHER_CONSTANT_ENTRY {
+   uint32_t                                     ConstantBufferOffset;
+   uint32_t                                     ChannelMask;
+   uint32_t                                     BindingTableIndexOffset;
+};
+
+static inline void
+GEN75_GATHER_CONSTANT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                               const struct GEN75_GATHER_CONSTANT_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_offset(values->ConstantBufferOffset, 8, 15) |
+      __gen_field(values->ChannelMask, 4, 7) |
+      __gen_field(values->BindingTableIndexOffset, 0, 3) |
+      0;
+
+}
+
 struct GEN75_3DSTATE_GATHER_CONSTANT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -2062,7 +2188,7 @@ struct GEN75_3DSTATE_GATHER_POOL_ALLOC {
    uint32_t                                     DwordLength;
    __gen_address_type                           GatherPoolBaseAddress;
    uint32_t                                     GatherPoolEnable;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     MemoryObjectControlState;
    __gen_address_type                           GatherPoolUpperBound;
 };
 
@@ -2080,9 +2206,12 @@ GEN75_3DSTATE_GATHER_POOL_ALLOC_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    uint32_t dw1 =
       __gen_field(values->GatherPoolEnable, 11, 11) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (0..3): */
+      __gen_field(dw_MemoryObjectControlState, 0, 3) |
       0;
 
    dw[1] =
@@ -2246,7 +2375,7 @@ struct GEN75_3DSTATE_HIER_DEPTH_BUFFER {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     HierarchicalDepthBufferObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     HierarchicalDepthBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
 };
@@ -2265,8 +2394,11 @@ GEN75_3DSTATE_HIER_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_HierarchicalDepthBufferObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_HierarchicalDepthBufferObjectControlState, &values->HierarchicalDepthBufferObjectControlState);
    dw[1] =
-   /* Struct  HierarchicalDepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  HierarchicalDepthBufferObjectControlState (25..28): */
+      __gen_field(dw_HierarchicalDepthBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -2396,7 +2528,7 @@ struct GEN75_3DSTATE_INDEX_BUFFER {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     MemoryObjectControlState;
 #define     INDEX_BYTE                                         0
 #define     INDEX_WORD                                         1
 #define     INDEX_DWORD                                        2
@@ -2412,12 +2544,15 @@ GEN75_3DSTATE_INDEX_BUFFER_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (12..15): */
+      __gen_field(dw_MemoryObjectControlState, 12, 15) |
       __gen_field(values->IndexFormat, 8, 9) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
@@ -3151,6 +3286,28 @@ GEN75_3DSTATE_RAST_MULTISAMPLE_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  =  2
 
+struct GEN75_PALETTE_ENTRY {
+   uint32_t                                     Alpha;
+   uint32_t                                     Red;
+   uint32_t                                     Green;
+   uint32_t                                     Blue;
+};
+
+static inline void
+GEN75_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN75_PALETTE_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->Alpha, 24, 31) |
+      __gen_field(values->Red, 16, 23) |
+      __gen_field(values->Green, 8, 15) |
+      __gen_field(values->Blue, 0, 7) |
+      0;
+
+}
+
 struct GEN75_3DSTATE_SAMPLER_PALETTE_LOAD0 {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -3768,7 +3925,7 @@ struct GEN75_3DSTATE_SO_BUFFER {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    uint32_t                                     SOBufferIndex;
-   uint32_t                                     SOBufferObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     SOBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
    __gen_address_type                           SurfaceEndAddress;
@@ -3788,9 +3945,12 @@ GEN75_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SOBufferObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SOBufferObjectControlState, &values->SOBufferObjectControlState);
    dw[1] =
       __gen_field(values->SOBufferIndex, 29, 30) |
-   /* Struct  SOBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SOBufferObjectControlState (25..28): */
+      __gen_field(dw_SOBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 11) |
       0;
 
@@ -3815,6 +3975,63 @@ GEN75_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  = 23
 
+struct GEN75_SO_DECL {
+   uint32_t                                     OutputBufferSlot;
+   uint32_t                                     HoleFlag;
+   uint32_t                                     RegisterIndex;
+   uint32_t                                     ComponentMask;
+};
+
+static inline void
+GEN75_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
+                 const struct GEN75_SO_DECL * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->OutputBufferSlot, 12, 13) |
+      __gen_field(values->HoleFlag, 11, 11) |
+      __gen_field(values->RegisterIndex, 4, 9) |
+      __gen_field(values->ComponentMask, 0, 3) |
+      0;
+
+}
+
+struct GEN75_SO_DECL_ENTRY {
+   struct GEN75_SO_DECL                         Stream3Decl;
+   struct GEN75_SO_DECL                         Stream2Decl;
+   struct GEN75_SO_DECL                         Stream1Decl;
+   struct GEN75_SO_DECL                         Stream0Decl;
+};
+
+static inline void
+GEN75_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN75_SO_DECL_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_Stream3Decl;
+   GEN75_SO_DECL_pack(data, &dw_Stream3Decl, &values->Stream3Decl);
+   uint32_t dw_Stream2Decl;
+   GEN75_SO_DECL_pack(data, &dw_Stream2Decl, &values->Stream2Decl);
+   uint32_t dw_Stream1Decl;
+   GEN75_SO_DECL_pack(data, &dw_Stream1Decl, &values->Stream1Decl);
+   uint32_t dw_Stream0Decl;
+   GEN75_SO_DECL_pack(data, &dw_Stream0Decl, &values->Stream0Decl);
+   dw[0] =
+      /* Struct  Stream3Decl (48..63): */
+      __gen_field(dw_Stream3Decl, 48, 63) |
+      /* Struct  Stream2Decl (32..47): */
+      __gen_field(dw_Stream2Decl, 32, 47) |
+      /* Struct  Stream1Decl (16..31): */
+      __gen_field(dw_Stream1Decl, 16, 31) |
+      /* Struct  Stream0Decl (0..15): */
+      __gen_field(dw_Stream0Decl, 0, 15) |
+      0;
+
+   GEN75_SO_DECL_pack(data, &dw[0], &values->Stream0Decl);
+}
+
 struct GEN75_3DSTATE_SO_DECL_LIST {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -3879,7 +4096,7 @@ struct GEN75_3DSTATE_STENCIL_BUFFER {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    uint32_t                                     StencilBufferEnable;
-   uint32_t                                     StencilBufferObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     StencilBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
 };
@@ -3898,9 +4115,12 @@ GEN75_3DSTATE_STENCIL_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_StencilBufferObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StencilBufferObjectControlState, &values->StencilBufferObjectControlState);
    dw[1] =
       __gen_field(values->StencilBufferEnable, 31, 31) |
-   /* Struct  StencilBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  StencilBufferObjectControlState (25..28): */
+      __gen_field(dw_StencilBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -4188,6 +4408,58 @@ GEN75_3DSTATE_URB_HS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  8
 
+struct GEN75_VERTEX_BUFFER_STATE {
+   uint32_t                                     VertexBufferIndex;
+#define     VERTEXDATA                                         0
+#define     INSTANCEDATA                                       1
+   uint32_t                                     BufferAccessType;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     VertexBufferMemoryObjectControlState;
+   uint32_t                                     AddressModifyEnable;
+   uint32_t                                     NullVertexBuffer;
+   uint32_t                                     VertexFetchInvalidate;
+   uint32_t                                     BufferPitch;
+   __gen_address_type                           BufferStartingAddress;
+   __gen_address_type                           EndAddress;
+   uint32_t                                     InstanceDataStepRate;
+};
+
+static inline void
+GEN75_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
+                             const struct GEN75_VERTEX_BUFFER_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_VertexBufferMemoryObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_VertexBufferMemoryObjectControlState, &values->VertexBufferMemoryObjectControlState);
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      __gen_field(values->BufferAccessType, 20, 20) |
+      /* Struct  VertexBufferMemoryObjectControlState (16..19): */
+      __gen_field(dw_VertexBufferMemoryObjectControlState, 16, 19) |
+      __gen_field(values->AddressModifyEnable, 14, 14) |
+      __gen_field(values->NullVertexBuffer, 13, 13) |
+      __gen_field(values->VertexFetchInvalidate, 12, 12) |
+      __gen_field(values->BufferPitch, 0, 11) |
+      0;
+
+   uint32_t dw1 =
+      0;
+
+   dw[1] =
+      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
+
+   uint32_t dw2 =
+      0;
+
+   dw[2] =
+      __gen_combine_address(data, &dw[2], values->EndAddress, dw2);
+
+   dw[3] =
+      __gen_field(values->InstanceDataStepRate, 0, 31) |
+      0;
+
+}
+
 struct GEN75_3DSTATE_VERTEX_BUFFERS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -4221,6 +4493,41 @@ GEN75_3DSTATE_VERTEX_BUFFERS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  9
 
+struct GEN75_VERTEX_ELEMENT_STATE {
+   uint32_t                                     VertexBufferIndex;
+   uint32_t                                     Valid;
+   uint32_t                                     SourceElementFormat;
+   uint32_t                                     EdgeFlagEnable;
+   uint32_t                                     SourceElementOffset;
+   uint32_t                                     Component0Control;
+   uint32_t                                     Component1Control;
+   uint32_t                                     Component2Control;
+   uint32_t                                     Component3Control;
+};
+
+static inline void
+GEN75_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
+                              const struct GEN75_VERTEX_ELEMENT_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      __gen_field(values->Valid, 25, 25) |
+      __gen_field(values->SourceElementFormat, 16, 24) |
+      __gen_field(values->EdgeFlagEnable, 15, 15) |
+      __gen_field(values->SourceElementOffset, 0, 11) |
+      0;
+
+   dw[1] =
+      __gen_field(values->Component0Control, 28, 30) |
+      __gen_field(values->Component1Control, 24, 26) |
+      __gen_field(values->Component2Control, 20, 22) |
+      __gen_field(values->Component3Control, 16, 18) |
+      0;
+
+}
+
 struct GEN75_3DSTATE_VERTEX_ELEMENTS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -6642,227 +6949,6 @@ GEN75_PIPE_CONTROL_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN75_3DSTATE_CONSTANT_BODY {
-   uint32_t                                     ConstantBuffer1ReadLength;
-   uint32_t                                     ConstantBuffer0ReadLength;
-   uint32_t                                     ConstantBuffer3ReadLength;
-   uint32_t                                     ConstantBuffer2ReadLength;
-   __gen_address_type                           PointerToConstantBuffer0;
-   uint32_t                                     ConstantBufferObjectControlState;
-   __gen_address_type                           PointerToConstantBuffer1;
-   __gen_address_type                           PointerToConstantBuffer2;
-   __gen_address_type                           PointerToConstantBuffer3;
-};
-
-static inline void
-GEN75_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
-                               const struct GEN75_3DSTATE_CONSTANT_BODY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
-      0;
-
-   dw[1] =
-      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
-      0;
-
-   uint32_t dw2 =
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-      0;
-
-   dw[2] =
-      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
-
-   uint32_t dw3 =
-      0;
-
-   dw[3] =
-      __gen_combine_address(data, &dw[3], values->PointerToConstantBuffer1, dw3);
-
-   uint32_t dw4 =
-      0;
-
-   dw[4] =
-      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer2, dw4);
-
-   uint32_t dw5 =
-      0;
-
-   dw[5] =
-      __gen_combine_address(data, &dw[5], values->PointerToConstantBuffer3, dw5);
-
-}
-
-struct GEN75_BINDING_TABLE_EDIT_ENTRY {
-   uint32_t                                     BindingTableIndex;
-   uint32_t                                     SurfaceStatePointer;
-};
-
-static inline void
-GEN75_BINDING_TABLE_EDIT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                                  const struct GEN75_BINDING_TABLE_EDIT_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->BindingTableIndex, 16, 23) |
-      __gen_offset(values->SurfaceStatePointer, 0, 15) |
-      0;
-
-}
-
-struct GEN75_GATHER_CONSTANT_ENTRY {
-   uint32_t                                     ConstantBufferOffset;
-   uint32_t                                     ChannelMask;
-   uint32_t                                     BindingTableIndexOffset;
-};
-
-static inline void
-GEN75_GATHER_CONSTANT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                               const struct GEN75_GATHER_CONSTANT_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_offset(values->ConstantBufferOffset, 8, 15) |
-      __gen_field(values->ChannelMask, 4, 7) |
-      __gen_field(values->BindingTableIndexOffset, 0, 3) |
-      0;
-
-}
-
-struct GEN75_VERTEX_BUFFER_STATE {
-   uint32_t                                     VertexBufferIndex;
-#define     VERTEXDATA                                         0
-#define     INSTANCEDATA                                       1
-   uint32_t                                     BufferAccessType;
-   uint32_t                                     VertexBufferMemoryObjectControlState;
-   uint32_t                                     AddressModifyEnable;
-   uint32_t                                     NullVertexBuffer;
-   uint32_t                                     VertexFetchInvalidate;
-   uint32_t                                     BufferPitch;
-   __gen_address_type                           BufferStartingAddress;
-   __gen_address_type                           EndAddress;
-   uint32_t                                     InstanceDataStepRate;
-};
-
-static inline void
-GEN75_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
-                             const struct GEN75_VERTEX_BUFFER_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-      __gen_field(values->BufferAccessType, 20, 20) |
-   /* Struct  VertexBufferMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-      __gen_field(values->AddressModifyEnable, 14, 14) |
-      __gen_field(values->NullVertexBuffer, 13, 13) |
-      __gen_field(values->VertexFetchInvalidate, 12, 12) |
-      __gen_field(values->BufferPitch, 0, 11) |
-      0;
-
-   uint32_t dw1 =
-      0;
-
-   dw[1] =
-      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
-
-   uint32_t dw2 =
-      0;
-
-   dw[2] =
-      __gen_combine_address(data, &dw[2], values->EndAddress, dw2);
-
-   dw[3] =
-      __gen_field(values->InstanceDataStepRate, 0, 31) |
-      0;
-
-}
-
-struct GEN75_VERTEX_ELEMENT_STATE {
-   uint32_t                                     VertexBufferIndex;
-   uint32_t                                     Valid;
-   uint32_t                                     SourceElementFormat;
-   uint32_t                                     EdgeFlagEnable;
-   uint32_t                                     SourceElementOffset;
-   uint32_t                                     Component0Control;
-   uint32_t                                     Component1Control;
-   uint32_t                                     Component2Control;
-   uint32_t                                     Component3Control;
-};
-
-static inline void
-GEN75_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
-                              const struct GEN75_VERTEX_ELEMENT_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-      __gen_field(values->Valid, 25, 25) |
-      __gen_field(values->SourceElementFormat, 16, 24) |
-      __gen_field(values->EdgeFlagEnable, 15, 15) |
-      __gen_field(values->SourceElementOffset, 0, 11) |
-      0;
-
-   dw[1] =
-      __gen_field(values->Component0Control, 28, 30) |
-      __gen_field(values->Component1Control, 24, 26) |
-      __gen_field(values->Component2Control, 20, 22) |
-      __gen_field(values->Component3Control, 16, 18) |
-      0;
-
-}
-
-struct GEN75_SO_DECL_ENTRY {
-   uint32_t                                     Stream3Decl;
-   uint32_t                                     Stream2Decl;
-   uint32_t                                     Stream1Decl;
-   uint32_t                                     Stream0Decl;
-};
-
-static inline void
-GEN75_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN75_SO_DECL_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-   /* Struct  Stream3Decl: found SO_DECL */
-   /* Struct  Stream2Decl: found SO_DECL */
-   /* Struct  Stream1Decl: found SO_DECL */
-   /* Struct  Stream0Decl: found SO_DECL */
-      0;
-
-}
-
-struct GEN75_SO_DECL {
-   uint32_t                                     OutputBufferSlot;
-   uint32_t                                     HoleFlag;
-   uint32_t                                     RegisterIndex;
-   uint32_t                                     ComponentMask;
-};
-
-static inline void
-GEN75_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
-                 const struct GEN75_SO_DECL * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->OutputBufferSlot, 12, 13) |
-      __gen_field(values->HoleFlag, 11, 11) |
-      __gen_field(values->RegisterIndex, 4, 9) |
-      __gen_field(values->ComponentMask, 0, 3) |
-      0;
-
-}
-
 struct GEN75_SCISSOR_RECT {
    uint32_t                                     ScissorRectangleYMin;
    uint32_t                                     ScissorRectangleXMin;
@@ -7251,22 +7337,6 @@ GEN75_DEPTH_STENCIL_STATE_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN75_MEMORY_OBJECT_CONTROL_STATE {
-   uint32_t                                     L3CacheabilityControlL3CC;
-};
-
-static inline void
-GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
-                                     const struct GEN75_MEMORY_OBJECT_CONTROL_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->L3CacheabilityControlL3CC, 0, 0) |
-      0;
-
-}
-
 struct GEN75_VEB_DI_IECP_COMMAND_SURFACE_CONTROL_BITS {
 #define     Highestpriority                                    0
 #define     Secondhighestpriority                              1
@@ -7379,28 +7449,6 @@ GEN75_INTERFACE_DESCRIPTOR_DATA_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN75_PALETTE_ENTRY {
-   uint32_t                                     Alpha;
-   uint32_t                                     Red;
-   uint32_t                                     Green;
-   uint32_t                                     Blue;
-};
-
-static inline void
-GEN75_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN75_PALETTE_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->Alpha, 24, 31) |
-      __gen_field(values->Red, 16, 23) |
-      __gen_field(values->Green, 8, 15) |
-      __gen_field(values->Blue, 0, 7) |
-      0;
-
-}
-
 struct GEN75_RENDER_SURFACE_STATE {
 #define     SURFTYPE_1D                                        0
 #define     SURFTYPE_2D                                        1
@@ -7454,7 +7502,7 @@ struct GEN75_RENDER_SURFACE_STATE {
    uint32_t                                     MinimumArrayElement0;
    uint32_t                                     XOffset;
    uint32_t                                     YOffset;
-   uint32_t                                     SurfaceObjectControlState;
+   struct GEN75_MEMORY_OBJECT_CONTROL_STATE     SurfaceObjectControlState;
    uint32_t                                     SurfaceMinLOD;
    uint32_t                                     MIPCountLOD;
    __gen_address_type                           MCSBaseAddress;
@@ -7527,10 +7575,13 @@ GEN75_RENDER_SURFACE_STATE_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->MinimumArrayElement, 0, 26) |
       0;
 
+   uint32_t dw_SurfaceObjectControlState;
+   GEN75_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceObjectControlState, &values->SurfaceObjectControlState);
    dw[5] =
       __gen_offset(values->XOffset, 25, 31) |
       __gen_offset(values->YOffset, 20, 23) |
-   /* Struct  SurfaceObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceObjectControlState (16..19): */
+      __gen_field(dw_SurfaceObjectControlState, 16, 19) |
       __gen_field(values->SurfaceMinLOD, 4, 7) |
       __gen_field(values->MIPCountLOD, 0, 3) |
       0;
index ef56e97539d98875027272e20c029aa530d958c5..d13d92e39988f4bf4af40a97a039575b81cf3a48 100644 (file)
@@ -206,6 +206,26 @@ GEN7_PIPELINE_SELECT_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  =  1,                  \
    .DwordLength          =  8
 
+struct GEN7_MEMORY_OBJECT_CONTROL_STATE {
+   uint32_t                                     GraphicsDataTypeGFDT;
+   uint32_t                                     LLCCacheabilityControlLLCCC;
+   uint32_t                                     L3CacheabilityControlL3CC;
+};
+
+static inline void
+GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
+                                     const struct GEN7_MEMORY_OBJECT_CONTROL_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->GraphicsDataTypeGFDT, 2, 2) |
+      __gen_field(values->LLCCacheabilityControlLLCCC, 1, 1) |
+      __gen_field(values->L3CacheabilityControlL3CC, 0, 0) |
+      0;
+
+}
+
 struct GEN7_STATE_BASE_ADDRESS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -213,21 +233,21 @@ struct GEN7_STATE_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           GeneralStateBaseAddress;
-   uint32_t                                     GeneralStateMemoryObjectControlState;
-   uint32_t                                     StatelessDataPortAccessMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      GeneralStateMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      StatelessDataPortAccessMemoryObjectControlState;
    uint32_t                                     StatelessDataPortAccessForceWriteThru;
    uint32_t                                     GeneralStateBaseAddressModifyEnable;
    __gen_address_type                           SurfaceStateBaseAddress;
-   uint32_t                                     SurfaceStateMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      SurfaceStateMemoryObjectControlState;
    uint32_t                                     SurfaceStateBaseAddressModifyEnable;
    __gen_address_type                           DynamicStateBaseAddress;
-   uint32_t                                     DynamicStateMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      DynamicStateMemoryObjectControlState;
    uint32_t                                     DynamicStateBaseAddressModifyEnable;
    __gen_address_type                           IndirectObjectBaseAddress;
-   uint32_t                                     IndirectObjectMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      IndirectObjectMemoryObjectControlState;
    uint32_t                                     IndirectObjectBaseAddressModifyEnable;
    __gen_address_type                           InstructionBaseAddress;
-   uint32_t                                     InstructionMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      InstructionMemoryObjectControlState;
    uint32_t                                     InstructionBaseAddressModifyEnable;
    __gen_address_type                           GeneralStateAccessUpperBound;
    uint32_t                                     GeneralStateAccessUpperBoundModifyEnable;
@@ -253,9 +273,15 @@ GEN7_STATE_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_GeneralStateMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_GeneralStateMemoryObjectControlState, &values->GeneralStateMemoryObjectControlState);
+   uint32_t dw_StatelessDataPortAccessMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StatelessDataPortAccessMemoryObjectControlState, &values->StatelessDataPortAccessMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  GeneralStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-   /* Struct  StatelessDataPortAccessMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  GeneralStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_GeneralStateMemoryObjectControlState, 8, 11) |
+      /* Struct  StatelessDataPortAccessMemoryObjectControlState (4..7): */
+      __gen_field(dw_StatelessDataPortAccessMemoryObjectControlState, 4, 7) |
       __gen_field(values->StatelessDataPortAccessForceWriteThru, 3, 3) |
       __gen_field(values->GeneralStateBaseAddressModifyEnable, 0, 0) |
       0;
@@ -263,32 +289,44 @@ GEN7_STATE_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
    dw[1] =
       __gen_combine_address(data, &dw[1], values->GeneralStateBaseAddress, dw1);
 
+   uint32_t dw_SurfaceStateMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceStateMemoryObjectControlState, &values->SurfaceStateMemoryObjectControlState);
    uint32_t dw2 =
-   /* Struct  SurfaceStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_SurfaceStateMemoryObjectControlState, 8, 11) |
       __gen_field(values->SurfaceStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[2] =
       __gen_combine_address(data, &dw[2], values->SurfaceStateBaseAddress, dw2);
 
+   uint32_t dw_DynamicStateMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DynamicStateMemoryObjectControlState, &values->DynamicStateMemoryObjectControlState);
    uint32_t dw3 =
-   /* Struct  DynamicStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DynamicStateMemoryObjectControlState (8..11): */
+      __gen_field(dw_DynamicStateMemoryObjectControlState, 8, 11) |
       __gen_field(values->DynamicStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[3] =
       __gen_combine_address(data, &dw[3], values->DynamicStateBaseAddress, dw3);
 
+   uint32_t dw_IndirectObjectMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_IndirectObjectMemoryObjectControlState, &values->IndirectObjectMemoryObjectControlState);
    uint32_t dw4 =
-   /* Struct  IndirectObjectMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  IndirectObjectMemoryObjectControlState (8..11): */
+      __gen_field(dw_IndirectObjectMemoryObjectControlState, 8, 11) |
       __gen_field(values->IndirectObjectBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[4] =
       __gen_combine_address(data, &dw[4], values->IndirectObjectBaseAddress, dw4);
 
+   uint32_t dw_InstructionMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_InstructionMemoryObjectControlState, &values->InstructionMemoryObjectControlState);
    uint32_t dw5 =
-   /* Struct  InstructionMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  InstructionMemoryObjectControlState (8..11): */
+      __gen_field(dw_InstructionMemoryObjectControlState, 8, 11) |
       __gen_field(values->InstructionBaseAddressModifyEnable, 0, 0) |
       0;
 
@@ -421,7 +459,7 @@ struct GEN7_SWTESS_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           SWTessellationBaseAddress;
-   uint32_t                                     SWTessellationMemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      SWTessellationMemoryObjectControlState;
 };
 
 static inline void
@@ -438,8 +476,11 @@ GEN7_SWTESS_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SWTessellationMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SWTessellationMemoryObjectControlState, &values->SWTessellationMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  SWTessellationMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SWTessellationMemoryObjectControlState (8..11): */
+      __gen_field(dw_SWTessellationMemoryObjectControlState, 8, 11) |
       0;
 
    dw[1] =
@@ -1035,13 +1076,71 @@ GEN7_3DSTATE_CLIP_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  = 26,                  \
    .DwordLength          =  5
 
+struct GEN7_3DSTATE_CONSTANT_BODY {
+   uint32_t                                     ConstantBuffer1ReadLength;
+   uint32_t                                     ConstantBuffer0ReadLength;
+   uint32_t                                     ConstantBuffer3ReadLength;
+   uint32_t                                     ConstantBuffer2ReadLength;
+   __gen_address_type                           PointerToConstantBuffer0;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
+   __gen_address_type                           PointerToConstantBuffer1;
+   __gen_address_type                           PointerToConstantBuffer2;
+   __gen_address_type                           PointerToConstantBuffer3;
+};
+
+static inline void
+GEN7_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
+                               const struct GEN7_3DSTATE_CONSTANT_BODY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
+      0;
+
+   dw[1] =
+      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
+      0;
+
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
+   uint32_t dw2 =
+      /* Struct  ConstantBufferObjectControlState (0..4): */
+      __gen_field(dw_ConstantBufferObjectControlState, 0, 4) |
+      0;
+
+   dw[2] =
+      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
+
+   uint32_t dw3 =
+      0;
+
+   dw[3] =
+      __gen_combine_address(data, &dw[3], values->PointerToConstantBuffer1, dw3);
+
+   uint32_t dw4 =
+      0;
+
+   dw[4] =
+      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer2, dw4);
+
+   uint32_t dw5 =
+      0;
+
+   dw[5] =
+      __gen_combine_address(data, &dw[5], values->PointerToConstantBuffer3, dw5);
+
+}
+
 struct GEN7_3DSTATE_CONSTANT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN7_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1058,10 +1157,7 @@ GEN7_3DSTATE_CONSTANT_DS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN7_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN7_3DSTATE_CONSTANT_GS_length 0x00000007
@@ -1079,7 +1175,7 @@ struct GEN7_3DSTATE_CONSTANT_GS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN7_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1096,10 +1192,7 @@ GEN7_3DSTATE_CONSTANT_GS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN7_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN7_3DSTATE_CONSTANT_HS_length 0x00000007
@@ -1117,7 +1210,7 @@ struct GEN7_3DSTATE_CONSTANT_HS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN7_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1134,10 +1227,7 @@ GEN7_3DSTATE_CONSTANT_HS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN7_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN7_3DSTATE_CONSTANT_PS_length 0x00000007
@@ -1155,7 +1245,7 @@ struct GEN7_3DSTATE_CONSTANT_PS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN7_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1172,10 +1262,7 @@ GEN7_3DSTATE_CONSTANT_PS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN7_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN7_3DSTATE_CONSTANT_VS_length 0x00000007
@@ -1193,7 +1280,7 @@ struct GEN7_3DSTATE_CONSTANT_VS {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN7_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1210,10 +1297,7 @@ GEN7_3DSTATE_CONSTANT_VS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN7_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN7_3DSTATE_DEPTH_BUFFER_length 0x00000007
@@ -1252,7 +1336,7 @@ struct GEN7_3DSTATE_DEPTH_BUFFER {
 #define     SURFTYPE_CUBEmustbezero                            0
    uint32_t                                     Depth;
    uint32_t                                     MinimumArrayElement;
-   uint32_t                                     DepthBufferObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      DepthBufferObjectControlState;
    uint32_t                                     DepthCoordinateOffsetY;
    uint32_t                                     DepthCoordinateOffsetX;
    uint32_t                                     RenderTargetViewExtent;
@@ -1293,10 +1377,13 @@ GEN7_3DSTATE_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->LOD, 0, 3) |
       0;
 
+   uint32_t dw_DepthBufferObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DepthBufferObjectControlState, &values->DepthBufferObjectControlState);
    dw[4] =
       __gen_field(values->Depth, 21, 31) |
       __gen_field(values->MinimumArrayElement, 10, 20) |
-   /* Struct  DepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DepthBufferObjectControlState (0..3): */
+      __gen_field(dw_DepthBufferObjectControlState, 0, 3) |
       0;
 
    dw[5] =
@@ -1643,7 +1730,7 @@ struct GEN7_3DSTATE_HIER_DEPTH_BUFFER {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     HierarchicalDepthBufferObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      HierarchicalDepthBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
 };
@@ -1662,8 +1749,11 @@ GEN7_3DSTATE_HIER_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_HierarchicalDepthBufferObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_HierarchicalDepthBufferObjectControlState, &values->HierarchicalDepthBufferObjectControlState);
    dw[1] =
-   /* Struct  HierarchicalDepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  HierarchicalDepthBufferObjectControlState (25..28): */
+      __gen_field(dw_HierarchicalDepthBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -1787,7 +1877,7 @@ struct GEN7_3DSTATE_INDEX_BUFFER {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      MemoryObjectControlState;
    uint32_t                                     CutIndexEnable;
 #define     INDEX_BYTE                                         0
 #define     INDEX_WORD                                         1
@@ -1804,12 +1894,15 @@ GEN7_3DSTATE_INDEX_BUFFER_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (12..15): */
+      __gen_field(dw_MemoryObjectControlState, 12, 15) |
       __gen_field(values->CutIndexEnable, 10, 10) |
       __gen_field(values->IndexFormat, 8, 9) |
       __gen_field(values->DwordLength, 0, 7) |
@@ -2425,6 +2518,28 @@ GEN7_3DSTATE_PUSH_CONSTANT_ALLOC_VS_pack(__gen_user_data *data, void * restrict
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  =  2
 
+struct GEN7_PALETTE_ENTRY {
+   uint32_t                                     Alpha;
+   uint32_t                                     Red;
+   uint32_t                                     Green;
+   uint32_t                                     Blue;
+};
+
+static inline void
+GEN7_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN7_PALETTE_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->Alpha, 24, 31) |
+      __gen_field(values->Red, 16, 23) |
+      __gen_field(values->Green, 8, 15) |
+      __gen_field(values->Blue, 0, 7) |
+      0;
+
+}
+
 struct GEN7_3DSTATE_SAMPLER_PALETTE_LOAD0 {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -3040,7 +3155,7 @@ struct GEN7_3DSTATE_SO_BUFFER {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    uint32_t                                     SOBufferIndex;
-   uint32_t                                     SOBufferObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      SOBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
    __gen_address_type                           SurfaceEndAddress;
@@ -3060,9 +3175,12 @@ GEN7_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SOBufferObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SOBufferObjectControlState, &values->SOBufferObjectControlState);
    dw[1] =
       __gen_field(values->SOBufferIndex, 29, 30) |
-   /* Struct  SOBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SOBufferObjectControlState (25..28): */
+      __gen_field(dw_SOBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 11) |
       0;
 
@@ -3087,6 +3205,63 @@ GEN7_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  = 23
 
+struct GEN7_SO_DECL {
+   uint32_t                                     OutputBufferSlot;
+   uint32_t                                     HoleFlag;
+   uint32_t                                     RegisterIndex;
+   uint32_t                                     ComponentMask;
+};
+
+static inline void
+GEN7_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
+                 const struct GEN7_SO_DECL * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->OutputBufferSlot, 12, 13) |
+      __gen_field(values->HoleFlag, 11, 11) |
+      __gen_field(values->RegisterIndex, 4, 9) |
+      __gen_field(values->ComponentMask, 0, 3) |
+      0;
+
+}
+
+struct GEN7_SO_DECL_ENTRY {
+   struct GEN7_SO_DECL                          Stream3Decl;
+   struct GEN7_SO_DECL                          Stream2Decl;
+   struct GEN7_SO_DECL                          Stream1Decl;
+   struct GEN7_SO_DECL                          Stream0Decl;
+};
+
+static inline void
+GEN7_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN7_SO_DECL_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_Stream3Decl;
+   GEN7_SO_DECL_pack(data, &dw_Stream3Decl, &values->Stream3Decl);
+   uint32_t dw_Stream2Decl;
+   GEN7_SO_DECL_pack(data, &dw_Stream2Decl, &values->Stream2Decl);
+   uint32_t dw_Stream1Decl;
+   GEN7_SO_DECL_pack(data, &dw_Stream1Decl, &values->Stream1Decl);
+   uint32_t dw_Stream0Decl;
+   GEN7_SO_DECL_pack(data, &dw_Stream0Decl, &values->Stream0Decl);
+   dw[0] =
+      /* Struct  Stream3Decl (48..63): */
+      __gen_field(dw_Stream3Decl, 48, 63) |
+      /* Struct  Stream2Decl (32..47): */
+      __gen_field(dw_Stream2Decl, 32, 47) |
+      /* Struct  Stream1Decl (16..31): */
+      __gen_field(dw_Stream1Decl, 16, 31) |
+      /* Struct  Stream0Decl (0..15): */
+      __gen_field(dw_Stream0Decl, 0, 15) |
+      0;
+
+   GEN7_SO_DECL_pack(data, &dw[0], &values->Stream0Decl);
+}
+
 struct GEN7_3DSTATE_SO_DECL_LIST {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -3150,7 +3325,7 @@ struct GEN7_3DSTATE_STENCIL_BUFFER {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     StencilBufferObjectControlState;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      StencilBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
 };
@@ -3169,8 +3344,11 @@ GEN7_3DSTATE_STENCIL_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_StencilBufferObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StencilBufferObjectControlState, &values->StencilBufferObjectControlState);
    dw[1] =
-   /* Struct  StencilBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  StencilBufferObjectControlState (25..28): */
+      __gen_field(dw_StencilBufferObjectControlState, 25, 28) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -3458,6 +3636,58 @@ GEN7_3DSTATE_URB_HS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  8
 
+struct GEN7_VERTEX_BUFFER_STATE {
+   uint32_t                                     VertexBufferIndex;
+#define     VERTEXDATA                                         0
+#define     INSTANCEDATA                                       1
+   uint32_t                                     BufferAccessType;
+   struct GEN7_MEMORY_OBJECT_CONTROL_STATE      VertexBufferMemoryObjectControlState;
+   uint32_t                                     AddressModifyEnable;
+   uint32_t                                     NullVertexBuffer;
+   uint32_t                                     VertexFetchInvalidate;
+   uint32_t                                     BufferPitch;
+   __gen_address_type                           BufferStartingAddress;
+   __gen_address_type                           EndAddress;
+   uint32_t                                     InstanceDataStepRate;
+};
+
+static inline void
+GEN7_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
+                             const struct GEN7_VERTEX_BUFFER_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_VertexBufferMemoryObjectControlState;
+   GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_VertexBufferMemoryObjectControlState, &values->VertexBufferMemoryObjectControlState);
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      __gen_field(values->BufferAccessType, 20, 20) |
+      /* Struct  VertexBufferMemoryObjectControlState (16..19): */
+      __gen_field(dw_VertexBufferMemoryObjectControlState, 16, 19) |
+      __gen_field(values->AddressModifyEnable, 14, 14) |
+      __gen_field(values->NullVertexBuffer, 13, 13) |
+      __gen_field(values->VertexFetchInvalidate, 12, 12) |
+      __gen_field(values->BufferPitch, 0, 11) |
+      0;
+
+   uint32_t dw1 =
+      0;
+
+   dw[1] =
+      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
+
+   uint32_t dw2 =
+      0;
+
+   dw[2] =
+      __gen_combine_address(data, &dw[2], values->EndAddress, dw2);
+
+   dw[3] =
+      __gen_field(values->InstanceDataStepRate, 0, 31) |
+      0;
+
+}
+
 struct GEN7_3DSTATE_VERTEX_BUFFERS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -3491,6 +3721,41 @@ GEN7_3DSTATE_VERTEX_BUFFERS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  9
 
+struct GEN7_VERTEX_ELEMENT_STATE {
+   uint32_t                                     VertexBufferIndex;
+   uint32_t                                     Valid;
+   uint32_t                                     SourceElementFormat;
+   uint32_t                                     EdgeFlagEnable;
+   uint32_t                                     SourceElementOffset;
+   uint32_t                                     Component0Control;
+   uint32_t                                     Component1Control;
+   uint32_t                                     Component2Control;
+   uint32_t                                     Component3Control;
+};
+
+static inline void
+GEN7_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
+                              const struct GEN7_VERTEX_ELEMENT_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      __gen_field(values->Valid, 25, 25) |
+      __gen_field(values->SourceElementFormat, 16, 24) |
+      __gen_field(values->EdgeFlagEnable, 15, 15) |
+      __gen_field(values->SourceElementOffset, 0, 11) |
+      0;
+
+   dw[1] =
+      __gen_field(values->Component0Control, 28, 30) |
+      __gen_field(values->Component1Control, 24, 26) |
+      __gen_field(values->Component2Control, 20, 22) |
+      __gen_field(values->Component3Control, 16, 18) |
+      0;
+
+}
+
 struct GEN7_3DSTATE_VERTEX_ELEMENTS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -5443,189 +5708,6 @@ GEN7_PIPE_CONTROL_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN7_3DSTATE_CONSTANT_BODY {
-   uint32_t                                     ConstantBuffer1ReadLength;
-   uint32_t                                     ConstantBuffer0ReadLength;
-   uint32_t                                     ConstantBuffer3ReadLength;
-   uint32_t                                     ConstantBuffer2ReadLength;
-   __gen_address_type                           PointerToConstantBuffer0;
-   uint32_t                                     ConstantBufferObjectControlState;
-   __gen_address_type                           PointerToConstantBuffer1;
-   __gen_address_type                           PointerToConstantBuffer2;
-   __gen_address_type                           PointerToConstantBuffer3;
-};
-
-static inline void
-GEN7_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
-                               const struct GEN7_3DSTATE_CONSTANT_BODY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
-      0;
-
-   dw[1] =
-      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
-      0;
-
-   uint32_t dw2 =
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-      0;
-
-   dw[2] =
-      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
-
-   uint32_t dw3 =
-      0;
-
-   dw[3] =
-      __gen_combine_address(data, &dw[3], values->PointerToConstantBuffer1, dw3);
-
-   uint32_t dw4 =
-      0;
-
-   dw[4] =
-      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer2, dw4);
-
-   uint32_t dw5 =
-      0;
-
-   dw[5] =
-      __gen_combine_address(data, &dw[5], values->PointerToConstantBuffer3, dw5);
-
-}
-
-struct GEN7_VERTEX_BUFFER_STATE {
-   uint32_t                                     VertexBufferIndex;
-#define     VERTEXDATA                                         0
-#define     INSTANCEDATA                                       1
-   uint32_t                                     BufferAccessType;
-   uint32_t                                     VertexBufferMemoryObjectControlState;
-   uint32_t                                     AddressModifyEnable;
-   uint32_t                                     NullVertexBuffer;
-   uint32_t                                     VertexFetchInvalidate;
-   uint32_t                                     BufferPitch;
-   __gen_address_type                           BufferStartingAddress;
-   __gen_address_type                           EndAddress;
-   uint32_t                                     InstanceDataStepRate;
-};
-
-static inline void
-GEN7_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
-                             const struct GEN7_VERTEX_BUFFER_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-      __gen_field(values->BufferAccessType, 20, 20) |
-   /* Struct  VertexBufferMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-      __gen_field(values->AddressModifyEnable, 14, 14) |
-      __gen_field(values->NullVertexBuffer, 13, 13) |
-      __gen_field(values->VertexFetchInvalidate, 12, 12) |
-      __gen_field(values->BufferPitch, 0, 11) |
-      0;
-
-   uint32_t dw1 =
-      0;
-
-   dw[1] =
-      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
-
-   uint32_t dw2 =
-      0;
-
-   dw[2] =
-      __gen_combine_address(data, &dw[2], values->EndAddress, dw2);
-
-   dw[3] =
-      __gen_field(values->InstanceDataStepRate, 0, 31) |
-      0;
-
-}
-
-struct GEN7_VERTEX_ELEMENT_STATE {
-   uint32_t                                     VertexBufferIndex;
-   uint32_t                                     Valid;
-   uint32_t                                     SourceElementFormat;
-   uint32_t                                     EdgeFlagEnable;
-   uint32_t                                     SourceElementOffset;
-   uint32_t                                     Component0Control;
-   uint32_t                                     Component1Control;
-   uint32_t                                     Component2Control;
-   uint32_t                                     Component3Control;
-};
-
-static inline void
-GEN7_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
-                              const struct GEN7_VERTEX_ELEMENT_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-      __gen_field(values->Valid, 25, 25) |
-      __gen_field(values->SourceElementFormat, 16, 24) |
-      __gen_field(values->EdgeFlagEnable, 15, 15) |
-      __gen_field(values->SourceElementOffset, 0, 11) |
-      0;
-
-   dw[1] =
-      __gen_field(values->Component0Control, 28, 30) |
-      __gen_field(values->Component1Control, 24, 26) |
-      __gen_field(values->Component2Control, 20, 22) |
-      __gen_field(values->Component3Control, 16, 18) |
-      0;
-
-}
-
-struct GEN7_SO_DECL_ENTRY {
-   uint32_t                                     Stream3Decl;
-   uint32_t                                     Stream2Decl;
-   uint32_t                                     Stream1Decl;
-   uint32_t                                     Stream0Decl;
-};
-
-static inline void
-GEN7_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN7_SO_DECL_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-   /* Struct  Stream3Decl: found SO_DECL */
-   /* Struct  Stream2Decl: found SO_DECL */
-   /* Struct  Stream1Decl: found SO_DECL */
-   /* Struct  Stream0Decl: found SO_DECL */
-      0;
-
-}
-
-struct GEN7_SO_DECL {
-   uint32_t                                     OutputBufferSlot;
-   uint32_t                                     HoleFlag;
-   uint32_t                                     RegisterIndex;
-   uint32_t                                     ComponentMask;
-};
-
-static inline void
-GEN7_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
-                 const struct GEN7_SO_DECL * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->OutputBufferSlot, 12, 13) |
-      __gen_field(values->HoleFlag, 11, 11) |
-      __gen_field(values->RegisterIndex, 4, 9) |
-      __gen_field(values->ComponentMask, 0, 3) |
-      0;
-
-}
-
 struct GEN7_SCISSOR_RECT {
    uint32_t                                     ScissorRectangleYMin;
    uint32_t                                     ScissorRectangleXMin;
@@ -6014,26 +6096,6 @@ GEN7_DEPTH_STENCIL_STATE_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN7_MEMORY_OBJECT_CONTROL_STATE {
-   uint32_t                                     GraphicsDataTypeGFDT;
-   uint32_t                                     LLCCacheabilityControlLLCCC;
-   uint32_t                                     L3CacheabilityControlL3CC;
-};
-
-static inline void
-GEN7_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
-                                     const struct GEN7_MEMORY_OBJECT_CONTROL_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->GraphicsDataTypeGFDT, 2, 2) |
-      __gen_field(values->LLCCacheabilityControlLLCCC, 1, 1) |
-      __gen_field(values->L3CacheabilityControlL3CC, 0, 0) |
-      0;
-
-}
-
 struct GEN7_INTERFACE_DESCRIPTOR_DATA {
    uint32_t                                     KernelStartPointer;
 #define     Multiple                                           0
@@ -6118,28 +6180,6 @@ GEN7_INTERFACE_DESCRIPTOR_DATA_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN7_PALETTE_ENTRY {
-   uint32_t                                     Alpha;
-   uint32_t                                     Red;
-   uint32_t                                     Green;
-   uint32_t                                     Blue;
-};
-
-static inline void
-GEN7_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN7_PALETTE_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->Alpha, 24, 31) |
-      __gen_field(values->Red, 16, 23) |
-      __gen_field(values->Green, 8, 15) |
-      __gen_field(values->Blue, 0, 7) |
-      0;
-
-}
-
 struct GEN7_SAMPLER_BORDER_COLOR_STATE {
    uint32_t                                     BorderColorRedDX100GL;
    uint32_t                                     BorderColorAlpha;
index 68dcf34c4939fd37b43ac314ddfa5b6d0f695aad..844b0ce6aed230ab5aec6f06360ccedbc65a5773 100644 (file)
@@ -591,6 +591,34 @@ GEN8_PIPELINE_SELECT_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  =  1,                  \
    .DwordLength          = 14
 
+struct GEN8_MEMORY_OBJECT_CONTROL_STATE {
+#define     UCwithFenceifcoherentcycle                         0
+#define     UCUncacheable                                      1
+#define     WT                                                 2
+#define     WB                                                 3
+   uint32_t                                     MemoryTypeLLCeLLCCacheabilityControl;
+#define     eLLCOnlywheneDRAMispresentelsegetsallocatedinLLC       0
+#define     LLCOnly                                            1
+#define     LLCeLLCAllowed                                     2
+#define     L3DefertoPATforLLCeLLCselection                    3
+   uint32_t                                     TargetCache;
+   uint32_t                                     AgeforQUADLRU;
+};
+
+static inline void
+GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
+                                     const struct GEN8_MEMORY_OBJECT_CONTROL_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->MemoryTypeLLCeLLCCacheabilityControl, 5, 6) |
+      __gen_field(values->TargetCache, 3, 4) |
+      __gen_field(values->AgeforQUADLRU, 0, 1) |
+      0;
+
+}
+
 struct GEN8_STATE_BASE_ADDRESS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -598,20 +626,20 @@ struct GEN8_STATE_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           GeneralStateBaseAddress;
-   uint32_t                                     GeneralStateMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      GeneralStateMemoryObjectControlState;
    uint32_t                                     GeneralStateBaseAddressModifyEnable;
-   uint32_t                                     StatelessDataPortAccessMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      StatelessDataPortAccessMemoryObjectControlState;
    __gen_address_type                           SurfaceStateBaseAddress;
-   uint32_t                                     SurfaceStateMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      SurfaceStateMemoryObjectControlState;
    uint32_t                                     SurfaceStateBaseAddressModifyEnable;
    __gen_address_type                           DynamicStateBaseAddress;
-   uint32_t                                     DynamicStateMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      DynamicStateMemoryObjectControlState;
    uint32_t                                     DynamicStateBaseAddressModifyEnable;
    __gen_address_type                           IndirectObjectBaseAddress;
-   uint32_t                                     IndirectObjectMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      IndirectObjectMemoryObjectControlState;
    uint32_t                                     IndirectObjectBaseAddressModifyEnable;
    __gen_address_type                           InstructionBaseAddress;
-   uint32_t                                     InstructionMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      InstructionMemoryObjectControlState;
    uint32_t                                     InstructionBaseAddressModifyEnable;
    uint32_t                                     GeneralStateBufferSize;
    uint32_t                                     GeneralStateBufferSizeModifyEnable;
@@ -637,44 +665,62 @@ GEN8_STATE_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_GeneralStateMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_GeneralStateMemoryObjectControlState, &values->GeneralStateMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  GeneralStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  GeneralStateMemoryObjectControlState (4..10): */
+      __gen_field(dw_GeneralStateMemoryObjectControlState, 4, 10) |
       __gen_field(values->GeneralStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[1] =
       __gen_combine_address(data, &dw[1], values->GeneralStateBaseAddress, dw1);
 
+   uint32_t dw_StatelessDataPortAccessMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StatelessDataPortAccessMemoryObjectControlState, &values->StatelessDataPortAccessMemoryObjectControlState);
    dw[3] =
-   /* Struct  StatelessDataPortAccessMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  StatelessDataPortAccessMemoryObjectControlState (16..22): */
+      __gen_field(dw_StatelessDataPortAccessMemoryObjectControlState, 16, 22) |
       0;
 
+   uint32_t dw_SurfaceStateMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceStateMemoryObjectControlState, &values->SurfaceStateMemoryObjectControlState);
    uint32_t dw4 =
-   /* Struct  SurfaceStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceStateMemoryObjectControlState (4..10): */
+      __gen_field(dw_SurfaceStateMemoryObjectControlState, 4, 10) |
       __gen_field(values->SurfaceStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[4] =
       __gen_combine_address(data, &dw[4], values->SurfaceStateBaseAddress, dw4);
 
+   uint32_t dw_DynamicStateMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DynamicStateMemoryObjectControlState, &values->DynamicStateMemoryObjectControlState);
    uint32_t dw6 =
-   /* Struct  DynamicStateMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DynamicStateMemoryObjectControlState (4..10): */
+      __gen_field(dw_DynamicStateMemoryObjectControlState, 4, 10) |
       __gen_field(values->DynamicStateBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[6] =
       __gen_combine_address(data, &dw[6], values->DynamicStateBaseAddress, dw6);
 
+   uint32_t dw_IndirectObjectMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_IndirectObjectMemoryObjectControlState, &values->IndirectObjectMemoryObjectControlState);
    uint32_t dw8 =
-   /* Struct  IndirectObjectMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  IndirectObjectMemoryObjectControlState (4..10): */
+      __gen_field(dw_IndirectObjectMemoryObjectControlState, 4, 10) |
       __gen_field(values->IndirectObjectBaseAddressModifyEnable, 0, 0) |
       0;
 
    dw[8] =
       __gen_combine_address(data, &dw[8], values->IndirectObjectBaseAddress, dw8);
 
+   uint32_t dw_InstructionMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_InstructionMemoryObjectControlState, &values->InstructionMemoryObjectControlState);
    uint32_t dw10 =
-   /* Struct  InstructionMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  InstructionMemoryObjectControlState (4..10): */
+      __gen_field(dw_InstructionMemoryObjectControlState, 4, 10) |
       __gen_field(values->InstructionBaseAddressModifyEnable, 0, 0) |
       0;
 
@@ -799,7 +845,7 @@ struct GEN8_SWTESS_BASE_ADDRESS {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    __gen_address_type                           SWTessellationBaseAddress;
-   uint32_t                                     SWTessellationMemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      SWTessellationMemoryObjectControlState;
    __gen_address_type                           SWTessellationBaseAddressHigh;
 };
 
@@ -817,8 +863,11 @@ GEN8_SWTESS_BASE_ADDRESS_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SWTessellationMemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SWTessellationMemoryObjectControlState, &values->SWTessellationMemoryObjectControlState);
    uint32_t dw1 =
-   /* Struct  SWTessellationMemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SWTessellationMemoryObjectControlState (8..11): */
+      __gen_field(dw_SWTessellationMemoryObjectControlState, 8, 11) |
       0;
 
    dw[1] =
@@ -969,6 +1018,24 @@ GEN8_3DSTATE_AA_LINE_PARAMETERS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  = 70
 
+struct GEN8_BINDING_TABLE_EDIT_ENTRY {
+   uint32_t                                     BindingTableIndex;
+   uint32_t                                     SurfaceStatePointer;
+};
+
+static inline void
+GEN8_BINDING_TABLE_EDIT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                                  const struct GEN8_BINDING_TABLE_EDIT_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->BindingTableIndex, 16, 23) |
+      __gen_offset(values->SurfaceStatePointer, 0, 15) |
+      0;
+
+}
+
 struct GEN8_3DSTATE_BINDING_TABLE_EDIT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -1384,7 +1451,7 @@ struct GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC {
    uint32_t                                     DwordLength;
    __gen_address_type                           BindingTablePoolBaseAddress;
    uint32_t                                     BindingTablePoolEnable;
-   uint32_t                                     SurfaceObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      SurfaceObjectControlState;
 #define     NoValidData                                        0
    uint32_t                                     BindingTablePoolBufferSize;
 };
@@ -1403,9 +1470,12 @@ GEN8_3DSTATE_BINDING_TABLE_POOL_ALLOC_pack(__gen_user_data *data, void * restric
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SurfaceObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SurfaceObjectControlState, &values->SurfaceObjectControlState);
    uint32_t dw1 =
       __gen_field(values->BindingTablePoolEnable, 11, 11) |
-   /* Struct  SurfaceObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SurfaceObjectControlState (0..6): */
+      __gen_field(dw_SurfaceObjectControlState, 0, 6) |
       0;
 
    dw[1] =
@@ -1695,14 +1765,67 @@ GEN8_3DSTATE_CLIP_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  = 26,                  \
    .DwordLength          =  9
 
+struct GEN8_3DSTATE_CONSTANT_BODY {
+   uint32_t                                     ConstantBuffer1ReadLength;
+   uint32_t                                     ConstantBuffer0ReadLength;
+   uint32_t                                     ConstantBuffer3ReadLength;
+   uint32_t                                     ConstantBuffer2ReadLength;
+   __gen_address_type                           PointerToConstantBuffer0;
+   __gen_address_type                           PointerToConstantBuffer1;
+   __gen_address_type                           PointerToConstantBuffer2;
+   __gen_address_type                           PointerToConstantBuffer3;
+};
+
+static inline void
+GEN8_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
+                               const struct GEN8_3DSTATE_CONSTANT_BODY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
+      0;
+
+   dw[1] =
+      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
+      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
+      0;
+
+   uint32_t dw2 =
+      0;
+
+   dw[2] =
+      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
+
+   uint32_t dw4 =
+      0;
+
+   dw[4] =
+      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer1, dw4);
+
+   uint32_t dw6 =
+      0;
+
+   dw[6] =
+      __gen_combine_address(data, &dw[6], values->PointerToConstantBuffer2, dw6);
+
+   uint32_t dw8 =
+      0;
+
+   dw[8] =
+      __gen_combine_address(data, &dw[8], values->PointerToConstantBuffer3, dw8);
+
+}
+
 struct GEN8_3DSTATE_CONSTANT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     ConstantBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN8_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1711,19 +1834,19 @@ GEN8_3DSTATE_CONSTANT_DS_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  ConstantBufferObjectControlState (8..14): */
+      __gen_field(dw_ConstantBufferObjectControlState, 8, 14) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN8_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN8_3DSTATE_CONSTANT_GS_length 0x0000000b
@@ -1740,9 +1863,9 @@ struct GEN8_3DSTATE_CONSTANT_GS {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     ConstantBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN8_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1751,19 +1874,19 @@ GEN8_3DSTATE_CONSTANT_GS_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  ConstantBufferObjectControlState (8..14): */
+      __gen_field(dw_ConstantBufferObjectControlState, 8, 14) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN8_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN8_3DSTATE_CONSTANT_HS_length 0x0000000b
@@ -1780,9 +1903,9 @@ struct GEN8_3DSTATE_CONSTANT_HS {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     ConstantBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN8_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1791,19 +1914,19 @@ GEN8_3DSTATE_CONSTANT_HS_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  ConstantBufferObjectControlState (8..14): */
+      __gen_field(dw_ConstantBufferObjectControlState, 8, 14) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN8_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN8_3DSTATE_CONSTANT_PS_length 0x0000000b
@@ -1820,9 +1943,9 @@ struct GEN8_3DSTATE_CONSTANT_PS {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     ConstantBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN8_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1831,19 +1954,19 @@ GEN8_3DSTATE_CONSTANT_PS_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  ConstantBufferObjectControlState (8..14): */
+      __gen_field(dw_ConstantBufferObjectControlState, 8, 14) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN8_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN8_3DSTATE_CONSTANT_VS_length 0x0000000b
@@ -1860,9 +1983,9 @@ struct GEN8_3DSTATE_CONSTANT_VS {
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
-   uint32_t                                     ConstantBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      ConstantBufferObjectControlState;
    uint32_t                                     DwordLength;
-   uint32_t                                     ConstantBody;
+   struct GEN8_3DSTATE_CONSTANT_BODY            ConstantBody;
 };
 
 static inline void
@@ -1871,19 +1994,19 @@ GEN8_3DSTATE_CONSTANT_VS_pack(__gen_user_data *data, void * restrict dst,
 {
    uint32_t *dw = (uint32_t * restrict) dst;
 
+   uint32_t dw_ConstantBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_ConstantBufferObjectControlState, &values->ConstantBufferObjectControlState);
    dw[0] =
       __gen_field(values->CommandType, 29, 31) |
       __gen_field(values->CommandSubType, 27, 28) |
       __gen_field(values->_3DCommandOpcode, 24, 26) |
       __gen_field(values->_3DCommandSubOpcode, 16, 23) |
-   /* Struct  ConstantBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  ConstantBufferObjectControlState (8..14): */
+      __gen_field(dw_ConstantBufferObjectControlState, 8, 14) |
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
-   dw[1] =
-   /* Struct  ConstantBody: found 3DSTATE_CONSTANT(Body) */
-      0;
-
+   GEN8_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
 }
 
 #define GEN8_3DSTATE_DEPTH_BUFFER_length 0x00000008
@@ -1921,7 +2044,7 @@ struct GEN8_3DSTATE_DEPTH_BUFFER {
    uint32_t                                     LOD;
    uint32_t                                     Depth;
    uint32_t                                     MinimumArrayElement;
-   uint32_t                                     DepthBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      DepthBufferObjectControlState;
    uint32_t                                     RenderTargetViewExtent;
    uint32_t                                     SurfaceQPitch;
 };
@@ -1961,10 +2084,13 @@ GEN8_3DSTATE_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->LOD, 0, 3) |
       0;
 
+   uint32_t dw_DepthBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_DepthBufferObjectControlState, &values->DepthBufferObjectControlState);
    dw[5] =
       __gen_field(values->Depth, 21, 31) |
       __gen_field(values->MinimumArrayElement, 10, 20) |
-   /* Struct  DepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  DepthBufferObjectControlState (0..6): */
+      __gen_field(dw_DepthBufferObjectControlState, 0, 6) |
       0;
 
    dw[6] =
@@ -2157,6 +2283,26 @@ GEN8_3DSTATE_DS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  = 55
 
+struct GEN8_GATHER_CONSTANT_ENTRY {
+   uint32_t                                     ConstantBufferOffset;
+   uint32_t                                     ChannelMask;
+   uint32_t                                     BindingTableIndexOffset;
+};
+
+static inline void
+GEN8_GATHER_CONSTANT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                               const struct GEN8_GATHER_CONSTANT_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_offset(values->ConstantBufferOffset, 8, 15) |
+      __gen_field(values->ChannelMask, 4, 7) |
+      __gen_field(values->BindingTableIndexOffset, 0, 3) |
+      0;
+
+}
+
 struct GEN8_3DSTATE_GATHER_CONSTANT_DS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -2406,7 +2552,7 @@ struct GEN8_3DSTATE_GATHER_POOL_ALLOC {
    uint32_t                                     DwordLength;
    __gen_address_type                           GatherPoolBaseAddress;
    uint32_t                                     GatherPoolEnable;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      MemoryObjectControlState;
    uint32_t                                     GatherPoolBufferSize;
 };
 
@@ -2424,9 +2570,12 @@ GEN8_3DSTATE_GATHER_POOL_ALLOC_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    uint32_t dw1 =
       __gen_field(values->GatherPoolEnable, 11, 11) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (0..6): */
+      __gen_field(dw_MemoryObjectControlState, 0, 6) |
       0;
 
    dw[1] =
@@ -2604,7 +2753,7 @@ struct GEN8_3DSTATE_HIER_DEPTH_BUFFER {
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     HierarchicalDepthBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      HierarchicalDepthBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
    uint32_t                                     SurfaceQPitch;
@@ -2624,8 +2773,11 @@ GEN8_3DSTATE_HIER_DEPTH_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_HierarchicalDepthBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_HierarchicalDepthBufferObjectControlState, &values->HierarchicalDepthBufferObjectControlState);
    dw[1] =
-   /* Struct  HierarchicalDepthBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  HierarchicalDepthBufferObjectControlState (25..31): */
+      __gen_field(dw_HierarchicalDepthBufferObjectControlState, 25, 31) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -2762,7 +2914,7 @@ struct GEN8_3DSTATE_INDEX_BUFFER {
 #define     INDEX_WORD                                         1
 #define     INDEX_DWORD                                        2
    uint32_t                                     IndexFormat;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      MemoryObjectControlState;
    __gen_address_type                           BufferStartingAddress;
    uint32_t                                     BufferSize;
 };
@@ -2781,9 +2933,12 @@ GEN8_3DSTATE_INDEX_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    dw[1] =
       __gen_field(values->IndexFormat, 8, 9) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (0..6): */
+      __gen_field(dw_MemoryObjectControlState, 0, 6) |
       0;
 
    uint32_t dw2 =
@@ -3580,6 +3735,28 @@ GEN8_3DSTATE_RASTER_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  =  2
 
+struct GEN8_PALETTE_ENTRY {
+   uint32_t                                     Alpha;
+   uint32_t                                     Red;
+   uint32_t                                     Green;
+   uint32_t                                     Blue;
+};
+
+static inline void
+GEN8_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN8_PALETTE_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->Alpha, 24, 31) |
+      __gen_field(values->Red, 16, 23) |
+      __gen_field(values->Green, 8, 15) |
+      __gen_field(values->Blue, 0, 7) |
+      0;
+
+}
+
 struct GEN8_3DSTATE_SAMPLER_PALETTE_LOAD0 {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -4056,13 +4233,51 @@ GEN8_3DSTATE_SBE_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandSubOpcode  = 81,                  \
    .DwordLength          =  9
 
+struct GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL {
+   uint32_t                                     ComponentOverrideW;
+   uint32_t                                     ComponentOverrideZ;
+   uint32_t                                     ComponentOverrideY;
+   uint32_t                                     ComponentOverrideX;
+   uint32_t                                     SwizzleControlMode;
+#define     CONST_0000                                         0
+#define     CONST_0001_FLOAT                                   1
+#define     CONST_1111_FLOAT                                   2
+#define     PRIM_ID                                            3
+   uint32_t                                     ConstantSource;
+#define     INPUTATTR                                          0
+#define     INPUTATTR_FACING                                   1
+#define     INPUTATTR_W                                        2
+#define     INPUTATTR_FACING_W                                 3
+   uint32_t                                     SwizzleSelect;
+   uint32_t                                     SourceAttribute;
+};
+
+static inline void
+GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(__gen_user_data *data, void * restrict dst,
+                                    const struct GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->ComponentOverrideW, 15, 15) |
+      __gen_field(values->ComponentOverrideZ, 14, 14) |
+      __gen_field(values->ComponentOverrideY, 13, 13) |
+      __gen_field(values->ComponentOverrideX, 12, 12) |
+      __gen_field(values->SwizzleControlMode, 11, 11) |
+      __gen_field(values->ConstantSource, 9, 10) |
+      __gen_field(values->SwizzleSelect, 6, 7) |
+      __gen_field(values->SourceAttribute, 0, 4) |
+      0;
+
+}
+
 struct GEN8_3DSTATE_SBE_SWIZ {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
    uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
-   uint32_t                                     Attribute;
+   struct GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL       Attribute;
    uint32_t                                     Attribute15WrapShortestEnables;
    uint32_t                                     Attribute14WrapShortestEnables;
    uint32_t                                     Attribute13WrapShortestEnables;
@@ -4095,10 +4310,14 @@ GEN8_3DSTATE_SBE_SWIZ_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_Attribute;
+   GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &dw_Attribute, &values->Attribute);
    dw[1] =
-   /* Struct  Attribute: found SF_OUTPUT_ATTRIBUTE_DETAIL */
+      /* Struct  Attribute (0..15): */
+      __gen_field(dw_Attribute, 0, 15) |
       0;
 
+   GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &dw[1], &values->Attribute);
    dw[9] =
       __gen_field(values->Attribute15WrapShortestEnables, 60, 63) |
       __gen_field(values->Attribute14WrapShortestEnables, 56, 59) |
@@ -4252,7 +4471,7 @@ struct GEN8_3DSTATE_SO_BUFFER {
    uint32_t                                     DwordLength;
    uint32_t                                     SOBufferEnable;
    uint32_t                                     SOBufferIndex;
-   uint32_t                                     SOBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      SOBufferObjectControlState;
    uint32_t                                     StreamOffsetWriteEnable;
    uint32_t                                     StreamOutputBufferOffsetAddressEnable;
    __gen_address_type                           SurfaceBaseAddress;
@@ -4275,10 +4494,13 @@ GEN8_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_SOBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_SOBufferObjectControlState, &values->SOBufferObjectControlState);
    dw[1] =
       __gen_field(values->SOBufferEnable, 31, 31) |
       __gen_field(values->SOBufferIndex, 29, 30) |
-   /* Struct  SOBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  SOBufferObjectControlState (22..28): */
+      __gen_field(dw_SOBufferObjectControlState, 22, 28) |
       __gen_field(values->StreamOffsetWriteEnable, 21, 21) |
       __gen_field(values->StreamOutputBufferOffsetAddressEnable, 20, 20) |
       0;
@@ -4312,6 +4534,63 @@ GEN8_3DSTATE_SO_BUFFER_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  1,                  \
    ._3DCommandSubOpcode  = 23
 
+struct GEN8_SO_DECL {
+   uint32_t                                     OutputBufferSlot;
+   uint32_t                                     HoleFlag;
+   uint32_t                                     RegisterIndex;
+   uint32_t                                     ComponentMask;
+};
+
+static inline void
+GEN8_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
+                 const struct GEN8_SO_DECL * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->OutputBufferSlot, 12, 13) |
+      __gen_field(values->HoleFlag, 11, 11) |
+      __gen_field(values->RegisterIndex, 4, 9) |
+      __gen_field(values->ComponentMask, 0, 3) |
+      0;
+
+}
+
+struct GEN8_SO_DECL_ENTRY {
+   struct GEN8_SO_DECL                          Stream3Decl;
+   struct GEN8_SO_DECL                          Stream2Decl;
+   struct GEN8_SO_DECL                          Stream1Decl;
+   struct GEN8_SO_DECL                          Stream0Decl;
+};
+
+static inline void
+GEN8_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
+                       const struct GEN8_SO_DECL_ENTRY * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_Stream3Decl;
+   GEN8_SO_DECL_pack(data, &dw_Stream3Decl, &values->Stream3Decl);
+   uint32_t dw_Stream2Decl;
+   GEN8_SO_DECL_pack(data, &dw_Stream2Decl, &values->Stream2Decl);
+   uint32_t dw_Stream1Decl;
+   GEN8_SO_DECL_pack(data, &dw_Stream1Decl, &values->Stream1Decl);
+   uint32_t dw_Stream0Decl;
+   GEN8_SO_DECL_pack(data, &dw_Stream0Decl, &values->Stream0Decl);
+   dw[0] =
+      /* Struct  Stream3Decl (48..63): */
+      __gen_field(dw_Stream3Decl, 48, 63) |
+      /* Struct  Stream2Decl (32..47): */
+      __gen_field(dw_Stream2Decl, 32, 47) |
+      /* Struct  Stream1Decl (16..31): */
+      __gen_field(dw_Stream1Decl, 16, 31) |
+      /* Struct  Stream0Decl (0..15): */
+      __gen_field(dw_Stream0Decl, 0, 15) |
+      0;
+
+   GEN8_SO_DECL_pack(data, &dw[0], &values->Stream0Decl);
+}
+
 struct GEN8_3DSTATE_SO_DECL_LIST {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -4376,7 +4655,7 @@ struct GEN8_3DSTATE_STENCIL_BUFFER {
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    uint32_t                                     StencilBufferEnable;
-   uint32_t                                     StencilBufferObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      StencilBufferObjectControlState;
    uint32_t                                     SurfacePitch;
    __gen_address_type                           SurfaceBaseAddress;
    uint32_t                                     SurfaceQPitch;
@@ -4396,9 +4675,12 @@ GEN8_3DSTATE_STENCIL_BUFFER_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->DwordLength, 0, 7) |
       0;
 
+   uint32_t dw_StencilBufferObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_StencilBufferObjectControlState, &values->StencilBufferObjectControlState);
    dw[1] =
       __gen_field(values->StencilBufferEnable, 31, 31) |
-   /* Struct  StencilBufferObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  StencilBufferObjectControlState (22..28): */
+      __gen_field(dw_StencilBufferObjectControlState, 22, 28) |
       __gen_field(values->SurfacePitch, 0, 16) |
       0;
 
@@ -4702,6 +4984,45 @@ GEN8_3DSTATE_URB_HS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  8
 
+struct GEN8_VERTEX_BUFFER_STATE {
+   uint32_t                                     VertexBufferIndex;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      MemoryObjectControlState;
+   uint32_t                                     AddressModifyEnable;
+   uint32_t                                     NullVertexBuffer;
+   uint32_t                                     BufferPitch;
+   __gen_address_type                           BufferStartingAddress;
+   uint32_t                                     BufferSize;
+};
+
+static inline void
+GEN8_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
+                             const struct GEN8_VERTEX_BUFFER_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   uint32_t dw_MemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      /* Struct  MemoryObjectControlState (16..22): */
+      __gen_field(dw_MemoryObjectControlState, 16, 22) |
+      __gen_field(values->AddressModifyEnable, 14, 14) |
+      __gen_field(values->NullVertexBuffer, 13, 13) |
+      __gen_field(values->BufferPitch, 0, 11) |
+      0;
+
+   uint32_t dw1 =
+      0;
+
+   dw[1] =
+      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
+
+   dw[3] =
+      __gen_field(values->BufferSize, 0, 31) |
+      0;
+
+}
+
 struct GEN8_3DSTATE_VERTEX_BUFFERS {
    uint32_t                                     CommandType;
    uint32_t                                     CommandSubType;
@@ -4735,10 +5056,45 @@ GEN8_3DSTATE_VERTEX_BUFFERS_pack(__gen_user_data *data, void * restrict dst,
    ._3DCommandOpcode     =  0,                  \
    ._3DCommandSubOpcode  =  9
 
-struct GEN8_3DSTATE_VERTEX_ELEMENTS {
-   uint32_t                                     CommandType;
-   uint32_t                                     CommandSubType;
-   uint32_t                                     _3DCommandOpcode;
+struct GEN8_VERTEX_ELEMENT_STATE {
+   uint32_t                                     VertexBufferIndex;
+   uint32_t                                     Valid;
+   uint32_t                                     SourceElementFormat;
+   uint32_t                                     EdgeFlagEnable;
+   uint32_t                                     SourceElementOffset;
+   uint32_t                                     Component0Control;
+   uint32_t                                     Component1Control;
+   uint32_t                                     Component2Control;
+   uint32_t                                     Component3Control;
+};
+
+static inline void
+GEN8_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
+                              const struct GEN8_VERTEX_ELEMENT_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->VertexBufferIndex, 26, 31) |
+      __gen_field(values->Valid, 25, 25) |
+      __gen_field(values->SourceElementFormat, 16, 24) |
+      __gen_field(values->EdgeFlagEnable, 15, 15) |
+      __gen_field(values->SourceElementOffset, 0, 11) |
+      0;
+
+   dw[1] =
+      __gen_field(values->Component0Control, 28, 30) |
+      __gen_field(values->Component1Control, 24, 26) |
+      __gen_field(values->Component2Control, 20, 22) |
+      __gen_field(values->Component3Control, 16, 18) |
+      0;
+
+}
+
+struct GEN8_3DSTATE_VERTEX_ELEMENTS {
+   uint32_t                                     CommandType;
+   uint32_t                                     CommandSubType;
+   uint32_t                                     _3DCommandOpcode;
    uint32_t                                     _3DCommandSubOpcode;
    uint32_t                                     DwordLength;
    /* variable length fields follow */
@@ -7295,250 +7651,6 @@ GEN8_PIPE_CONTROL_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN8_3DSTATE_CONSTANT_BODY {
-   uint32_t                                     ConstantBuffer1ReadLength;
-   uint32_t                                     ConstantBuffer0ReadLength;
-   uint32_t                                     ConstantBuffer3ReadLength;
-   uint32_t                                     ConstantBuffer2ReadLength;
-   __gen_address_type                           PointerToConstantBuffer0;
-   __gen_address_type                           PointerToConstantBuffer1;
-   __gen_address_type                           PointerToConstantBuffer2;
-   __gen_address_type                           PointerToConstantBuffer3;
-};
-
-static inline void
-GEN8_3DSTATE_CONSTANT_BODY_pack(__gen_user_data *data, void * restrict dst,
-                               const struct GEN8_3DSTATE_CONSTANT_BODY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->ConstantBuffer1ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer0ReadLength, 0, 15) |
-      0;
-
-   dw[1] =
-      __gen_field(values->ConstantBuffer3ReadLength, 16, 31) |
-      __gen_field(values->ConstantBuffer2ReadLength, 0, 15) |
-      0;
-
-   uint32_t dw2 =
-      0;
-
-   dw[2] =
-      __gen_combine_address(data, &dw[2], values->PointerToConstantBuffer0, dw2);
-
-   uint32_t dw4 =
-      0;
-
-   dw[4] =
-      __gen_combine_address(data, &dw[4], values->PointerToConstantBuffer1, dw4);
-
-   uint32_t dw6 =
-      0;
-
-   dw[6] =
-      __gen_combine_address(data, &dw[6], values->PointerToConstantBuffer2, dw6);
-
-   uint32_t dw8 =
-      0;
-
-   dw[8] =
-      __gen_combine_address(data, &dw[8], values->PointerToConstantBuffer3, dw8);
-
-}
-
-struct GEN8_BINDING_TABLE_EDIT_ENTRY {
-   uint32_t                                     BindingTableIndex;
-   uint32_t                                     SurfaceStatePointer;
-};
-
-static inline void
-GEN8_BINDING_TABLE_EDIT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                                  const struct GEN8_BINDING_TABLE_EDIT_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->BindingTableIndex, 16, 23) |
-      __gen_offset(values->SurfaceStatePointer, 0, 15) |
-      0;
-
-}
-
-struct GEN8_GATHER_CONSTANT_ENTRY {
-   uint32_t                                     ConstantBufferOffset;
-   uint32_t                                     ChannelMask;
-   uint32_t                                     BindingTableIndexOffset;
-};
-
-static inline void
-GEN8_GATHER_CONSTANT_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                               const struct GEN8_GATHER_CONSTANT_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_offset(values->ConstantBufferOffset, 8, 15) |
-      __gen_field(values->ChannelMask, 4, 7) |
-      __gen_field(values->BindingTableIndexOffset, 0, 3) |
-      0;
-
-}
-
-struct GEN8_VERTEX_BUFFER_STATE {
-   uint32_t                                     VertexBufferIndex;
-   uint32_t                                     MemoryObjectControlState;
-   uint32_t                                     AddressModifyEnable;
-   uint32_t                                     NullVertexBuffer;
-   uint32_t                                     BufferPitch;
-   __gen_address_type                           BufferStartingAddress;
-   uint32_t                                     BufferSize;
-};
-
-static inline void
-GEN8_VERTEX_BUFFER_STATE_pack(__gen_user_data *data, void * restrict dst,
-                             const struct GEN8_VERTEX_BUFFER_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
-      __gen_field(values->AddressModifyEnable, 14, 14) |
-      __gen_field(values->NullVertexBuffer, 13, 13) |
-      __gen_field(values->BufferPitch, 0, 11) |
-      0;
-
-   uint32_t dw1 =
-      0;
-
-   dw[1] =
-      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, dw1);
-
-   dw[3] =
-      __gen_field(values->BufferSize, 0, 31) |
-      0;
-
-}
-
-struct GEN8_VERTEX_ELEMENT_STATE {
-   uint32_t                                     VertexBufferIndex;
-   uint32_t                                     Valid;
-   uint32_t                                     SourceElementFormat;
-   uint32_t                                     EdgeFlagEnable;
-   uint32_t                                     SourceElementOffset;
-   uint32_t                                     Component0Control;
-   uint32_t                                     Component1Control;
-   uint32_t                                     Component2Control;
-   uint32_t                                     Component3Control;
-};
-
-static inline void
-GEN8_VERTEX_ELEMENT_STATE_pack(__gen_user_data *data, void * restrict dst,
-                              const struct GEN8_VERTEX_ELEMENT_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->VertexBufferIndex, 26, 31) |
-      __gen_field(values->Valid, 25, 25) |
-      __gen_field(values->SourceElementFormat, 16, 24) |
-      __gen_field(values->EdgeFlagEnable, 15, 15) |
-      __gen_field(values->SourceElementOffset, 0, 11) |
-      0;
-
-   dw[1] =
-      __gen_field(values->Component0Control, 28, 30) |
-      __gen_field(values->Component1Control, 24, 26) |
-      __gen_field(values->Component2Control, 20, 22) |
-      __gen_field(values->Component3Control, 16, 18) |
-      0;
-
-}
-
-struct GEN8_SO_DECL_ENTRY {
-   uint32_t                                     Stream3Decl;
-   uint32_t                                     Stream2Decl;
-   uint32_t                                     Stream1Decl;
-   uint32_t                                     Stream0Decl;
-};
-
-static inline void
-GEN8_SO_DECL_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN8_SO_DECL_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-   /* Struct  Stream3Decl: found SO_DECL */
-   /* Struct  Stream2Decl: found SO_DECL */
-   /* Struct  Stream1Decl: found SO_DECL */
-   /* Struct  Stream0Decl: found SO_DECL */
-      0;
-
-}
-
-struct GEN8_SO_DECL {
-   uint32_t                                     OutputBufferSlot;
-   uint32_t                                     HoleFlag;
-   uint32_t                                     RegisterIndex;
-   uint32_t                                     ComponentMask;
-};
-
-static inline void
-GEN8_SO_DECL_pack(__gen_user_data *data, void * restrict dst,
-                 const struct GEN8_SO_DECL * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->OutputBufferSlot, 12, 13) |
-      __gen_field(values->HoleFlag, 11, 11) |
-      __gen_field(values->RegisterIndex, 4, 9) |
-      __gen_field(values->ComponentMask, 0, 3) |
-      0;
-
-}
-
-struct GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL {
-   uint32_t                                     ComponentOverrideW;
-   uint32_t                                     ComponentOverrideZ;
-   uint32_t                                     ComponentOverrideY;
-   uint32_t                                     ComponentOverrideX;
-   uint32_t                                     SwizzleControlMode;
-#define     CONST_0000                                         0
-#define     CONST_0001_FLOAT                                   1
-#define     CONST_1111_FLOAT                                   2
-#define     PRIM_ID                                            3
-   uint32_t                                     ConstantSource;
-#define     INPUTATTR                                          0
-#define     INPUTATTR_FACING                                   1
-#define     INPUTATTR_W                                        2
-#define     INPUTATTR_FACING_W                                 3
-   uint32_t                                     SwizzleSelect;
-   uint32_t                                     SourceAttribute;
-};
-
-static inline void
-GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(__gen_user_data *data, void * restrict dst,
-                                    const struct GEN8_SF_OUTPUT_ATTRIBUTE_DETAIL * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->ComponentOverrideW, 15, 15) |
-      __gen_field(values->ComponentOverrideZ, 14, 14) |
-      __gen_field(values->ComponentOverrideY, 13, 13) |
-      __gen_field(values->ComponentOverrideX, 12, 12) |
-      __gen_field(values->SwizzleControlMode, 11, 11) |
-      __gen_field(values->ConstantSource, 9, 10) |
-      __gen_field(values->SwizzleSelect, 6, 7) |
-      __gen_field(values->SourceAttribute, 0, 4) |
-      0;
-
-}
-
 struct GEN8_SCISSOR_RECT {
    uint32_t                                     ScissorRectangleYMin;
    uint32_t                                     ScissorRectangleXMin;
@@ -7651,43 +7763,6 @@ GEN8_SF_CLIP_VIEWPORT_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN8_BLEND_STATE {
-   uint32_t                                     AlphaToCoverageEnable;
-   uint32_t                                     IndependentAlphaBlendEnable;
-   uint32_t                                     AlphaToOneEnable;
-   uint32_t                                     AlphaToCoverageDitherEnable;
-   uint32_t                                     AlphaTestEnable;
-   uint32_t                                     AlphaTestFunction;
-   uint32_t                                     ColorDitherEnable;
-   uint32_t                                     XDitherOffset;
-   uint32_t                                     YDitherOffset;
-   uint32_t                                     Entry;
-};
-
-static inline void
-GEN8_BLEND_STATE_pack(__gen_user_data *data, void * restrict dst,
-                     const struct GEN8_BLEND_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->AlphaToCoverageEnable, 31, 31) |
-      __gen_field(values->IndependentAlphaBlendEnable, 30, 30) |
-      __gen_field(values->AlphaToOneEnable, 29, 29) |
-      __gen_field(values->AlphaToCoverageDitherEnable, 28, 28) |
-      __gen_field(values->AlphaTestEnable, 27, 27) |
-      __gen_field(values->AlphaTestFunction, 24, 26) |
-      __gen_field(values->ColorDitherEnable, 23, 23) |
-      __gen_field(values->XDitherOffset, 21, 22) |
-      __gen_field(values->YDitherOffset, 19, 20) |
-      0;
-
-   dw[1] =
-   /* Struct  Entry: found BLEND_STATE_ENTRY */
-      0;
-
-}
-
 struct GEN8_BLEND_STATE_ENTRY {
    uint32_t                                     LogicOpEnable;
    uint32_t                                     LogicOpFunction;
@@ -7739,6 +7814,40 @@ GEN8_BLEND_STATE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
+struct GEN8_BLEND_STATE {
+   uint32_t                                     AlphaToCoverageEnable;
+   uint32_t                                     IndependentAlphaBlendEnable;
+   uint32_t                                     AlphaToOneEnable;
+   uint32_t                                     AlphaToCoverageDitherEnable;
+   uint32_t                                     AlphaTestEnable;
+   uint32_t                                     AlphaTestFunction;
+   uint32_t                                     ColorDitherEnable;
+   uint32_t                                     XDitherOffset;
+   uint32_t                                     YDitherOffset;
+   struct GEN8_BLEND_STATE_ENTRY                Entry;
+};
+
+static inline void
+GEN8_BLEND_STATE_pack(__gen_user_data *data, void * restrict dst,
+                     const struct GEN8_BLEND_STATE * restrict values)
+{
+   uint32_t *dw = (uint32_t * restrict) dst;
+
+   dw[0] =
+      __gen_field(values->AlphaToCoverageEnable, 31, 31) |
+      __gen_field(values->IndependentAlphaBlendEnable, 30, 30) |
+      __gen_field(values->AlphaToOneEnable, 29, 29) |
+      __gen_field(values->AlphaToCoverageDitherEnable, 28, 28) |
+      __gen_field(values->AlphaTestEnable, 27, 27) |
+      __gen_field(values->AlphaTestFunction, 24, 26) |
+      __gen_field(values->ColorDitherEnable, 23, 23) |
+      __gen_field(values->XDitherOffset, 21, 22) |
+      __gen_field(values->YDitherOffset, 19, 20) |
+      0;
+
+   GEN8_BLEND_STATE_ENTRY_pack(data, &dw[1], &values->Entry);
+}
+
 struct GEN8_CC_VIEWPORT {
    float                                        MinimumDepth;
    float                                        MaximumDepth;
@@ -7813,20 +7922,6 @@ GEN8_COLOR_CALC_STATE_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN8_MEMORY_OBJECT_CONTROL_STATE {
-};
-
-static inline void
-GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(__gen_user_data *data, void * restrict dst,
-                                     const struct GEN8_MEMORY_OBJECT_CONTROL_STATE * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      0;
-
-}
-
 struct GEN8_VEB_DI_IECP_COMMAND_SURFACE_CONTROL_BITS {
 #define     UseCacheabilityControlsfrompagetableUCwithFenceifcoherentcycle       0
 #define     UncacheableUCnoncacheable                          1
@@ -7959,28 +8054,6 @@ GEN8_INTERFACE_DESCRIPTOR_DATA_pack(__gen_user_data *data, void * restrict dst,
 
 }
 
-struct GEN8_PALETTE_ENTRY {
-   uint32_t                                     Alpha;
-   uint32_t                                     Red;
-   uint32_t                                     Green;
-   uint32_t                                     Blue;
-};
-
-static inline void
-GEN8_PALETTE_ENTRY_pack(__gen_user_data *data, void * restrict dst,
-                       const struct GEN8_PALETTE_ENTRY * restrict values)
-{
-   uint32_t *dw = (uint32_t * restrict) dst;
-
-   dw[0] =
-      __gen_field(values->Alpha, 24, 31) |
-      __gen_field(values->Red, 16, 23) |
-      __gen_field(values->Green, 8, 15) |
-      __gen_field(values->Blue, 0, 7) |
-      0;
-
-}
-
 struct GEN8_RENDER_SURFACE_STATE {
 #define     SURFTYPE_1D                                        0
 #define     SURFTYPE_2D                                        1
@@ -8021,7 +8094,7 @@ struct GEN8_RENDER_SURFACE_STATE {
    uint32_t                                     CubeFaceEnableNegativeY;
    uint32_t                                     CubeFaceEnablePositiveX;
    uint32_t                                     CubeFaceEnableNegativeX;
-   uint32_t                                     MemoryObjectControlState;
+   struct GEN8_MEMORY_OBJECT_CONTROL_STATE      MemoryObjectControlState;
    uint32_t                                     BaseMipLevel;
    uint32_t                                     SurfaceQPitch;
    uint32_t                                     Height;
@@ -8103,8 +8176,11 @@ GEN8_RENDER_SURFACE_STATE_pack(__gen_user_data *data, void * restrict dst,
       __gen_field(values->CubeFaceEnableNegativeX, 5, 5) |
       0;
 
+   uint32_t dw_MemoryObjectControlState;
+   GEN8_MEMORY_OBJECT_CONTROL_STATE_pack(data, &dw_MemoryObjectControlState, &values->MemoryObjectControlState);
    dw[1] =
-   /* Struct  MemoryObjectControlState: found MEMORY_OBJECT_CONTROL_STATE */
+      /* Struct  MemoryObjectControlState (24..30): */
+      __gen_field(dw_MemoryObjectControlState, 24, 30) |
       __gen_field(values->BaseMipLevel, 19, 23) |
       __gen_field(values->SurfaceQPitch, 0, 14) |
       0;