Skip to content

Commit

Permalink
client: render: minor optimizations related to memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
SNMetamorph committed Dec 3, 2024
1 parent 2dbcabd commit d1cd03c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions client/render/gl_rmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ void R_BuildViewPassHierarchy( void )

void R_ClearFrameLists( void )
{
RI->frame.solid_faces.Purge();
RI->frame.solid_meshes.Purge();
RI->frame.grass_list.Purge();
RI->frame.trans_list.Purge();
RI->frame.light_meshes.Purge();
RI->frame.light_faces.Purge();
RI->frame.light_grass.Purge();
RI->frame.primverts.Purge();
RI->frame.solid_faces.RemoveAll();
RI->frame.solid_meshes.RemoveAll();
RI->frame.grass_list.RemoveAll();
RI->frame.trans_list.RemoveAll();
RI->frame.light_meshes.RemoveAll();
RI->frame.light_faces.RemoveAll();
RI->frame.light_grass.RemoveAll();
RI->frame.primverts.RemoveAll();
RI->frame.num_subview_faces = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion client/render/gl_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void R_ClearScene( void )
tr.sky_camera = nullptr;
tr.local_client_added = false;
tr.num_draw_entities = 0;
tr.cached_state.Purge(); // invalidate cache
tr.cached_state.RemoveAll(); // invalidate cache
GET_ENTITY( 0 )->hCachedMatrix = GL_CacheState( g_vecZero, g_vecZero );

tr.num_2D_shadows_used = tr.num_CM_shadows_used = 0;
Expand Down
6 changes: 3 additions & 3 deletions client/render/gl_studio_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2688,8 +2688,8 @@ void CStudioModelRenderer :: DrawViewModel( void )
GL_FrontFace( !glState.frontFace );

m_iDrawModelType = DRAWSTUDIO_VIEWMODEL;
RI->frame.solid_meshes.Purge();
RI->frame.trans_list.Purge();
RI->frame.solid_meshes.RemoveAll();
RI->frame.trans_list.RemoveAll();
view->curstate.weaponmodel = 0;

matrix4x4 projMatrix, worldViewProjMatrix;
Expand Down Expand Up @@ -2740,7 +2740,7 @@ void CStudioModelRenderer :: DrawMeshFromBuffer( const vbomesh_t *mesh )

void CStudioModelRenderer :: BuildMeshListForLight( CDynLight *pl, bool solid )
{
RI->frame.light_meshes.Purge();
RI->frame.light_meshes.RemoveAll();
Vector bounds[2];

if( solid )
Expand Down
4 changes: 2 additions & 2 deletions client/render/gl_world_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2923,8 +2923,8 @@ void R_BuildFaceListForLight( CDynLight *pl, bool solid )
{
RI->currententity = GET_ENTITY( 0 );
RI->currentmodel = RI->currententity->model;
RI->frame.light_faces.Purge();
RI->frame.light_grass.Purge();
RI->frame.light_faces.RemoveAll();
RI->frame.light_grass.RemoveAll();
tr.modelorg = pl->origin;

if( solid )
Expand Down

0 comments on commit d1cd03c

Please sign in to comment.