2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrGLNvprProgramBuilder_DEFINED
9 #define GrGLNvprProgramBuilder_DEFINED
11 #include "GrGLProgramBuilder.h"
13 class GrGLNvprProgramBuilder : public GrGLProgramBuilder {
15 GrGLNvprProgramBuilder(GrGpuGL*, const GrOptDrawState&);
18 * The separable varying info must be passed to GrGLProgram so this must
19 * be part of the public interface
21 struct SeparableVaryingInfo {
22 GrGLShaderVar fVariable;
26 typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray;
28 virtual GrGLProgram* createProgram(GrGLuint programID);
31 virtual void emitTransforms(const GrFragmentStage&,
32 GrGLProcessor::TransformedCoordsArray* outCoords,
33 GrGLInstalledFragProc*) SK_OVERRIDE;
35 typedef GrGLInstalledFragProc::ShaderVarHandle ShaderVarHandle;
38 * Add a separable varying input variable to the current program.
39 * A separable varying (fragment shader input) is a varying that can be used also when vertex
40 * shaders are not used. With a vertex shader, the operation is same as with other
41 * varyings. Without a vertex shader, such as with NV_path_rendering, GL APIs are used to
42 * populate the variable. The APIs can refer to the variable through the returned handle.
44 ShaderVarHandle addSeparableVarying(const char* name, GrGLVarying* v);
46 void resolveSeparableVaryings(GrGLuint programId);
48 SeparableVaryingInfoArray fSeparableVaryingInfos;
50 typedef GrGLProgramBuilder INHERITED;