KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
751 stars 403 forks source link

Push Constant memory leak #8632

Closed Eearslya closed 2 days ago

Eearslya commented 2 days ago

Environment:

Describe the Issue

Command Buffer state tracking has a member variable, push_constant_data_chunks that tracks push constant data as it is pushed with vkCmdPushConstants calls. Every call adds to the end of this array with the data the user has pushed, here.

This array is cleared out whenever a multipass render pass begins or moves to the next subpass (via UnbindResources()). However, this array is NOT cleared out when the command buffer is reset, either with vkResetCommandBuffer or vkResetCommandPool. This results in a slow leak as every push constant slowly adds more data to the command buffer's state.

Expected behavior

vvl::CommandBuffer::ResetCBState() should clear the push_constant_data_chunks array.

Additional context

arno-lunarg commented 2 days ago

Thank you for reporting this! Should be a quick fix (TM)