summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
diff options
context:
space:
mode:
authorRafael Antognolli <[email protected]>2018-01-18 17:19:30 -0800
committerRafael Antognolli <[email protected]>2018-04-05 07:42:45 -0700
commite8cadb673d6e3a5946e7d9be5811881e99bef952 (patch)
treeb9bfecb2eedd286348e041477ec0c6dc6add5c53 /src/intel/vulkan/anv_device.c
parent021e1885d0d09adf3b9bc40c74172f983a2263dd (diff)
anv: Use clear address for HiZ fast clears too.
Store the default clear address for HiZ fast clears on a global bo, and point to it when needed. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r--src/intel/vulkan/anv_device.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index d400a1328b4..7522b7865c2 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1422,6 +1422,20 @@ vk_priority_to_gen(int priority)
}
}
+static void
+anv_device_init_hiz_clear_batch(struct anv_device *device)
+{
+ anv_bo_init_new(&device->hiz_clear_bo, device, 4096);
+ uint32_t *map = anv_gem_mmap(device, device->hiz_clear_bo.gem_handle,
+ 0, 4096, 0);
+
+ union isl_color_value hiz_clear = { .u32 = { 0, } };
+ hiz_clear.f32[0] = ANV_HZ_FC_VAL;
+
+ memcpy(map, hiz_clear.u32, sizeof(hiz_clear.u32));
+ anv_gem_munmap(map, device->hiz_clear_bo.size);
+}
+
VkResult anv_CreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
@@ -1602,6 +1616,9 @@ VkResult anv_CreateDevice(
anv_device_init_trivial_batch(device);
+ if (device->info.gen >= 10)
+ anv_device_init_hiz_clear_batch(device);
+
anv_scratch_pool_init(device, &device->scratch_pool);
anv_queue_init(device, &device->queue);
@@ -1695,6 +1712,8 @@ void anv_DestroyDevice(
anv_gem_close(device, device->workaround_bo.gem_handle);
anv_gem_close(device, device->trivial_batch_bo.gem_handle);
+ if (device->info.gen >= 10)
+ anv_gem_close(device, device->hiz_clear_bo.gem_handle);
anv_state_pool_finish(&device->surface_state_pool);
anv_state_pool_finish(&device->instruction_state_pool);