aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/GrInstancedPipelineInfo.h
blob: 196c35b96f98c4660bc51462cd899022c5bc0cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGrInstancedPipelineInfo_DEFINED
#define GrGrInstancedPipelineInfo_DEFINED

#include "GrRenderTargetProxy.h"

/**
 * Provides info about the pipeline that GrInstancedRendering needs in order to select appropriate
 * drawing algorithms.
 */
struct GrInstancedPipelineInfo {
    GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp)
        : fIsMultisampled(rtp->isStencilBufferMultisampled())
        , fIsMixedSampled(rtp->isMixedSampled())
        , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->desc().fConfig)) {}

    bool canUseCoverageAA() const { return !fIsMultisampled || fIsMixedSampled; }

    bool fIsMultisampled         : 1;
    bool fIsMixedSampled         : 1;
    bool fIsRenderingToFloat     : 1;
};

#endif