anv/meta: Allocate descriptor pools on-the-fly

We can't use a global descriptor pool like we were because it's not
thread-safe.  For now, we'll allocate them on-the-fly and that should work
fine.  At some point in the future, we could do something where we
stack-allocate them or allocate them out of one of the state streams.
This commit is contained in:
Jason Ekstrand
2016-02-23 17:04:19 -08:00
parent bfbb238dea
commit bd3db3d665
4 changed files with 39 additions and 33 deletions

View File

@@ -138,27 +138,6 @@ anv_device_init_meta(struct anv_device *device)
.pfnFree = meta_free,
};
const VkDescriptorPoolCreateInfo create_info = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = NULL,
.flags = 0,
.maxSets = 1,
.poolSizeCount = 1,
.pPoolSizes = (VkDescriptorPoolSize[]) {
{
.type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
.descriptorCount = 1
},
}
};
result = anv_CreateDescriptorPool(anv_device_to_handle(device),
&create_info,
&device->meta_state.alloc,
&device->meta_state.desc_pool);
if (result != VK_SUCCESS)
goto fail_desc_pool;
result = anv_device_init_meta_clear_state(device);
if (result != VK_SUCCESS)
goto fail_clear;
@@ -178,10 +157,6 @@ fail_blit:
fail_resolve:
anv_device_finish_meta_clear_state(device);
fail_clear:
anv_DestroyDescriptorPool(anv_device_to_handle(device),
device->meta_state.desc_pool,
&device->meta_state.alloc);
fail_desc_pool:
return result;
}