Skip to content

Commit

Permalink
Performance|Client: Faster resizing of the view
Browse files Browse the repository at this point in the history
When the view grid was updated, LensFX was always releasing all GL
resources for all viewports even if the viewports were only resized.
  • Loading branch information
skyjake committed Jul 31, 2014
1 parent 7f070bb commit 29d84d3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions doomsday/client/src/render/viewports.cpp
Expand Up @@ -345,16 +345,21 @@ void R_UpdateViewPortGeometry(viewport_t *port, int col, int row)

bool R_SetViewGrid(int numCols, int numRows)
{
// LensFx needs to reallocate resources only for the consoles in use.
LensFx_GLRelease();

if(numCols > 0 && numRows > 0)
{
if(numCols * numRows > DDMAXPLAYERS)
{
return false;
}

if(numCols != gridCols || numRows != gridRows)
{
// The number of consoles has changes; LensFx needs to reallocate resources
// only for the consoles in use.
/// @todo This could be done smarter, only for the affected viewports. -jk
LensFx_GLRelease();
}

if(numCols > DDMAXPLAYERS)
numCols = DDMAXPLAYERS;
if(numRows > DDMAXPLAYERS)
Expand Down

0 comments on commit 29d84d3

Please sign in to comment.