• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 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 
8 #ifndef skgpu_graphite_render_TessellateWedgesRenderStep_DEFINED
9 #define skgpu_graphite_render_TessellateWedgesRenderStep_DEFINED
10 
11 #include "src/gpu/graphite/Renderer.h"
12 #include "src/gpu/graphite/ResourceTypes.h"
13 #include "src/gpu/tessellate/Tessellation.h"
14 
15 namespace skgpu::graphite {
16 
17 class StaticBufferManager;
18 
19 class TessellateWedgesRenderStep final : public RenderStep {
20 public:
21     // 'vertexBuffer' and 'indexBuffer' must have been returned by CreateVertexTemplate(), but they
22     // can be shared by all instances of TessellateWedgesRenderStep.
23     TessellateWedgesRenderStep(std::string_view variantName,
24                                bool infinitySupport,
25                                DepthStencilSettings depthStencilSettings,
26                                StaticBufferManager* bufferManager);
27 
28     ~TessellateWedgesRenderStep() override;
29 
30     static std::pair<BindBufferInfo, BindBufferInfo> CreateVertexTemplate(StaticBufferManager*);
31 
32     std::string vertexSkSL() const override;
33     void writeVertices(DrawWriter*, const DrawParams&, int ssboIndex) const override;
34     void writeUniformsAndTextures(const DrawParams&, PipelineDataGatherer*) const override;
35 
36 private:
37     // Points to the static buffers holding the fixed indexed vertex template for drawing instances.
38     BindBufferInfo fVertexBuffer;
39     BindBufferInfo fIndexBuffer;
40     bool fInfinitySupport;
41 };
42 
43 }  // namespace skgpu::graphite
44 
45 #endif // skgpu_graphite_render_TessellateWedgesRenderStep_DEFINED
46