Commit 2f11e92c authored by Kenneth Graunke's avatar Kenneth Graunke

mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().

Generated by sed; no manual changes.
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
parent cd0dec0d
......@@ -78,7 +78,7 @@ static int compar_nr( const int *a, enum_elt *b )
static char token_tmp[20];
const char *_mesa_lookup_enum_by_nr( int nr )
const char *_mesa_enum_to_string( int nr )
{
enum_elt *elt;
......
......@@ -312,7 +312,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
break;
default:
_mesa_problem(ctx, "Unkown texture target %s\n",
_mesa_lookup_enum_by_nr(target));
_mesa_enum_to_string(target));
shader_index = BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE;
}
......
......@@ -66,7 +66,7 @@ fallback_required(struct gl_context *ctx, GLenum target,
if (target == GL_TEXTURE_3D) {
_mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
"glGenerateMipmap() to %s target\n",
_mesa_lookup_enum_by_nr(target));
_mesa_enum_to_string(target));
return true;
}
......
......@@ -57,7 +57,7 @@ i830StencilFuncSeparate(struct gl_context * ctx, GLenum face, GLenum func, GLint
mask = mask & 0xff;
DBG("%s : func: %s, ref : 0x%x, mask: 0x%x\n", __func__,
_mesa_lookup_enum_by_nr(func), ref, mask);
_mesa_enum_to_string(func), ref, mask);
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
......@@ -95,9 +95,9 @@ i830StencilOpSeparate(struct gl_context * ctx, GLenum face, GLenum fail, GLenum
int fop, dfop, dpop;
DBG("%s: fail : %s, zfail: %s, zpass : %s\n", __func__,
_mesa_lookup_enum_by_nr(fail),
_mesa_lookup_enum_by_nr(zfail),
_mesa_lookup_enum_by_nr(zpass));
_mesa_enum_to_string(fail),
_mesa_enum_to_string(zfail),
_mesa_enum_to_string(zpass));
fop = 0;
dfop = 0;
......@@ -389,8 +389,8 @@ static void
i830BlendEquationSeparate(struct gl_context * ctx, GLenum modeRGB, GLenum modeA)
{
DBG("%s -> %s, %s\n", __func__,
_mesa_lookup_enum_by_nr(modeRGB),
_mesa_lookup_enum_by_nr(modeA));
_mesa_enum_to_string(modeRGB),
_mesa_enum_to_string(modeA));
(void) modeRGB;
(void) modeA;
......@@ -403,10 +403,10 @@ i830BlendFuncSeparate(struct gl_context * ctx, GLenum sfactorRGB,
GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA)
{
DBG("%s -> RGB(%s, %s) A(%s, %s)\n", __func__,
_mesa_lookup_enum_by_nr(sfactorRGB),
_mesa_lookup_enum_by_nr(dfactorRGB),
_mesa_lookup_enum_by_nr(sfactorA),
_mesa_lookup_enum_by_nr(dfactorA));
_mesa_enum_to_string(sfactorRGB),
_mesa_enum_to_string(dfactorRGB),
_mesa_enum_to_string(sfactorA),
_mesa_enum_to_string(dfactorA));
(void) sfactorRGB;
(void) dfactorRGB;
......
......@@ -216,7 +216,7 @@ intel_alloc_private_renderbuffer_storage(struct gl_context * ctx, struct gl_rend
intel_miptree_release(&irb->mt);
DBG("%s: %s: %s (%dx%d)\n", __func__,
_mesa_lookup_enum_by_nr(internalFormat),
_mesa_enum_to_string(internalFormat),
_mesa_get_format_name(rb->Format), width, height);
if (width == 0 || height == 0)
......
......@@ -81,7 +81,7 @@ intel_miptree_create_layout(struct intel_context *intel,
return NULL;
DBG("%s target %s format %s level %d..%d <-- %p\n", __func__,
_mesa_lookup_enum_by_nr(target),
_mesa_enum_to_string(target),
_mesa_get_format_name(format),
first_level, last_level, mt);
......
......@@ -113,7 +113,7 @@ static void
intelDmaPrimitive(struct intel_context *intel, GLenum prim)
{
if (0)
fprintf(stderr, "%s %s\n", __func__, _mesa_lookup_enum_by_nr(prim));
fprintf(stderr, "%s %s\n", __func__, _mesa_enum_to_string(prim));
INTEL_FIREVERTICES(intel);
intel->vtbl.reduced_primitive_state(intel, reduced_prim[prim]);
intel_set_prim(intel, hw_prim[prim]);
......
......@@ -189,7 +189,7 @@ intelTexImage(struct gl_context * ctx,
const struct gl_pixelstore_attrib *unpack)
{
DBG("%s target %s level %d %dx%dx%d\n", __func__,
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_enum_to_string(texImage->TexObject->Target),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
/* Attempt to use the blitter for PBO image uploads.
......
......@@ -72,7 +72,7 @@ intel_blit_texsubimage(struct gl_context * ctx,
DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
__func__,
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_enum_to_string(texImage->TexObject->Target),
texImage->Level, xoffset, yoffset, width, height);
pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1,
......
......@@ -1134,7 +1134,7 @@ intelRasterPrimitive(struct gl_context * ctx, GLenum rprim, GLuint hwprim)
if (0)
fprintf(stderr, "%s %s %x\n", __func__,
_mesa_lookup_enum_by_nr(rprim), hwprim);
_mesa_enum_to_string(rprim), hwprim);
intel->vtbl.reduced_primitive_state(intel, rprim);
......@@ -1158,7 +1158,7 @@ intelRenderPrimitive(struct gl_context * ctx, GLenum prim)
ctx->Polygon.BackMode != GL_FILL);
if (0)
fprintf(stderr, "%s %s\n", __func__, _mesa_lookup_enum_by_nr(prim));
fprintf(stderr, "%s %s\n", __func__, _mesa_enum_to_string(prim));
/* Let some clipping routines know which primitive they're dealing
* with.
......
......@@ -110,7 +110,7 @@ static void brw_set_prim(struct brw_context *brw,
struct gl_context *ctx = &brw->ctx;
uint32_t hw_prim = get_hw_prim_for_gl_prim(prim->mode);
DBG("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
DBG("PRIM: %s\n", _mesa_enum_to_string(prim->mode));
/* Slight optimization to avoid the GS program when not needed:
*/
......@@ -143,7 +143,7 @@ static void gen6_set_prim(struct brw_context *brw,
{
uint32_t hw_prim;
DBG("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
DBG("PRIM: %s\n", _mesa_enum_to_string(prim->mode));
hw_prim = get_hw_prim_for_gl_prim(prim->mode);
......@@ -182,7 +182,7 @@ static void brw_emit_prim(struct brw_context *brw,
int indirect_flag;
int predicate_enable;
DBG("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode),
DBG("PRIM: %s %d %d\n", _mesa_enum_to_string(prim->mode),
prim->start, prim->count);
int start_vertex_location = prim->start;
......@@ -582,7 +582,7 @@ void brw_draw_prims( struct gl_context *ctx,
*/
if (ctx->RenderMode != GL_RENDER) {
perf_debug("%s render mode not supported in hardware\n",
_mesa_lookup_enum_by_nr(ctx->RenderMode));
_mesa_enum_to_string(ctx->RenderMode));
_swsetup_Wakeup(ctx);
_tnl_wakeup(ctx);
_tnl_draw_prims(ctx, prims, nr_prims, ib,
......
......@@ -230,7 +230,7 @@ brw_get_vertex_surface_type(struct brw_context *brw,
if (unlikely(INTEL_DEBUG & DEBUG_VERTS))
fprintf(stderr, "type %s size %d normalized %d\n",
_mesa_lookup_enum_by_nr(glarray->Type),
_mesa_enum_to_string(glarray->Type),
glarray->Size, glarray->Normalized);
if (glarray->Integer) {
......
......@@ -97,8 +97,8 @@ gen6_upload_blend_state(struct brw_context *brw)
rb_type != GL_UNSIGNED_NORMALIZED &&
rb_type != GL_FLOAT, "Ignoring %s logic op on %s "
"renderbuffer\n",
_mesa_lookup_enum_by_nr(ctx->Color.LogicOp),
_mesa_lookup_enum_by_nr(rb_type));
_mesa_enum_to_string(ctx->Color.LogicOp),
_mesa_enum_to_string(rb_type));
if (rb_type == GL_UNSIGNED_NORMALIZED) {
blend[b].blend1.logic_op_enable = 1;
blend[b].blend1.logic_op_func =
......
......@@ -310,7 +310,7 @@ intel_alloc_private_renderbuffer_storage(struct gl_context * ctx, struct gl_rend
intel_miptree_release(&irb->mt);
DBG("%s: %s: %s (%dx%d)\n", __func__,
_mesa_lookup_enum_by_nr(internalFormat),
_mesa_enum_to_string(internalFormat),
_mesa_get_format_name(rb->Format), width, height);
if (width == 0 || height == 0)
......
......@@ -279,7 +279,7 @@ intel_miptree_create_layout(struct brw_context *brw,
return NULL;
DBG("%s target %s format %s level %d..%d slices %d <-- %p\n", __func__,
_mesa_lookup_enum_by_nr(target),
_mesa_enum_to_string(target),
_mesa_get_format_name(format),
first_level, last_level, depth0, mt);
......
......@@ -97,8 +97,8 @@ intelTexImage(struct gl_context * ctx,
DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
__func__, _mesa_get_format_name(texImage->TexFormat),
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
_mesa_enum_to_string(texImage->TexObject->Target),
_mesa_enum_to_string(format), _mesa_enum_to_string(type),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
/* Allocate storage for texture data. */
......
......@@ -206,8 +206,8 @@ intelTexSubImage(struct gl_context * ctx,
DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
__func__, _mesa_get_format_name(texImage->TexFormat),
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
_mesa_enum_to_string(texImage->TexObject->Target),
_mesa_enum_to_string(format), _mesa_enum_to_string(type),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
ok = _mesa_meta_pbo_TexSubImage(ctx, dims, texImage,
......
......@@ -1669,7 +1669,7 @@ static void r200Enable( struct gl_context *ctx, GLenum cap, GLboolean state )
if ( R200_DEBUG & RADEON_STATE )
fprintf( stderr, "%s( %s = %s )\n", __func__,
_mesa_lookup_enum_by_nr( cap ),
_mesa_enum_to_string( cap ),
state ? "GL_TRUE" : "GL_FALSE" );
switch ( cap ) {
......
......@@ -68,9 +68,9 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap, GLenu
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s(tex %p) sw %s, tw %s, rw %s\n",
__func__, t,
_mesa_lookup_enum_by_nr(swrap),
_mesa_lookup_enum_by_nr(twrap),
_mesa_lookup_enum_by_nr(rwrap));
_mesa_enum_to_string(swrap),
_mesa_enum_to_string(twrap),
_mesa_enum_to_string(rwrap));
t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK | R200_BORDER_MODE_D3D);
......@@ -225,8 +225,8 @@ static void r200SetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf )
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s(tex %p) minf %s, maxf %s, anisotropy %d.\n",
__func__, t,
_mesa_lookup_enum_by_nr(minf),
_mesa_lookup_enum_by_nr(magf),
_mesa_enum_to_string(minf),
_mesa_enum_to_string(magf),
anisotropy);
if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) {
......@@ -302,7 +302,7 @@ static void r200TexEnv( struct gl_context *ctx, GLenum target,
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE, "%s( %s )\n",
__func__, _mesa_lookup_enum_by_nr( pname ) );
__func__, _mesa_enum_to_string( pname ) );
/* This is incorrect: Need to maintain this data for each of
* GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
......@@ -384,7 +384,7 @@ static void r200TexParameter( struct gl_context *ctx,
radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE,
"%s(%p, tex %p) pname %s\n",
__func__, ctx, texObj,
_mesa_lookup_enum_by_nr( pname ) );
_mesa_enum_to_string( pname ) );
switch ( pname ) {
case GL_TEXTURE_MIN_FILTER:
......@@ -415,7 +415,7 @@ static void r200DeleteTexture(struct gl_context * ctx, struct gl_texture_object
radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_NORMAL,
"%s( %p (target = %s) )\n", __func__,
(void *)texObj,
_mesa_lookup_enum_by_nr(texObj->Target));
_mesa_enum_to_string(texObj->Target));
if (rmesa) {
int i;
......@@ -473,7 +473,7 @@ static struct gl_texture_object *r200NewTextureObject(struct gl_context * ctx,
radeon_print(RADEON_STATE | RADEON_TEXTURE, RADEON_NORMAL,
"%s(%p) target %s, new texture %p.\n",
__func__, ctx,
_mesa_lookup_enum_by_nr(target), t);
_mesa_enum_to_string(target), t);
_mesa_initialize_texture_object(ctx, &t->base, name, target);
t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
......
......@@ -343,7 +343,7 @@ void radeonDrawBuffer( struct gl_context *ctx, GLenum mode )
{
if (RADEON_DEBUG & RADEON_DRI)
fprintf(stderr, "%s %s\n", __func__,
_mesa_lookup_enum_by_nr( mode ));
_mesa_enum_to_string( mode ));
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
......
......@@ -700,7 +700,7 @@ radeon_bind_framebuffer(struct gl_context * ctx, GLenum target,
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s(%p, fb %p, target %s) \n",
__func__, ctx, fb,
_mesa_lookup_enum_by_nr(target));
_mesa_enum_to_string(target));
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
radeon_draw_buffer(ctx, fb);
......
......@@ -276,7 +276,7 @@ static void calculate_min_max_lod(struct gl_sampler_object *samp, struct gl_text
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s(%p) target %s, min %d, max %d.\n",
__func__, tObj,
_mesa_lookup_enum_by_nr(tObj->Target),
_mesa_enum_to_string(tObj->Target),
minLod, maxLod);
/* save these values */
......
......@@ -212,7 +212,7 @@ radeonReadPixels(struct gl_context * ctx,
*/
radeon_print(RADEON_FALLBACKS, RADEON_NORMAL,
"Falling back to sw for ReadPixels (format %s, type %s)\n",
_mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type));
_mesa_enum_to_string(format), _mesa_enum_to_string(type));
if (ctx->NewState)
_mesa_update_state(ctx);
......
......@@ -1452,7 +1452,7 @@ static void radeonEnable( struct gl_context *ctx, GLenum cap, GLboolean state )
if ( RADEON_DEBUG & RADEON_STATE )
fprintf( stderr, "%s( %s = %s )\n", __func__,
_mesa_lookup_enum_by_nr( cap ),
_mesa_enum_to_string( cap ),
state ? "GL_TRUE" : "GL_FALSE" );
switch ( cap ) {
......
......@@ -442,7 +442,7 @@ static GLboolean radeon_run_render( struct gl_context *ctx,
radeon_print(RADEON_SWRENDER, RADEON_NORMAL,
"radeon_render.c: prim %s %d..%d\n",
_mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
_mesa_enum_to_string(prim & PRIM_MODE_MASK),
start, start+length);
if (length)
......
......@@ -263,7 +263,7 @@ static void radeonTexEnv( struct gl_context *ctx, GLenum target,
if ( RADEON_DEBUG & RADEON_STATE ) {
fprintf( stderr, "%s( %s )\n",
__func__, _mesa_lookup_enum_by_nr( pname ) );
__func__, _mesa_enum_to_string( pname ) );
}
switch ( pname ) {
......@@ -335,7 +335,7 @@ static void radeonTexParameter( struct gl_context *ctx,
radeonTexObj* t = radeon_tex_obj(texObj);
radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, "%s( %s )\n", __func__,
_mesa_lookup_enum_by_nr( pname ) );
_mesa_enum_to_string( pname ) );
switch ( pname ) {
case GL_TEXTURE_BASE_LEVEL:
......@@ -359,7 +359,7 @@ static void radeonDeleteTexture( struct gl_context *ctx,
radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
"%s( %p (target = %s) )\n", __func__, (void *)texObj,
_mesa_lookup_enum_by_nr( texObj->Target ) );
_mesa_enum_to_string( texObj->Target ) );
if ( rmesa ) {
radeon_firevertices(&rmesa->radeon);
......
......@@ -279,8 +279,8 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s InternalFormat=%s(%d) type=%s format=%s\n",
__func__,
_mesa_lookup_enum_by_nr(internalFormat), internalFormat,
_mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format));
_mesa_enum_to_string(internalFormat), internalFormat,
_mesa_enum_to_string(type), _mesa_enum_to_string(format));
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"%s do32bpt=%d force16bpt=%d\n",
__func__, do32bpt, force16bpt);
......
......@@ -291,7 +291,7 @@ valid_elements_type(struct gl_context *ctx, GLenum type, const char *name)
default:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
_mesa_lookup_enum_by_nr(type));
_mesa_enum_to_string(type));
return false;
}
}
......
......@@ -132,21 +132,21 @@ static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst,
op_name = atifs_ops[(arg_count-1)+(optype?3:0)];
fprintf(stderr, "%s(%s, %s", op_name, _mesa_lookup_enum_by_nr(op),
_mesa_lookup_enum_by_nr(dst));
fprintf(stderr, "%s(%s, %s", op_name, _mesa_enum_to_string(op),
_mesa_enum_to_string(dst));
if (!optype)
fprintf(stderr, ", %d", dstMask);
fprintf(stderr, ", %s", create_dst_mod_str(dstMod));
fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg1),
_mesa_lookup_enum_by_nr(arg1Rep), arg1Mod);
fprintf(stderr, ", %s, %s, %d", _mesa_enum_to_string(arg1),
_mesa_enum_to_string(arg1Rep), arg1Mod);
if (arg_count>1)
fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg2),
_mesa_lookup_enum_by_nr(arg2Rep), arg2Mod);
fprintf(stderr, ", %s, %s, %d", _mesa_enum_to_string(arg2),
_mesa_enum_to_string(arg2Rep), arg2Mod);
if (arg_count>2)
fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg3),
_mesa_lookup_enum_by_nr(arg3Rep), arg3Mod);
fprintf(stderr, ", %s, %s, %d", _mesa_enum_to_string(arg3),
_mesa_enum_to_string(arg3Rep), arg3Mod);
fprintf(stderr,")\n");
......@@ -383,7 +383,7 @@ _mesa_EndFragmentShaderATI(void)
for (j = 0; j < MAX_NUM_PASSES_ATI; j++) {
for (i = 0; i < MAX_NUM_FRAGMENT_REGISTERS_ATI; i++) {
GLuint op = curProg->SetupInst[j][i].Opcode;
const char *op_enum = op > 5 ? _mesa_lookup_enum_by_nr(op) : "0";
const char *op_enum = op > 5 ? _mesa_enum_to_string(op) : "0";
GLuint src = curProg->SetupInst[j][i].src;
GLuint swizzle = curProg->SetupInst[j][i].swizzle;
fprintf(stderr, "%2d %04X %s %d %04X\n", i, op, op_enum, src,
......@@ -392,8 +392,8 @@ _mesa_EndFragmentShaderATI(void)
for (i = 0; i < curProg->numArithInstr[j]; i++) {
GLuint op0 = curProg->Instructions[j][i].Opcode[0];
GLuint op1 = curProg->Instructions[j][i].Opcode[1];
const char *op0_enum = op0 > 5 ? _mesa_lookup_enum_by_nr(op0) : "0";
const char *op1_enum = op1 > 5 ? _mesa_lookup_enum_by_nr(op1) : "0";
const char *op0_enum = op0 > 5 ? _mesa_enum_to_string(op0) : "0";
const char *op1_enum = op1 > 5 ? _mesa_enum_to_string(op1) : "0";
GLuint count0 = curProg->Instructions[j][i].ArgCount[0];
GLuint count1 = curProg->Instructions[j][i].ArgCount[1];
fprintf(stderr, "%2d %04X %s %d %04X %s %d\n", i, op0, op0_enum, count0,
......@@ -477,8 +477,8 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle)
#if MESA_DEBUG_ATI_FS
_mesa_debug(ctx, "%s(%s, %s, %s)\n", __func__,
_mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(coord),
_mesa_lookup_enum_by_nr(swizzle));
_mesa_enum_to_string(dst), _mesa_enum_to_string(coord),
_mesa_enum_to_string(swizzle));
#endif
}
......@@ -550,8 +550,8 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle)
#if MESA_DEBUG_ATI_FS
_mesa_debug(ctx, "%s(%s, %s, %s)\n", __func__,
_mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(interp),
_mesa_lookup_enum_by_nr(swizzle));
_mesa_enum_to_string(dst), _mesa_enum_to_string(interp),
_mesa_enum_to_string(swizzle));
#endif
}
......
......@@ -937,7 +937,7 @@ _mesa_PopAttrib(void)
if (MESA_VERBOSE & VERBOSE_API) {
_mesa_debug(ctx, "glPopAttrib %s\n",
_mesa_lookup_enum_by_nr(attr->kind));
_mesa_enum_to_string(attr->kind));
}
switch (attr->kind) {
......
......@@ -128,28 +128,28 @@ validate_blend_factors(struct gl_context *ctx, const char *func,
if (!legal_src_factor(ctx, sfactorRGB)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(sfactorRGB = %s)", func,
_mesa_lookup_enum_by_nr(sfactorRGB));
_mesa_enum_to_string(sfactorRGB));
return GL_FALSE;
}
if (!legal_dst_factor(ctx, dfactorRGB)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(dfactorRGB = %s)", func,
_mesa_lookup_enum_by_nr(dfactorRGB));
_mesa_enum_to_string(dfactorRGB));
return GL_FALSE;
}
if (sfactorA != sfactorRGB && !legal_src_factor(ctx, sfactorA)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(sfactorA = %s)", func,
_mesa_lookup_enum_by_nr(sfactorA));
_mesa_enum_to_string(sfactorA));
return GL_FALSE;
}
if (dfactorA != dfactorRGB && !legal_dst_factor(ctx, dfactorA)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(dfactorA = %s)", func,
_mesa_lookup_enum_by_nr(dfactorA));
_mesa_enum_to_string(dfactorA));
return GL_FALSE;
}
......@@ -208,10 +208,10 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n",
_mesa_lookup_enum_by_nr(sfactorRGB),
_mesa_lookup_enum_by_nr(dfactorRGB),
_mesa_lookup_enum_by_nr(sfactorA),
_mesa_lookup_enum_by_nr(dfactorA));
_mesa_enum_to_string(sfactorRGB),
_mesa_enum_to_string(dfactorRGB),
_mesa_enum_to_string(sfactorA),
_mesa_enum_to_string(dfactorA));
if (!validate_blend_factors(ctx, "glBlendFuncSeparate",
sfactorRGB, dfactorRGB,
......@@ -342,7 +342,7 @@ _mesa_BlendEquation( GLenum mode )
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquation(%s)\n",
_mesa_lookup_enum_by_nr(mode));
_mesa_enum_to_string(mode));
if (!legal_blend_equation(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation");
......@@ -385,7 +385,7 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquationi(%u, %s)\n",
buf, _mesa_lookup_enum_by_nr(mode));
buf, _mesa_enum_to_string(mode));
if (buf >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBlendFuncSeparatei(buffer=%u)",
......@@ -421,8 +421,8 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
_mesa_lookup_enum_by_nr(modeRGB),
_mesa_lookup_enum_by_nr(modeA));
_mesa_enum_to_string(modeRGB),
_mesa_enum_to_string(modeA));
if ( (modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate ) {
_mesa_error(ctx, GL_INVALID_OPERATION,
......@@ -476,8 +476,8 @@ _mesa_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBlendEquationSeparatei(%u, %s %s)\n", buf,
_mesa_lookup_enum_by_nr(modeRGB),
_mesa_lookup_enum_by_nr(modeA));
_mesa_enum_to_string(modeRGB),
_mesa_enum_to_string(modeA));
if (buf >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBlendEquationSeparatei(buffer=%u)",
......@@ -567,7 +567,7 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glAlphaFunc(%s, %f)\n",
_mesa_lookup_enum_by_nr(func), ref);
_mesa_enum_to_string(func), ref);
switch (func) {
case GL_NEVER:
......@@ -613,7 +613,7 @@ _mesa_LogicOp( GLenum opcode )
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLogicOp(%s)\n", _mesa_lookup_enum_by_nr(opcode));
_mesa_debug(ctx, "glLogicOp(%s)\n", _mesa_enum_to_string(opcode));
switch (opcode) {
case GL_CLEAR:
......@@ -790,7 +790,7 @@ _mesa_ClampColor(GLenum target, GLenum clamp)
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "glClampColor(%s)",
_mesa_lookup_enum_by_nr(target));
_mesa_enum_to_string(target));
}
static GLboolean
......
......@@ -212,7 +212,7 @@ _mesa_blit_framebuffer(struct gl_context *ctx,
if (!is_valid_blit_filter(ctx, filter)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid filter %s)", func,
_mesa_lookup_enum_by_nr(filter));
_mesa_enum_to_string(filter));
return;
}
......@@ -220,7 +220,7 @@ _mesa_blit_framebuffer(struct gl_context *ctx,
filter == GL_SCALED_RESOLVE_NICEST_EXT) &&
(readFb->Visual.samples == 0 || drawFb->Visual.samples > 0)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(%s: invalid samples)", func,
_mesa_lookup_enum_by_nr(filter));
_mesa_enum_to_string(filter));
return;
}
......@@ -548,7 +548,7 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
" %d, %d, %d, %d, 0x%x, %s)\n",
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
mask, _mesa_lookup_enum_by_nr(filter));
mask, _mesa_enum_to_string(filter));
_mesa_blit_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
srcX0, srcY0, srcX1, srcY1,
......@@ -573,7 +573,7 @@ _mesa_BlitNamedFramebuffer(GLuint readFramebuffer, GLuint drawFramebuffer,
readFramebuffer, drawFramebuffer,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
mask, _mesa_lookup_enum_by_nr(filter));
mask, _mesa_enum_to_string(filter));
/*
* According to PDF page 533 of the OpenGL 4.5 core spec (30.10.2014,
......
......@@ -1182,7 +1182,7 @@ _mesa_BindBuffer(GLenum target, GLuint buffer)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBindBuffer(%s, %u)\n",
_mesa_lookup_enum_by_nr(target), buffer);
_mesa_enum_to_string(target), buffer);
bind_buffer_object(ctx, target, buffer);
}
......@@ -1535,9 +1535,9 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "%s(%s, %ld, %p, %s)\n",
func,
_mesa_lookup_enum_by_nr(target),
_mesa_enum_to_string(target),
(long int) size, data,
_mesa_lookup_enum_by_nr(usage));
_mesa_enum_to_string(usage));
if (size < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", func);
......@@ -1570,7 +1570,7 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
if (!valid_usage) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid usage: %s)", func,
_mesa_lookup_enum_by_nr(usage));
_mesa_enum_to_string(usage));
return;
}
......@@ -2025,7 +2025,7 @@ get_buffer_parameter(struct gl_context *ctx,
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid pname: %s)", func,
_mesa_lookup_enum_by_nr(pname));
_mesa_enum_to_string(pname));
return false;
}
......@@ -4367,7 +4367,7 @@ _mesa_BindBuffersRange(GLenum target, GLuint first, GLsizei count,
return;
default: