diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGLProgramDataManager.cpp | 13 | ||||
-rw-r--r-- | src/gpu/gl/GrGLProgramDataManager.h | 1 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLProgramDataManager.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp index 9513a3fd57..fa232b73fd 100644 --- a/src/gpu/gl/GrGLProgramDataManager.cpp +++ b/src/gpu/gl/GrGLProgramDataManager.cpp @@ -89,6 +89,19 @@ void GrGLProgramDataManager::setSamplers(const SkTArray<GrGLSampler>& samplers) } } +void GrGLProgramDataManager::set1i(UniformHandle u, int i) const { + const Uniform& uni = fUniforms[u.toIndex()]; + SkASSERT(uni.fType == kInt_GrSLType); + SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); + SkDEBUGCODE(this->printUnused(uni)); + if (kUnusedUniform != uni.fFSLocation) { + GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, i)); + } + if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) { + GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, i)); + } +} + void GrGLProgramDataManager::set1f(UniformHandle u, float v0) const { const Uniform& uni = fUniforms[u.toIndex()]; SkASSERT(uni.fType == kFloat_GrSLType); diff --git a/src/gpu/gl/GrGLProgramDataManager.h b/src/gpu/gl/GrGLProgramDataManager.h index 513b6a4ce6..62da06dbec 100644 --- a/src/gpu/gl/GrGLProgramDataManager.h +++ b/src/gpu/gl/GrGLProgramDataManager.h @@ -53,6 +53,7 @@ public: /** Functions for uploading uniform values. The varities ending in v can be used to upload to an * array of uniforms. arrayCount must be <= the array count of the uniform. */ + void set1i(UniformHandle, int) const override; void set1f(UniformHandle, float v0) const override; void set1fv(UniformHandle, int arrayCount, const float v[]) const override; void set2f(UniformHandle, float, float) const override; diff --git a/src/gpu/glsl/GrGLSLProgramDataManager.h b/src/gpu/glsl/GrGLSLProgramDataManager.h index 5d502cfd75..7b310628c5 100644 --- a/src/gpu/glsl/GrGLSLProgramDataManager.h +++ b/src/gpu/glsl/GrGLSLProgramDataManager.h @@ -26,6 +26,7 @@ public: /** Functions for uploading uniform values. The varities ending in v can be used to upload to an * array of uniforms. arrayCount must be <= the array count of the uniform. */ + virtual void set1i(UniformHandle, int) const = 0; virtual void set1f(UniformHandle, float v0) const = 0; virtual void set1fv(UniformHandle, int arrayCount, const float v[]) const = 0; virtual void set2f(UniformHandle, float, float) const = 0; |