[PATCH] remove _gl_lightmap_sort cvar

Benchmarking didn't show any noticable difference, so removing this cvar and
code path.

Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
Tyrann 2006-09-16 07:05:48 +09:30
parent aba56091ac
commit aa84c0d8f7
6 changed files with 14 additions and 72 deletions

View File

@ -116,7 +116,6 @@ cvar_t gl_playermip = { "gl_playermip", "0" };
cvar_t gl_nocolors = { "gl_nocolors", "0" };
cvar_t gl_doubleeyes = { "gl_doubleeyes", "1" };
cvar_t _gl_lightmap_sort = { "_gl_lightmap_sort", "0" };
cvar_t _gl_allowgammafallback = { "_gl_allowgammafallback", "1" };
/*

View File

@ -210,7 +210,6 @@ R_Init(void)
Cvar_RegisterVariable(&gl_clear);
Cvar_RegisterVariable(&gl_texsort);
Cvar_RegisterVariable(&_gl_lightmap_sort);
Cvar_RegisterVariable(&_gl_allowgammafallback);
Cvar_RegisterVariable(&_gl_drawhull);

View File

@ -120,7 +120,6 @@ cvar_t gl_flashblend = { "gl_flashblend", "1" };
cvar_t gl_playermip = { "gl_playermip", "0" };
cvar_t gl_nocolors = { "gl_nocolors", "0" };
cvar_t _gl_lightmap_sort = { "_gl_lightmap_sort", "0" };
cvar_t _gl_allowgammafallback = { "_gl_allowgammafallback", "1" };
/*

View File

@ -210,7 +210,6 @@ R_Init(void)
Cvar_RegisterVariable(&gl_clear);
Cvar_RegisterVariable(&gl_texsort);
Cvar_RegisterVariable(&_gl_lightmap_sort);
Cvar_RegisterVariable(&_gl_allowgammafallback);
Cvar_RegisterVariable(&_gl_drawhull);

View File

@ -1345,76 +1345,23 @@ GL_BuildLightmaps(void)
t1 = Sys_DoubleTime();
cnt = 0;
if (_gl_lightmap_sort.value) {
/*
* Create texture chains so that lightmaps get allocated in texture
* order. That way, surfaces with the same textures are more likely to
* be allocated in the same lightmap block and hence we will need less
* state changes when rendering
* FIXME - benchmark & pick one when texsort + multitexture is done).
*/
for (j = 1; j < MAX_MODELS; j++) {
msurface_t *surf;
texture_t *t;
for (j = 1; j < MAX_MODELS; j++) {
m = cl.model_precache[j];
if (!m)
break;
if (m->name[0] == '*')
continue;
m = cl.model_precache[j];
if (!m)
break;
if (m->name[0] == '*')
r_pcurrentvertbase = m->vertexes;
currentmodel = m;
for (i = 0; i < m->numsurfaces; i++) {
cnt++;
GL_CreateSurfaceLightmap(m->surfaces + i);
if (m->surfaces[i].flags & SURF_DRAWTURB)
continue;
for (i = 0; i < m->numtextures; i++) {
t = m->textures[i];
if (t)
t->texturechain = NULL;
}
for (i = 0; i < m->numsurfaces; i++) {
surf = m->surfaces + i;
surf->texturechain = surf->texinfo->texture->texturechain;
surf->texinfo->texture->texturechain = surf;
}
r_pcurrentvertbase = m->vertexes;
currentmodel = m;
for (i = 0; i < m->numtextures; i++) {
t = m->textures[i];
if (!t)
continue;
for (surf = t->texturechain; surf; surf = surf->texturechain) {
cnt++;
GL_CreateSurfaceLightmap(surf);
if (surf->flags & SURF_DRAWTURB)
continue;
if (surf->flags & SURF_DRAWSKY)
continue;
BuildSurfaceDisplayList(surf);
}
t->texturechain = NULL;
}
}
} else {
for (j = 1; j < MAX_MODELS; j++) {
m = cl.model_precache[j];
if (!m)
break;
if (m->name[0] == '*')
if (m->surfaces[i].flags & SURF_DRAWSKY)
continue;
r_pcurrentvertbase = m->vertexes;
currentmodel = m;
for (i = 0; i < m->numsurfaces; i++) {
cnt++;
GL_CreateSurfaceLightmap(m->surfaces + i);
if (m->surfaces[i].flags & SURF_DRAWTURB)
continue;
if (m->surfaces[i].flags & SURF_DRAWSKY)
continue;
BuildSurfaceDisplayList(m->surfaces + i);
}
BuildSurfaceDisplayList(m->surfaces + i);
}
}

View File

@ -215,7 +215,6 @@ extern cvar_t gl_flashblend;
extern cvar_t gl_nocolors;
extern cvar_t gl_finish;
extern cvar_t _gl_lightmap_sort;
extern cvar_t _gl_allowgammafallback;
extern cvar_t _gl_drawhull;