Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: include/private/GrInstancedPipelineInfo.h

Issue 2066993003: Begin instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rix perf regressions Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrGrInstancedPipelineInfo_DEFINED
9 #define GrGrInstancedPipelineInfo_DEFINED
10
11 #include "GrRenderTarget.h"
12
13 /**
14 * Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate
15 * drawing algorithms.
16 */
17 struct GrInstancedPipelineInfo {
18 GrInstancedPipelineInfo(const GrRenderTarget* rt)
19 : fIsMultisampled(rt->isStencilBufferMultisampled()),
20 fIsMixedSampled(rt->hasMixedSamples()),
21 fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rt->desc().fConfig)),
22 fColorDisabled(false),
23 fDrawingShapeToStencil(false),
24 fCanDiscard(false) {
25 }
26
27 bool canUseCoverageAA() const {
28 return !fIsMultisampled || (fIsMixedSampled && !fDrawingShapeToStencil);
29 }
30
31 bool fIsMultisampled : 1;
32 bool fIsMixedSampled : 1;
33 bool fIsRenderingToFloat : 1;
34 bool fColorDisabled : 1;
35 /**
36 * Indicates that the instanced renderer should take extra precautions to en sure the shape gets
37 * drawn correctly to the stencil buffer (e.g. no coverage AA). NOTE: this d oes not mean a
38 * stencil test is or is not active.
39 */
40 bool fDrawingShapeToStencil : 1;
41 /**
42 * Indicates that the instanced renderer can use processors with discard ins tructions. This
43 * should not be set if the shader will use derivatives, automatic mipmap LO D, or other features
44 * that depend on neighboring pixels. Some draws will fail to create if this is not set.
45 */
46 bool fCanDiscard : 1;
47 };
48
49 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698