From a260b4c1433c49cd169a188e5037642a541b496b Mon Sep 17 00:00:00 2001 From: lewa_j Date: Sat, 17 Jan 2026 21:27:18 +0300 Subject: [PATCH] ref: dx2: some culling cvars --- ref/dx2/r_d3d.c | 11 +++++++++++ ref/dx2/r_local.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/ref/dx2/r_d3d.c b/ref/dx2/r_d3d.c index b3faadce..a1597343 100644 --- a/ref/dx2/r_d3d.c +++ b/ref/dx2/r_d3d.c @@ -16,6 +16,12 @@ GNU General Public License for more details. #include "r_local.h" #include "xash3d_mathlib.h" +CVAR_DEFINE_AUTO( r_novis, "0", 0, "ignore vis information (perfomance test)" ); +CVAR_DEFINE_AUTO( r_nocull, "0", 0, "ignore frustrum culling (perfomance test)" ); +CVAR_DEFINE_AUTO( r_lockpvs, "0", FCVAR_CHEAT, "lockpvs area at current point (pvs test)" ); +CVAR_DEFINE_AUTO( r_lockfrustum, "0", FCVAR_CHEAT, "lock frustrum area at current point (cull test)" ); + + DEFINE_ENGINE_SHARED_CVAR_LIST() poolhandle_t r_temppool; @@ -218,6 +224,11 @@ qboolean R_Init( void ) RETRIEVE_ENGINE_SHARED_CVAR_LIST(); + gEngfuncs.Cvar_RegisterVariable( &r_novis ); + gEngfuncs.Cvar_RegisterVariable( &r_nocull ); + gEngfuncs.Cvar_RegisterVariable( &r_lockpvs ); + gEngfuncs.Cvar_RegisterVariable( &r_lockfrustum ); + // init draw stack tr.draw_list = &tr.draw_stack[0]; tr.draw_stack_pos = 0; diff --git a/ref/dx2/r_local.h b/ref/dx2/r_local.h index 476b11d3..593409b7 100644 --- a/ref/dx2/r_local.h +++ b/ref/dx2/r_local.h @@ -307,6 +307,10 @@ void GL_SubdivideSurface( model_t *mod, msurface_t *fa ); void GL_OrthoBounds( const float *mins, const float *maxs ); byte *Mod_GetCurrentVis( void ); +extern convar_t r_novis; +extern convar_t r_nocull; +extern convar_t r_lockpvs; +extern convar_t r_lockfrustum; // // engine shared convars