summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_meta_resolve.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-02-11 22:46:28 -0800
committerKristian Høgsberg Kristensen <[email protected]>2016-02-22 17:13:51 -0800
commit2570a58bcdf30d699b89323fef60692093dee7ea (patch)
treed27100ecad296a746182c96e6cc5aa3e5998b491 /src/intel/vulkan/anv_meta_resolve.c
parent353d5bf286e1509af9ec2f1b8152d1f64790b52c (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_resolve.c')
-rw-r--r--src/intel/vulkan/anv_meta_resolve.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_meta_resolve.c b/src/intel/vulkan/anv_meta_resolve.c
index ea5020c5f24..9a77d21452f 100644
--- a/src/intel/vulkan/anv_meta_resolve.c
+++ b/src/intel/vulkan/anv_meta_resolve.c
@@ -483,7 +483,6 @@ emit_resolve(struct anv_cmd_buffer *cmd_buffer,
VkCommandBuffer cmd_buffer_h = anv_cmd_buffer_to_handle(cmd_buffer);
const struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
const struct anv_image *src_image = src_iview->image;
- VkDescriptorPool dummy_desc_pool_h = (VkDescriptorPool) 1;
const struct vertex_attrs vertex_data[3] = {
{
@@ -564,7 +563,7 @@ emit_resolve(struct anv_cmd_buffer *cmd_buffer,
anv_AllocateDescriptorSets(device_h,
&(VkDescriptorSetAllocateInfo) {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
- .descriptorPool = dummy_desc_pool_h,
+ .descriptorPool = device->meta_state.desc_pool,
.descriptorSetCount = 1,
.pSetLayouts = (VkDescriptorSetLayout[]) {
device->meta_state.resolve.ds_layout,
@@ -572,8 +571,6 @@ emit_resolve(struct anv_cmd_buffer *cmd_buffer,
},
&desc_set_h);
- ANV_FROM_HANDLE(anv_descriptor_set, desc_set, desc_set_h);
-
anv_UpdateDescriptorSets(device_h,
/*writeCount*/ 1,
(VkWriteDescriptorSet[]) {
@@ -644,7 +641,8 @@ emit_resolve(struct anv_cmd_buffer *cmd_buffer,
/* All objects below are consumed by the draw call. We may safely destroy
* them.
*/
- anv_descriptor_set_destroy(device, desc_set);
+ anv_ResetDescriptorPool(anv_device_to_handle(device),
+ device->meta_state.desc_pool, 0);
anv_DestroySampler(device_h, sampler_h,
&cmd_buffer->pool->alloc);
}