Index: src/gpu/gl/builders/GrGLProgramBuilder.h |
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h |
index 09f7eba511ce8c6877ecc7de0b2a2daecc34d864..d1af63fc4ee3fa5369274480fee71bf7232bed81 100644 |
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h |
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h |
@@ -40,6 +40,7 @@ public: |
}; |
typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
+ typedef GrGLProgramDataManager::VaryingHandle VaryingHandle; |
// Handles for program uniforms (other than per-effect uniforms) |
struct BuiltinUniformHandles { |
@@ -69,6 +70,13 @@ public: |
// name strings. Otherwise, we'd have to hand out copies. |
typedef GrTAllocator<UniformInfo> UniformInfoArray; |
+ struct SeparableVaryingInfo { |
+ GrGLShaderVar fVariable; |
+ GrGLint fLocation; |
+ }; |
+ |
+ typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray; |
+ |
/** Generates a shader program. |
* |
* The program implements what is specified in the stages given as input. |
@@ -91,6 +99,9 @@ public: |
bool hasVertexShader() const { SkASSERT(fProgramID); return !fFragOnly; } |
int getTexCoordSetCount() const { SkASSERT(fProgramID); return fTexCoordSetCnt; } |
const UniformInfoArray& getUniformInfos() const { return fUniforms; } |
+ const SeparableVaryingInfoArray& getSeparableVaryingInfos() const { |
+ return fSeparableVaryingInfos; |
+ } |
virtual ~GrGLProgramBuilder() {} |
@@ -126,13 +137,12 @@ public: |
const GrGLContextInfo& ctxInfo() const; |
GrGLFragmentShaderBuilder* getFragmentShaderBuilder() { return &fFS; } |
+ GrGpuGL* gpu() const { return fGpu; } |
protected: |
typedef GrTAllocator<GrGLShaderVar> VarArray; |
GrGLProgramBuilder(GrGpuGL*, const GrGLProgramDesc&); |
- GrGpuGL* gpu() const { return fGpu; } |
- |
const GrGLProgramDesc& desc() const { return fDesc; } |
// Helper for emitEffects(). |
@@ -162,6 +172,7 @@ protected: |
int fTexCoordSetCnt; |
GrGLuint fProgramID; |
GrGLFragmentShaderBuilder fFS; |
+ SeparableVaryingInfoArray fSeparableVaryingInfos; |
private: |
class CodeStage : SkNoncopyable { |
public: |
@@ -271,6 +282,17 @@ public: |
const char** vsOutName = NULL, |
const char** fsInName = NULL); |
+ /** Add a separable varying input variable to the current program. |
+ * A separable varying (fragment shader input) is a varying that can be used also when vertex |
+ * shaders are not used. With a vertex shader, the operation is same as with other |
+ * varyings. Without a vertex shader, such as with NV_path_rendering, GL APIs are used to |
+ * populate the variable. The APIs can refer to the variable through the returned handle. |
+ */ |
+ VaryingHandle addSeparableVarying(GrSLType type, |
+ const char* name, |
+ const char** vsOutName, |
+ const char** fsInName); |
+ |
joshua.litt
2014/08/25 17:00:05
Since this only requires a fragment shader, does i
Chris Dalton
2014/08/25 18:04:50
It actually does require a vertex shader. Not for
|
GrGLVertexShaderBuilder* getVertexShaderBuilder() { return &fVS; } |
private: |