egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 1 | /* |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 2 | * Copyright 2015 Google Inc. |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 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 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 8 | #ifndef GrPipeline_DEFINED |
| 9 | #define GrPipeline_DEFINED |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkRefCnt.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 12 | #include "src/gpu/GrColor.h" |
John Stiles | 87960de | 2021-06-03 16:44:53 -0400 | [diff] [blame] | 13 | #include "src/gpu/GrDstProxyView.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 14 | #include "src/gpu/GrFragmentProcessor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 15 | #include "src/gpu/GrProcessorSet.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | #include "src/gpu/GrScissorState.h" |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 17 | #include "src/gpu/GrSurfaceProxyView.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 18 | #include "src/gpu/GrUserStencilSettings.h" |
| 19 | #include "src/gpu/GrWindowRectsState.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 20 | #include "src/gpu/effects/GrPorterDuffXferProcessor.h" |
robertphillips | 5fa7f30 | 2016-07-21 09:21:04 -0700 | [diff] [blame] | 21 | |
Brian Salomon | 652ecb5 | 2017-01-17 12:39:53 -0500 | [diff] [blame] | 22 | class GrAppliedClip; |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 23 | class GrAppliedHardClip; |
John Stiles | 010d088 | 2021-06-03 20:28:41 -0400 | [diff] [blame] | 24 | struct GrGLSLBuiltinUniformHandles; |
| 25 | class GrGLSLProgramDataManager; |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 26 | class GrOp; |
Robert Phillips | 550de7f | 2021-07-06 16:28:52 -0400 | [diff] [blame] | 27 | class GrTextureEffect; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 28 | |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 29 | /** |
John Stiles | 7c328b4 | 2021-05-10 17:33:22 -0400 | [diff] [blame] | 30 | * This immutable object contains information needed to build a shader program and set API |
Robert Phillips | 787fd9d | 2021-03-22 14:48:09 -0400 | [diff] [blame] | 31 | * state for a draw. It is used along with a GrGeometryProcessor and a source of geometric |
Chris Dalton | eb694b7 | 2020-03-16 09:25:50 -0600 | [diff] [blame] | 32 | * data to draw. |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 33 | */ |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 34 | class GrPipeline { |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 35 | public: |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 36 | /////////////////////////////////////////////////////////////////////////// |
| 37 | /// @name Creation |
| 38 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 39 | // Pipeline options that the caller may enable. |
| 40 | // NOTE: This enum is extended later by GrPipeline::Flags. |
| 41 | enum class InputFlags : uint8_t { |
| 42 | kNone = 0, |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 43 | /** |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 44 | * Cause every pixel to be rasterized that is touched by the triangle anywhere (not just at |
| 45 | * pixel center). Additionally, if using MSAA, the sample mask will always have 100% |
| 46 | * coverage. |
| 47 | * NOTE: The primitive type must be a triangle type. |
| 48 | */ |
| 49 | kConservativeRaster = (1 << 1), |
| 50 | /** |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 51 | * Draws triangles as outlines. |
| 52 | */ |
| 53 | kWireframe = (1 << 2), |
| 54 | /** |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 55 | * Modifies the vertex shader so that vertices will be positioned at pixel centers. |
| 56 | */ |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 57 | kSnapVerticesToPixelCenters = (1 << 3), // This value must be last. (See kLastInputFlag.) |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 58 | }; |
| 59 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 60 | struct InitArgs { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 61 | InputFlags fInputFlags = InputFlags::kNone; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 62 | const GrCaps* fCaps = nullptr; |
John Stiles | 52cb1d0 | 2021-06-02 11:58:05 -0400 | [diff] [blame] | 63 | GrDstProxyView fDstProxyView; |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 64 | GrSwizzle fWriteSwizzle; |
bsalomon | a387a11 | 2015-08-11 14:47:42 -0700 | [diff] [blame] | 65 | }; |
| 66 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 67 | /** |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 68 | * Creates a simple pipeline with default settings and no processors. The provided blend mode |
Chris Dalton | 916c498 | 2018-08-15 00:53:25 -0600 | [diff] [blame] | 69 | * must be "Porter Duff" (<= kLastCoeffMode). If using GrScissorTest::kEnabled, the caller must |
Chris Dalton | 46983b7 | 2017-06-06 12:27:16 -0600 | [diff] [blame] | 70 | * specify a scissor rectangle through the DynamicState struct. |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 71 | **/ |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 72 | GrPipeline(GrScissorTest scissor, |
| 73 | SkBlendMode blend, |
| 74 | const GrSwizzle& writeSwizzle, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame] | 75 | InputFlags flags = InputFlags::kNone) |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 76 | : GrPipeline(scissor, |
| 77 | GrPorterDuffXPFactory::MakeNoCoverageXP(blend), |
| 78 | writeSwizzle, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame] | 79 | flags) {} |
Chris Dalton | c3318f0 | 2019-07-19 14:20:53 -0600 | [diff] [blame] | 80 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 81 | GrPipeline(GrScissorTest, |
| 82 | sk_sp<const GrXferProcessor>, |
| 83 | const GrSwizzle& writeSwizzle, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame] | 84 | InputFlags = InputFlags::kNone); |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 85 | |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 86 | GrPipeline(const InitArgs& args, sk_sp<const GrXferProcessor>, const GrAppliedHardClip&); |
Brian Salomon | bfd18cd | 2017-08-09 16:27:09 -0400 | [diff] [blame] | 87 | GrPipeline(const InitArgs&, GrProcessorSet&&, GrAppliedClip&&); |
Brian Salomon | 6d4b65e | 2017-05-03 17:06:09 -0400 | [diff] [blame] | 88 | |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 89 | GrPipeline(const GrPipeline&) = delete; |
| 90 | GrPipeline& operator=(const GrPipeline&) = delete; |
| 91 | |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 92 | /// @} |
| 93 | |
| 94 | /////////////////////////////////////////////////////////////////////////// |
bsalomon | 6be6f7c | 2015-02-26 13:05:21 -0800 | [diff] [blame] | 95 | /// @name GrFragmentProcessors |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 96 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 97 | int numFragmentProcessors() const { return fFragmentProcessors.count(); } |
Brian Osman | 3316796 | 2021-03-04 13:05:49 -0500 | [diff] [blame] | 98 | int numColorFragmentProcessors() const { return fNumColorProcessors; } |
John Stiles | d3feb6f | 2020-07-23 18:18:12 -0400 | [diff] [blame] | 99 | bool isColorFragmentProcessor(int idx) const { return idx < fNumColorProcessors; } |
| 100 | bool isCoverageFragmentProcessor(int idx) const { return idx >= fNumColorProcessors; } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 101 | |
Brian Salomon | 66b500a | 2021-08-02 12:37:14 -0400 | [diff] [blame] | 102 | bool usesLocalCoords() const { |
| 103 | // The sample coords for the top level FPs are implicitly the GP's local coords. |
Chris Dalton | 198ac15 | 2021-06-09 13:49:43 -0600 | [diff] [blame] | 104 | for (const auto& fp : fFragmentProcessors) { |
Brian Salomon | 66b500a | 2021-08-02 12:37:14 -0400 | [diff] [blame] | 105 | if (fp->usesSampleCoords()) { |
Chris Dalton | 198ac15 | 2021-06-09 13:49:43 -0600 | [diff] [blame] | 106 | return true; |
| 107 | } |
| 108 | } |
| 109 | return false; |
| 110 | } |
| 111 | |
Brian Salomon | d90b3d3 | 2020-07-09 12:04:31 -0400 | [diff] [blame] | 112 | void visitTextureEffects(const std::function<void(const GrTextureEffect&)>&) const; |
| 113 | |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 114 | const GrXferProcessor& getXferProcessor() const { |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 115 | if (fXferProcessor) { |
John Stiles | a008b0f | 2020-08-16 08:48:02 -0400 | [diff] [blame] | 116 | return *fXferProcessor; |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 117 | } else { |
| 118 | // A null xp member means the common src-over case. GrXferProcessor's ref'ing |
| 119 | // mechanism is not thread safe so we do not hold a ref on this global. |
| 120 | return GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 121 | } |
| 122 | } |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 123 | |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 124 | // Helper functions to quickly know if this GrPipeline will access the dst as a texture or an |
| 125 | // input attachment. |
Greg Daniel | 87fab9f | 2021-06-07 15:18:23 -0400 | [diff] [blame] | 126 | bool usesDstTexture() const { return this->dstProxyView() && !this->usesDstInputAttachment(); } |
| 127 | bool usesDstInputAttachment() const { |
Robert Phillips | 550de7f | 2021-07-06 16:28:52 -0400 | [diff] [blame] | 128 | return this->dstSampleFlags() & GrDstSampleFlags::kAsInputAttachment; |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 129 | } |
| 130 | |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 131 | /** |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 132 | * This returns the GrSurfaceProxyView for the texture used to access the dst color. If the |
| 133 | * GrXferProcessor does not use the dst color then the proxy on the GrSurfaceProxyView will be |
| 134 | * nullptr. |
| 135 | */ |
John Stiles | bcfdc1d | 2021-06-04 17:19:43 -0400 | [diff] [blame] | 136 | const GrSurfaceProxyView& dstProxyView() const { return fDstProxy.proxyView(); } |
| 137 | |
| 138 | SkIPoint dstTextureOffset() const { return fDstProxy.offset(); } |
| 139 | |
Greg Daniel | 87fab9f | 2021-06-07 15:18:23 -0400 | [diff] [blame] | 140 | GrDstSampleFlags dstSampleFlags() const { return fDstProxy.dstSampleFlags(); } |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 141 | |
John Stiles | 3e77d6e | 2021-06-04 15:30:50 -0400 | [diff] [blame] | 142 | /** If this GrXferProcessor uses a texture to access the dst color, returns that texture. */ |
| 143 | GrTexture* peekDstTexture() const { |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 144 | if (!this->usesDstTexture()) { |
| 145 | return nullptr; |
| 146 | } |
Robert Phillips | 3d4cac5 | 2019-06-11 08:08:08 -0400 | [diff] [blame] | 147 | |
John Stiles | bcfdc1d | 2021-06-04 17:19:43 -0400 | [diff] [blame] | 148 | if (GrTextureProxy* dstProxy = this->dstProxyView().asTextureProxy()) { |
Brian Salomon | fd98c2c | 2018-07-31 17:25:29 -0400 | [diff] [blame] | 149 | return dstProxy->peekTexture(); |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | return nullptr; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 153 | } |
| 154 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 155 | const GrFragmentProcessor& getFragmentProcessor(int idx) const { |
John Stiles | a008b0f | 2020-08-16 08:48:02 -0400 | [diff] [blame] | 156 | return *fFragmentProcessors[idx]; |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 157 | } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 158 | |
| 159 | /// @} |
| 160 | |
Chris Dalton | 2e7ed26 | 2020-02-21 15:17:59 -0700 | [diff] [blame] | 161 | bool isScissorTestEnabled() const { |
| 162 | return SkToBool(fFlags & Flags::kScissorTestEnabled); |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 163 | } |
joshualitt | 54e0c12 | 2014-11-19 09:38:51 -0800 | [diff] [blame] | 164 | |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 165 | const GrWindowRectsState& getWindowRectsState() const { return fWindowRectsState; } |
csmartdalton | 28341fa | 2016-08-17 10:00:21 -0700 | [diff] [blame] | 166 | |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 167 | bool usesConservativeRaster() const { return fFlags & InputFlags::kConservativeRaster; } |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 168 | bool isWireframe() const { return fFlags & InputFlags::kWireframe; } |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 169 | bool snapVerticesToPixelCenters() const { |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 170 | return fFlags & InputFlags::kSnapVerticesToPixelCenters; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 171 | } |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 172 | bool hasStencilClip() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 173 | return SkToBool(fFlags & Flags::kHasStencilClip); |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 174 | } |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 175 | #ifdef SK_DEBUG |
| 176 | bool allProxiesInstantiated() const { |
| 177 | for (int i = 0; i < fFragmentProcessors.count(); ++i) { |
| 178 | if (!fFragmentProcessors[i]->isInstantiated()) { |
| 179 | return false; |
| 180 | } |
| 181 | } |
John Stiles | bcfdc1d | 2021-06-04 17:19:43 -0400 | [diff] [blame] | 182 | if (this->dstProxyView().proxy()) { |
| 183 | return this->dstProxyView().proxy()->isInstantiated(); |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | return true; |
| 187 | } |
| 188 | #endif |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 189 | |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 190 | GrXferBarrierType xferBarrierType(const GrCaps&) const; |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 191 | |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 192 | // Used by Vulkan and Metal to cache their respective pipeline objects |
Chris Dalton | b204e4c | 2019-11-07 12:43:13 -0700 | [diff] [blame] | 193 | void genKey(GrProcessorKeyBuilder*, const GrCaps&) const; |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 194 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 195 | const GrSwizzle& writeSwizzle() const { return fWriteSwizzle; } |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 196 | |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 197 | void visitProxies(const GrVisitProxyFunc&) const; |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 198 | |
John Stiles | 010d088 | 2021-06-03 20:28:41 -0400 | [diff] [blame] | 199 | void setDstTextureUniforms(const GrGLSLProgramDataManager& pdm, |
| 200 | GrGLSLBuiltinUniformHandles* fBuiltinUniformHandles) const; |
| 201 | |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 202 | private: |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 203 | static constexpr uint8_t kLastInputFlag = (uint8_t)InputFlags::kSnapVerticesToPixelCenters; |
| 204 | |
| 205 | /** This is a continuation of the public "InputFlags" enum. */ |
| 206 | enum class Flags : uint8_t { |
| 207 | kHasStencilClip = (kLastInputFlag << 1), |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame] | 208 | kScissorTestEnabled = (kLastInputFlag << 2), |
bsalomon | 04ddf89 | 2014-11-19 12:36:22 -0800 | [diff] [blame] | 209 | }; |
| 210 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 211 | GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags); |
| 212 | |
| 213 | friend bool operator&(Flags, InputFlags); |
| 214 | |
John Stiles | 59e18dc | 2020-07-22 18:18:12 -0400 | [diff] [blame] | 215 | // A pipeline can contain up to three processors: color, paint coverage, and clip coverage. |
| 216 | using FragmentProcessorArray = SkAutoSTArray<3, std::unique_ptr<const GrFragmentProcessor>>; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 217 | |
John Stiles | bcfdc1d | 2021-06-04 17:19:43 -0400 | [diff] [blame] | 218 | GrDstProxyView fDstProxy; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 219 | GrWindowRectsState fWindowRectsState; |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 220 | Flags fFlags; |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 221 | sk_sp<const GrXferProcessor> fXferProcessor; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 222 | FragmentProcessorArray fFragmentProcessors; |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 223 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 224 | // This value is also the index in fFragmentProcessors where coverage processors begin. |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 225 | int fNumColorProcessors = 0; |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 226 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 227 | GrSwizzle fWriteSwizzle; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
Brian Osman | 2421b99 | 2021-06-19 10:44:54 -0400 | [diff] [blame] | 230 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::InputFlags) |
| 231 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::Flags) |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 232 | |
| 233 | inline bool operator&(GrPipeline::Flags flags, GrPipeline::InputFlags inputFlag) { |
| 234 | return (flags & (GrPipeline::Flags)inputFlag); |
| 235 | } |
| 236 | |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 237 | #endif |