forked from scala-native/scala-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TracerBenchmark.scala
43 lines (34 loc) · 1.37 KB
/
TracerBenchmark.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */
// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
// http://labs.flog.co.nz/raytracer/
//
// Ported from the v8 benchmark suite by Google 2012.
// Ported from the Dart benchmark_harness to Scala.js by Jonas Fonseca 2013
package tracer
import benchmarks.{BenchmarkRunningTime, LongRunningTime}
class TracerBenchmark extends benchmarks.Benchmark[Unit] {
val config = EngineConfiguration(
imageWidth = 100,
imageHeight = 100,
pixelWidth = 5,
pixelHeight = 5,
rayDepth = 2,
renderDiffuse = true,
renderShadows = true,
renderHighlights = true,
renderReflections = true
)
override val runningTime: BenchmarkRunningTime = LongRunningTime
override def run(): Unit =
new RenderScene().renderScene(config, null)
override def check(t: Unit): Boolean =
true
}