mesa: remove _mesa_problem() from a few locations
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 5 May 2017 05:39:15 +0000 (15:39 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 11 May 2017 03:53:39 +0000 (13:53 +1000)
_mesa_problem() is still useful in some places such as is if a backend
compile fails, but for the majority of cases we should be able to
remove it.

OpenGL test suites are becoming very mature, we should place more
trust in debug builds picking up missed cases.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/accum.c
src/mesa/main/attrib.c
src/mesa/main/fbobject.c

index d81e1ba583c1f92654ff8446cdfe053c6f72e021..c0a3e7ea72ae1e24e0c23ff0cb0ddb20b10c95e3 100644 (file)
@@ -426,7 +426,7 @@ accum(struct gl_context *ctx, GLenum op, GLfloat value)
       accum_return(ctx, value, xpos, ypos, width, height);
       break;
    default:
-      _mesa_problem(ctx, "invalid mode in _mesa_Accum()");
+      unreachable("invalid mode in _mesa_Accum()");
       break;
    }
 }
index dbcfb4edc7b2d847be05770606243c63b1d59c62..9e86faee346fffb22d665a067448d44a71330cb8 100644 (file)
@@ -1428,8 +1428,7 @@ _mesa_PopAttrib(void)
             break;
 
          default:
-            _mesa_problem( ctx, "Bad attrib flag in PopAttrib");
-            break;
+            unreachable("Bad attrib flag in PopAttrib");
       }
 
       next = attr->next;
@@ -1753,8 +1752,7 @@ _mesa_PopClientAttrib(void)
             break;
         }
          default:
-            _mesa_problem( ctx, "Bad attrib flag in PopClientAttrib");
-            break;
+            unreachable("Bad attrib flag in PopClientAttrib");
       }
 
       next = node->next;
index ef4fecff2aeac1c5247dc137c0aa676bb7683e4a..a1c5a6f26eb47cd9ed7c1192682213d38c9518e0 100644 (file)
@@ -3966,10 +3966,6 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
           && !_mesa_is_gles3(ctx)) {
          goto invalid_pname_enum;
       }
-      else if (att->Type == GL_NONE) {
-         _mesa_error(ctx, err, "%s(invalid pname %s)", caller,
-                     _mesa_enum_to_string(pname));
-      }
       else if (att->Texture) {
          const struct gl_texture_image *texImage =
             _mesa_select_tex_image(att->Texture, att->Texture->Target,
@@ -3987,7 +3983,9 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
                                       att->Renderbuffer->Format);
       }
       else {
-         _mesa_problem(ctx, "%s: invalid FBO attachment structure", caller);
+         assert(att->Type == GL_NONE);
+         _mesa_error(ctx, err, "%s(invalid pname %s)", caller,
+                     _mesa_enum_to_string(pname));
       }
       return;
    case GL_FRAMEBUFFER_ATTACHMENT_LAYERED: