aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2017-02-09 09:47:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-10 22:51:45 +0000
commit75864b09e11a1918f202093d042f23ca0b3c8530 (patch)
tree6a12503d5a9e9f0a1716ece93afae00efa0ba822 /src/gpu
parent29d871554b195206e35e2d5837d1073ddccc1b6b (diff)
Add GrGLSLShaderBuilder::declareGlobal
BUG=skia: Change-Id: I75eeb7cbd1bf157c463e5e80b4560a953b7883e8 Reviewed-on: https://skia-review.googlesource.com/8245 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/glsl/GrGLSLShaderBuilder.cpp5
-rw-r--r--src/gpu/glsl/GrGLSLShaderBuilder.h2
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.
*/