7 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_r",
"timedelta",
"Red - display the specified renderer statistic"},
8 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_g",
"batch_batches",
"Green - display the specified renderer statistic"},
9 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_b",
"batch_triangles",
"Blue - display the specified renderer statistic"},
10 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_y",
"fast_triangles",
"Yellow - display the specified renderer statistic"},
11 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_c",
"copytriangles_triangles",
"Cyan - display the specified renderer statistic"},
12 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_m",
"dynamic_triangles",
"Magenta - display the specified renderer statistic"},
13 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_w",
"animcache_shade_vertices",
"White - display the specified renderer statistic"},
14 {
CF_CLIENT |
CF_ARCHIVE,
"r_speeds_graph_filter_o",
"animcache_shape_vertices",
"Orange - display the specified renderer statistic"},
39 "lightmapupdatepixels",
49 "lights_lighttriangles",
50 "lights_shadowtriangles",
51 "lights_dynamicshadowtriangles",
53 "bouncegrid_particles",
58 "photoncache_animated",
65 "rendertargets_pixels",
66 "indexbufferuploadcount",
67 "indexbufferuploadsize",
68 "vertexbufferuploadcount",
69 "vertexbufferuploadsize",
72 "bufferdatacurrent_vertex",
73 "bufferdatacurrent_index16",
74 "bufferdatacurrent_index32",
75 "bufferdatacurrent_uniform",
76 "bufferdatasize_vertex",
77 "bufferdatasize_index16",
78 "bufferdatasize_index32",
79 "bufferdatasize_uniform",
80 "animcache_skeletal_count",
81 "animcache_skeletal_bones",
82 "animcache_skeletal_maxbones",
83 "animcache_shade_count",
84 "animcache_shade_vertices",
85 "animcache_shade_maxvertices",
86 "animcache_shape_count",
87 "animcache_shape_vertices",
88 "animcache_shape_maxvertices",
98 "copytriangles_batches",
99 "copytriangles_surfaces",
100 "copytriangles_vertices",
101 "copytriangles_triangles",
106 "dynamicskeletal_batches",
107 "dynamicskeletal_surfaces",
108 "dynamicskeletal_vertices",
109 "dynamicskeletal_triangles",
110 "dynamic_batches_because_cvar",
111 "dynamic_surfaces_because_cvar",
112 "dynamic_vertices_because_cvar",
113 "dynamic_triangles_because_cvar",
114 "dynamic_batches_because_lightmapvertex",
115 "dynamic_surfaces_because_lightmapvertex",
116 "dynamic_vertices_because_lightmapvertex",
117 "dynamic_triangles_because_lightmapvertex",
118 "dynamic_batches_because_deformvertexes_autosprite",
119 "dynamic_surfaces_because_deformvertexes_autosprite",
120 "dynamic_vertices_because_deformvertexes_autosprite",
121 "dynamic_triangles_because_deformvertexes_autosprite",
122 "dynamic_batches_because_deformvertexes_autosprite2",
123 "dynamic_surfaces_because_deformvertexes_autosprite2",
124 "dynamic_vertices_because_deformvertexes_autosprite2",
125 "dynamic_triangles_because_deformvertexes_autosprite2",
126 "dynamic_batches_because_deformvertexes_normal",
127 "dynamic_surfaces_because_deformvertexes_normal",
128 "dynamic_vertices_because_deformvertexes_normal",
129 "dynamic_triangles_because_deformvertexes_normal",
130 "dynamic_batches_because_deformvertexes_wave",
131 "dynamic_surfaces_because_deformvertexes_wave",
132 "dynamic_vertices_because_deformvertexes_wave",
133 "dynamic_triangles_because_deformvertexes_wave",
134 "dynamic_batches_because_deformvertexes_bulge",
135 "dynamic_surfaces_because_deformvertexes_bulge",
136 "dynamic_vertices_because_deformvertexes_bulge",
137 "dynamic_triangles_because_deformvertexes_bulge",
138 "dynamic_batches_because_deformvertexes_move",
139 "dynamic_surfaces_because_deformvertexes_move",
140 "dynamic_vertices_because_deformvertexes_move",
141 "dynamic_triangles_because_deformvertexes_move",
142 "dynamic_batches_because_tcgen_lightmap",
143 "dynamic_surfaces_because_tcgen_lightmap",
144 "dynamic_vertices_because_tcgen_lightmap",
145 "dynamic_triangles_because_tcgen_lightmap",
146 "dynamic_batches_because_tcgen_vector",
147 "dynamic_surfaces_because_tcgen_vector",
148 "dynamic_vertices_because_tcgen_vector",
149 "dynamic_triangles_because_tcgen_vector",
150 "dynamic_batches_because_tcgen_environment",
151 "dynamic_surfaces_because_tcgen_environment",
152 "dynamic_vertices_because_tcgen_environment",
153 "dynamic_triangles_because_tcgen_environment",
154 "dynamic_batches_because_tcmod_turbulent",
155 "dynamic_surfaces_because_tcmod_turbulent",
156 "dynamic_vertices_because_tcmod_turbulent",
157 "dynamic_triangles_because_tcmod_turbulent",
158 "dynamic_batches_because_nogaps",
159 "dynamic_surfaces_because_nogaps",
160 "dynamic_vertices_because_nogaps",
161 "dynamic_triangles_because_nogaps",
162 "dynamic_batches_because_derived",
163 "dynamic_surfaces_because_derived",
164 "dynamic_vertices_because_derived",
165 "dynamic_triangles_because_derived",
167 "entitycache_surfaces",
168 "entitycache_vertices",
169 "entitycache_triangles",
170 "entityanimate_count",
171 "entityanimate_surfaces",
172 "entityanimate_vertices",
173 "entityanimate_triangles",
174 "entityskeletal_count",
175 "entityskeletal_surfaces",
176 "entityskeletal_vertices",
177 "entityskeletal_triangles",
178 "entitystatic_count",
179 "entitystatic_surfaces",
180 "entitystatic_vertices",
181 "entitystatic_triangles",
182 "entitycustom_count",
183 "entitycustom_surfaces",
184 "entitycustom_vertices",
185 "entitycustom_triangles",
244 int i, triangles = 0;
250#define R_SPEEDS_GRAPH_COLORS 8
251#define R_SPEEDS_GRAPH_TEXTLENGTH 64
252static float r_speeds_graph_colors[
R_SPEEDS_GRAPH_COLORS][4] = {{1, 0, 0, 1}, {0, 1, 0, 1}, {0, 0, 1, 1}, {1, 1, 0, 1}, {0, 1, 1, 1}, {1, 0, 1, 1}, {1, 1, 1, 1}, {1, 0.5f, 0, 1}};
259 char string[1024+4096];
261 static double oldtime = 0;
275"%6ius time delta %s%s %.3f cl.time%2.4f brightness\n"
276"%3i renders org:'%+8.2f %+8.2f %+8.2f' dir:'%+2.3f %+2.3f %+2.3f'\n"
277"%5i viewleaf%5i cluster%3i area%4i brushes%4i surfaces(%7i triangles)\n"
278"%7i surfaces%7i triangles %5i entities (%7i surfaces%7i triangles)\n"
279"%5i leafs%5i portals%6i/%6i particles%6i/%6i decals %3i%% quality\n"
280"%7i lightmap updates (%7i pixels)%8i/%8i framedata\n"
281"%4i lights%4i clears%4i scissored%7i light%7i shadow%7i dynamic\n"
282"bouncegrid:%4i lights%6i particles%6i traces%6i hits%6i splats%6i bounces\n"
283"photon cache efficiency:%6i cached%6i traced%6ianimated\n"
284"%6i draws%8i vertices%8i triangles bloompixels%8i copied%8i drawn\n"
285"%3i rendertargets%8i pixels\n"
286"updated%5i indexbuffers%8i bytes%5i vertexbuffers%8i bytes\n"
287"animcache%5ib gpuskeletal%7i vertices (%7i with normals)\n"
288"fastbatch%5i count%5i surfaces%7i vertices %7i triangles\n"
289"copytris%5i count%5i surfaces%7i vertices %7i triangles\n"
290"dynamic%5i count%5i surfaces%7i vertices%7i triangles\n"
324 if (
string[
strlen(
string)-1] ==
'\n')
325 string[
strlen(
string)-1] = 0;
327 for (
i = 0;
string[
i];
i++)
328 if (
string[
i] ==
'\n')
337 while (
string[
i] &&
string[
i] !=
'\n')
340 DrawQ_String(0,
y,
string + j,
i - j, 8, 8, 1, 1, 1, 1, 0,
NULL,
true,
FONT_DEFAULT);
341 if (
string[
i] ==
'\n')
361 int stat,
index, d, graph_length, *graph_data;
376 for (
i = 0;
i < graph_length;
i++)
377 graph_data[
index++] = d;
399 int color, stat, stats,
index, range_min, range_max;
400 int graph_current, graph_length, *graph_data;
413 graph_data[stat * graph_length + graph_current] =
r_refdef.
stats[stat];
453 statindex[
color] = -1;
462 statindex[
color] = stat;
464 dpsnprintf(legend,
sizeof(legend),
"%10i :%s", graph_data[stat * graph_length + graph_current],
r_stat_name[stat]);
465 DrawQ_String(
x,
y + stats * 8, legend, 0, 8, 8,
r_speeds_graph_colors[
color][0],
r_speeds_graph_colors[
color][1],
r_speeds_graph_colors[
color][2],
r_speeds_graph_colors[
color][3] * 1.00f, 0,
NULL,
true,
FONT_DEFAULT);
479 stat = statindex[
color];
489 scaley =
height / (range_max - range_min);
492 data = graph_data + stat * graph_length;
493 index = graph_current;
495 for (
i = 0;
i < graph_length - 1;)
503 index = graph_length - 1;
cl_locnode_t * CL_Locs_FindNearest(const vec3_t point)
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
#define dp_strlcat(dst, src, dsize)
void Cvar_SetValueQuick(cvar_t *var, float value)
void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags)
float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags)
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLenum GLsizei GLsizei height
GLenum GLuint GLenum GLsizei length
GLint GLenum GLint GLint y
GLsizeiptr const GLvoid * data
#define bound(min, num, max)
cvar_t r_speeds_graph_maxtimedelta
static float r_speeds_graph_colors[R_SPEEDS_GRAPH_COLORS][4]
cvar_t r_speeds_graph_length
cvar_t r_speeds_graph_maxdefault
char r_speeds_timestring[4096]
cvar_t r_speeds_graph_filter[8]
void R_TimeReport(const char *desc)
float viewscalefpsadjusted
cvar_t r_speeds_graph_width
const char * r_stat_name[r_stat_count]
cvar_t r_speeds_graph_height
double r_timereport_current
#define R_SPEEDS_GRAPH_COLORS
cvar_t r_speeds_graph_seconds
double r_timereport_start
void R_TimeReport_BeginFrame(void)
static int R_CountLeafTriangles(const model_t *model, const mleaf_t *leaf)
void R_TimeReport_EndFrame(void)
@ r_stat_bouncegrid_splats
@ r_stat_batch_fast_vertices
@ r_stat_vertexbufferuploadsize
@ r_stat_framedatacurrent
@ r_stat_bouncegrid_particles
@ r_stat_vertexbufferuploadcount
@ r_stat_batch_dynamic_batches
@ r_stat_indexbufferuploadcount
@ r_stat_animcache_skeletal_bones
@ r_stat_bouncegrid_lights
@ r_stat_rendertargets_used
@ r_stat_lights_dynamicshadowtriangles
@ r_stat_batch_copytriangles_vertices
@ r_stat_rendertargets_pixels
@ r_stat_batch_copytriangles_batches
@ r_stat_entities_triangles
@ r_stat_lights_lighttriangles
@ r_stat_bloom_drawpixels
@ r_stat_bouncegrid_traces
@ r_stat_batch_dynamic_vertices
@ r_stat_batch_dynamic_triangles
@ r_stat_photoncache_animated
@ r_stat_photoncache_traced
@ r_stat_lightmapupdatepixels
@ r_stat_entities_surfaces
@ r_stat_batch_copytriangles_surfaces
@ r_stat_batch_fast_surfaces
@ r_stat_indexbufferuploadsize
@ r_stat_batch_fast_triangles
@ r_stat_lights_scissored
@ r_stat_lights_shadowtriangles
@ r_stat_batch_copytriangles_triangles
@ r_stat_batch_fast_batches
@ r_stat_bloom_copypixels
@ r_stat_animcache_shape_vertices
@ r_stat_bouncegrid_bounces
@ r_stat_animcache_shade_vertices
@ r_stat_batch_dynamic_surfaces
@ r_stat_photoncache_cached
int sb_lines
scan lines to draw
mempool_t * permanentmempool
int r_speeds_graph_length
int * r_speeds_graph_data
int r_speeds_graph_datamax[r_stat_count]
int r_speeds_graph_datamin[r_stat_count]
int r_speeds_graph_current
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
mleaf_t *(* PointInLeaf)(struct model_s *model, const vec3_t p)
model_t * worldmodel
same as worldentity->model
float colorscale
global RGB color multiplier for rendering
float quality
render quality (0 to 1) - affects r_drawparticles_drawdistance and others
double Sys_DirtyTime(void)
#define Mem_Alloc(pool, size)