mesa: replace _mesa_problem with unreachable in fetch_state
authorMarek Olšák <marek.olsak@amd.com>
Mon, 28 Sep 2020 04:24:36 +0000 (00:24 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Dec 2020 11:52:10 +0000 (11:52 +0000)
let's get this out of release builds

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>

src/mesa/program/prog_statevars.c

index e177aa8c2751ded5e82863bafefe193f1339721e..d638d8038a2573cb62ec5364a859d1fc5f18e767 100644 (file)
@@ -92,7 +92,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
             value[3] = 1.0F;
             return;
          default:
-            _mesa_problem(ctx, "Invalid material state in fetch_state");
+            unreachable("Invalid material state in fetch_state");
             return;
          }
       }
@@ -144,7 +144,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
             }
             return;
          default:
-            _mesa_problem(ctx, "Invalid light state in fetch_state");
+            unreachable("Invalid light state in fetch_state");
             return;
          }
       }
@@ -205,7 +205,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
                value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3];
                return;
             default:
-               _mesa_problem(ctx, "Invalid lightprod state in fetch_state");
+               unreachable("Invalid lightprod state in fetch_state");
                return;
          }
       }
@@ -240,7 +240,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
             COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenQ.ObjectPlane);
             return;
          default:
-            _mesa_problem(ctx, "Invalid texgen state in fetch_state");
+            unreachable("Invalid texgen state in fetch_state");
             return;
          }
       }
@@ -323,7 +323,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
             matrix = ctx->ProgramMatrixStack[index].Top;
          }
          else {
-            _mesa_problem(ctx, "Bad matrix name in fetch_state()");
+            unreachable("Bad matrix name in fetch_state()");
             return;
          }
          if (modifier == STATE_MATRIX_INVERSE ||
@@ -387,7 +387,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
                        ctx->FragmentProgram.Current->arb.LocalParams[idx]);
                return;
             default:
-               _mesa_problem(ctx, "Bad state switch in fetch_state()");
+               unreachable("Bad state switch in fetch_state()");
                return;
          }
       }
@@ -416,7 +416,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
                        ctx->VertexProgram.Current->arb.LocalParams[idx]);
                return;
             default:
-               _mesa_problem(ctx, "Bad state switch in fetch_state()");
+               unreachable("Bad state switch in fetch_state()");
                return;
          }
       }
@@ -631,7 +631,7 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
       return;
 
    default:
-      _mesa_problem(ctx, "Invalid state in _mesa_fetch_state");
+      unreachable("Invalid state in _mesa_fetch_state");
       return;
    }
 }