vkd3d: Add memory allocator instance to device.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2021-01-28 13:25:13 +01:00 committed by Hans-Kristian Arntzen
parent 6e1867b001
commit 229273fb3b
2 changed files with 9 additions and 1 deletions

View File

@ -2602,6 +2602,7 @@ static void d3d12_device_destroy(struct d3d12_device *device)
vkd3d_render_pass_cache_cleanup(&device->render_pass_cache, device);
vkd3d_fence_worker_stop(&device->fence_worker, device);
d3d12_device_destroy_vkd3d_queues(device);
vkd3d_memory_allocator_cleanup(&device->memory_allocator, device);
VK_CALL(vkDestroyDevice(device->vk_device, NULL));
pthread_mutex_destroy(&device->mutex);
if (device->parent)
@ -5071,9 +5072,12 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
if (FAILED(hr = vkd3d_private_store_init(&device->private_store)))
goto out_free_vk_resources;
if (FAILED(hr = vkd3d_fence_worker_start(&device->fence_worker, device)))
if (FAILED(hr = vkd3d_memory_allocator_init(&device->memory_allocator, device)))
goto out_free_private_store;
if (FAILED(hr = vkd3d_fence_worker_start(&device->fence_worker, device)))
goto out_free_memory_allocator;
if (FAILED(hr = vkd3d_init_format_info(device)))
goto out_stop_fence_worker;
@ -5121,6 +5125,8 @@ out_cleanup_format_info:
vkd3d_cleanup_format_info(device);
out_stop_fence_worker:
vkd3d_fence_worker_stop(&device->fence_worker, device);
out_free_memory_allocator:
vkd3d_memory_allocator_cleanup(&device->memory_allocator, device);
out_free_private_store:
vkd3d_private_store_destroy(&device->private_store);
out_free_vk_resources:

View File

@ -2318,6 +2318,8 @@ struct d3d12_device
struct vkd3d_private_store private_store;
struct d3d12_caps d3d12_caps;
struct vkd3d_memory_allocator memory_allocator;
struct vkd3d_scratch_buffer scratch_buffers[VKD3D_SCRATCH_BUFFER_COUNT];
size_t scratch_buffer_count;