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