vulkan/overlay: fix command buffer stats
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 4 Jul 2019 18:55:49 +0000 (21:55 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 7 Jul 2019 12:47:54 +0000 (15:47 +0300)
Begin/Reset of command buffer both reset the content of the command
buffer. Don't forget to wipe them on Begin.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4438188f492e1f ("vulkan/overlay: record stats in command buffers and accumulate on exec/submit")
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/vulkan/overlay-layer/overlay.cpp

index a8cba732675fe0bce2d9d82f3578266d9f1ecf8b..c4344f96aa47a7eed30ae5da3f04127b44a03b7f 100644 (file)
@@ -1843,6 +1843,8 @@ static VkResult overlay_BeginCommandBuffer(
    struct command_buffer_data *cmd_buffer_data = FIND_CMD_BUFFER_DATA(commandBuffer);
    struct device_data *device_data = cmd_buffer_data->device;
 
+   memset(&cmd_buffer_data->stats, 0, sizeof(cmd_buffer_data->stats));
+
    /* We don't record any query in secondary command buffers, just make sure
     * we have the right inheritance.
     */