<div dir="ltr"><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>And pushed.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 12:14 PM,  <span dir="ltr"><<a href="mailto:cstout@chromium.org" target="_blank">cstout@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Craig Stout <<a href="mailto:cstout@google.com">cstout@google.com</a>><br>
<br>
push_constants must be free'd.<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=100452" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=100452</a><br>
---<br>
 src/intel/vulkan/anv_cmd_<wbr>buffer.c | 10 +++++++++-<br>
 1 file changed, 9 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_cmd_<wbr>buffer.c b/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
index 909bee2..c65eba2 100644<br>
--- a/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
+++ b/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
@@ -120,7 +120,12 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer)<br>
    cmd_buffer->batch.status = VK_SUCCESS;<br>
<br>
    memset(&state->descriptors, 0, sizeof(state->descriptors));<br>
-   memset(&state->push_constants, 0, sizeof(state->push_constants))<wbr>;<br>
+   for (uint32_t i = 0; i < MESA_SHADER_STAGES; i++) {<br>
+      if (state->push_constants[i] != NULL) {<br>
+         vk_free(&cmd_buffer->pool-><wbr>alloc, state->push_constants[i]);<br>
+         state->push_constants[i] = NULL;<br>
+      }<br>
+   }<br>
    memset(state->binding_tables, 0, sizeof(state->binding_tables))<wbr>;<br>
    memset(state->samplers, 0, sizeof(state->samplers));<br>
<br>
@@ -193,6 +198,9 @@ static VkResult anv_create_cmd_buffer(<br>
<br>
    cmd_buffer->batch.status = VK_SUCCESS;<br>
<br>
+   for (uint32_t i = 0; i < MESA_SHADER_STAGES; i++) {<br>
+      cmd_buffer->state.push_<wbr>constants[i] = NULL;<br>
+   }<br>
    cmd_buffer->_loader_data.<wbr>loaderMagic = ICD_LOADER_MAGIC;<br>
    cmd_buffer->device = device;<br>
    cmd_buffer->pool = pool;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>