summaryrefslogtreecommitdiffstats
path: root/opengl/tests/gl_perf/filltest.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-09-09 14:51:56 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-09 14:51:56 -0700
commit127612855a5c73ed4d8b2b46a540626da4f5c6cb (patch)
tree113643a75541c7f87a64cd06b16a69bc5c0dacc9 /opengl/tests/gl_perf/filltest.cpp
parentddf719e519d84138dde1ab4ba66eae1beb1b87e6 (diff)
parentd997f71d3046424e977352d442b4944369ddbe9a (diff)
downloadframeworks_base-127612855a5c73ed4d8b2b46a540626da4f5c6cb.zip
frameworks_base-127612855a5c73ed4d8b2b46a540626da4f5c6cb.tar.gz
frameworks_base-127612855a5c73ed4d8b2b46a540626da4f5c6cb.tar.bz2
Merge "Rework gl perf test to focus on important use cases."
Diffstat (limited to 'opengl/tests/gl_perf/filltest.cpp')
-rw-r--r--opengl/tests/gl_perf/filltest.cpp58
1 files changed, 6 insertions, 52 deletions
diff --git a/opengl/tests/gl_perf/filltest.cpp b/opengl/tests/gl_perf/filltest.cpp
index 0dd4e22..3f8faca 100644
--- a/opengl/tests/gl_perf/filltest.cpp
+++ b/opengl/tests/gl_perf/filltest.cpp
@@ -33,65 +33,19 @@ using namespace android;
#include "fill_common.cpp"
-static void doSingleTest(uint32_t w, uint32_t h,
- bool useVarColor,
- int texCount,
- bool modulateFirstTex,
- int extraMath,
- int tex0, int tex1) {
- char *pgmTxt = genShader(useVarColor, texCount, modulateFirstTex, extraMath);
- int pgm = createProgram(gVertexShader, pgmTxt);
- if (!pgm) {
- printf("error running test\n");
- return;
- }
- int loc = glGetUniformLocation(pgm, "u_tex0");
- if (loc >= 0) glUniform1i(loc, 0);
- loc = glGetUniformLocation(pgm, "u_tex1");
- if (loc >= 0) glUniform1i(loc, 1);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, tex0);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, tex1);
- glActiveTexture(GL_TEXTURE0);
-
- char str2[1024];
-
- glBlendFunc(GL_ONE, GL_ONE);
- glDisable(GL_BLEND);
- //sprintf(str2, "%i, %i, %i, %i, %i, 0",
- //useVarColor, texCount, modulateFirstTex, extraMath, tex0);
- //doLoop(true, pgm, w, h, str2);
- //doLoop(false, pgm, w, h, str2);
-
- glEnable(GL_BLEND);
- sprintf(str2, "%i, %i, %i, %i, %i, 1",
- useVarColor, texCount, modulateFirstTex, extraMath, tex0);
- doLoop(true, pgm, w, h, str2);
- doLoop(false, pgm, w, h, str2);
-}
bool doTest(uint32_t w, uint32_t h) {
+ gWidth = w;
+ gHeight = h;
setupVA();
genTextures();
printf("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n");
- for (int texCount = 0; texCount < 2; texCount++) {
- for (int extraMath = 0; extraMath < 5; extraMath++) {
-
- doSingleTest(w, h, false, texCount, false, extraMath, 1, 1);
- doSingleTest(w, h, true, texCount, false, extraMath, 1, 1);
- if (texCount) {
- doSingleTest(w, h, false, texCount, true, extraMath, 1, 1);
- doSingleTest(w, h, true, texCount, true, extraMath, 1, 1);
-
- doSingleTest(w, h, false, texCount, false, extraMath, 2, 2);
- doSingleTest(w, h, true, texCount, false, extraMath, 2, 2);
- doSingleTest(w, h, false, texCount, true, extraMath, 2, 2);
- doSingleTest(w, h, true, texCount, true, extraMath, 2, 2);
- }
+ for (uint32_t num = 0; num < gFragmentTestCount; num++) {
+ doSingleTest(num, 2);
+ if (gFragmentTests[num]->texCount) {
+ doSingleTest(num, 1);
}
}