vk: profiler: add sprites count metric

This commit is contained in:
Ivan Avdeev 2023-03-25 11:24:33 -07:00 committed by Ivan Avdeev
parent 2976f753e1
commit 68761fbbbb
3 changed files with 19 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "vk_devmem.h"
#include "vk_commandpool.h"
#include "r_speeds.h"
#include "vk_sprite.h"
// FIXME move this rt-specific stuff out
#include "vk_light.h"
@ -798,6 +799,8 @@ qboolean R_VkInit( void )
VK_LightsInit();
}
R_SpriteInit();
return true;
}

View File

@ -4,6 +4,7 @@
#include "vk_render.h"
#include "vk_geometry.h"
#include "vk_scene.h"
#include "r_speeds.h"
#include "sprite.h"
#include "xash3d_mathlib.h"
@ -17,6 +18,17 @@
#define MAPSPRITE_SIZE 128
#define GLARE_FALLOFF 19000.0f
static struct {
struct {
int sprites;
} stats;
} g_sprite;
qboolean R_SpriteInit(void) {
R_SpeedsRegisterMetric(&g_sprite.stats.sprites, "sprites_count", kSpeedsMetricCount);
return true;
}
static mspriteframe_t *R_GetSpriteFrame( const model_t *pModel, int frame, float yaw )
{
msprite_t *psprite;
@ -831,6 +843,8 @@ void R_VkSpriteDrawModel( cl_entity_t *e, float blend )
if( spriteIsOccluded( e, origin, &scale, &blend))
return; // sprite culled
g_sprite.stats.sprites++;
/* FIXME VK
r_stats.c_sprite_models_drawn++;

View File

@ -8,3 +8,5 @@ void Mod_LoadMapSprite( struct model_s *mod, const void *buffer, size_t size, qb
void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, uint texFlags );
void R_VkSpriteDrawModel( cl_entity_t *e, float blend );
qboolean R_SpriteInit(void);