diff options
author | Jason Ekstrand <[email protected]> | 2016-02-23 17:04:19 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-02-23 17:04:19 -0800 |
commit | bd3db3d6655beeb3da817a96d524f537092e386b (patch) | |
tree | 71c448c0f18466531f4afb5bbe42b955727b332c /src/intel/vulkan/anv_meta_blit.c | |
parent | bfbb238dea91b1c2bde4f2f3eb20d39c95da3850 (diff) |
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.
Diffstat (limited to 'src/intel/vulkan/anv_meta_blit.c')
-rw-r--r-- | src/intel/vulkan/anv_meta_blit.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c index 9c6cd8c510e..8ef943aa512 100644 --- a/src/intel/vulkan/anv_meta_blit.c +++ b/src/intel/vulkan/anv_meta_blit.c @@ -243,14 +243,31 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, .minFilter = blit_filter, }, &cmd_buffer->pool->alloc, &sampler); + VkDescriptorPool desc_pool; + anv_CreateDescriptorPool(anv_device_to_handle(device), + &(const VkDescriptorPoolCreateInfo) { + .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 + }, + } + }, &cmd_buffer->pool->alloc, &desc_pool); + VkDescriptorSet set; anv_AllocateDescriptorSets(anv_device_to_handle(device), &(VkDescriptorSetAllocateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - .descriptorPool = device->meta_state.desc_pool, + .descriptorPool = desc_pool, .descriptorSetCount = 1, .pSetLayouts = &device->meta_state.blit.ds_layout }, &set); + anv_UpdateDescriptorSets(anv_device_to_handle(device), 1, /* writeCount */ (VkWriteDescriptorSet[]) { @@ -340,8 +357,8 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, /* At the point where we emit the draw call, all data from the * descriptor sets, etc. has been used. We are free to delete it. */ - anv_ResetDescriptorPool(anv_device_to_handle(device), - device->meta_state.desc_pool, 0); + anv_DestroyDescriptorPool(anv_device_to_handle(device), + desc_pool, &cmd_buffer->pool->alloc); anv_DestroySampler(anv_device_to_handle(device), sampler, &cmd_buffer->pool->alloc); anv_DestroyFramebuffer(anv_device_to_handle(device), fb, |