anv/state: Use the new emit macro
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 18 Apr 2016 22:24:59 +0000 (15:24 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 20 Apr 2016 21:54:09 +0000 (14:54 -0700)
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
src/intel/vulkan/genX_state.c

index 900f6dc8eecf7d836593f31b74e36b96551e2e2e..b997e1bd1388941161b8a2fb02effaefc5dcc5e0 100644 (file)
@@ -44,97 +44,98 @@ genX(init_device_state)(struct anv_device *device)
    batch.start = batch.next = cmds;
    batch.end = (void *) cmds + sizeof(cmds);
 
-   anv_batch_emit(&batch, GENX(PIPELINE_SELECT),
+   anv_batch_emit_blk(&batch, GENX(PIPELINE_SELECT), ps) {
 #if GEN_GEN >= 9
-                  .MaskBits = 3,
+      ps.MaskBits = 3;
 #endif
-                  .PipelineSelection = _3D);
+      ps.PipelineSelection = _3D;
+   }
+
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_VF_STATISTICS), vfs)
+      vfs.StatisticsEnable = true;
 
-   anv_batch_emit(&batch, GENX(3DSTATE_VF_STATISTICS),
-                  .StatisticsEnable = true);
-   anv_batch_emit(&batch, GENX(3DSTATE_HS));
-   anv_batch_emit(&batch, GENX(3DSTATE_TE));
-   anv_batch_emit(&batch, GENX(3DSTATE_DS));
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_HS), hs);
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_TE), ts);
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_DS), ds);
 
-   anv_batch_emit(&batch, GENX(3DSTATE_STREAMOUT), .SOFunctionEnable = false);
-   anv_batch_emit(&batch, GENX(3DSTATE_AA_LINE_PARAMETERS));
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_STREAMOUT), so);
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_AA_LINE_PARAMETERS), aa);
 
 #if GEN_GEN >= 8
-   anv_batch_emit(&batch, GENX(3DSTATE_WM_CHROMAKEY),
-                  .ChromaKeyKillEnable = false);
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_WM_CHROMAKEY), ck);
 
    /* See the Vulkan 1.0 spec Table 24.1 "Standard sample locations" and
     * VkPhysicalDeviceFeatures::standardSampleLocations.
     */
-   anv_batch_emit(&batch, GENX(3DSTATE_SAMPLE_PATTERN),
-      ._1xSample0XOffset      = 0.5,
-      ._1xSample0YOffset      = 0.5,
-      ._2xSample0XOffset      = 0.25,
-      ._2xSample0YOffset      = 0.25,
-      ._2xSample1XOffset      = 0.75,
-      ._2xSample1YOffset      = 0.75,
-      ._4xSample0XOffset      = 0.375,
-      ._4xSample0YOffset      = 0.125,
-      ._4xSample1XOffset      = 0.875,
-      ._4xSample1YOffset      = 0.375,
-      ._4xSample2XOffset      = 0.125,
-      ._4xSample2YOffset      = 0.625,
-      ._4xSample3XOffset      = 0.625,
-      ._4xSample3YOffset      = 0.875,
-      ._8xSample0XOffset      = 0.5625,
-      ._8xSample0YOffset      = 0.3125,
-      ._8xSample1XOffset      = 0.4375,
-      ._8xSample1YOffset      = 0.6875,
-      ._8xSample2XOffset      = 0.8125,
-      ._8xSample2YOffset      = 0.5625,
-      ._8xSample3XOffset      = 0.3125,
-      ._8xSample3YOffset      = 0.1875,
-      ._8xSample4XOffset      = 0.1875,
-      ._8xSample4YOffset      = 0.8125,
-      ._8xSample5XOffset      = 0.0625,
-      ._8xSample5YOffset      = 0.4375,
-      ._8xSample6XOffset      = 0.6875,
-      ._8xSample6YOffset      = 0.9375,
-      ._8xSample7XOffset      = 0.9375,
-      ._8xSample7YOffset      = 0.0625,
+   anv_batch_emit_blk(&batch, GENX(3DSTATE_SAMPLE_PATTERN), sp) {
+      sp._1xSample0XOffset    = 0.5;
+      sp._1xSample0YOffset    = 0.5;
+      sp._2xSample0XOffset    = 0.25;
+      sp._2xSample0YOffset    = 0.25;
+      sp._2xSample1XOffset    = 0.75;
+      sp._2xSample1YOffset    = 0.75;
+      sp._4xSample0XOffset    = 0.375;
+      sp._4xSample0YOffset    = 0.125;
+      sp._4xSample1XOffset    = 0.875;
+      sp._4xSample1YOffset    = 0.375;
+      sp._4xSample2XOffset    = 0.125;
+      sp._4xSample2YOffset    = 0.625;
+      sp._4xSample3XOffset    = 0.625;
+      sp._4xSample3YOffset    = 0.875;
+      sp._8xSample0XOffset    = 0.5625;
+      sp._8xSample0YOffset    = 0.3125;
+      sp._8xSample1XOffset    = 0.4375;
+      sp._8xSample1YOffset    = 0.6875;
+      sp._8xSample2XOffset    = 0.8125;
+      sp._8xSample2YOffset    = 0.5625;
+      sp._8xSample3XOffset    = 0.3125;
+      sp._8xSample3YOffset    = 0.1875;
+      sp._8xSample4XOffset    = 0.1875;
+      sp._8xSample4YOffset    = 0.8125;
+      sp._8xSample5XOffset    = 0.0625;
+      sp._8xSample5YOffset    = 0.4375;
+      sp._8xSample6XOffset    = 0.6875;
+      sp._8xSample6YOffset    = 0.9375;
+      sp._8xSample7XOffset    = 0.9375;
+      sp._8xSample7YOffset    = 0.0625;
 #if GEN_GEN >= 9
-      ._16xSample0XOffset     = 0.5625,
-      ._16xSample0YOffset     = 0.5625,
-      ._16xSample1XOffset     = 0.4375,
-      ._16xSample1YOffset     = 0.3125,
-      ._16xSample2XOffset     = 0.3125,
-      ._16xSample2YOffset     = 0.6250,
-      ._16xSample3XOffset     = 0.7500,
-      ._16xSample3YOffset     = 0.4375,
-      ._16xSample4XOffset     = 0.1875,
-      ._16xSample4YOffset     = 0.3750,
-      ._16xSample5XOffset     = 0.6250,
-      ._16xSample5YOffset     = 0.8125,
-      ._16xSample6XOffset     = 0.8125,
-      ._16xSample6YOffset     = 0.6875,
-      ._16xSample7XOffset     = 0.6875,
-      ._16xSample7YOffset     = 0.1875,
-      ._16xSample8XOffset     = 0.3750,
-      ._16xSample8YOffset     = 0.8750,
-      ._16xSample9XOffset     = 0.5000,
-      ._16xSample9YOffset     = 0.0625,
-      ._16xSample10XOffset    = 0.2500,
-      ._16xSample10YOffset    = 0.1250,
-      ._16xSample11XOffset    = 0.1250,
-      ._16xSample11YOffset    = 0.7500,
-      ._16xSample12XOffset    = 0.0000,
-      ._16xSample12YOffset    = 0.5000,
-      ._16xSample13XOffset    = 0.9375,
-      ._16xSample13YOffset    = 0.2500,
-      ._16xSample14XOffset    = 0.8750,
-      ._16xSample14YOffset    = 0.9375,
-      ._16xSample15XOffset    = 0.0625,
-      ._16xSample15YOffset    = 0.0000,
+      sp._16xSample0XOffset   = 0.5625;
+      sp._16xSample0YOffset   = 0.5625;
+      sp._16xSample1XOffset   = 0.4375;
+      sp._16xSample1YOffset   = 0.3125;
+      sp._16xSample2XOffset   = 0.3125;
+      sp._16xSample2YOffset   = 0.6250;
+      sp._16xSample3XOffset   = 0.7500;
+      sp._16xSample3YOffset   = 0.4375;
+      sp._16xSample4XOffset   = 0.1875;
+      sp._16xSample4YOffset   = 0.3750;
+      sp._16xSample5XOffset   = 0.6250;
+      sp._16xSample5YOffset   = 0.8125;
+      sp._16xSample6XOffset   = 0.8125;
+      sp._16xSample6YOffset   = 0.6875;
+      sp._16xSample7XOffset   = 0.6875;
+      sp._16xSample7YOffset   = 0.1875;
+      sp._16xSample8XOffset   = 0.3750;
+      sp._16xSample8YOffset   = 0.8750;
+      sp._16xSample9XOffset   = 0.5000;
+      sp._16xSample9YOffset   = 0.0625;
+      sp._16xSample10XOffset  = 0.2500;
+      sp._16xSample10YOffset  = 0.1250;
+      sp._16xSample11XOffset  = 0.1250;
+      sp._16xSample11YOffset  = 0.7500;
+      sp._16xSample12XOffset  = 0.0000;
+      sp._16xSample12YOffset  = 0.5000;
+      sp._16xSample13XOffset  = 0.9375;
+      sp._16xSample13YOffset  = 0.2500;
+      sp._16xSample14XOffset  = 0.8750;
+      sp._16xSample14YOffset  = 0.9375;
+      sp._16xSample15XOffset  = 0.0625;
+      sp._16xSample15YOffset  = 0.0000;
 #endif
-   );
+   }
 #endif
 
-   anv_batch_emit(&batch, GENX(MI_BATCH_BUFFER_END));
+   anv_batch_emit_blk(&batch, GENX(MI_BATCH_BUFFER_END), bbe);
 
    assert(batch.next <= batch.end);