From a7f29640f6ab4eb50962a9d9f12d01ac2ce8b471 Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Thu, 7 Jul 2016 08:49:11 -0700 Subject: Begin instanced rendering for simple shapes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bench/ShapesBench.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bench/ShapesBench.cpp') 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 -- cgit v1.2.3