summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorCraig Stout <[email protected]>2017-03-29 12:14:30 -0700
committerJason Ekstrand <[email protected]>2017-03-29 14:32:32 -0700
commit1da7a11de8113932871487efaeb2674a3d1c644a (patch)
treec03aa6e01954202f05f5c7fe06602a25c4cfa65c /src/intel/vulkan
parent16debc652a4f054a9c74e9229b98dec1746d292b (diff)
anv/cmd_buffer: fix host memory leak
push_constants must be free'd. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100452 Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0 13.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_cmd_buffer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c
index 909bee2add4..c65eba287d6 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -120,7 +120,12 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer)
cmd_buffer->batch.status = VK_SUCCESS;
memset(&state->descriptors, 0, sizeof(state->descriptors));
- memset(&state->push_constants, 0, sizeof(state->push_constants));
+ for (uint32_t i = 0; i < MESA_SHADER_STAGES; i++) {
+ if (state->push_constants[i] != NULL) {
+ vk_free(&cmd_buffer->pool->alloc, state->push_constants[i]);
+ state->push_constants[i] = NULL;
+ }
+ }
memset(state->binding_tables, 0, sizeof(state->binding_tables));
memset(state->samplers, 0, sizeof(state->samplers));
@@ -193,6 +198,9 @@ static VkResult anv_create_cmd_buffer(
cmd_buffer->batch.status = VK_SUCCESS;
+ for (uint32_t i = 0; i < MESA_SHADER_STAGES; i++) {
+ cmd_buffer->state.push_constants[i] = NULL;
+ }
cmd_buffer->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
cmd_buffer->device = device;
cmd_buffer->pool = pool;