summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-22 10:58:34 -0700
committerJason Ekstrand <[email protected]>2015-09-24 08:42:38 -0700
commitbc17f9c9d76dbf2cdc657cfb6861b887dbca3046 (patch)
tree6037b9e66eaeb10f1d875a7c688ac2fb7fc3d56e
parente1a7c721d34158f94f6b6dee94a211d32e9f5752 (diff)
anv/cmd_buffer: Add a helper for getting the surface state base address
-rw-r--r--src/vulkan/anv_batch_chain.c9
-rw-r--r--src/vulkan/anv_private.h2
-rw-r--r--src/vulkan/gen7_cmd_buffer.c2
-rw-r--r--src/vulkan/gen8_cmd_buffer.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/src/vulkan/anv_batch_chain.c b/src/vulkan/anv_batch_chain.c
index b8f08b9cd8a..6c37ce0aca3 100644
--- a/src/vulkan/anv_batch_chain.c
+++ b/src/vulkan/anv_batch_chain.c
@@ -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)
{
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index fa910064945..2e8bfa2c1d6 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -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);
diff --git a/src/vulkan/gen7_cmd_buffer.c b/src/vulkan/gen7_cmd_buffer.c
index b149673f405..95d1e28698f 100644
--- a/src/vulkan/gen7_cmd_buffer.c
+++ b/src/vulkan/gen7_cmd_buffer.c
@@ -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,
diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c
index 5737879ffe7..5018b6775d9 100644
--- a/src/vulkan/gen8_cmd_buffer.c
+++ b/src/vulkan/gen8_cmd_buffer.c
@@ -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,