Make the shaded_cube benchmark actually draw the cube on the screen.
authorBernie Innocenti <bernie@codewiz.org>
Mon, 8 May 2017 03:34:39 +0000 (23:34 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 8 May 2017 03:34:39 +0000 (23:34 -0400)
benches/shaded_cube.rs

index 8ea5a0e53dc73788bc7d23bbda0c4861ec67c22f..ea4e5ead316d2e305c7c77a77c492ae34944b1ce 100644 (file)
@@ -18,10 +18,11 @@ fn bench_shaded_cube(b: &mut test::Bencher) {
     let cube = ShadedCube::new(&display, &bounds, &program);
     let mut frame = display.draw();
     b.iter(|| {
-        let mat = [[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.0f32]];
+        let model =     [[0.7, 0.5, -0.5, 0.0], [0.0, 0.7, 0.7, 0.0], [0.7, -0.5,  0.5,  0.0], [0., 0., -3.0, 1.0f32]];
+        let perspview = [[0.5, 0.0,  0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0,  0.0, -1.0, -1.0], [0., 0., -0.2, 0.0f32]];
         let uniforms = uniform! {
-            model: mat,
-            viewpersp: mat,
+            model: model,
+            perspview: perspview,
         };
         cube.draw(&mut frame, &uniforms);
     });