2023-03-09 20:36:31 +01:00
|
|
|
#pragma once
|
2023-03-21 17:57:23 +01:00
|
|
|
#include "xash3d_types.h"
|
2023-03-09 20:36:31 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-03-23 17:10:00 +01:00
|
|
|
void R_SpeedsInit( void );
|
2023-03-14 20:18:41 +01:00
|
|
|
|
2023-04-03 19:45:16 +02:00
|
|
|
struct vk_combuf_scopes_s;
|
2023-04-07 20:14:41 +02:00
|
|
|
void R_SpeedsDisplayMore(uint32_t prev_frame_index, const struct vk_combuf_scopes_s *gpurofl, int gpurofl_count);
|
2023-03-21 17:57:23 +01:00
|
|
|
|
2023-03-23 17:10:00 +01:00
|
|
|
// Called from the engine into ref_api to get the latest speeds info
|
|
|
|
qboolean R_SpeedsMessage( char *out, size_t size );
|
2023-03-23 17:47:17 +01:00
|
|
|
|
2023-03-25 18:45:37 +01:00
|
|
|
typedef enum {
|
|
|
|
kSpeedsMetricCount,
|
|
|
|
kSpeedsMetricBytes,
|
|
|
|
kSpeedsMetricMicroseconds,
|
|
|
|
} r_speeds_metric_type_t;
|
|
|
|
|
2023-06-14 20:23:09 +02:00
|
|
|
// TODO upper limit argument
|
|
|
|
void R_SpeedsRegisterMetric(int* p_value, const char *module, const char *name, r_speeds_metric_type_t type, qboolean reset, const char *var_name, const char *file, int line);
|
2023-06-13 18:39:50 +02:00
|
|
|
|
2023-06-14 20:23:09 +02:00
|
|
|
// A counter is a value accumulated during a single frame, and reset to zero between frames.
|
|
|
|
// Examples: drawn models count, scope times, etc.
|
|
|
|
#define R_SPEEDS_COUNTER(var, name, type) \
|
|
|
|
R_SpeedsRegisterMetric(&(var), MODULE_NAME, name, type, /*reset*/ true, #var, __FILE__, __LINE__)
|
|
|
|
|
|
|
|
// A metric is computed and preserved across frame boundaries.
|
|
|
|
// Examples: total allocated memory, cache sizes, etc.
|
2023-06-13 18:39:50 +02:00
|
|
|
#define R_SPEEDS_METRIC(var, name, type) \
|
2023-06-14 20:23:09 +02:00
|
|
|
R_SpeedsRegisterMetric(&(var), MODULE_NAME, name, type, /*reset*/ false, #var, __FILE__, __LINE__)
|