• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014 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 GrGLSLGeometryShaderBuilder_DEFINED
9 #define GrGLSLGeometryShaderBuilder_DEFINED
10 
11 #include "GrGLSLShaderBuilder.h"
12 
13 class GrGLSLVarying;
14 
15 class GrGLSLGeometryBuilder : public GrGLSLShaderBuilder {
16 public:
17     GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program);
18 
19     enum class InputType {
20         kPoints,
21         kLines,
22         kLinesAdjacency,
23         kTriangles,
24         kTrianglesAdjacency
25     };
26 
27     enum class OutputType {
28         kPoints,
29         kLineStrip,
30         kTriangleStrip
31     };
32 
33     void configure(InputType, OutputType, int maxVertices, int numInvocations = 1);
isConfigured()34     bool isConfigured() const { return fNumInvocations; }
35 
36 private:
37     void onFinalize() override;
38 
39     int fNumInvocations;
40 
41     friend class GrGLProgramBuilder;
42 
43     typedef GrGLSLShaderBuilder INHERITED;
44 };
45 
46 #endif
47