Only set GL tex base/max MIP level if supported

Change-Id: Id42f9b55af0b0ab6b6c15a136300c5bae1455f84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293836
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index fd5dfbc..a63db97 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3582,9 +3582,9 @@
 
     this->bindTextureToScratchUnit(info.fTarget, info.fID);
 
-    // If we have mips make sure the base level is set to 0 and the max level set to numMipLevesl-1
+    // If we have mips make sure the base level is set to 0 and the max level set to numMipLevels-1
     // so that the uploads go to the right levels.
-    if (numMipLevels) {
+    if (numMipLevels && this->glCaps().mipMapLevelAndLodControlSupport()) {
         auto params = backendTexture.getGLTextureParams();
         GrGLTextureParameters::NonsamplerState nonsamplerState = params->nonsamplerState();
         if (params->nonsamplerState().fBaseMipMapLevel != 0) {