diff options
author | Kristian Høgsberg Kristensen <[email protected]> | 2016-02-11 22:46:28 -0800 |
---|---|---|
committer | Kristian Høgsberg Kristensen <[email protected]> | 2016-02-22 17:13:51 -0800 |
commit | 2570a58bcdf30d699b89323fef60692093dee7ea (patch) | |
tree | d27100ecad296a746182c96e6cc5aa3e5998b491 /src/intel/vulkan/anv_meta_blit.c | |
parent | 353d5bf286e1509af9ec2f1b8152d1f64790b52c (diff) |
anv: Implement descriptor pools
Descriptor pools are an optimization that lets applications allocate
descriptor sets through an externally synchronized object (that is,
unlocked). In our case it's also plugging a memory leak, since we
didn't track all allocated sets and failed to free them in
vkResetDescriptorPool() and vkDestroyDescriptorPool().
Diffstat (limited to 'src/intel/vulkan/anv_meta_blit.c')
-rw-r--r-- | src/intel/vulkan/anv_meta_blit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c index 06f13ecc8db..9c6cd8c510e 100644 --- a/src/intel/vulkan/anv_meta_blit.c +++ b/src/intel/vulkan/anv_meta_blit.c @@ -165,7 +165,6 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, VkFilter blit_filter) { struct anv_device *device = cmd_buffer->device; - VkDescriptorPool dummy_desc_pool = (VkDescriptorPool)1; struct blit_vb_data { float pos[2]; @@ -248,7 +247,7 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer, anv_AllocateDescriptorSets(anv_device_to_handle(device), &(VkDescriptorSetAllocateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - .descriptorPool = dummy_desc_pool, + .descriptorPool = device->meta_state.desc_pool, .descriptorSetCount = 1, .pSetLayouts = &device->meta_state.blit.ds_layout }, &set); @@ -341,7 +340,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_descriptor_set_destroy(device, anv_descriptor_set_from_handle(set)); + anv_ResetDescriptorPool(anv_device_to_handle(device), + device->meta_state.desc_pool, 0); anv_DestroySampler(anv_device_to_handle(device), sampler, &cmd_buffer->pool->alloc); anv_DestroyFramebuffer(anv_device_to_handle(device), fb, |