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

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

Issue 1750833003: Disabling calls to TexParameteri when the values do not exist on ES2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Making the check for mipmap lod part of caps. Created 4 years, 10 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
« src/gpu/gl/GrGLCaps.cpp ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 29841331c01d308d45b7c1948db0dfe54547a4a6..dc50c1429ce44ea940c65a31b85693b1b45d6010 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3344,14 +3344,17 @@ void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur
GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_FILTER, newTexParams.fMinFilter));
}
if (setAll || newTexParams.fMaxMipMapLevel != oldTexParams.fMaxMipMapLevel) {
- if (newTexParams.fMaxMipMapLevel != 0) {
- this->setTextureUnit(unitIdx);
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_LOD, 0));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_BASE_LEVEL, 0));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LOD,
- newTexParams.fMaxMipMapLevel));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LEVEL,
- newTexParams.fMaxMipMapLevel));
+ // These are not supported in ES2 contexts
+ if (this->glCaps().mipMapLevelAndLodControlSupport()) {
+ if (newTexParams.fMaxMipMapLevel != 0) {
+ this->setTextureUnit(unitIdx);
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_LOD, 0));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_BASE_LEVEL, 0));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LOD,
+ newTexParams.fMaxMipMapLevel));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LEVEL,
+ newTexParams.fMaxMipMapLevel));
+ }
}
}
if (setAll || newTexParams.fWrapS != oldTexParams.fWrapS) {
« src/gpu/gl/GrGLCaps.cpp ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698