diff mbox

[Branch,~glcompbench-dev/glcompbench/trunk] Rev 33: Replace --no-vbo command line option with 'use-vbo' test option.

Message ID 20110623142315.3922.9229.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org June 23, 2011, 2:23 p.m. UTC
------------------------------------------------------------
revno: 33
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Thu 2011-06-23 16:32:36 +0300
message:
  Replace --no-vbo command line option with 'use-vbo' test option.
modified:
  src/composite-canvas.cc
  src/composite-test-simple-base.cc
  src/composite-test-simple-brick.cc
  src/composite-test.h
  src/options.cc
  src/options.h


--
lp:glcompbench
https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk

You are subscribed to branch lp:glcompbench.
To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/composite-canvas.cc'
--- src/composite-canvas.cc	2011-06-23 13:13:26 +0000
+++ src/composite-canvas.cc	2011-06-23 13:32:36 +0000
@@ -597,9 +597,7 @@ 
         current_test_ = &benchmark->setup_test();
         load_current_test_options();
         reshape(width_, height_);
-        Log::info("Running test: '%s' %susing vertex buffer objects\n", 
-                  current_test_->name().c_str(),
-                  (Options::use_vbo) ? "" : "NOT ");
+        Log::info("Running test: '%s'\n", current_test_->name().c_str());
 
         while (true) {
             if (handle_xevent()) {

=== modified file 'src/composite-test-simple-base.cc'
--- src/composite-test-simple-base.cc	2011-06-23 11:22:08 +0000
+++ src/composite-test-simple-base.cc	2011-06-23 13:32:36 +0000
@@ -34,6 +34,15 @@ 
 const string CompositeTestSimpleBase::texcoord_name_("texcoord");
 const string CompositeTestSimpleBase::position_name_("position");
 
+CompositeTestSimpleBase::CompositeTestSimpleBase(const std::string& test_name,
+                                                 const std::string& vs_filename,
+                                                 const std::string& fs_filename)
+    : CompositeTest(test_name), vs_filename_(vs_filename),
+      fs_filename_(fs_filename)
+{
+    options_["use-vbo"] = CompositeTest::Option("use-vbo", "true", "");
+}
+
 void
 CompositeTestSimpleBase::init()
 {
@@ -101,7 +110,6 @@ 
     vboData_.addTexCoord(vec2(0, 0));
 
     vboData_.genBufferObject();
-    vboData_.useBufferObject(Options::use_vbo);
 }
 
 /**
@@ -110,6 +118,8 @@ 
 void
 CompositeTestSimpleBase::prepare_for_run()
 {
+    vboData_.useBufferObject(options_["use-vbo"].value == "true");
+
     program_.start();
     int texUnit(0);
     program_.loadUniformScalar(texUnit, texture0_name_);

=== modified file 'src/composite-test-simple-brick.cc'
--- src/composite-test-simple-brick.cc	2011-06-23 11:22:08 +0000
+++ src/composite-test-simple-brick.cc	2011-06-23 13:32:36 +0000
@@ -38,19 +38,13 @@ 
 void
 CompositeTestSimpleBrick::prepare_for_run()
 {
+    CompositeTestSimpleBase::prepare_for_run();
+
     lightPos_ = LibMatrix::vec4(0.0, 1.0, 1.0, 0.0);
 
-    program_.start();
-    int texUnit(0);
-    program_.loadUniformScalar(texUnit, texture0_name_);
     program_.loadUniformVector(brickSize_, brickSizeName_);
     program_.loadUniformVector(brickPct_, brickPctName_);
     program_.loadUniformVector(lightPos_, lightPosName_);
-
-    glClearColor(0.1, 0.1, 0.3, 1.0);
-
-    glEnable(GL_BLEND);
-    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 }
 
 void

=== modified file 'src/composite-test.h'
--- src/composite-test.h	2011-06-23 13:10:17 +0000
+++ src/composite-test.h	2011-06-23 13:32:36 +0000
@@ -91,11 +91,8 @@ 
 {
 public:
     CompositeTestSimpleBase(const std::string& test_name,
-                            const std::string& vs_filename, 
-                            const std::string& fs_filename)
-        : CompositeTest(test_name), vs_filename_(vs_filename),
-          fs_filename_(fs_filename)
-        {}
+                            const std::string& vs_filename,
+                            const std::string& fs_filename);
 
     virtual void init();
     virtual void prepare_for_run();

=== modified file 'src/options.cc'
--- src/options.cc	2011-06-23 13:13:26 +0000
+++ src/options.cc	2011-06-23 13:32:36 +0000
@@ -40,7 +40,6 @@ 
 bool Options::manual_redirect = false;
 bool Options::show_debug = false;
 bool Options::show_help = false;
-bool Options::use_vbo = true;
 bool Options::list_tests = false;
 bool Options::swap_buffers = true;
 
@@ -48,7 +47,6 @@ 
     {"ids", 1, 0, 0},
     {"size", 1, 0, 0},
     {"no-accel-tfp", 0, 0, 0},
-    {"no-vbo", 0, 0, 0},
     {"benchmark", 1, 0, 0},
     {"no-draw", 0, 0, 0},
     {"idle-redraw", 0, 0, 0},
@@ -88,7 +86,6 @@ 
            "  --size <SIZE>      The size of each side of the main window in pixels\n"
            "                     [default: 512]\n"
            "  --no-accel-tfp     Don't use accelerated TFP (use glTexImage2D)\n"
-           "  --no-vbo           Don't use vertex buffer objects for drawing (use client vertex arrays)\n"
            "  --benchmark BENCH  A benchmark to run: 'test(:opt1=val1)*'\n"
            "                     (the option can be used multiple times)\n"
            "  --no-draw          Process the windows but don't draw anything on screen\n"
@@ -129,8 +126,6 @@ 
             Options::size = strtol(optarg, NULL, 10);
         else if (!strcmp(optname, "no-accel-tfp"))
             Options::use_accel_tfp = false;
-        else if (!strcmp(optname, "no-vbo"))
-            Options::use_vbo = false;
         else if (!strcmp(optname, "benchmark"))
             Options::benchmarks.push_back(optarg);
         else if (!strcmp(optname, "no-draw"))

=== modified file 'src/options.h'
--- src/options.h	2011-06-23 13:13:26 +0000
+++ src/options.h	2011-06-23 13:32:36 +0000
@@ -43,7 +43,6 @@ 
     static bool manual_redirect;
     static bool show_debug;
     static bool show_help;
-    static bool use_vbo;
     static bool list_tests;
     static bool swap_buffers;
 };