blob: b89f8632cf67e9e45e608837dd209eaaa48d9959 [file] [log] [blame]
csmartdaltona7f29642016-07-07 08:49:11 -07001/*
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
Robert Phillipsc7635fa2016-10-28 13:25:24 -040011#include "GrRenderTargetProxy.h"
csmartdaltona7f29642016-07-07 08:49:11 -070012
13/**
14 * Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate
15 * drawing algorithms.
16 */
17struct GrInstancedPipelineInfo {
Robert Phillipsc7635fa2016-10-28 13:25:24 -040018 GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp)
Brian Salomon7c8460e2017-05-12 11:36:10 -040019 : fIsMultisampled(GrFSAAType::kNone != rtp->fsaaType())
20 , fIsMixedSampled(GrFSAAType::kMixedSamples == rtp->fsaaType())
Brian Salomon63e79732017-05-15 21:23:13 -040021 , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->config())) {}
csmartdaltona7f29642016-07-07 08:49:11 -070022
Brian Salomon5ff3a5c2017-03-01 14:34:41 -050023 bool canUseCoverageAA() const { return !fIsMultisampled || fIsMixedSampled; }
csmartdaltona7f29642016-07-07 08:49:11 -070024
25 bool fIsMultisampled : 1;
26 bool fIsMixedSampled : 1;
27 bool fIsRenderingToFloat : 1;
csmartdaltona7f29642016-07-07 08:49:11 -070028};
29
30#endif