mesa: simplify/improve some _mesa_error() calls in teximage.c
authorBrian Paul <brianp@vmware.com>
Tue, 5 Dec 2017 16:27:52 +0000 (09:27 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 5 Dec 2017 22:32:25 +0000 (15:32 -0700)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/teximage.c

index 41de966d79377b15b8e78c5f8034edc94beaf82f..572e380872b8260081f276a9b3910888e4dd46f3 100644 (file)
@@ -5778,14 +5778,10 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
    }
 
    if (!check_multisample_target(dims, target, dsa)) {
-      if (dsa) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(target)", func);
-         return;
-      }
-      else {
-         _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
-         return;
-      }
+      GLenum err = dsa ? GL_INVALID_OPERATION : GL_INVALID_ENUM;
+      _mesa_error(ctx, err, "%s(target=%s)", func,
+                  _mesa_enum_to_string(target));
+      return;
    }
 
    /* check that the specified internalformat is color/depth/stencil-renderable;
@@ -5826,7 +5822,7 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
     *    However, if samples is not supported, then no error is generated.
     */
    if (!samplesOK && !_mesa_is_proxy_texture(target)) {
-      _mesa_error(ctx, sample_count_error, "%s(samples)", func);
+      _mesa_error(ctx, sample_count_error, "%s(samples=%d)", func, samples);
       return;
    }