mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[renderer] Report scrap rectangle counts
Stats are good. More stats even better :) I wanted to see just how many lightmaps were being created in e1m3.
This commit is contained in:
parent
398405c8d6
commit
1fdedbaf33
4 changed files with 15 additions and 8 deletions
|
@ -43,7 +43,7 @@ void R_ScrapDelete (rscrap_t *scrap);
|
|||
struct vrect_s *R_ScrapAlloc (rscrap_t *scrap, int width, int height);
|
||||
void R_ScrapFree (rscrap_t *scrap, struct vrect_s *rect);
|
||||
void R_ScrapClear (rscrap_t *scrap);
|
||||
size_t R_ScrapArea (rscrap_t *scrap) __attribute__((pure));
|
||||
size_t R_ScrapArea (rscrap_t *scrap, int *count) __attribute__((pure));
|
||||
void R_ScrapDump (rscrap_t *scrap);
|
||||
|
||||
#endif//__r_scrap_h
|
||||
|
|
|
@ -655,18 +655,19 @@ gl_scraps_f (void)
|
|||
scrap_t *scrap;
|
||||
int area;
|
||||
int size;
|
||||
int count;
|
||||
|
||||
if (!scrap_list) {
|
||||
Sys_Printf ("No scraps\n");
|
||||
return;
|
||||
}
|
||||
for (scrap = scrap_list; scrap; scrap = scrap->next) {
|
||||
area = R_ScrapArea (&scrap->rscrap);
|
||||
area = R_ScrapArea (&scrap->rscrap, &count);
|
||||
// always square
|
||||
size = scrap->rscrap.width;
|
||||
Sys_Printf ("tnum=%u size=%d format=%04x bpp=%d free=%d%%\n",
|
||||
Sys_Printf ("tnum=%u size=%d format=%04x bpp=%d free=%d%% rects=%d\n",
|
||||
scrap->tnum, size, scrap->format, scrap->bpp,
|
||||
area * 100 / (size * size));
|
||||
area * 100 / (size * size), count);
|
||||
if (Cmd_Argc () > 1) {
|
||||
R_ScrapDump (&scrap->rscrap);
|
||||
}
|
||||
|
|
|
@ -251,18 +251,19 @@ glsl_scraps_f (void)
|
|||
scrap_t *scrap;
|
||||
int area;
|
||||
int size;
|
||||
int count;
|
||||
|
||||
if (!scrap_list) {
|
||||
Sys_Printf ("No scraps\n");
|
||||
return;
|
||||
}
|
||||
for (scrap = scrap_list; scrap; scrap = scrap->next) {
|
||||
area = R_ScrapArea (&scrap->rscrap);
|
||||
area = R_ScrapArea (&scrap->rscrap, &count);
|
||||
// always square
|
||||
size = scrap->rscrap.width;
|
||||
Sys_Printf ("tnum=%u size=%d format=%04x bpp=%d free=%d%%\n",
|
||||
Sys_Printf ("tnum=%u size=%d format=%04x bpp=%d free=%d%% rects=%d\n",
|
||||
scrap->tnum, size, scrap->format, scrap->bpp,
|
||||
area * 100 / (size * size));
|
||||
area * 100 / (size * size), count);
|
||||
if (Cmd_Argc () > 1) {
|
||||
R_ScrapDump (&scrap->rscrap);
|
||||
}
|
||||
|
|
|
@ -157,13 +157,18 @@ R_ScrapClear (rscrap_t *scrap)
|
|||
}
|
||||
|
||||
VISIBLE size_t
|
||||
R_ScrapArea (rscrap_t *scrap)
|
||||
R_ScrapArea (rscrap_t *scrap, int *count)
|
||||
{
|
||||
vrect_t *rect;
|
||||
size_t area;
|
||||
int c = 0;
|
||||
|
||||
for (rect = scrap->free_rects, area = 0; rect; rect = rect->next) {
|
||||
area += rect->width * rect->height;
|
||||
c++;
|
||||
}
|
||||
if (count) {
|
||||
*count = c;
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue