vulkan/overlay: add a frame counter option
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 3 Mar 2019 18:08:36 +0000 (18:08 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 2 May 2019 16:02:35 +0000 (17:02 +0100)
This is useful to normalize the numbers written into the output file
as those number are accumulated over a period of time and number of
frames.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/vulkan/overlay-layer/overlay.cpp
src/vulkan/overlay-layer/overlay_params.h

index 8c5489f389c6c1049c764a7ee9693fa2e6484357..c07409623bfc730a7e1335090393873636e4a037 100644 (file)
@@ -678,7 +678,8 @@ static void compute_swapchain_display(struct swapchain_data *data)
 
    for (uint32_t s = 0; s < OVERLAY_PARAM_ENABLED_MAX; s++) {
       if (!instance_data->params.enabled[s] ||
-          s == OVERLAY_PARAM_ENABLED_fps)
+          s == OVERLAY_PARAM_ENABLED_fps ||
+          s == OVERLAY_PARAM_ENABLED_frame)
          continue;
 
       char hash[40];
@@ -1561,6 +1562,8 @@ VKAPI_ATTR VkResult VKAPI_CALL overlay_QueuePresentKHR(
    struct instance_data *instance_data = device_data->instance;
    uint32_t query_results[OVERLAY_QUERY_COUNT];
 
+   device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_frame]++;
+
    if (list_length(&queue_data->running_command_buffer) > 0) {
       /* Before getting the query results, make sure the operations have
        * completed.
index 9a3d5be1b9bd053eb49f8f39d964c8dd5c4ed6bf..6bbb2e4e657394a207850f4bb7d114f249c06dc8 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
 
 #define OVERLAY_PARAMS                               \
    OVERLAY_PARAM_BOOL(fps)                           \
+   OVERLAY_PARAM_BOOL(frame)                         \
    OVERLAY_PARAM_BOOL(frame_timing)                  \
    OVERLAY_PARAM_BOOL(submit)                        \
    OVERLAY_PARAM_BOOL(draw)                          \