progs/perf: make teximage results easier to read, more reproducible
Always run the same tests on different drivers, give zero results where test image is too big for driver. Add a newline between groups of tests.
This commit is contained in:
parent
89f2799dac
commit
6a09c9d2d8
|
@ -181,34 +181,44 @@ PerfDraw(void)
|
||||||
/* loop over glTexImage, glTexSubImage */
|
/* loop over glTexImage, glTexSubImage */
|
||||||
for (subImage = 0; subImage < 2; subImage++) {
|
for (subImage = 0; subImage < 2; subImage++) {
|
||||||
|
|
||||||
/* loop over texture sizes */
|
/* loop over a defined range of texture sizes, test only the
|
||||||
for (TexSize = 16; TexSize <= maxSize; TexSize *= 4) {
|
* ones which are legal for this driver.
|
||||||
GLint bytesPerImage;
|
*/
|
||||||
|
for (TexSize = 16; TexSize <= 4096; TexSize *= 4) {
|
||||||
double mbPerSec;
|
double mbPerSec;
|
||||||
|
|
||||||
bytesPerImage = TexSize * TexSize * 4;
|
if (TexSize <= maxSize) {
|
||||||
TexImage = malloc(bytesPerImage);
|
GLint bytesPerImage;
|
||||||
|
|
||||||
if (subImage) {
|
bytesPerImage = TexSize * TexSize * 4;
|
||||||
/* create initial, empty texture */
|
TexImage = malloc(bytesPerImage);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
|
|
||||||
TexSize, TexSize, 0,
|
if (subImage) {
|
||||||
TexSrcFormat, TexSrcType, NULL);
|
/* create initial, empty texture */
|
||||||
rate = PerfMeasureRate(UploadTexSubImage2D);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
|
||||||
|
TexSize, TexSize, 0,
|
||||||
|
TexSrcFormat, TexSrcType, NULL);
|
||||||
|
rate = PerfMeasureRate(UploadTexSubImage2D);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rate = PerfMeasureRate(UploadTexImage2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0);
|
||||||
|
free(TexImage);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rate = PerfMeasureRate(UploadTexImage2D);
|
rate = 0;
|
||||||
|
mbPerSec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0);
|
|
||||||
|
|
||||||
perf_printf(" glTex%sImage2D(%s %d x %d): "
|
perf_printf(" glTex%sImage2D(%s %d x %d): "
|
||||||
"%.1f images/sec, %.1f MB/sec\n",
|
"%.1f images/sec, %.1f MB/sec\n",
|
||||||
(subImage ? "Sub" : ""),
|
(subImage ? "Sub" : ""),
|
||||||
SrcFormats[fmt].name, TexSize, TexSize, rate, mbPerSec);
|
SrcFormats[fmt].name, TexSize, TexSize, rate, mbPerSec);
|
||||||
|
|
||||||
free(TexImage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
perf_printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue