aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ShapesBench.cpp
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-07-07 08:49:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-07 08:49:11 -0700
commita7f29640f6ab4eb50962a9d9f12d01ac2ce8b471 (patch)
treeb2ab8bb78abede727cf680cfeca76e385bd7205b /bench/ShapesBench.cpp
parentd5f6e9a759891473b8211efb90f665b14a85b830 (diff)
Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it for a select subset of draws on Mac GL platforms. The instance processor can currently handle rects, ovals, round rects, and double round rects. It can generalize shapes as round rects in order to improve batching. The instance processor also employs new drawing algorithms, irrespective of instanced rendering, that improve GPU-side performance (e.g. sample mask, different triangle layouts, etc.). This change only scratches the surface of instanced rendering. The majority of draws still only have one instance. Future work may include: * Passing coord transforms through the texel buffer. * Sending FP uniforms through instanced vertex attribs. * Using instanced rendering for more draws (stencil writes, drawAtlas, etc.). * Adding more shapes to the instance processor’s repertoire. * Batching draws that have mismatched scissors (analyzing draw bounds, inserting clip planes, etc.). * Bindless textures. * Uber shaders. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2066993003 Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891 Review-Url: https://codereview.chromium.org/2066993003
Diffstat (limited to 'bench/ShapesBench.cpp')
-rw-r--r--bench/ShapesBench.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/bench/ShapesBench.cpp b/bench/ShapesBench.cpp
index a658c453d1..83f0e455b1 100644
--- a/bench/ShapesBench.cpp
+++ b/bench/ShapesBench.cpp
@@ -248,6 +248,9 @@ private:
typedef Benchmark INHERITED;
};
+#if ENABLE_COMMAND_LINE_SHAPES_BENCH
+DEF_BENCH(return new ShapesBench;)
+#else
// Small primitives (CPU bound, in theory):
DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kNone_ShapesType,
10000, SkISize::Make(32, 32), false);)
@@ -282,7 +285,4 @@ DEF_BENCH(return new ShapesBench(ShapesBench::kRect_ShapesType, ShapesBench::kRe
50, SkISize::Make(500, 500), false);)
DEF_BENCH(return new ShapesBench(ShapesBench::kRRect_ShapesType, ShapesBench::kRRect_ShapesType,
50, SkISize::Make(500, 500), false);)
-
-#if ENABLE_COMMAND_LINE_SHAPES_BENCH
-DEF_BENCH(return new ShapesBench;)
#endif