summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-03-03 18:08:36 +0000
committerLionel Landwerlin <[email protected]>2019-05-02 17:02:35 +0100
commit7d908038ad4de85ed3204491fc215d76d88dc5a6 (patch)
treea21128bb7847affc47458fe46e30076660a29af9 /src
parent81fd6ba7cc6a519c9e612eeb5dbf3fa1fbf9c431 (diff)
vulkan/overlay: add a frame counter option
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/overlay-layer/overlay.cpp5
-rw-r--r--src/vulkan/overlay-layer/overlay_params.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp
index 8c5489f389c..c07409623bf 100644
--- a/src/vulkan/overlay-layer/overlay.cpp
+++ b/src/vulkan/overlay-layer/overlay.cpp
@@ -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.
diff --git a/src/vulkan/overlay-layer/overlay_params.h b/src/vulkan/overlay-layer/overlay_params.h
index 9a3d5be1b9b..6bbb2e4e657 100644
--- a/src/vulkan/overlay-layer/overlay_params.h
+++ b/src/vulkan/overlay-layer/overlay_params.h
@@ -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) \