Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021 Google LLC. |
| 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 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 8 | #include "src/gpu/tessellate/GrPathStencilCoverOp.h" |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 9 | |
| 10 | #include "src/gpu/GrEagerVertexAllocator.h" |
Chris Dalton | d9bdc32 | 2021-06-01 19:22:05 -0600 | [diff] [blame] | 11 | #include "src/gpu/GrGpu.h" |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 12 | #include "src/gpu/GrOpFlushState.h" |
| 13 | #include "src/gpu/GrRecordingContextPriv.h" |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 14 | #include "src/gpu/glsl/GrGLSLProgramBuilder.h" |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 15 | #include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h" |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 16 | #include "src/gpu/tessellate/GrMiddleOutPolygonTriangulator.h" |
Chris Dalton | d9bdc32 | 2021-06-01 19:22:05 -0600 | [diff] [blame] | 17 | #include "src/gpu/tessellate/GrPathCurveTessellator.h" |
Chris Dalton | d9bdc32 | 2021-06-01 19:22:05 -0600 | [diff] [blame] | 18 | #include "src/gpu/tessellate/GrPathWedgeTessellator.h" |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 19 | #include "src/gpu/tessellate/GrTessellationPathRenderer.h" |
Chris Dalton | 3b41278 | 2021-06-01 13:40:03 -0600 | [diff] [blame] | 20 | #include "src/gpu/tessellate/shaders/GrPathTessellationShader.h" |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 21 | |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 22 | using PathFlags = GrTessellationPathRenderer::PathFlags; |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 23 | |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 24 | namespace { |
| 25 | |
| 26 | // Fills a path's bounding box, with subpixel outset to avoid possible T-junctions with extreme |
| 27 | // edges of the path. |
| 28 | // NOTE: The emitted geometry may not be axis-aligned, depending on the view matrix. |
| 29 | class BoundingBoxShader : public GrPathTessellationShader { |
| 30 | public: |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 31 | BoundingBoxShader(const SkMatrix& viewMatrix, SkPMColor4f color, const GrShaderCaps& shaderCaps) |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 32 | : GrPathTessellationShader(kTessellate_BoundingBoxShader_ClassID, |
| 33 | GrPrimitiveType::kTriangleStrip, 0, viewMatrix, color) { |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 34 | constexpr static Attribute kPathBoundsAttrib("pathBounds", kFloat4_GrVertexAttribType, |
| 35 | kFloat4_GrSLType); |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 36 | this->setInstanceAttributes(&kPathBoundsAttrib, 1); |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 37 | if (!shaderCaps.vertexIDSupport()) { |
| 38 | constexpr static Attribute kUnitCoordAttrib("unitCoord", kFloat2_GrVertexAttribType, |
| 39 | kFloat2_GrSLType); |
| 40 | this->setVertexAttributes(&kUnitCoordAttrib, 1); |
| 41 | } |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | private: |
Chris Dalton | b63711a | 2021-06-01 14:52:02 -0600 | [diff] [blame] | 45 | const char* name() const final { return "tessellate_BoundingBoxShader"; } |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 46 | void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const final {} |
| 47 | GrGLSLGeometryProcessor* createGLSLInstance(const GrShaderCaps&) const final; |
| 48 | }; |
| 49 | |
| 50 | GrGLSLGeometryProcessor* BoundingBoxShader::createGLSLInstance(const GrShaderCaps&) const { |
| 51 | class Impl : public GrPathTessellationShader::Impl { |
Chris Dalton | d2b8ba3 | 2021-06-09 00:12:59 -0600 | [diff] [blame] | 52 | void emitVertexCode(const GrPathTessellationShader&, GrGLSLVertexBuilder* v, |
| 53 | GrGPArgs* gpArgs) override { |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 54 | if (v->getProgramBuilder()->caps()->shaderCaps()->vertexIDSupport()) { |
| 55 | // If we don't have sk_VertexID support then "unitCoord" already came in as a vertex |
| 56 | // attrib. |
| 57 | v->codeAppendf(R"( |
| 58 | float2 unitCoord = float2(sk_VertexID & 1, sk_VertexID >> 1);)"); |
| 59 | } |
| 60 | |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 61 | v->codeAppend(R"( |
| 62 | // Bloat the bounding box by 1/4px to avoid potential T-junctions at the edges. |
| 63 | float2x2 M_ = inverse(AFFINE_MATRIX); |
| 64 | float2 bloat = float2(abs(M_[0]) + abs(M_[1])) * .25; |
| 65 | |
| 66 | // Find the vertex position. |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 67 | float2 localcoord = mix(pathBounds.xy - bloat, pathBounds.zw + bloat, unitCoord); |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 68 | float2 vertexpos = AFFINE_MATRIX * localcoord + TRANSLATE;)"); |
| 69 | gpArgs->fLocalCoordVar.set(kFloat2_GrSLType, "localcoord"); |
| 70 | gpArgs->fPositionVar.set(kFloat2_GrSLType, "vertexpos"); |
| 71 | } |
| 72 | }; |
| 73 | return new Impl; |
| 74 | } |
| 75 | |
| 76 | } // namespace |
| 77 | |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 78 | void GrPathStencilCoverOp::visitProxies(const GrVisitProxyFunc& func) const { |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 79 | if (fCoverBBoxProgram) { |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 80 | fCoverBBoxProgram->pipeline().visitProxies(func); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 81 | } else { |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 82 | fProcessors.visitProxies(func); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 83 | } |
| 84 | } |
| 85 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 86 | GrDrawOp::FixedFunctionFlags GrPathStencilCoverOp::fixedFunctionFlags() const { |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 87 | auto flags = FixedFunctionFlags::kUsesStencil; |
| 88 | if (fAAType != GrAAType::kNone) { |
| 89 | flags |= FixedFunctionFlags::kUsesHWAA; |
| 90 | } |
| 91 | return flags; |
| 92 | } |
| 93 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 94 | GrProcessorSet::Analysis GrPathStencilCoverOp::finalize(const GrCaps& caps, |
| 95 | const GrAppliedClip* clip, |
| 96 | GrClampType clampType) { |
Chris Dalton | 57ab06c | 2021-04-22 12:57:28 -0600 | [diff] [blame] | 97 | return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr, caps, |
| 98 | clampType, &fColor); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 99 | } |
| 100 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 101 | void GrPathStencilCoverOp::prePreparePrograms(const GrTessellationShader::ProgramArgs& args, |
| 102 | GrAppliedClip&& appliedClip) { |
Chris Dalton | 569c01b | 2021-05-25 10:11:46 -0600 | [diff] [blame] | 103 | SkASSERT(!fTessellator); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 104 | SkASSERT(!fStencilFanProgram); |
| 105 | SkASSERT(!fStencilPathProgram); |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 106 | SkASSERT(!fCoverBBoxProgram); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 107 | |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 108 | const GrPipeline* stencilPipeline = GrPathTessellationShader::MakeStencilOnlyPipeline( |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 109 | args, fAAType, fPathFlags, appliedClip.hardClip()); |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 110 | const GrUserStencilSettings* stencilPathSettings = |
Chris Dalton | baae2dd | 2021-06-25 14:52:49 -0600 | [diff] [blame] | 111 | GrPathTessellationShader::StencilPathSettings(GrFillRuleForSkPath(fPath)); |
Chris Dalton | 569c01b | 2021-05-25 10:11:46 -0600 | [diff] [blame] | 112 | |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 113 | if (fPath.countVerbs() > 50 && this->bounds().height() * this->bounds().width() > 256 * 256) { |
Chris Dalton | d2b8ba3 | 2021-06-09 00:12:59 -0600 | [diff] [blame] | 114 | // Large complex paths do better with a dedicated triangle shader for the inner fan. |
| 115 | // This takes less PCI bus bandwidth (6 floats per triangle instead of 8) and allows us |
| 116 | // to make sure it has an efficient middle-out topology. |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 117 | auto shader = GrPathTessellationShader::MakeSimpleTriangleShader( |
| 118 | args.fArena, fViewMatrix, SK_PMColor4fTRANSPARENT); |
| 119 | fStencilFanProgram = GrTessellationShader::MakeProgram(args, shader, stencilPipeline, |
| 120 | stencilPathSettings); |
Chris Dalton | d2b8ba3 | 2021-06-09 00:12:59 -0600 | [diff] [blame] | 121 | fTessellator = GrPathCurveTessellator::Make(args.fArena, fViewMatrix, |
| 122 | SK_PMColor4fTRANSPARENT, |
| 123 | GrPathCurveTessellator::DrawInnerFan::kNo, |
Chris Dalton | 198ac15 | 2021-06-09 13:49:43 -0600 | [diff] [blame] | 124 | fPath.countVerbs(), *stencilPipeline, |
| 125 | *args.fCaps); |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 126 | } else { |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 127 | fTessellator = GrPathWedgeTessellator::Make(args.fArena, fViewMatrix, |
Chris Dalton | d2b8ba3 | 2021-06-09 00:12:59 -0600 | [diff] [blame] | 128 | SK_PMColor4fTRANSPARENT, fPath.countVerbs(), |
Chris Dalton | 198ac15 | 2021-06-09 13:49:43 -0600 | [diff] [blame] | 129 | *stencilPipeline, *args.fCaps); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 130 | } |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 131 | fStencilPathProgram = GrTessellationShader::MakeProgram(args, fTessellator->shader(), |
| 132 | stencilPipeline, stencilPathSettings); |
Chris Dalton | 569c01b | 2021-05-25 10:11:46 -0600 | [diff] [blame] | 133 | |
Chris Dalton | 917f919 | 2021-06-08 14:32:37 -0600 | [diff] [blame] | 134 | if (!(fPathFlags & PathFlags::kStencilOnly)) { |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 135 | // Create a program that draws a bounding box over the path and fills its stencil coverage |
| 136 | // into the color buffer. |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 137 | auto* bboxShader = args.fArena->make<BoundingBoxShader>(fViewMatrix, fColor, |
| 138 | *args.fCaps->shaderCaps()); |
Chris Dalton | 2f733ec | 2021-06-01 12:11:57 -0600 | [diff] [blame] | 139 | auto* bboxPipeline = GrTessellationShader::MakePipeline(args, fAAType, |
| 140 | std::move(appliedClip), |
| 141 | std::move(fProcessors)); |
Chris Dalton | baae2dd | 2021-06-25 14:52:49 -0600 | [diff] [blame] | 142 | auto* bboxStencil = |
| 143 | GrPathTessellationShader::TestAndResetStencilSettings(fPath.isInverseFillType()); |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 144 | fCoverBBoxProgram = GrTessellationShader::MakeProgram(args, bboxShader, bboxPipeline, |
| 145 | bboxStencil); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 146 | } |
| 147 | } |
| 148 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 149 | void GrPathStencilCoverOp::onPrePrepare(GrRecordingContext* context, |
| 150 | const GrSurfaceProxyView& writeView, GrAppliedClip* clip, |
| 151 | const GrDstProxyView& dstProxyView, |
| 152 | GrXferBarrierFlags renderPassXferBarriers, |
| 153 | GrLoadOp colorLoadOp) { |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 154 | this->prePreparePrograms({context->priv().recordTimeAllocator(), writeView, &dstProxyView, |
| 155 | renderPassXferBarriers, colorLoadOp, context->priv().caps()}, |
| 156 | (clip) ? std::move(*clip) : GrAppliedClip::Disabled()); |
| 157 | if (fStencilFanProgram) { |
| 158 | context->priv().recordProgramInfo(fStencilFanProgram); |
| 159 | } |
| 160 | if (fStencilPathProgram) { |
| 161 | context->priv().recordProgramInfo(fStencilPathProgram); |
| 162 | } |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 163 | if (fCoverBBoxProgram) { |
| 164 | context->priv().recordProgramInfo(fCoverBBoxProgram); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 165 | } |
| 166 | } |
| 167 | |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 168 | GR_DECLARE_STATIC_UNIQUE_KEY(gUnitQuadBufferKey); |
| 169 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 170 | void GrPathStencilCoverOp::onPrepare(GrOpFlushState* flushState) { |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 171 | if (!fTessellator) { |
| 172 | this->prePreparePrograms({flushState->allocator(), flushState->writeView(), |
| 173 | &flushState->dstProxyView(), flushState->renderPassBarriers(), |
| 174 | flushState->colorLoadOp(), &flushState->caps()}, |
| 175 | flushState->detachAppliedClip()); |
| 176 | if (!fTessellator) { |
| 177 | return; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | if (fStencilFanProgram) { |
| 182 | // The inner fan isn't built into the tessellator. Generate a standard Redbook fan with a |
| 183 | // middle-out topology. |
| 184 | GrEagerDynamicVertexAllocator vertexAlloc(flushState, &fFanBuffer, &fFanBaseVertex); |
| 185 | int maxFanTriangles = fPath.countVerbs() - 2; // n - 2 triangles make an n-gon. |
Chris Dalton | 8731a71 | 2021-05-14 14:48:54 -0600 | [diff] [blame] | 186 | GrVertexWriter triangleVertexWriter = vertexAlloc.lock<SkPoint>(maxFanTriangles * 3); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 187 | fFanVertexCount = GrMiddleOutPolygonTriangulator::WritePathInnerFan( |
Chris Dalton | df2dbad | 2021-05-14 16:21:15 -0600 | [diff] [blame] | 188 | &triangleVertexWriter, GrMiddleOutPolygonTriangulator::OutputType::kTriangles, |
| 189 | fPath) * 3; |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 190 | SkASSERT(fFanVertexCount <= maxFanTriangles * 3); |
| 191 | vertexAlloc.unlock(fFanVertexCount); |
| 192 | } |
| 193 | |
Chris Dalton | 569c01b | 2021-05-25 10:11:46 -0600 | [diff] [blame] | 194 | fTessellator->prepare(flushState, this->bounds(), fPath); |
Chris Dalton | c91dd69 | 2021-05-24 15:04:47 -0600 | [diff] [blame] | 195 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 196 | if (fCoverBBoxProgram) { |
Chris Dalton | c91dd69 | 2021-05-24 15:04:47 -0600 | [diff] [blame] | 197 | GrVertexWriter vertexWriter = flushState->makeVertexSpace(sizeof(SkRect), 1, &fBBoxBuffer, |
| 198 | &fBBoxBaseInstance); |
Chris Dalton | baae2dd | 2021-06-25 14:52:49 -0600 | [diff] [blame] | 199 | if (fPath.isInverseFillType()) { |
| 200 | // Fill the entire backing store to make sure we clear every stencil value back to 0. If |
| 201 | // there is a scissor it will have already clipped the stencil draw. |
| 202 | auto rtBounds = flushState->writeView().asRenderTargetProxy()->backingStoreBoundsRect(); |
| 203 | SkASSERT(rtBounds == fOriginalDrawBounds); |
| 204 | SkRect pathSpaceRTBounds; |
| 205 | if (SkMatrixPriv::InverseMapRect(fViewMatrix, &pathSpaceRTBounds, rtBounds)) { |
| 206 | vertexWriter.write(pathSpaceRTBounds); |
| 207 | } else { |
| 208 | vertexWriter.write(fPath.getBounds()); |
| 209 | } |
| 210 | } else { |
| 211 | vertexWriter.write(fPath.getBounds()); |
| 212 | } |
Chris Dalton | c91dd69 | 2021-05-24 15:04:47 -0600 | [diff] [blame] | 213 | } |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 214 | |
| 215 | if (!flushState->caps().shaderCaps()->vertexIDSupport()) { |
| 216 | constexpr static SkPoint kUnitQuad[4] = {{0,0}, {0,1}, {1,0}, {1,1}}; |
| 217 | |
| 218 | GR_DEFINE_STATIC_UNIQUE_KEY(gUnitQuadBufferKey); |
| 219 | |
| 220 | fBBoxVertexBufferIfNoIDSupport = flushState->resourceProvider()->findOrMakeStaticBuffer( |
| 221 | GrGpuBufferType::kVertex, sizeof(kUnitQuad), kUnitQuad, gUnitQuadBufferKey); |
| 222 | } |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 223 | } |
| 224 | |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 225 | void GrPathStencilCoverOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) { |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 226 | if (!fTessellator) { |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | // Stencil the inner fan, if any. |
| 231 | if (fFanVertexCount > 0) { |
| 232 | SkASSERT(fStencilFanProgram); |
| 233 | SkASSERT(fFanBuffer); |
| 234 | flushState->bindPipelineAndScissorClip(*fStencilFanProgram, this->bounds()); |
| 235 | flushState->bindBuffers(nullptr, nullptr, fFanBuffer); |
| 236 | flushState->draw(fFanVertexCount, fFanBaseVertex); |
| 237 | } |
| 238 | |
| 239 | // Stencil the rest of the path. |
| 240 | SkASSERT(fStencilPathProgram); |
| 241 | flushState->bindPipelineAndScissorClip(*fStencilPathProgram, this->bounds()); |
| 242 | fTessellator->draw(flushState); |
Chris Dalton | d9bdc32 | 2021-06-01 19:22:05 -0600 | [diff] [blame] | 243 | if (flushState->caps().requiresManualFBBarrierAfterTessellatedStencilDraw()) { |
| 244 | flushState->gpu()->insertManualFramebufferBarrier(); // http://skbug.com/9739 |
| 245 | } |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 246 | |
| 247 | // Fill in the bounding box (if not in stencil-only mode). |
Chris Dalton | 031d76b | 2021-06-08 16:32:00 -0600 | [diff] [blame] | 248 | if (fCoverBBoxProgram) { |
| 249 | flushState->bindPipelineAndScissorClip(*fCoverBBoxProgram, this->bounds()); |
| 250 | flushState->bindTextures(fCoverBBoxProgram->geomProc(), nullptr, |
| 251 | fCoverBBoxProgram->pipeline()); |
Chris Dalton | a05ccc3 | 2021-06-29 19:42:13 -0600 | [diff] [blame^] | 252 | flushState->bindBuffers(nullptr, fBBoxBuffer, fBBoxVertexBufferIfNoIDSupport); |
Chris Dalton | c91dd69 | 2021-05-24 15:04:47 -0600 | [diff] [blame] | 253 | flushState->drawInstanced(1, fBBoxBaseInstance, 4, 0); |
Chris Dalton | 70a0d2c | 2021-01-26 12:01:21 -0700 | [diff] [blame] | 254 | } |
| 255 | } |