X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fpack.c;h=64ad115f8b5a25d6c9427e4279d81695aae2dff0;hb=b68ff2b8731427b3b68c9c81902f7ba93606caaf;hp=89faf5154436fbd55aa728f7e2894153318e2298;hpb=958fc04dc51a2561c8598f42df59e3d9139e56a7;p=mesa.git diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 89faf515443..64ad115f8b5 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -42,6 +42,7 @@ #endif +#include "errors.h" #include "glheader.h" #include "enums.h" #include "image.h" @@ -460,27 +461,11 @@ extract_uint_indexes(GLuint n, GLuint indexes[], break; default: - _mesa_problem(NULL, "bad srcType in extract_uint_indexes"); - return; + unreachable("bad srcType in extract_uint_indexes"); } } -static inline GLuint -clamp_float_to_uint(GLfloat f) -{ - return f < 0.0F ? 0 : _mesa_lroundevenf(f); -} - - -static inline GLuint -clamp_half_to_uint(GLhalfARB h) -{ - GLfloat f = _mesa_half_to_float(h); - return f < 0.0F ? 0 : _mesa_lroundevenf(f); -} - - /* * Unpack a row of stencil data from a client buffer according to * the pixel unpacking parameters. @@ -600,7 +585,7 @@ _mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n, } break; default: - _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); + unreachable("bad dstType in _mesa_unpack_stencil_span"); } free(indexes); @@ -747,7 +732,7 @@ _mesa_pack_stencil_span( struct gl_context *ctx, GLuint n, } break; default: - _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); + unreachable("bad type in _mesa_pack_index_span"); } free(stencil); @@ -1138,8 +1123,7 @@ _mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest, } break; default: - _mesa_problem(ctx, "bad type in _mesa_pack_depth_span (%s)", - _mesa_enum_to_string(dstType)); + unreachable("bad type in _mesa_pack_depth_span()"); } free(depthCopy);