On 11/07/2013 02:16 PM, Courtney Goeltzenleuchter wrote:
Needed test to measure texture upload speed under a variety
of modes (mipmap, source format, internal format, size, etc.)
This new test has an interactive run mode like the other Mesa
Perf tests but also includes command line options to make
it automatable.
Fix up code formatting.
Signed-off-by: Courtney Goeltzenleuchter <court...@lunarg.com>
---
src/perf/CMakeLists.txt | 1 +
src/perf/Makefile.am | 1 +
src/perf/bench_glTexImage2D.sh | 13 ++
src/perf/teximage_enh.README | 10 ++
src/perf/teximage_enh.c | 391 +++++++++++++++++++++++++++++++++++++++++
What does "enh" mean? Maybe you could find something a bit more obvious?
5 files changed, 416 insertions(+)
create mode 100755 src/perf/bench_glTexImage2D.sh
create mode 100644 src/perf/teximage_enh.README
create mode 100644 src/perf/teximage_enh.c
diff --git a/src/perf/CMakeLists.txt b/src/perf/CMakeLists.txt
index 68b6875..ded6666 100644
--- a/src/perf/CMakeLists.txt
+++ b/src/perf/CMakeLists.txt
@@ -28,6 +28,7 @@ set (targets
readpixels
swapbuffers
teximage
+ teximage_enh
vbo
vertexrate
)
diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
index 5363c58..1cc5c43 100644
--- a/src/perf/Makefile.am
+++ b/src/perf/Makefile.am
@@ -51,6 +51,7 @@ bin_PROGRAMS = \
readpixels \
swapbuffers \
teximage \
+ teximage_enh \
vbo \
vertexrate \
glslstateschange
diff --git a/src/perf/bench_glTexImage2D.sh b/src/perf/bench_glTexImage2D.sh
new file mode 100755
index 0000000..c63a251
--- /dev/null
+++ b/src/perf/bench_glTexImage2D.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+./teximage_enh --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle full --test TexImage
+./teximage_enh --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test TexImage
+./teximage_enh --width 512 --height 512 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle data --test TexImage
+./teximage_enh --width 512 --height 512 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test TexImage
+./teximage_enh --width 256 --height 256 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle data --test TexImage
+./teximage_enh --width 256 --height 256 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test TexImage
+./teximage_enh --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle data --test
TexImage_Mipmap
+./teximage_enh --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test
TexImage_Mipmap
+./teximage_enh --width 512 --height 512 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle data --test
TexImage_Mipmap
+./teximage_enh --width 512 --height 512 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test
TexImage_Mipmap
+./teximage_enh --width 256 --height 256 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGBA --csvstyle data --test
TexImage_Mipmap
+./teximage_enh --width 256 --height 256 --type GL_UNSIGNED_BYTE --format
GL_RGBA --texelsize 4 --internalformat GL_RGB --csvstyle data --test
TexImage_Mipmap
diff --git a/src/perf/teximage_enh.README b/src/perf/teximage_enh.README
new file mode 100644
index 0000000..44e8aea
--- /dev/null
+++ b/src/perf/teximage_enh.README
@@ -0,0 +1,10 @@
+glTexImage2D benchmark
+ - executable name: teximage_enh
+ - modified files: CMakeLists.txt Makefile.am
+ - new files:
+ teximage_enh.c - code
+ bench_glTexImage2D.sh
+direct run command: ./teximage_enh
+
+script usage: ./test_glTexImage2D.sh
+
diff --git a/src/perf/teximage_enh.c b/src/perf/teximage_enh.c
new file mode 100644
index 0000000..9bb3944
--- /dev/null
+++ b/src/perf/teximage_enh.c
@@ -0,0 +1,391 @@
+/*
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
Maybe add your own LunarG copyright line.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
s/VMWARE/THE AUTHORS/
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
I really only skimmed the rest. If the test does what you need that's
fine. But consider a more descriptive name.
Acked-by: Brian Paul <bri...@vmware.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev