diff options
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r-- | src/gpu/glsl/GrGLSLShaderBuilder.cpp | 5 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLShaderBuilder.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp index 5609a9caa1..17f7f10287 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp @@ -35,6 +35,11 @@ void GrGLSLShaderBuilder::declAppend(const GrShaderVar& var) { this->codeAppendf("%s;", tempDecl.c_str()); } +void GrGLSLShaderBuilder::declareGlobal(const GrShaderVar& v) { + v.appendDecl(this->getProgramBuilder()->shaderCaps(), &this->definitions()); + this->definitions().append(";"); +} + void GrGLSLShaderBuilder::emitFunction(GrSLType returnType, const char* name, int argCnt, diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h index 983d50b926..2d6aaf08fa 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLShaderBuilder.h @@ -102,6 +102,8 @@ public: this->definitions().append(";\n"); } + void declareGlobal(const GrShaderVar&); + /** * Called by GrGLSLProcessors to add code to one of the shaders. */ |