_mesa_print_state( const char *msg, GLuint state )
{
_mesa_debug(NULL,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
state,
(state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
(state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
(state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
(state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
+ (state & _NEW_STENCIL) ? "ctx->Stencil, " : "",
(state & _NEW_TEXTURE) ? "ctx->Texture, " : "",
(state & _NEW_TRANSFORM) ? "ctx->Transform, " : "",
(state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "",
MESA_VERBOSE = 0x0;
for (i = 0; i < Elements(debug_opt); i++) {
- if (_mesa_strstr(debug, debug_opt[i].name))
+ if (strstr(debug, debug_opt[i].name))
MESA_VERBOSE |= debug_opt[i].flag;
}
/* Debug flag:
*/
- if (_mesa_strstr(debug, "flush"))
+ if (strstr(debug, "flush"))
MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
- if (_mesa_strstr(debug, "fpexceptions")) {
+ if (strstr(debug, "fpexceptions")) {
/* raise FP exceptions */
fpu_control_t mask;
_FPU_GETCW(mask);
GLubyte *buffer;
char s[100];
- buffer = (GLubyte *) _mesa_malloc(img->Width * img->Height
+ buffer = (GLubyte *) malloc(img->Width * img->Height
* img->Depth * 4);
store = ctx->Pack; /* save */
buffer, texObj, img);
/* make filename */
- _mesa_sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
+ sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
- _mesa_printf(" Writing image level %u to %s\n", level, s);
+ printf(" Writing image level %u to %s\n", level, s);
write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE);
ctx->Pack = store; /* restore */
- _mesa_free(buffer);
+ free(buffer);
}
}
return;
}
- buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4);
+ buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4);
ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height,
format, type, &ctx->DefaultPacking, buffer);
/* make filename */
- _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name);
+ sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name);
- _mesa_printf(" Writing renderbuffer image to %s\n", s);
+ printf(" Writing renderbuffer image to %s\n", s);
write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE);
- _mesa_free(buffer);
+ free(buffer);
}
GLboolean written = GL_FALSE;
GLuint i, j;
- _mesa_printf("Texture %u\n", texObj->Name);
- _mesa_printf(" Target %s\n", tex_target_name(texObj->Target));
+ printf("Texture %u\n", texObj->Name);
+ printf(" Target %s\n", tex_target_name(texObj->Target));
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
for (j = 0; j < numFaces; j++) {
struct gl_texture_image *texImg = texObj->Image[j][i];
if (texImg) {
- _mesa_printf(" Face %u level %u: %d x %d x %d, format %s at %p\n",
- j, i,
- texImg->Width, texImg->Height, texImg->Depth,
- _mesa_get_format_name(texImg->TexFormat),
- texImg->Data);
+ printf(" Face %u level %u: %d x %d x %d, format %s at %p\n",
+ j, i,
+ texImg->Width, texImg->Height, texImg->Depth,
+ _mesa_get_format_name(texImg->TexFormat),
+ texImg->Data);
if (writeImages == WRITE_ALL ||
(writeImages == WRITE_ONE && !written)) {
write_texture_image(texObj, j, i);
static void
dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage)
{
- _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n",
- rb->Name, rb->Width, rb->Height,
- _mesa_lookup_enum_by_nr(rb->InternalFormat));
+ printf("Renderbuffer %u: %u x %u IntFormat = %s\n",
+ rb->Name, rb->Width, rb->Height,
+ _mesa_lookup_enum_by_nr(rb->InternalFormat));
if (writeImage) {
write_renderbuffer_image(rb);
}
const GLuint h = ctx->DrawBuffer->Height;
GLubyte *buf;
- buf = (GLubyte *) _mesa_malloc(w * h * 4);
+ buf = (GLubyte *) malloc(w * h * 4);
_mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
_mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
_mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf);
- _mesa_printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n",
- ctx->ReadBuffer->_ColorReadBuffer,
- ctx->ReadBuffer->ColorReadBuffer,
- ctx->DrawBuffer->_ColorDrawBuffers[0],
- ctx->DrawBuffer->ColorDrawBuffer[0]);
- _mesa_printf("Writing %d x %d color buffer to %s\n", w, h, filename);
+ printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n",
+ (void *) ctx->ReadBuffer->_ColorReadBuffer,
+ ctx->ReadBuffer->ColorReadBuffer,
+ (void *) ctx->DrawBuffer->_ColorDrawBuffers[0],
+ ctx->DrawBuffer->ColorDrawBuffer[0]);
+ printf("Writing %d x %d color buffer to %s\n", w, h, filename);
write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE);
_mesa_PopClientAttrib();
- _mesa_free(buf);
+ free(buf);
}
GLubyte *buf2;
GLuint i;
- buf = (GLuint *) _mesa_malloc(w * h * 4); /* 4 bpp */
- buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */
+ buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */
+ buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
_mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
_mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
buf2[i*3+2] = (buf[i] >> 8) & 0xff;
}
- _mesa_printf("Writing %d x %d depth buffer to %s\n", w, h, filename);
+ printf("Writing %d x %d depth buffer to %s\n", w, h, filename);
write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
_mesa_PopClientAttrib();
- _mesa_free(buf);
- _mesa_free(buf2);
+ free(buf);
+ free(buf2);
}
GLubyte *buf2;
GLuint i;
- buf = (GLubyte *) _mesa_malloc(w * h); /* 1 bpp */
- buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */
+ buf = (GLubyte *) malloc(w * h); /* 1 bpp */
+ buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */
_mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
_mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
buf2[i*3+2] = (buf[i] - 128) * 2;
}
- _mesa_printf("Writing %d x %d stencil buffer to %s\n", w, h, filename);
+ printf("Writing %d x %d stencil buffer to %s\n", w, h, filename);
write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE);
_mesa_PopClientAttrib();
- _mesa_free(buf);
- _mesa_free(buf2);
+ free(buf);
+ free(buf2);
}
const GLubyte *data = (const GLubyte *) img->Data;
if (!data) {
- _mesa_printf("No texture data\n");
+ printf("No texture data\n");
return;
}
for (i = 0; i < img->Height; i++) {
for (j = 0; j < img->Width; j++) {
if (c==1)
- _mesa_printf("%02x ", data[0]);
+ printf("%02x ", data[0]);
else if (c==2)
- _mesa_printf("%02x%02x ", data[0], data[1]);
+ printf("%02x%02x ", data[0], data[1]);
else if (c==3)
- _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]);
+ printf("%02x%02x%02x ", data[0], data[1], data[2]);
else if (c==4)
- _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
+ printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
data += (img->RowStride - img->Width) * c;
}
/* XXX use img->ImageStride here */
- _mesa_printf("\n");
+ printf("\n");
}
#endif
}