aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgramDataManager.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-03-17 14:10:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-17 18:45:34 +0000
commitf6ce600bc576f9951648bdda6e77af5bad4e9562 (patch)
tree40b92c0254a1b926e19062a794abab99a415d59e /src/gpu/gl/GrGLProgramDataManager.cpp
parent025a1ca73b19875272f929fb88e572f0f645ac14 (diff)
Remove "Unused uniform in shader" messages
BUG=skia:6393 Change-Id: Ia510311ac313de2cb06290aedc860a952cf8246f Reviewed-on: https://skia-review.googlesource.com/9862 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLProgramDataManager.cpp')
-rw-r--r--src/gpu/gl/GrGLProgramDataManager.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index 863eab7abf..2a3422e308 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -56,11 +56,6 @@ void GrGLProgramDataManager::setSamplers(const UniformInfoArray& samplers) const
SkASSERT(sampler.fVisibility);
if (kUnusedUniform != sampler.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform1i(sampler.fLocation, i));
- } else {
- // FIXME: We still insert a single sampler uniform for every stage. If the shader does
- // not reference the sampler then the compiler may have optimized it out. Uncomment this
- // assert once stages insert their own samplers.
- // this->printUnused(uni);
}
}
}
@@ -79,7 +74,6 @@ void GrGLProgramDataManager::set1i(UniformHandle u, int32_t i) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kInt_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
- SkDEBUGCODE(this->printUnused(uni));
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fLocation, i));
}
@@ -101,7 +95,6 @@ void GrGLProgramDataManager::set1f(UniformHandle u, float v0) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kFloat_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform1f(uni.fLocation, v0));
}
@@ -127,7 +120,6 @@ void GrGLProgramDataManager::set2f(UniformHandle u, float v0, float v1) const {
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec2f_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform2f(uni.fLocation, v0, v1));
}
@@ -140,7 +132,6 @@ void GrGLProgramDataManager::set2fv(UniformHandle u,
SkASSERT(uni.fType == kVec2f_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fLocation, arrayCount, v));
}
@@ -150,7 +141,6 @@ void GrGLProgramDataManager::set3f(UniformHandle u, float v0, float v1, float v2
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec3f_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform3f(uni.fLocation, v0, v1, v2));
}
@@ -163,7 +153,6 @@ void GrGLProgramDataManager::set3fv(UniformHandle u,
SkASSERT(uni.fType == kVec3f_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fLocation, arrayCount, v));
}
@@ -177,7 +166,6 @@ void GrGLProgramDataManager::set4f(UniformHandle u,
const Uniform& uni = fUniforms[u.toIndex()];
SkASSERT(uni.fType == kVec4f_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform4f(uni.fLocation, v0, v1, v2, v3));
}
@@ -190,7 +178,6 @@ void GrGLProgramDataManager::set4fv(UniformHandle u,
SkASSERT(uni.fType == kVec4f_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fLocation, arrayCount, v));
}
@@ -229,7 +216,6 @@ template<int N> inline void GrGLProgramDataManager::setMatrices(UniformHandle u,
SkASSERT(uni.fType == kMat22f_GrSLType + (N - 2));
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
- SkDEBUGCODE(this->printUnused(uni);)
if (kUnusedUniform != uni.fLocation) {
set_uniform_matrix<N>::set(fGpu->glInterface(), uni.fLocation, arrayCount, matrices);
}
@@ -268,11 +254,3 @@ void GrGLProgramDataManager::setPathFragmentInputTransform(VaryingHandle u,
components,
matrix);
}
-
-#ifdef SK_DEBUG
-void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
- if (kUnusedUniform == uni.fLocation) {
- GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
- }
-}
-#endif