aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/gl/GrGLProgramDataManager.cpp22
-rw-r--r--src/gpu/gl/GrGLProgramDataManager.h2
2 files changed, 0 insertions, 24 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
diff --git a/src/gpu/gl/GrGLProgramDataManager.h b/src/gpu/gl/GrGLProgramDataManager.h
index 62af4b8cc0..42e0656915 100644
--- a/src/gpu/gl/GrGLProgramDataManager.h
+++ b/src/gpu/gl/GrGLProgramDataManager.h
@@ -99,8 +99,6 @@ private:
);
};
- SkDEBUGCODE(void printUnused(const Uniform&) const;)
-
template<int N> inline void setMatrices(UniformHandle, int arrayCount,
const float matrices[]) const;