OLD | NEW |
| (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 | |
OLD | NEW |