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

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: get mixed samples and base instance paths working again Created 4 years, 6 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
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 fColorDisabled(false),
22 fDrawingShapeToStencil(false),
23 fCanDiscard(false) {
24 }
25
26 bool canUseCoverageAA() const {
27 return !fIsMultisampled || (fIsMixedSampled && !fDrawingShapeToStencil);
28 }
29
30 bool fIsMultisampled : 1;
31 bool fIsMixedSampled : 1;
32 bool fColorDisabled : 1;
33 /**
34 * Indicates that GrInstancedRendering should take extra precautions to ensu re the shape gets
35 * drawn correctly to the stencil buffer (e.g. no coverage AA). NOTE: this d oes not mean a
36 * stencil test is or is not active.
37 */
38 bool fDrawingShapeToStencil : 1;
39 /**
40 * Indicates that GrInstancedRendering can use processors with discard instr uctions. This should
41 * not be set if the shader will use derivatives, automatic mipmap LOD, or o ther features that
42 * depend on neighboring pixels. Some draws will fail to create if this is n ot set.
43 */
44 bool fCanDiscard : 1;
45 };
46
47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698