diff options
author | Jason Ekstrand <[email protected]> | 2020-05-04 17:27:22 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-08 16:54:17 +0000 |
commit | d11e4738a86ecac6bb4cfaf5cad5c1d32169b18f (patch) | |
tree | 5e8b69138b575968381a307d9702817a67684224 /src/intel/vulkan/anv_device.c | |
parent | 772b15ad3227e08bb4e18932ac9ecf4c29271160 (diff) |
anv/allocator: Add a start_offset to anv_state_pool
This allows a pool's allocations to start somewhere other than the base
address. Our first real use of this will be to use a negative offset
for the binding table pool to make it so that the offset is baked into
the pool and the code in anv_batch_chain.c doesn't have to understand
pool offsetting.
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4897>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 348ce8f2978..49553b0b2aa 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2867,23 +2867,27 @@ VkResult anv_CreateDevice( anv_bo_pool_init(&device->batch_bo_pool, device); result = anv_state_pool_init(&device->dynamic_state_pool, device, - DYNAMIC_STATE_POOL_MIN_ADDRESS, 16384); + DYNAMIC_STATE_POOL_MIN_ADDRESS, 0, 16384); if (result != VK_SUCCESS) goto fail_batch_bo_pool; result = anv_state_pool_init(&device->instruction_state_pool, device, - INSTRUCTION_STATE_POOL_MIN_ADDRESS, 16384); + INSTRUCTION_STATE_POOL_MIN_ADDRESS, 0, 16384); if (result != VK_SUCCESS) goto fail_dynamic_state_pool; result = anv_state_pool_init(&device->surface_state_pool, device, - SURFACE_STATE_POOL_MIN_ADDRESS, 4096); + SURFACE_STATE_POOL_MIN_ADDRESS, 0, 4096); if (result != VK_SUCCESS) goto fail_instruction_state_pool; if (physical_device->use_softpin) { + int64_t bt_pool_offset = (int64_t)BINDING_TABLE_POOL_MIN_ADDRESS - + (int64_t)SURFACE_STATE_POOL_MIN_ADDRESS; + assert(INT32_MIN < bt_pool_offset && bt_pool_offset < 0); result = anv_state_pool_init(&device->binding_table_pool, device, - BINDING_TABLE_POOL_MIN_ADDRESS, 4096); + SURFACE_STATE_POOL_MIN_ADDRESS, + bt_pool_offset, 4096); if (result != VK_SUCCESS) goto fail_surface_state_pool; } |