anv/cmd_buffer: Add a helper for getting the surface state base address
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Sep 2015 17:58:34 +0000 (10:58 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 24 Sep 2015 15:42:38 +0000 (08:42 -0700)
src/vulkan/anv_batch_chain.c
src/vulkan/anv_private.h
src/vulkan/gen7_cmd_buffer.c
src/vulkan/gen8_cmd_buffer.c

index b8f08b9cd8aeab5283828b1a2b83d09cdba387e5..6c37ce0aca3e4a122eea9e10c3607f354bf9d29f 100644 (file)
@@ -395,6 +395,15 @@ anv_cmd_buffer_current_surface_relocs(struct anv_cmd_buffer *cmd_buffer)
    return &anv_cmd_buffer_current_surface_bbo(cmd_buffer)->relocs;
 }
 
+struct anv_address
+anv_cmd_buffer_surface_base_address(struct anv_cmd_buffer *cmd_buffer)
+{
+   return (struct anv_address) {
+      .bo = anv_cmd_buffer_current_surface_bo(cmd_buffer),
+      .offset = 0,
+   };
+}
+
 static void
 emit_batch_buffer_start(struct anv_batch *batch, struct anv_bo *bo, uint32_t offset)
 {
index fa9100649454bf1897bfbd1d5b8e70d3650bd2e7..2e8bfa2c1d6e54bb393ade3658402f586d19c4bc 100644 (file)
@@ -897,6 +897,8 @@ struct anv_bo *
 anv_cmd_buffer_current_surface_bo(struct anv_cmd_buffer *cmd_buffer);
 struct anv_reloc_list *
 anv_cmd_buffer_current_surface_relocs(struct anv_cmd_buffer *cmd_buffer);
+struct anv_address
+anv_cmd_buffer_surface_base_address(struct anv_cmd_buffer *cmd_buffer);
 struct anv_state
 anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer,
                                    uint32_t size, uint32_t alignment);
index b149673f405310b2af98825372a68aa622ed45b7..95d1e28698f9a5f64df15ef97018ec5cc6e08131 100644 (file)
@@ -48,7 +48,7 @@ gen7_cmd_buffer_emit_state_base_address(struct anv_cmd_buffer *cmd_buffer)
       .GeneralStateAccessUpperBound             = { scratch_bo, scratch_bo->size },
       .GeneralStateAccessUpperBoundModifyEnable = true,
 
-      .SurfaceStateBaseAddress                  = { anv_cmd_buffer_current_surface_bo(cmd_buffer), 0 },
+      .SurfaceStateBaseAddress                  = anv_cmd_buffer_surface_base_address(cmd_buffer),
       .SurfaceStateMemoryObjectControlState     = GEN7_MOCS,
       .SurfaceStateBaseAddressModifyEnable      = true,
 
index 5737879ffe7a25cd47b1402a4d75f668f7679424..5018b6775d92d6fb7bc6c961519bca1af0d2d384 100644 (file)
@@ -824,7 +824,7 @@ gen8_cmd_buffer_emit_state_base_address(struct anv_cmd_buffer *cmd_buffer)
                   .GeneralStateBufferSize = 0xfffff,
                   .GeneralStateBufferSizeModifyEnable = true,
 
-                  .SurfaceStateBaseAddress = { anv_cmd_buffer_current_surface_bo(cmd_buffer), 0 },
+                  .SurfaceStateBaseAddress = anv_cmd_buffer_surface_base_address(cmd_buffer),
                   .SurfaceStateMemoryObjectControlState = GEN8_MOCS,
                   .SurfaceStateBaseAddressModifyEnable = true,