GrGLShaderBuilder.h revision 363e546ed626b6dbbc42f5db87b3594bc0b5944b
180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/* 280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2012 Google Inc. 380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * 480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be 580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file. 680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef GrGLShaderBuilder_DEFINED 980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define GrGLShaderBuilder_DEFINED 1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "GrAllocator.h" 12363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger#include "GrBackendEffectFactory.h" 13363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger#include "GrEffect.h" 1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "gl/GrGLShaderVar.h" 1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "gl/GrGLSL.h" 1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "gl/GrGLUniformManager.h" 1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass GrGLContextInfo; 1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/** 2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru Contains all the incremental state of a shader as it is being built,as well as helpers to 2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru manipulate that state. 2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru*/ 2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass GrGLShaderBuilder { 2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic: 2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** 27363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger * Used by GrGLEffects to add texture reads to their shader code. 2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru class TextureSampler { 3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru public: 3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru TextureSampler() 3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru : fTextureAccess(NULL) 3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru , fSamplerUniform(GrGLUniformManager::kInvalidUniformHandle) {} 3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru TextureSampler(const TextureSampler& other) { *this = other; } 3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 3780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru TextureSampler& operator= (const TextureSampler& other) { 3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(NULL == fTextureAccess); 3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(GrGLUniformManager::kInvalidUniformHandle == fSamplerUniform); 4080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru fTextureAccess = other.fTextureAccess; 4280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru fSamplerUniform = other.fSamplerUniform; 4380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru return *this; 4480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru } 4580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const GrTextureAccess* textureAccess() const { return fTextureAccess; } 4780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 4880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru private: 4980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void init(GrGLShaderBuilder* builder, const GrTextureAccess* access) { 5080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(NULL == fTextureAccess); 5180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(GrGLUniformManager::kInvalidUniformHandle == fSamplerUniform); 5280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 5380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(NULL != builder); 5480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(NULL != access); 5580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru fSamplerUniform = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, 5680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kSampler2D_GrSLType, 5780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru "Sampler"); 5880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrAssert(GrGLUniformManager::kInvalidUniformHandle != fSamplerUniform); 5980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 6080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru fTextureAccess = access; 6180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru } 6280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 6380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const GrTextureAccess* fTextureAccess; 6480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrGLUniformManager::UniformHandle fSamplerUniform; 6580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 6680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru friend class GrGLShaderBuilder; // to access fSamplerUniform 6780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru friend class GrGLProgram; // to construct these and access fSamplerUniform. 6880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 6980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 7080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru typedef SkTArray<TextureSampler> TextureSamplerArray; 7180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 7280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum ShaderType { 7380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kVertex_ShaderType = 0x1, 7480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kGeometry_ShaderType = 0x2, 7580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kFragment_ShaderType = 0x4, 7680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 7780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 7880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrGLShaderBuilder(const GrGLContextInfo&, GrGLUniformManager&); 7980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 80363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger /** Appends a 2D texture sample with projection if necessary. coordType must either be Vec2f or 81363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger Vec3f. The latter is interpreted as projective texture coords. The vec length and swizzle 82363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger order of the result depends on the GrTextureAccess associated with the TextureSampler. */ 8380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void appendTextureLookup(SkString* out, 8480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const TextureSampler&, 85363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const char* coordName, 8680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrSLType coordType = kVec2f_GrSLType) const; 8780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 8880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Does the work of appendTextureLookup and modulates the result by modulation. The result is 8980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru always a vec4. modulation and the swizzle specified by TextureSampler must both be vec4 or 9080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru float. If modulation is "" or NULL it this function acts as though appendTextureLookup were 9180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru called. */ 9280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void appendTextureLookupAndModulate(SkString* out, 9380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* modulation, 9480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const TextureSampler&, 95363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const char* coordName, 9680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrSLType coordType = kVec2f_GrSLType) const; 9780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 9880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Emits a helper function outside of main(). Currently ShaderType must be 9980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kFragment_ShaderType. */ 10080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void emitFunction(ShaderType shader, 10180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrSLType returnType, 10280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* name, 10380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru int argCnt, 10480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const GrGLShaderVar* args, 10580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* body, 10680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString* outName); 10780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 108363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger /** Generates a EffectKey for the shader code based on the texture access parameters and the 10980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru capabilities of the GL context. This is useful for keying the shader programs that may 11080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru have multiple representations, based on the type/format of textures used. */ 111363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger static GrBackendEffectFactory::EffectKey KeyForTextureAccess(const GrTextureAccess&, 112363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const GrGLCaps&); 11380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 11480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** If texture swizzling is available using tex parameters then it is preferred over mangling 11580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru the generated shader code. This potentially allows greater reuse of cached shaders. */ 11680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru static const GrGLenum* GetTexParamSwizzle(GrPixelConfig config, const GrGLCaps& caps); 11780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 118363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger /** Add a uniform variable to the current program, that has visibility in one or more shaders. 11980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru visibility is a bitfield of ShaderType values indicating from which shaders the uniform 12080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru should be accessible. At least one bit must be set. Geometry shader uniforms are not 12180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru supported at this time. The actual uniform name will be mangled. If outName is not NULL then 12280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru it will refer to the final uniform name after return. Use the addUniformArray variant to add 12380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru an array of uniforms. 12480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 12580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrGLUniformManager::UniformHandle addUniform(uint32_t visibility, 12680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrSLType type, 12780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* name, 12880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char** outName = NULL) { 12980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru return this->addUniformArray(visibility, type, name, GrGLShaderVar::kNonArray, outName); 13080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru } 13180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrGLUniformManager::UniformHandle addUniformArray(uint32_t visibility, 13280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrSLType type, 13380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* name, 13480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru int arrayCount, 13580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char** outName = NULL); 13680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 13780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle) const; 13880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 13980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** 140363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger * Shortcut for getUniformVariable(u).c_str() 14180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 14280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* getUniformCStr(GrGLUniformManager::UniformHandle u) const { 14380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru return this->getUniformVariable(u).c_str(); 14480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru } 14580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 14680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Add a varying variable to the current program to pass values between vertex and fragment 14780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru shaders. If the last two parameters are non-NULL, they are filled in with the name 14880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru generated. */ 14980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void addVarying(GrSLType type, 15080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char* name, 15180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char** vsOutName = NULL, 15280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru const char** fsInName = NULL); 15380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 154363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger /** Returns a variable name that represents the position of the fragment in the FS. The position 155363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger is in device space (e.g. 0,0 is the top left and pixel centers are at half-integers). */ 156363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const char* fragmentPosition(); 157363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger 158363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger /** Returns a vertex attribute that represents the vertex position in the VS. This is the 159363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger pre-matrix position and is commonly used by effects to compute texture coords via a matrix. 160363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger */ 161363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const GrGLShaderVar& positionAttribute() const { return *fPositionVar; } 162363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger 16380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** Called after building is complete to get the final shader string. */ 16480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void getShader(ShaderType, SkString*) const; 16580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 16680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** 167363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger * TODO: Make this do all the compiling, linking, etc. Hide from the GrEffects 16880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 16980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void finished(GrGLuint programID); 17080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 17180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru /** 17280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Sets the current stage (used to make variable names unique). 173363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger * TODO: Hide from the GrEffects 17480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */ 175363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger void setCurrentStage(int stageIdx) { fCurrentStageIdx = stageIdx; } 176363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger void setNonStage() { fCurrentStageIdx = kNonStageIdx; } 177363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger 178363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger GrGLUniformManager::UniformHandle getRTHeightUniform() const { return fRTHeightUniform; } 17980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 18080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate: 18180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 18280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru typedef GrTAllocator<GrGLShaderVar> VarArray; 18380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 18480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void appendDecls(const VarArray&, SkString*) const; 18580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru void appendUniformDecls(ShaderType, SkString*) const; 18680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 18780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru typedef GrGLUniformManager::BuilderUniform BuilderUniform; 18880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru GrGLUniformManager::BuilderUniformArray fUniforms; 18980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 19080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru // TODO: Everything below here private. 19180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic: 19280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 19380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString fHeader; // VS+FS, GLSL version, etc 19480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fVSAttrs; 19580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fVSOutputs; 19680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fGSInputs; 19780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fGSOutputs; 19880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fFSInputs; 19980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString fGSHeader; // layout qualifiers specific to GS 20080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru VarArray fFSOutputs; 20180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString fVSCode; 20280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString fGSCode; 20380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru SkString fFSCode; 20480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru bool fUsesGS; 20580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 20680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate: 20780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru enum { 20880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru kNonStageIdx = -1, 20980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru }; 21080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 211363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger const GrGLContextInfo& fContext; 212363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger GrGLUniformManager& fUniformManager; 213363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger int fCurrentStageIdx; 214363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger SkString fFSFunctions; 215363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger SkString fFSHeader; 21680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 217363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger bool fSetupFragPosition; 218363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger GrGLUniformManager::UniformHandle fRTHeightUniform; 21980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 220363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger GrGLShaderVar* fPositionVar; 22180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru}; 22280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru 22380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif 224