Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/gpu/gl/GrGLProgramDataManager.cpp

Issue 2076143003: Integers can now be passed as uniforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary assert Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLProgramDataManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDataManager.cpp
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index 9513a3fd57b086c60b95b8f1b4df61bcac9a7e5a..056e7b73dd2c4a2314130385c1b692de7fb130c8 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, int32_t 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);
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLProgramDataManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698