vk: profiler: add beams count metric

This commit is contained in:
Ivan Avdeev 2023-03-25 11:27:48 -07:00 committed by Ivan Avdeev
parent 68761fbbbb
commit 89f49276a5
3 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "vk_scene.h"
#include "vk_math.h"
#include "vk_triapi.h"
#include "r_speeds.h"
#include "xash3d_types.h"
#include "xash3d_mathlib.h"
@ -23,6 +24,17 @@ typedef struct
float width;
} beamseg_t;
static struct {
struct {
int beams;
} stats;
} g_beam;
qboolean R_BeamInit(void) {
R_SpeedsRegisterMetric(&g_beam.stats.beams, "beams_count", kSpeedsMetricCount);
return true;
}
/*
==============================================================
@ -978,6 +990,8 @@ void R_BeamDraw( BEAM *pbeam, float frametime )
return;
}
++g_beam.stats.beams;
// update frequency
pbeam->freq += frametime;

View File

@ -9,3 +9,5 @@ qboolean R_BeamCull( const vec3_t start, const vec3_t end, qboolean pvsOnly );
void R_BeamDrawCustomEntity( struct cl_entity_s *ent, float frametime );
void R_BeamDraw( struct beam_s *pbeam, float frametime );
qboolean R_BeamInit(void);

View File

@ -20,6 +20,7 @@
#include "vk_commandpool.h"
#include "r_speeds.h"
#include "vk_sprite.h"
#include "vk_beams.h"
// FIXME move this rt-specific stuff out
#include "vk_light.h"
@ -800,6 +801,7 @@ qboolean R_VkInit( void )
}
R_SpriteInit();
R_BeamInit();
return true;
}