Generated by sed; no manual changes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
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;
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;
}
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;
}
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);
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;
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;
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;
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)
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);
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]);
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.
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,
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);
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.
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:
*/
{
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);
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;
*/
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,
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) {
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 =
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)
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);
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. */
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,
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 ) {
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);
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 ) {
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
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:
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;
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;
{
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);
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);
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 */
*/
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);
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 ) {
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)
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 ) {
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:
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);
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);
default:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)", name,
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(type));
return false;
}
}
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");
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,
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,
#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
}
#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
}
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) {
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;
}
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,
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");
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)",
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,
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)",
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:
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:
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "glClampColor(%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
}
static GLboolean
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;
}
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;
}
" %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,
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,
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);
}
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);
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;
}
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;
}
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glBindBuffersRange(target=%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
break;
}
}
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glBindBuffersBase(target=%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
break;
}
}
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API) {
- _mesa_debug(ctx, "%s %s\n", caller, _mesa_lookup_enum_by_nr(buffer));
+ _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
}
if (buffer == GL_NONE) {
if (destMask == BAD_MASK) {
/* totally bogus buffer */
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)", caller,
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
destMask &= supportedMask;
if (destMask == 0x0) {
/* none of the named color buffers exist! */
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffer));
+ caller, _mesa_enum_to_string(buffer));
return;
}
}
*/
if (destMask[output] == BAD_MASK) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffers[output]));
+ caller, _mesa_enum_to_string(buffers[output]));
return;
}
*/
if (_mesa_bitcount(destMask[output]) > 1) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffers[output]));
+ caller, _mesa_enum_to_string(buffers[output]));
return;
}
if (destMask[output] == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(unsupported buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffers[output]));
+ caller, _mesa_enum_to_string(buffers[output]));
return;
}
buffers[output] != GL_COLOR_ATTACHMENT0 + output) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(unsupported buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffers[output]));
+ caller, _mesa_enum_to_string(buffers[output]));
return;
}
if (destMask[output] & usedBufferMask) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(duplicated buffer %s)",
- caller, _mesa_lookup_enum_by_nr(buffers[output]));
+ caller, _mesa_enum_to_string(buffers[output]));
return;
}
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "%s %s\n", caller, _mesa_lookup_enum_by_nr(buffer));
+ _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
if (buffer == GL_NONE) {
/* This is legal--it means that no buffer should be bound for reading. */
if (srcBuffer == -1) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(invalid buffer %s)", caller,
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
supportedMask = supported_buffer_bitmask(ctx, fb);
if (((1 << srcBuffer) & supportedMask) == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid buffer %s)", caller,
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
}
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferiv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
}
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
}
return;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
}
if (buffer != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
+ _mesa_enum_to_string(buffer));
return;
}
/* fallthrough - invalid */
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glBeginConditionalRender(mode=%s)",
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_enum_to_string(mode));
return;
}
default:
_mesa_problem(ctx, "Bad cond render mode %s in "
" _mesa_check_conditional_render()",
- _mesa_lookup_enum_by_nr(ctx->Query.CondRenderMode));
+ _mesa_enum_to_string(ctx->Query.CondRenderMode));
return GL_TRUE;
}
}
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glCopyImageSubData(%sTarget = %s)", dbg_prefix,
- _mesa_lookup_enum_by_nr(*target));
+ _mesa_enum_to_string(*target));
return false;
}
if ((*tex_obj)->Target != *target) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCopyImageSubData(%sTarget = %s)", dbg_prefix,
- _mesa_lookup_enum_by_nr(*target));
+ _mesa_enum_to_string(*target));
return false;
}
_mesa_debug(ctx, "glCopyImageSubData(%u, %s, %d, %d, %d, %d, "
"%u, %s, %d, %d, %d, %d, "
"%d, %d, %d)\n",
- srcName, _mesa_lookup_enum_by_nr(srcTarget), srcLevel,
+ srcName, _mesa_enum_to_string(srcTarget), srcLevel,
srcX, srcY, srcZ,
- dstName, _mesa_lookup_enum_by_nr(dstTarget), dstLevel,
+ dstName, _mesa_enum_to_string(dstTarget), dstLevel,
dstX, dstY, dstZ,
srcWidth, srcHeight, srcWidth);
{
printf("Renderbuffer %u: %u x %u IntFormat = %s\n",
rb->Name, rb->Width, rb->Height,
- _mesa_lookup_enum_by_nr(rb->InternalFormat));
+ _mesa_enum_to_string(rb->InternalFormat));
if (writeImage) {
_mesa_write_renderbuffer_image(rb);
}
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
+ _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_enum_to_string(func));
if (ctx->Depth.Func == func)
return;
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glNewList %u %s\n", name,
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_enum_to_string(mode));
if (name == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
static const char *
enum_string(GLenum k)
{
- return _mesa_lookup_enum_by_nr(k);
+ return _mesa_enum_to_string(k);
}
break;
case OPCODE_BIND_TEXTURE:
fprintf(f, "BindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
+ _mesa_enum_to_string(n[1].ui), n[2].ui);
break;
case OPCODE_SHADE_MODEL:
- fprintf(f, "ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ fprintf(f, "ShadeModel %s\n", _mesa_enum_to_string(n[1].ui));
break;
case OPCODE_MAP1:
fprintf(f, "Map1 %s %.3f %.3f %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
+ _mesa_enum_to_string(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
fprintf(f, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
+ _mesa_enum_to_string(n[1].ui),
n[2].f, n[3].f, n[4].f, n[5].f,
n[6].i, n[7].i, n[8].i, n[9].i);
break;
case OPCODE_PROVOKING_VERTEX:
fprintf(f, "ProvokingVertex %s\n",
- _mesa_lookup_enum_by_nr(n[1].ui));
+ _mesa_enum_to_string(n[1].ui));
break;
/*
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",
width, height,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type),
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type),
pixels,
- _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+ _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
IROUND(ctx->Current.RasterPos[0]),
IROUND(ctx->Current.RasterPos[1]));
err = _mesa_error_check_format_and_type(ctx, format, type);
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err, "glDrawPixels(invalid format %s and/or type %s)",
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
goto end;
}
_mesa_debug(ctx,
"glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",
srcx, srcy, width, height,
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer),
- _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+ _mesa_enum_to_string(type),
+ _mesa_enum_to_string(ctx->ReadBuffer->ColorReadBuffer),
+ _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
IROUND(ctx->Current.RasterPos[0]),
IROUND(ctx->Current.RasterPos[1]));
type != GL_STENCIL &&
type != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels(type=%s)",
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(type));
return;
}
invalid_enum_error:
_mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(%s)",
- state ? "Enable" : "Disable", _mesa_lookup_enum_by_nr(cap));
+ state ? "Enable" : "Disable", _mesa_enum_to_string(cap));
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "%s %s (newstate is %x)\n",
state ? "glEnable" : "glDisable",
- _mesa_lookup_enum_by_nr(cap),
+ _mesa_enum_to_string(cap),
ctx->NewState);
switch (cap) {
invalid_enum_error:
_mesa_error(ctx, GL_INVALID_ENUM, "gl%s(%s)",
- state ? "Enable" : "Disable", _mesa_lookup_enum_by_nr(cap));
+ state ? "Enable" : "Disable", _mesa_enum_to_string(cap));
}
invalid_enum_error:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
state ? "glEnablei" : "glDisablei",
- _mesa_lookup_enum_by_nr(cap));
+ _mesa_enum_to_string(cap));
}
return (ctx->Scissor.EnableFlags >> index) & 1;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
- _mesa_lookup_enum_by_nr(cap));
+ _mesa_enum_to_string(cap));
return GL_FALSE;
}
}
invalid_enum_error:
_mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(%s)",
- _mesa_lookup_enum_by_nr(cap));
+ _mesa_enum_to_string(cap));
return GL_FALSE;
}
#endif
-extern const char *_mesa_lookup_enum_by_nr( int nr );
+extern const char *_mesa_enum_to_string( int nr );
/* Get the name of an enum given that it is a primitive type. Avoids
* GL_FALSE/GL_POINTS ambiguity and others.
if (ctx->ErrorDebugCount) {
_mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
ctx->ErrorDebugCount,
- _mesa_lookup_enum_by_nr(ctx->ErrorValue));
+ _mesa_enum_to_string(ctx->ErrorValue));
output_if_debug("Mesa", s, GL_TRUE);
}
len = _mesa_snprintf(s2, MAX_DEBUG_MESSAGE_LENGTH, "%s in %s",
- _mesa_lookup_enum_by_nr(error), s);
+ _mesa_enum_to_string(error), s);
if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
/* Same as above. */
assert(0);
baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat=%s)",
- func, _mesa_lookup_enum_by_nr(internalFormat));
+ func, _mesa_enum_to_string(internalFormat));
return;
}
if (samples == NO_SAMPLES)
_mesa_debug(ctx, "%s(%u, %s, %d, %d)\n",
func, renderbuffer,
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(internalFormat),
width, height);
else
_mesa_debug(ctx, "%s(%u, %s, %d, %d, %d)\n",
func, renderbuffer,
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(internalFormat),
width, height, samples);
}
if (samples == NO_SAMPLES)
_mesa_debug(ctx, "%s(%s, %s, %d, %d)\n",
func,
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(internalFormat),
width, height);
else
_mesa_debug(ctx, "%s(%s, %s, %d, %d, %d)\n",
func,
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(internalFormat),
width, height, samples);
}
/* fallthrough */
default:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return;
}
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glCheckFramebufferStatus(%s)\n",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
fb = get_framebuffer_target(ctx, target);
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCheckFramebufferStatus(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return 0;
}
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glCheckNamedFramebufferStatus(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return 0;
}
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid texture target %s)", caller,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return false;
}
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid texture target %s)", caller,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return false;
}
if (err) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid textarget %s)",
- caller, _mesa_lookup_enum_by_nr(textarget));
+ caller, _mesa_enum_to_string(textarget));
return false;
}
att = get_attachment(ctx, fb, attachment);
if (att == NULL) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid attachment %s)", caller,
- _mesa_lookup_enum_by_nr(attachment));
+ _mesa_enum_to_string(attachment));
return;
}
fb = get_framebuffer_target(ctx, target);
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", caller,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glFramebufferTextureLayer(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glFramebufferTexture(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (att == NULL) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(invalid attachment %s)", func,
- _mesa_lookup_enum_by_nr(attachment));
+ _mesa_enum_to_string(attachment));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glFramebufferRenderbuffer(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
attachment != GL_DEPTH && attachment != GL_STENCIL) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(invalid attachment %s)", caller,
- _mesa_lookup_enum_by_nr(attachment));
+ _mesa_enum_to_string(attachment));
return;
}
/* the default / window-system FBO */
if (att == NULL) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid attachment %s)", caller,
- _mesa_lookup_enum_by_nr(attachment));
+ _mesa_enum_to_string(attachment));
return;
}
}
else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
else {
goto invalid_pname_enum;
}
else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
else {
goto invalid_pname_enum;
goto invalid_pname_enum;
} else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
} else if (att->Type == GL_TEXTURE) {
if (att->Texture && (att->Texture->Target == GL_TEXTURE_3D ||
att->Texture->Target == GL_TEXTURE_2D_ARRAY)) {
}
else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
else {
if (ctx->Extensions.EXT_framebuffer_sRGB) {
}
else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
else {
mesa_format format = att->Renderbuffer->Format;
}
else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
else if (att->Texture) {
const struct gl_texture_image *texImage =
*params = att->Layered;
} else if (att->Type == GL_NONE) {
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
} else {
goto invalid_pname_enum;
}
invalid_pname_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid pname %s)", caller,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return;
}
if (!buffer) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameteriv(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid attachment %s)", name,
- _mesa_lookup_enum_by_nr(attachments[i]));
+ _mesa_enum_to_string(attachments[i]));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glInvalidateSubFramebuffer(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glInvalidateFramebuffer(invalid target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glDiscardFramebufferEXT(target %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM,
"glDiscardFramebufferEXT(attachment %s)",
- _mesa_lookup_enum_by_nr(attachments[i]));
+ _mesa_enum_to_string(attachments[i]));
}
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glRenderMode %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glRenderMode %s\n", _mesa_enum_to_string(mode));
FLUSH_VERTICES(ctx, _NEW_RENDERMODE);
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetInternalformativ(target=%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
_mesa_base_fbo_format(ctx, internalformat) == 0) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetInternalformativ(internalformat=%s)",
- _mesa_lookup_enum_by_nr(internalformat));
+ _mesa_enum_to_string(internalformat));
return;
}
if (bufSize < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetInternalformativ(target=%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetInternalformativ(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return;
}
fprintf(stderr, "Mesa Framebuffer %u at %p\n", fb->Name, (void *) fb);
fprintf(stderr, " Size: %u x %u Status: %s\n", fb->Width, fb->Height,
- _mesa_lookup_enum_by_nr(fb->_Status));
+ _mesa_enum_to_string(fb->_Status));
fprintf(stderr, " Attachments:\n");
for (i = 0; i < BUFFER_COUNT; i++) {
if (error) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGenerate%sMipmap(target=%s)",
- suffix, _mesa_lookup_enum_by_nr(target));
+ suffix, _mesa_enum_to_string(target));
return;
}
if (api_check && !api_found) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(d->pname));
+ _mesa_enum_to_string(d->pname));
return GL_FALSE;
}
* any valid enum. */
if (unlikely(idx == 0)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return &error_value;
}
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return TYPE_INVALID;
invalid_value:
_mesa_error(ctx, GL_INVALID_VALUE, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return TYPE_INVALID;
}
return;
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_enum_to_string(pname));
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
+ _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_enum_to_string(e));
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
ctx->ErrorDebugCount = 0;
return IDX_RG;
default:
_mesa_problem(NULL, "Unexpected inFormat %s",
- _mesa_lookup_enum_by_nr(value));
+ _mesa_enum_to_string(value));
return 0;
}
}
#if 0
printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n",
- inFormat, _mesa_lookup_enum_by_nr(inFormat),
- outFormat, _mesa_lookup_enum_by_nr(outFormat),
+ inFormat, _mesa_enum_to_string(inFormat),
+ outFormat, _mesa_enum_to_string(outFormat),
map[0],
map[1],
map[2],
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glHint %s %s\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(mode));
if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glShadeModel %s\n", _mesa_enum_to_string(mode));
if (mode != GL_FLAT && mode != GL_SMOOTH) {
_mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel");
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glColorMaterial %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_enum_to_string(face),
+ _mesa_enum_to_string(mode));
bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial");
if (bitmask == 0)
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glPushMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ _mesa_enum_to_string(ctx->Transform.MatrixMode));
if (stack->Depth + 1 >= stack->MaxDepth) {
if (ctx->Transform.MatrixMode == GL_TEXTURE) {
}
else {
_mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ _mesa_enum_to_string(ctx->Transform.MatrixMode));
}
return;
}
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glPopMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ _mesa_enum_to_string(ctx->Transform.MatrixMode));
if (stack->Depth == 0) {
if (ctx->Transform.MatrixMode == GL_TEXTURE) {
}
else {
_mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ _mesa_enum_to_string(ctx->Transform.MatrixMode));
}
return;
}
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(identifier = %s)",
- caller, _mesa_lookup_enum_by_nr(identifier));
+ caller, _mesa_enum_to_string(identifier));
return NULL;
}
}
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramPipelineiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
/**
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode));
if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
_mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
+ _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode));
if (mode!=GL_CW && mode!=GL_CCW) {
_mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glPolygonMode %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
+ _mesa_enum_to_string(face),
+ _mesa_enum_to_string(mode));
if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
_mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
/* Validate interface. */
if (!supported_interface_enum(programInterface)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramInterfaceiv(%s)",
- _mesa_lookup_enum_by_nr(programInterface));
+ _mesa_enum_to_string(programInterface));
return;
}
if (programInterface == GL_ATOMIC_COUNTER_BUFFER) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
- _mesa_lookup_enum_by_nr(programInterface),
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(programInterface),
+ _mesa_enum_to_string(pname));
return;
}
/* Name length consists of base name, 3 additional chars '[0]' if
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
- _mesa_lookup_enum_by_nr(programInterface),
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(programInterface),
+ _mesa_enum_to_string(pname));
};
break;
case GL_MAX_NUM_COMPATIBLE_SUBROUTINES:
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(pname %s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
}
case GL_ATOMIC_COUNTER_BUFFER:
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceIndex(%s)",
- _mesa_lookup_enum_by_nr(programInterface));
+ _mesa_enum_to_string(programInterface));
}
return GL_INVALID_INDEX;
if (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
!supported_interface_enum(programInterface)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceName(%s)",
- _mesa_lookup_enum_by_nr(programInterface));
+ _mesa_enum_to_string(programInterface));
return;
}
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceLocation(%s %s)",
- _mesa_lookup_enum_by_nr(programInterface), name);
+ _mesa_enum_to_string(programInterface), name);
}
return _mesa_program_resource_location(shProg, programInterface, name);
if (programInterface != GL_PROGRAM_OUTPUT) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetProgramResourceLocationIndex(%s)",
- _mesa_lookup_enum_by_nr(programInterface));
+ _mesa_enum_to_string(programInterface));
return -1;
}
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glCreateQueries(invalid target = %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glBeginQueryIndexed(%s, %u, %u)\n",
- _mesa_lookup_enum_by_nr(target), index, id);
+ _mesa_enum_to_string(target), index, id);
if (!query_error_check_index(ctx, target, index))
return;
if (*bindpt) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginQuery{Indexed}(target=%s is active)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glEndQueryIndexed(%s, %u)\n",
- _mesa_lookup_enum_by_nr(target), index);
+ _mesa_enum_to_string(target), index);
if (!query_error_check_index(ctx, target, index))
return;
if (q && q->Target != target) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glEndQuery(target=%s with active query of target %s)",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(q->Target));
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(q->Target));
return;
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glQueryCounter(%u, %s)\n", id,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
/* error checking */
if (target != GL_TIMESTAMP) {
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetQueryIndexediv(%s, %u, %s)\n",
- _mesa_lookup_enum_by_nr(target),
+ _mesa_enum_to_string(target),
index,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
if (!query_error_check_index(ctx, target, index))
return;
default:
_mesa_problem(ctx,
"Unknown target in glGetQueryIndexediv(target = %s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
*params = 0;
break;
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetQueryObjectiv(%u, %s)\n", id,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
if (id)
q = _mesa_lookup_query_object(ctx, id);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetQueryObjectuiv(%u, %s)\n", id,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
if (id)
q = _mesa_lookup_query_object(ctx, id);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetQueryObjecti64v(%u, %s)\n", id,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
if (id)
q = _mesa_lookup_query_object(ctx, id);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetQueryObjectui64v(%u, %s)\n", id,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
if (id)
q = _mesa_lookup_query_object(ctx, id);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
width, height,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type),
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type),
pixels);
if (width < 0 || height < 0) {
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)",
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return;
}
}
err = _mesa_error_check_format_and_type(ctx, format, type);
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)",
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return;
}
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n",
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n",
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(param=%d)\n",
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(param=%f)\n",
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(param=%d)\n",
break;
case INVALID_PNAME:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
case INVALID_PARAM:
_mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(param=%u)\n",
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIuiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
invalid_operation:
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(%s prop %s)", caller,
- _mesa_lookup_enum_by_nr(res->Type),
- _mesa_lookup_enum_by_nr(prop));
+ _mesa_enum_to_string(res->Type),
+ _mesa_enum_to_string(prop));
return 0;
}
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "%s(%s prop %s)", caller,
- _mesa_lookup_enum_by_nr(res->Type),
- _mesa_lookup_enum_by_nr(prop));
+ _mesa_enum_to_string(res->Type),
+ _mesa_enum_to_string(prop));
return 0;
invalid_operation:
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(%s prop %s)", caller,
- _mesa_lookup_enum_by_nr(res->Type),
- _mesa_lookup_enum_by_nr(prop));
+ _mesa_enum_to_string(res->Type),
+ _mesa_enum_to_string(prop));
return 0;
}
if (!res || bufSize < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetProgramResourceiv(%s index %d bufSize %d)",
- _mesa_lookup_enum_by_nr(programInterface), index, bufSize);
+ _mesa_enum_to_string(programInterface), index, bufSize);
return;
}
}
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
{
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCreateShader %s\n", _mesa_lookup_enum_by_nr(type));
+ _mesa_debug(ctx, "glCreateShader %s\n", _mesa_enum_to_string(type));
return create_shader(ctx, type);
}
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return;
}
_mesa_error(ctx, GL_INVALID_VALUE,
"glProgramParameteri(pname=%s, value=%d): "
"value must be 0 or 1.",
- _mesa_lookup_enum_by_nr(pname),
+ _mesa_enum_to_string(pname),
value);
}
"glBindImageTextures(the internal format %s of "
"the level zero texture image of textures[%d]=%u "
"is not supported)",
- _mesa_lookup_enum_by_nr(tex_format),
+ _mesa_enum_to_string(tex_format),
i, texture);
continue;
}
{
for (unsigned i = 0; everything[i].name != NULL; i++) {
EXPECT_STREQ(everything[i].name,
- _mesa_lookup_enum_by_nr(everything[i].value));
+ _mesa_enum_to_string(everything[i].value));
}
}
TEST(EnumStrings, LookUpUnknownNumber)
{
- EXPECT_STRCASEEQ("0xEEEE", _mesa_lookup_enum_by_nr(0xEEEE));
+ EXPECT_STRCASEEQ("0xEEEE", _mesa_enum_to_string(0xEEEE));
}
/* Please type the name and the value. This makes it easier to detect
#define TE_ERROR(errCode, msg, value) \
- _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
+ _mesa_error(ctx, errCode, msg, _mesa_enum_to_string(value));
/** Set texture env mode */
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(target=%s)",
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(pname),
*param,
- _mesa_lookup_enum_by_nr((GLenum) iparam0));
+ _mesa_enum_to_string((GLenum) iparam0));
/* Tell device driver about the new texture environment */
if (ctx->Driver.TexEnv) {
}
_mesa_problem(ctx, "unexpected format %s in _mesa_choose_tex_format()",
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return MESA_FORMAT_NONE;
}
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n",
- _mesa_lookup_enum_by_nr(coord),
- _mesa_lookup_enum_by_nr(pname),
+ _mesa_enum_to_string(coord),
+ _mesa_enum_to_string(pname),
*params,
- _mesa_lookup_enum_by_nr((GLenum) (GLint) *params));
+ _mesa_enum_to_string((GLenum) (GLint) *params));
if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)");
*/
if (!legal_getteximage_target(ctx, texObj->Target, true)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTextureImage(target=%s)",
- _mesa_lookup_enum_by_nr(texObj->Target));
+ _mesa_enum_to_string(texObj->Target));
return;
}
if (!legal_getteximage_target(ctx, target, dsa)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetCompressedTex%sImage(target=%s)", suffix,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return GL_TRUE;
}
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexImage%dD(format = %s, internalFormat = %s)",
dimensions,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
_mesa_error(ctx, err,
"glTexImage%dD(format = %s, type = %s, internalFormat = %s)",
dimensions,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type),
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
}
if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glTexImage%dD(internalFormat=%s)",
- dimensions, _mesa_lookup_enum_by_nr(internalFormat));
+ dimensions, _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err,
"glTexImage%dD(incompatible format = %s, type = %s)",
- dimensions, _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ dimensions, _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return GL_TRUE;
}
if (!texture_formats_agree(internalFormat, format)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexImage%dD(incompatible internalFormat = %s, format = %s)",
- dimensions, _mesa_lookup_enum_by_nr(internalFormat),
- _mesa_lookup_enum_by_nr(format));
+ dimensions, _mesa_enum_to_string(internalFormat),
+ _mesa_enum_to_string(format));
return GL_TRUE;
}
if (!_mesa_is_compressed_format(ctx, internalFormat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCompressedTexImage%dD(internalFormat=%s)",
- dimensions, _mesa_lookup_enum_by_nr(internalFormat));
+ dimensions, _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
/* check target (proxies not allowed) */
if (!legal_texsubimage_target(ctx, dimensions, target, dsa)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(target=%s)",
- callerName, _mesa_lookup_enum_by_nr(target));
+ callerName, _mesa_enum_to_string(target));
return GL_TRUE;
}
err = _mesa_es_error_check_format_and_type(format, type, dimensions);
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err, "%s(format = %s, type = %s)",
- callerName, _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ callerName, _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return GL_TRUE;
}
}
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err,
"%s(incompatible format = %s, type = %s)",
- callerName, _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ callerName, _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return GL_TRUE;
}
/* check target */
if (!legal_texsubimage_target(ctx, dimensions, target, false)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)",
- dimensions, _mesa_lookup_enum_by_nr(target));
+ dimensions, _mesa_enum_to_string(target));
return GL_TRUE;
}
default:
_mesa_error(ctx, GL_INVALID_VALUE,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
}
if (baseFormat < 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
if (rb_base_format < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
}
if (!valid) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
}
if(_mesa_is_enum_format_snorm(internalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
}
"DXT compression requested (%s), "
"but libtxc_dxtn library not installed. Using %s "
"instead.",
- _mesa_lookup_enum_by_nr(before),
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(before),
+ _mesa_enum_to_string(internalFormat));
}
}
_mesa_debug(ctx,
"glCompressedTexImage%uD %s %d %s %d %d %d %d %p\n",
dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(target), level,
+ _mesa_enum_to_string(internalFormat),
width, height, depth, border, pixels);
else
_mesa_debug(ctx,
"glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n",
dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(target), level,
+ _mesa_enum_to_string(internalFormat),
width, height, depth, border,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type), pixels);
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type), pixels);
}
internalFormat = override_internal_format(internalFormat, width, height);
/* target error checking */
if (!legal_teximage_target(ctx, dims, target)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
- func, dims, _mesa_lookup_enum_by_nr(target));
+ func, dims, _mesa_enum_to_string(target));
return;
}
_mesa_error(ctx, GL_OUT_OF_MEMORY,
"glTexImage%uD(image too large: %d x %d x %d, %s format)",
dims, width, height, depth,
- _mesa_lookup_enum_by_nr(internalFormat));
+ _mesa_enum_to_string(internalFormat));
return;
}
if (!legal_texsubimage_target(ctx, dims, target, dsa)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sSubImage%uD(target=%s)",
dsa ? "ture" : "",
- dims, _mesa_lookup_enum_by_nr(target));
+ dims, _mesa_enum_to_string(target));
return;
}
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s %p\n",
dims,
- _mesa_lookup_enum_by_nr(target), level,
+ _mesa_enum_to_string(target), level,
xoffset, yoffset, zoffset, width, height, depth,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type), pixels);
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type), pixels);
_mesa_texture_sub_image(ctx, dims, texObj, texImage, target, level,
xoffset, yoffset, zoffset, width, height, depth,
"glTextureSubImage%uD %d %d %d %d %d %d %d %d %s %s %p\n",
dims, texture, level,
xoffset, yoffset, zoffset, width, height, depth,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type), pixels);
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type), pixels);
/* Get the texture object by Name. */
texObj = _mesa_lookup_texture(ctx, texture);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n",
dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_enum_to_string(target), level,
+ _mesa_enum_to_string(internalFormat),
x, y, width, height, border);
if (ctx->NewState & NEW_COPY_TEX_STATE)
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "%s %s %d %d %d %d %d %d %d %d\n", caller,
- _mesa_lookup_enum_by_nr(target),
+ _mesa_enum_to_string(target),
level, xoffset, yoffset, zoffset, x, y, width, height);
if (ctx->NewState & NEW_COPY_TEX_STATE)
*/
if (!legal_texsubimage_target(ctx, 1, target, false)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
*/
if (!legal_texsubimage_target(ctx, 2, target, false)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
*/
if (!legal_texsubimage_target(ctx, 3, target, false)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 1, texObj->Target, true)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(texObj->Target));
+ _mesa_enum_to_string(texObj->Target));
return;
}
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 2, texObj->Target, true)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(texObj->Target));
+ _mesa_enum_to_string(texObj->Target));
return;
}
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 3, texObj->Target, true)) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
- _mesa_lookup_enum_by_nr(texObj->Target));
+ _mesa_enum_to_string(texObj->Target));
return;
}
_mesa_error(ctx, err,
"%s(incompatible format = %s, type = %s)",
function,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type));
+ _mesa_enum_to_string(format),
+ _mesa_enum_to_string(type));
return false;
}
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(incompatible internalFormat = %s, format = %s)",
function,
- _mesa_lookup_enum_by_nr(internalFormat),
- _mesa_lookup_enum_by_nr(format));
+ _mesa_enum_to_string(internalFormat),
+ _mesa_enum_to_string(format));
return false;
}
if (dsa && target == GL_TEXTURE_RECTANGLE) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid target %s)", caller,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return GL_TRUE;
}
if (invalidformat) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(invalid target %s for format %s)", caller,
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(format));
+ _mesa_enum_to_string(target),
+ _mesa_enum_to_string(format));
return GL_TRUE;
}
}
if (!targetOK) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", caller,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return GL_TRUE;
}
if (immutable && !_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(internalformat=%s not legal for immutable-format)",
- func, _mesa_lookup_enum_by_nr(internalformat));
+ func, _mesa_enum_to_string(internalformat));
return;
}
if (!is_renderable_texture_format(ctx, internalformat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(internalformat=%s)",
- func, _mesa_lookup_enum_by_nr(internalformat));
+ func, _mesa_enum_to_string(internalformat));
return;
}
if (targetIndex < 0) { /* Bad Target */
mtx_unlock(&ctx->Shared->Mutex);
_mesa_error(ctx, GL_INVALID_ENUM, "gl%sTextures(target = %s)",
- func, _mesa_lookup_enum_by_nr(texObj->Target));
+ func, _mesa_enum_to_string(texObj->Target));
return;
}
assert(targetIndex < NUM_TEXTURE_TARGETS);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glBindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(target), (GLint) texName);
+ _mesa_enum_to_string(target), (GLint) texName);
targetIndex = _mesa_tex_target_to_index(ctx, target);
if (targetIndex < 0) {
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glBindTextureUnit %s %d\n",
- _mesa_lookup_enum_by_nr(GL_TEXTURE0+unit), (GLint) texture);
+ _mesa_enum_to_string(GL_TEXTURE0+unit), (GLint) texture);
/* Section 8.1 (Texture Objects) of the OpenGL 4.5 core profile spec
* (20141030) says:
if (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTex%sParameter(target=%s, param=%d)", suffix,
- _mesa_lookup_enum_by_nr(texObj->Target), params[0]);
+ _mesa_enum_to_string(texObj->Target), params[0]);
return GL_FALSE;
}
incomplete(ctx, texObj);
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sParameter(pname=%s)",
- suffix, _mesa_lookup_enum_by_nr(pname));
+ suffix, _mesa_enum_to_string(pname));
return GL_FALSE;
invalid_param:
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sParameter(param=%s)",
- suffix, _mesa_lookup_enum_by_nr(params[0]));
+ suffix, _mesa_enum_to_string(params[0]));
return GL_FALSE;
invalid_operation:
_mesa_error(ctx, GL_INVALID_OPERATION, "glTex%sParameter(pname=%s)",
- suffix, _mesa_lookup_enum_by_nr(pname));
+ suffix, _mesa_enum_to_string(pname));
return GL_FALSE;
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sParameter(pname=%s)",
- suffix, _mesa_lookup_enum_by_nr(pname));
+ suffix, _mesa_enum_to_string(pname));
return GL_FALSE;
}
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sParameter(pname=%s)",
- suffix, _mesa_lookup_enum_by_nr(pname));
+ suffix, _mesa_enum_to_string(pname));
return GL_FALSE;
invalid_enum:
_mesa_error(ctx, GL_INVALID_ENUM, "glTex%sParameter(pname=%s)",
- suffix, _mesa_lookup_enum_by_nr(pname));
+ suffix, _mesa_enum_to_string(pname));
return GL_FALSE;
}
else {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetTex%sLevelParameter[if]v(pname=%s)", suffix,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
break;
case GL_TEXTURE_COMPRESSED:
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTex%sLevelParameter[if]v(pname=%s)", suffix,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
/* Always illegal for GL_TEXTURE_BUFFER */
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetTex%sLevelParameter[if]v(pname=%s)", suffix,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
break;
/* GL_ARB_texture_float */
invalid_pname:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTex%sLevelParameter[if]v(pname=%s)", suffix,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
}
if (!legal_get_tex_level_parameter_target(ctx, target, dsa)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTex%sLevelParameter[if]v(target=%s)", suffix,
- _mesa_lookup_enum_by_nr(target));
+ _mesa_enum_to_string(target));
return;
}
{
const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
printf("Texture Unit %d\n", unit);
- printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
- printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
- printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
- printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
- printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
- printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
- printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
- printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
- printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
- printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
- printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
- printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
- printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
- printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
- printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
+ printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_enum_to_string(texUnit->EnvMode));
+ printf(" GL_COMBINE_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.ModeRGB));
+ printf(" GL_COMBINE_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.ModeA));
+ printf(" GL_SOURCE0_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceRGB[0]));
+ printf(" GL_SOURCE1_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceRGB[1]));
+ printf(" GL_SOURCE2_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceRGB[2]));
+ printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceA[0]));
+ printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceA[1]));
+ printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.SourceA[2]));
+ printf(" GL_OPERAND0_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandRGB[0]));
+ printf(" GL_OPERAND1_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandRGB[1]));
+ printf(" GL_OPERAND2_RGB = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandRGB[2]));
+ printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandA[0]));
+ printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandA[1]));
+ printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_enum_to_string(texUnit->Combine.OperandA[2]));
printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(texture));
+ _mesa_enum_to_string(texture));
if (texUnit >= k) {
_mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)",
- _mesa_lookup_enum_by_nr(texture));
+ _mesa_enum_to_string(texture));
return;
}
if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
_mesa_debug(ctx, "glClientActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(texture));
+ _mesa_enum_to_string(texture));
if (texUnit >= ctx->Const.MaxTextureCoordUnits) {
_mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)");
* implementation."
*/
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unit=%s)", func,
- _mesa_lookup_enum_by_nr(GL_TEXTURE0+unit));
+ _mesa_enum_to_string(GL_TEXTURE0+unit));
return NULL;
}
_mesa_error(ctx, _mesa_is_desktop_gl(ctx)?
GL_INVALID_ENUM : GL_INVALID_OPERATION,
"glTex%sStorage%dD(internalformat = %s)", suffix, dims,
- _mesa_lookup_enum_by_nr(internalformat));
+ _mesa_enum_to_string(internalformat));
return GL_TRUE;
}
if (!legal_texobj_target(ctx, dims, target)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glTexStorage%uD(illegal target=%s)",
- dims, _mesa_lookup_enum_by_nr(target));
+ dims, _mesa_enum_to_string(target));
return;
}
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTexStorage%uD %s %d %s %d %d %d\n",
dims,
- _mesa_lookup_enum_by_nr(target), levels,
- _mesa_lookup_enum_by_nr(internalformat),
+ _mesa_enum_to_string(target), levels,
+ _mesa_enum_to_string(internalformat),
width, height, depth);
/* Check the format to make sure it is sized. */
if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glTexStorage%uD(internalformat = %s)", dims,
- _mesa_lookup_enum_by_nr(internalformat));
+ _mesa_enum_to_string(internalformat));
return;
}
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTextureStorage%uD %d %d %s %d %d %d\n",
dims, texture, levels,
- _mesa_lookup_enum_by_nr(internalformat),
+ _mesa_enum_to_string(internalformat),
width, height, depth);
/* Check the format to make sure it is sized. */
if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glTextureStorage%uD(internalformat = %s)", dims,
- _mesa_lookup_enum_by_nr(internalformat));
+ _mesa_enum_to_string(internalformat));
return;
}
if (!legal_texobj_target(ctx, dims, texObj->Target)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glTextureStorage%uD(illegal target=%s)",
- dims, _mesa_lookup_enum_by_nr(texObj->Target));
+ dims, _mesa_enum_to_string(texObj->Target));
return;
}
}
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTextureView(illegal target=%s)",
- _mesa_lookup_enum_by_nr(newTarget));
+ _mesa_enum_to_string(newTarget));
return false;
}
#undef RETURN_IF_SUPPORTED
if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
_mesa_debug(ctx, "glTextureView %d %s %d %s %d %d %d %d\n",
- texture, _mesa_lookup_enum_by_nr(target), origtexture,
- _mesa_lookup_enum_by_nr(internalformat),
+ texture, _mesa_enum_to_string(target), origtexture,
+ _mesa_enum_to_string(internalformat),
minlevel, numlevels, minlayer, numlayers);
if (origtexture == 0) {
internalformat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTextureView(internalformat %s not compatible with origtexture %s)",
- _mesa_lookup_enum_by_nr(internalformat),
- _mesa_lookup_enum_by_nr(origTexObj->Image[0][0]->InternalFormat));
+ _mesa_enum_to_string(internalformat),
+ _mesa_enum_to_string(origTexObj->Image[0][0]->InternalFormat));
return;
}
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(pname 0x%x (%s))", caller, pname,
- _mesa_lookup_enum_by_nr(pname));
+ _mesa_enum_to_string(pname));
return;
}
}
typeBit = type_to_bit(ctx, type);
if (typeBit == 0x0 || (typeBit & legalTypesMask) == 0x0) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(type = %s)",
- func, _mesa_lookup_enum_by_nr(type));
+ func, _mesa_enum_to_string(type));
return false;
}
if (bgra_error) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(size=GL_BGRA and type=%s)",
- func, _mesa_lookup_enum_by_nr(type));
+ func, _mesa_enum_to_string(type));
return false;
}
else
fprintf(stderr, " %s: ", name);
fprintf(stderr, "Ptr=%p, Type=%s, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %lu)\n",
- array->Ptr, _mesa_lookup_enum_by_nr(array->Type), array->Size,
+ array->Ptr, _mesa_enum_to_string(array->Type), array->Size,
array->_ElementSize, array->StrideB, array->BufferObj->Name,
(unsigned long) array->BufferObj->Size);
}
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glClipControl(%s, %s)\n",
- _mesa_lookup_enum_by_nr(origin),
- _mesa_lookup_enum_by_nr(depth));
+ _mesa_enum_to_string(origin),
+ _mesa_enum_to_string(depth));
ASSERT_OUTSIDE_BEGIN_END(ctx);
printf("%s %d..%d\n", __func__, min_index, max_index);
for (i = 0; i < nr_prims; i++)
printf("prim %d: %s start %d count %d\n", i,
- _mesa_lookup_enum_by_nr(prim[i].mode),
+ _mesa_enum_to_string(prim[i].mode),
prim[i].start,
prim[i].count);
}
if (MESA_VERBOSE & VERBOSE_PRIMS)
_mesa_debug(NULL, "MESA 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)
break;
case GL_UNSIGNED_SHORT:
default:
- printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
+ printf("unknown CHAN_TYPE %s\n", _mesa_enum_to_string(CHAN_TYPE));
return GL_FALSE;
}
break;
}
if (!ok) {
-/* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */
+/* fprintf(stderr, "not ok %s\n", _mesa_enum_to_string(prim & PRIM_MODE_MASK)); */
return GL_FALSE;
}
}
}
/* fprintf(stderr, "%s %s %d %d %d\n", __func__, */
-/* _mesa_lookup_enum_by_nr( mode ), */
+/* _mesa_enum_to_string( mode ), */
/* ef[e0], ef[e1], ef[e2]); */
if (mode == GL_POINT) {
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, count);
+ _mesa_enum_to_string(mode), start, count);
if (!_mesa_validate_DrawArrays(ctx, mode, count))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
+ _mesa_enum_to_string(mode), start, count, numInstances);
if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawArraysInstancedBaseInstance(%s, %d, %d, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), first, count,
+ _mesa_enum_to_string(mode), first, count,
numInstances, baseInstance);
if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx,
"glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, end, count,
- _mesa_lookup_enum_by_nr(type), indices, basevertex);
+ _mesa_enum_to_string(mode), start, end, count,
+ _mesa_enum_to_string(type), indices, basevertex);
if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
type, indices))
GET_CURRENT_CONTEXT(ctx);
_mesa_debug(ctx,
"glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
- _mesa_lookup_enum_by_nr(mode), start, end, count,
- _mesa_lookup_enum_by_nr(type), indices);
+ _mesa_enum_to_string(mode), start, end, count,
+ _mesa_enum_to_string(type), indices);
}
vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices);
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices);
if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices, basevertex);
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices, basevertex);
if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices, numInstances);
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices, numInstances);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
numInstances))
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsInstancedBaseVertex(%s, %d, %s, %p, %d; %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices,
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices,
numInstances, basevertex);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsInstancedBaseInstance(%s, %d, %s, %p, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices,
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices,
numInstances, baseInstance);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsInstancedBaseVertexBaseInstance(%s, %d, %s, %p, %d, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices,
+ _mesa_enum_to_string(mode), count,
+ _mesa_enum_to_string(type), indices,
numInstances, basevertex, baseInstance);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n",
- _mesa_lookup_enum_by_nr(mode), name);
+ _mesa_enum_to_string(mode), name);
vbo_draw_transform_feedback(ctx, mode, obj, 0, 1);
}
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawTransformFeedbackStream(%s, %u, %u)\n",
- _mesa_lookup_enum_by_nr(mode), name, stream);
+ _mesa_enum_to_string(mode), name, stream);
vbo_draw_transform_feedback(ctx, mode, obj, stream, 1);
}
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawTransformFeedbackInstanced(%s, %d)\n",
- _mesa_lookup_enum_by_nr(mode), name);
+ _mesa_enum_to_string(mode), name);
vbo_draw_transform_feedback(ctx, mode, obj, 0, primcount);
}
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawTransformFeedbackStreamInstanced"
"(%s, %u, %u, %i)\n",
- _mesa_lookup_enum_by_nr(mode), name, stream, primcount);
+ _mesa_enum_to_string(mode), name, stream, primcount);
vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount);
}
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawArraysIndirect(%s, %p)\n",
- _mesa_lookup_enum_by_nr(mode), indirect);
+ _mesa_enum_to_string(mode), indirect);
if (!_mesa_validate_DrawArraysIndirect(ctx, mode, indirect))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsIndirect(%s, %s, %p)\n",
- _mesa_lookup_enum_by_nr(mode),
- _mesa_lookup_enum_by_nr(type), indirect);
+ _mesa_enum_to_string(mode),
+ _mesa_enum_to_string(type), indirect);
if (!_mesa_validate_DrawElementsIndirect(ctx, mode, type, indirect))
return;
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glMultiDrawArraysIndirect(%s, %p, %i, %i)\n",
- _mesa_lookup_enum_by_nr(mode), indirect, primcount, stride);
+ _mesa_enum_to_string(mode), indirect, primcount, stride);
/* If <stride> is zero, the array elements are treated as tightly packed. */
if (stride == 0)
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glMultiDrawElementsIndirect(%s, %s, %p, %i, %i)\n",
- _mesa_lookup_enum_by_nr(mode),
- _mesa_lookup_enum_by_nr(type), indirect, primcount, stride);
+ _mesa_enum_to_string(mode),
+ _mesa_enum_to_string(type), indirect, primcount, stride);
/* If <stride> is zero, the array elements are treated as tightly packed. */
if (stride == 0)