*/
/*
- _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n",
+ printf("mip3d %d x %d x %d -> %d x %d x %d\n",
srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth);
*/
finish_y -= sy;
/*
- _mesa_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
+ printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
*/
for (y = start_y; y < finish_y; y++) {
glXQueryServerString( Display *dpy, int screen, int name )
{
static char version[1000];
- _mesa_sprintf(version, "%d.%d %s",
- SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
+ sprintf(version, "%d.%d %s",
+ SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
(void) screen;
glXGetClientString( Display *dpy, int name )
{
static char version[1000];
- _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
- CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
+ sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
+ CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
* reports bugs.
*/
if (_mesa_getenv("MESA_INFO")) {
- _mesa_printf("X/Mesa visual = %p\n", (void *) v);
- _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level);
- _mesa_printf("X/Mesa depth = %d\n", v->visinfo->depth);
- _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
+ printf("X/Mesa visual = %p\n", (void *) v);
+ printf("X/Mesa level = %d\n", v->mesa_visual.level);
+ printf("X/Mesa depth = %d\n", v->visinfo->depth);
+ printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
}
if (b && window) {
texTarget = "RECT";
else
texTarget = "2D";
- _mesa_snprintf(program2, sizeof(program2), program, texTarget);
+ snprintf(program2, sizeof(program2), program, texTarget);
_mesa_GenPrograms(1, &blit->DepthFP);
_mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP);
texTarget = "RECT";
else
texTarget = "2D";
- _mesa_snprintf(program2, sizeof(program2), program, texTarget);
+ snprintf(program2, sizeof(program2), program, texTarget);
_mesa_GenPrograms(1, &drawpix->StencilFP);
_mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP);
texTarget = "RECT";
else
texTarget = "2D";
- _mesa_snprintf(program2, sizeof(program2), program, texTarget);
+ snprintf(program2, sizeof(program2), program, texTarget);
_mesa_GenPrograms(1, &drawpix->DepthFP);
_mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->DepthFP);
return GL_FALSE;
if (0)
- _mesa_printf("\ntexmem-0-3 branch\n\n");
+ printf("\ntexmem-0-3 branch\n\n");
i915InitVtbl(i915);
#include "i915_context.h"
#include "i915_debug.h"
-#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ )
-
static GLboolean debug( struct debug_stream *stream, const char *name, GLuint len )
{
GLuint i;
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
if (len == 0) {
- PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]);
+ printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]);
assert(0);
return GL_FALSE;
}
if (stream->print_addresses)
- PRINTF("%08x: ", stream->offset);
+ printf("%08x: ", stream->offset);
- PRINTF("%s (%d dwords):\n", name, len);
+ printf("%s (%d dwords):\n", name, len);
for (i = 0; i < len; i++)
- PRINTF("\t0x%08x\n", ptr[i]);
- PRINTF("\n");
+ printf("\t0x%08x\n", ptr[i]);
+ printf("\n");
stream->offset += len * sizeof(GLuint);
- PRINTF("%s %s (%d dwords):\n", name, prim, len);
- PRINTF("\t0x%08x\n", ptr[0]);
+ printf("%s %s (%d dwords):\n", name, prim, len);
+ printf("\t0x%08x\n", ptr[0]);
for (i = 1; i < len; i++) {
if (dump_floats)
- PRINTF("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]);
+ printf("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]);
else
- PRINTF("\t0x%08x\n", ptr[i]);
+ printf("\t0x%08x\n", ptr[i]);
}
- PRINTF("\n");
+ printf("\n");
stream->offset += len * sizeof(GLuint);
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
if (len == 0) {
- PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]);
+ printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]);
assert(0);
return GL_FALSE;
}
if (stream->print_addresses)
- PRINTF("%08x: ", stream->offset);
+ printf("%08x: ", stream->offset);
- PRINTF("%s (%d dwords):\n", name, len);
+ printf("%s (%d dwords):\n", name, len);
i915_disassemble_program( ptr, len );
stream->offset += len * sizeof(GLuint);
GLuint old_offset = stream->offset + len * sizeof(GLuint);
GLuint i;
- PRINTF("%s (%d dwords):\n", name, len);
+ printf("%s (%d dwords):\n", name, len);
for (i = 0; i < len; i++)
- PRINTF("\t0x%08x\n", ptr[i]);
+ printf("\t0x%08x\n", ptr[i]);
stream->offset = ptr[1] & ~0x3;
if (stream->offset < old_offset)
- PRINTF("\n... skipping backwards from 0x%x --> 0x%x ...\n\n",
+ printf("\n... skipping backwards from 0x%x --> 0x%x ...\n\n",
old_offset, stream->offset );
else
- PRINTF("\n... skipping from 0x%x --> 0x%x ...\n\n",
+ printf("\n... skipping from 0x%x --> 0x%x ...\n\n",
old_offset, stream->offset );
len = 1+(i+2)/2;
- PRINTF("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len);
+ printf("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len);
for (i = 0; i < len; i++)
- PRINTF("\t0x%08x\n", ptr[i]);
- PRINTF("\n");
+ printf("\t0x%08x\n", ptr[i]);
+ printf("\n");
stream->offset += len * sizeof(GLuint);
return GL_TRUE;
#define BITS( dw, hi, lo, ... ) \
do { \
unsigned himask = 0xffffffffU >> (31 - (hi)); \
- PRINTF("\t\t "); \
- PRINTF(__VA_ARGS__); \
- PRINTF(": 0x%x\n", ((dw) & himask) >> (lo)); \
+ printf("\t\t "); \
+ printf(__VA_ARGS__); \
+ printf(": 0x%x\n", ((dw) & himask) >> (lo)); \
} while (0)
#define MBZ( dw, hi, lo) do { \
#define FLAG( dw, bit, ... ) \
do { \
if (((dw) >> (bit)) & 1) { \
- PRINTF("\t\t "); \
- PRINTF(__VA_ARGS__); \
- PRINTF("\n"); \
+ printf("\t\t "); \
+ printf(__VA_ARGS__); \
+ printf("\n"); \
} \
} while (0)
GLuint bits = (ptr[0] >> 4) & 0xff;
GLuint j = 0;
- PRINTF("%s (%d dwords, flags: %x):\n", name, len, bits);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords, flags: %x):\n", name, len, bits);
+ printf("\t0x%08x\n", ptr[j++]);
if (bits & (1<<0)) {
- PRINTF("\t LIS0: 0x%08x\n", ptr[j]);
- PRINTF("\t vb address: 0x%08x\n", (ptr[j] & ~0x3));
+ printf("\t LIS0: 0x%08x\n", ptr[j]);
+ printf("\t vb address: 0x%08x\n", (ptr[j] & ~0x3));
BITS(ptr[j], 0, 0, "vb invalidate disable");
j++;
}
if (bits & (1<<1)) {
- PRINTF("\t LIS1: 0x%08x\n", ptr[j]);
+ printf("\t LIS1: 0x%08x\n", ptr[j]);
BITS(ptr[j], 29, 24, "vb dword width");
BITS(ptr[j], 21, 16, "vb dword pitch");
BITS(ptr[j], 15, 0, "vb max index");
}
if (bits & (1<<2)) {
int i;
- PRINTF("\t LIS2: 0x%08x\n", ptr[j]);
+ printf("\t LIS2: 0x%08x\n", ptr[j]);
for (i = 0; i < 8; i++) {
unsigned tc = (ptr[j] >> (i * 4)) & 0xf;
if (tc != 0xf)
j++;
}
if (bits & (1<<3)) {
- PRINTF("\t LIS3: 0x%08x\n", ptr[j]);
+ printf("\t LIS3: 0x%08x\n", ptr[j]);
j++;
}
if (bits & (1<<4)) {
- PRINTF("\t LIS4: 0x%08x\n", ptr[j]);
+ printf("\t LIS4: 0x%08x\n", ptr[j]);
BITS(ptr[j], 31, 23, "point width");
BITS(ptr[j], 22, 19, "line width");
FLAG(ptr[j], 18, "alpha flatshade");
j++;
}
if (bits & (1<<5)) {
- PRINTF("\t LIS5: 0x%08x\n", ptr[j]);
+ printf("\t LIS5: 0x%08x\n", ptr[j]);
BITS(ptr[j], 31, 28, "rgba write disables");
FLAG(ptr[j], 27, "force dflt point width");
FLAG(ptr[j], 26, "last pixel enable");
j++;
}
if (bits & (1<<6)) {
- PRINTF("\t LIS6: 0x%08x\n", ptr[j]);
+ printf("\t LIS6: 0x%08x\n", ptr[j]);
FLAG(ptr[j], 31, "alpha test enable");
BITS(ptr[j], 30, 28, "alpha func");
BITS(ptr[j], 27, 20, "alpha ref");
}
- PRINTF("\n");
+ printf("\n");
assert(j == len);
GLuint bits = (ptr[0] >> 8) & 0x3f;
GLuint i, j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
for (i = 0; i < 6; i++) {
if (bits & (1<<i)) {
switch (1<<(8+i)) {
case LI0_STATE_STATIC_INDIRECT:
- PRINTF(" STATIC: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
- PRINTF(" 0x%08x\n", ptr[j++]);
+ printf(" STATIC: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" 0x%08x\n", ptr[j++]);
break;
case LI0_STATE_DYNAMIC_INDIRECT:
- PRINTF(" DYNAMIC: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" DYNAMIC: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
break;
case LI0_STATE_SAMPLER:
- PRINTF(" SAMPLER: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
- PRINTF(" 0x%08x\n", ptr[j++]);
+ printf(" SAMPLER: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" 0x%08x\n", ptr[j++]);
break;
case LI0_STATE_MAP:
- PRINTF(" MAP: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
- PRINTF(" 0x%08x\n", ptr[j++]);
+ printf(" MAP: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" 0x%08x\n", ptr[j++]);
break;
case LI0_STATE_PROGRAM:
- PRINTF(" PROGRAM: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
- PRINTF(" 0x%08x\n", ptr[j++]);
+ printf(" PROGRAM: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" 0x%08x\n", ptr[j++]);
break;
case LI0_STATE_CONSTANTS:
- PRINTF(" CONSTANTS: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
- PRINTF(" 0x%08x\n", ptr[j++]);
+ printf(" CONSTANTS: 0x%08x | %x\n", ptr[j]&~3, ptr[j]&3); j++;
+ printf(" 0x%08x\n", ptr[j++]);
break;
default:
assert(0);
}
if (bits == 0) {
- PRINTF("\t DUMMY: 0x%08x\n", ptr[j++]);
+ printf("\t DUMMY: 0x%08x\n", ptr[j++]);
}
- PRINTF("\n");
+ printf("\n");
assert(j == len);
static void BR13( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x\n", val);
+ printf("\t0x%08x\n", val);
FLAG(val, 30, "clipping enable");
BITS(val, 25, 24, "color depth (3==32bpp)");
BITS(val, 23, 16, "raster op");
BR22.val = val22;
BR23.val = val23;
- PRINTF("\t0x%08x\n", val22);
+ printf("\t0x%08x\n", val22);
BITS(val22, 31, 16, "dest y1");
BITS(val22, 15, 0, "dest x1");
- PRINTF("\t0x%08x\n", val23);
+ printf("\t0x%08x\n", val23);
BITS(val23, 31, 16, "dest y2");
BITS(val23, 15, 0, "dest x2");
static void BR09( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x -- dest address\n", val);
+ printf("\t0x%08x -- dest address\n", val);
}
static void BR26( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x\n", val);
+ printf("\t0x%08x\n", val);
BITS(val, 31, 16, "src y1");
BITS(val, 15, 0, "src x1");
}
static void BR11( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x\n", val);
+ printf("\t0x%08x\n", val);
BITS(val, 15, 0, "src pitch");
}
static void BR12( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x -- src address\n", val);
+ printf("\t0x%08x -- src address\n", val);
}
static void BR16( struct debug_stream *stream,
GLuint val )
{
- PRINTF("\t0x%08x -- color\n", val);
+ printf("\t0x%08x -- color\n", val);
}
static GLboolean debug_copy_blit( struct debug_stream *stream,
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
BR13(stream, ptr[j++]);
BR2223(stream, ptr[j], ptr[j+1]);
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
BR13(stream, ptr[j++]);
BR2223(stream, ptr[j], ptr[j+1]);
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j]);
BITS(ptr[j], 21, 18, "logicop func");
FLAG(ptr[j], 17, "stencil test mask modify-enable");
FLAG(ptr[j], 16, "stencil write mask modify-enable");
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
{
- PRINTF("\t0x%08x\n", ptr[j]);
+ printf("\t0x%08x\n", ptr[j]);
BITS(ptr[j], 15, 0, "map mask");
j++;
}
while (j < len) {
{
- PRINTF("\t TMn.0: 0x%08x\n", ptr[j]);
- PRINTF("\t map address: 0x%08x\n", (ptr[j] & ~0x3));
+ printf("\t TMn.0: 0x%08x\n", ptr[j]);
+ printf("\t map address: 0x%08x\n", (ptr[j] & ~0x3));
FLAG(ptr[j], 1, "vertical line stride");
FLAG(ptr[j], 0, "vertical line stride offset");
j++;
}
{
- PRINTF("\t TMn.1: 0x%08x\n", ptr[j]);
+ printf("\t TMn.1: 0x%08x\n", ptr[j]);
BITS(ptr[j], 31, 21, "height");
BITS(ptr[j], 20, 10, "width");
BITS(ptr[j], 9, 7, "surface format");
j++;
}
{
- PRINTF("\t TMn.2: 0x%08x\n", ptr[j]);
+ printf("\t TMn.2: 0x%08x\n", ptr[j]);
BITS(ptr[j], 31, 21, "dword pitch");
BITS(ptr[j], 20, 15, "cube face enables");
BITS(ptr[j], 14, 9, "max lod");
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
{
- PRINTF("\t0x%08x\n", ptr[j]);
+ printf("\t0x%08x\n", ptr[j]);
BITS(ptr[j], 15, 0, "sampler mask");
j++;
}
while (j < len) {
{
- PRINTF("\t TSn.0: 0x%08x\n", ptr[j]);
+ printf("\t TSn.0: 0x%08x\n", ptr[j]);
FLAG(ptr[j], 31, "reverse gamma");
FLAG(ptr[j], 30, "planar to packed");
FLAG(ptr[j], 29, "yuv->rgb");
}
{
- PRINTF("\t TSn.1: 0x%08x\n", ptr[j]);
+ printf("\t TSn.1: 0x%08x\n", ptr[j]);
BITS(ptr[j], 31, 24, "min lod");
MBZ( ptr[j], 23, 18 );
FLAG(ptr[j], 17, "kill pixel enable");
j++;
}
{
- PRINTF("\t TSn.2: 0x%08x (default color)\n", ptr[j]);
+ printf("\t TSn.2: 0x%08x (default color)\n", ptr[j]);
j++;
}
}
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
{
- PRINTF("\t0x%08x\n", ptr[j]);
+ printf("\t0x%08x\n", ptr[j]);
FLAG(ptr[j], 31, "early classic ztest");
FLAG(ptr[j], 30, "opengl tex default color");
FLAG(ptr[j], 29, "bypass iz");
GLuint *ptr = (GLuint *)(stream->ptr + stream->offset);
int j = 0;
- PRINTF("%s (%d dwords):\n", name, len);
- PRINTF("\t0x%08x\n", ptr[j++]);
+ printf("%s (%d dwords):\n", name, len);
+ printf("\t0x%08x\n", ptr[j++]);
{
- PRINTF("\t0x%08x\n", ptr[j]);
+ printf("\t0x%08x\n", ptr[j]);
BITS(ptr[j], 28, 28, "aux buffer id");
BITS(ptr[j], 27, 24, "buffer id (7=depth, 3=back)");
FLAG(ptr[j], 23, "use fence regs");
j++;
}
- PRINTF("\t0x%08x -- buffer base address\n", ptr[j++]);
+ printf("\t0x%08x -- buffer base address\n", ptr[j++]);
stream->offset += len * sizeof(GLuint);
assert(j == len);
GLuint bytes = (end - start) * 4;
GLboolean done = GL_FALSE;
- PRINTF("\n\nBATCH: (%d)\n", bytes / 4);
+ printf("\n\nBATCH: (%d)\n", bytes / 4);
stream.offset = 0;
stream.ptr = (char *)start;
stream.offset >= 0);
}
- PRINTF("END-BATCH\n\n\n");
+ printf("END-BATCH\n\n\n");
}
#include "i915_debug.h"
#include "main/imports.h"
-#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ )
-
static const char *opcodes[0x20] = {
"NOP",
"ADD",
case REG_TYPE_T:
switch (nr) {
case T_DIFFUSE:
- PRINTF("T_DIFFUSE");
+ printf("T_DIFFUSE");
return;
case T_SPECULAR:
- PRINTF("T_SPECULAR");
+ printf("T_SPECULAR");
return;
case T_FOG_W:
- PRINTF("T_FOG_W");
+ printf("T_FOG_W");
return;
default:
- PRINTF("T_TEX%d", nr);
+ printf("T_TEX%d", nr);
return;
}
case REG_TYPE_OC:
if (nr == 0) {
- PRINTF("oC");
+ printf("oC");
return;
}
break;
case REG_TYPE_OD:
if (nr == 0) {
- PRINTF("oD");
+ printf("oD");
return;
}
break;
break;
}
- PRINTF("%s[%d]", regname[type], nr);
+ printf("%s[%d]", regname[type], nr);
}
#define REG_SWIZZLE_MASK 0x7777
(reg & REG_NEGATE_MASK) == 0)
return;
- PRINTF(".");
+ printf(".");
for (i = 3; i >= 0; i--) {
if (reg & (1 << ((i * 4) + 3)))
- PRINTF("-");
+ printf("-");
switch ((reg >> (i * 4)) & 0x7) {
case 0:
- PRINTF("x");
+ printf("x");
break;
case 1:
- PRINTF("y");
+ printf("y");
break;
case 2:
- PRINTF("z");
+ printf("z");
break;
case 3:
- PRINTF("w");
+ printf("w");
break;
case 4:
- PRINTF("0");
+ printf("0");
break;
case 5:
- PRINTF("1");
+ printf("1");
break;
default:
- PRINTF("?");
+ printf("?");
break;
}
}
print_reg_type_nr(type, nr);
if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL)
return;
- PRINTF(".");
+ printf(".");
if (dword & A0_DEST_CHANNEL_X)
- PRINTF("x");
+ printf("x");
if (dword & A0_DEST_CHANNEL_Y)
- PRINTF("y");
+ printf("y");
if (dword & A0_DEST_CHANNEL_Z)
- PRINTF("z");
+ printf("z");
if (dword & A0_DEST_CHANNEL_W)
- PRINTF("w");
+ printf("w");
}
if (opcode != A0_NOP) {
print_dest_reg(program[0]);
if (program[0] & A0_DEST_SATURATE)
- PRINTF(" = SATURATE ");
+ printf(" = SATURATE ");
else
- PRINTF(" = ");
+ printf(" = ");
}
- PRINTF("%s ", opcodes[opcode]);
+ printf("%s ", opcodes[opcode]);
print_src_reg(GET_SRC0_REG(program[0], program[1]));
if (args[opcode] == 1) {
- PRINTF("\n");
+ printf("\n");
return;
}
- PRINTF(", ");
+ printf(", ");
print_src_reg(GET_SRC1_REG(program[1], program[2]));
if (args[opcode] == 2) {
- PRINTF("\n");
+ printf("\n");
return;
}
- PRINTF(", ");
+ printf(", ");
print_src_reg(GET_SRC2_REG(program[2]));
- PRINTF("\n");
+ printf("\n");
return;
}
print_tex_op(GLuint opcode, const GLuint * program)
{
print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- PRINTF(" = ");
+ printf(" = ");
- PRINTF("%s ", opcodes[opcode]);
+ printf("%s ", opcodes[opcode]);
- PRINTF("S[%d],", program[0] & T0_SAMPLER_NR_MASK);
+ printf("S[%d],", program[0] & T0_SAMPLER_NR_MASK);
print_reg_type_nr((program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) &
REG_TYPE_MASK,
(program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK);
- PRINTF("\n");
+ printf("\n");
}
static void
print_dcl_op(GLuint opcode, const GLuint * program)
{
- PRINTF("%s ", opcodes[opcode]);
+ printf("%s ", opcodes[opcode]);
print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- PRINTF("\n");
+ printf("\n");
}
GLuint size = program[0] & 0x1ff;
GLint i;
- PRINTF("\t\tBEGIN\n");
+ printf("\t\tBEGIN\n");
assert(size + 2 == sz);
for (i = 1; i < sz; i += 3, program += 3) {
GLuint opcode = program[0] & (0x1f << 24);
- PRINTF("\t\t");
+ printf("\t\t");
if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT)
print_arith_op(opcode >> 24, program);
else if (opcode == D0_DCL)
print_dcl_op(opcode >> 24, program);
else
- PRINTF("Unknown opcode 0x%x\n", opcode);
+ printf("Unknown opcode 0x%x\n", opcode);
}
- PRINTF("\t\tEND\n\n");
+ printf("\t\tEND\n\n");
}
intel_miptree_set_image_offset(mt, level, face, x, y);
if (d == 0)
- _mesa_printf("cube mipmap %d/%d (%d..%d) is 0x0\n",
- face, level, mt->first_level, mt->last_level);
+ printf("cube mipmap %d/%d (%d..%d) is 0x0\n",
+ face, level, mt->first_level, mt->last_level);
d >>= 1;
x += step_offsets[face][0] * d;
assert(intel->prim.primitive != ~0);
-/* _mesa_printf("/\n"); */
+/* printf("/\n"); */
if (used < 8)
goto do_discard;
intel->no_batch_wrap = GL_TRUE;
- /*_mesa_printf("%s *", __progname);*/
+ /*printf("%s *", __progname);*/
/* Emit a slot which will be filled with the inline primitive
* command later.
ADVANCE_BATCH();
intel->no_batch_wrap = GL_FALSE;
-/* _mesa_printf(">"); */
+/* printf(">"); */
}
static void intel_wrap_inline(struct intel_context *intel)
if (intel_batchbuffer_space(intel->batch) < sz)
intel_wrap_inline(intel);
-/* _mesa_printf("."); */
+/* printf("."); */
intel->vtbl.assert_not_dirty(intel);
GLcontext *ctx = &intel->ctx;
if (!brw) {
- _mesa_printf("%s: failed to alloc context\n", __FUNCTION__);
+ printf("%s: failed to alloc context\n", __FUNCTION__);
return GL_FALSE;
}
if (!intelInitContext( intel, mesaVis, driContextPriv,
sharedContextPrivate, &functions )) {
- _mesa_printf("%s: failed to init intel context\n", __FUNCTION__);
+ printf("%s: failed to init intel context\n", __FUNCTION__);
FREE(brw);
return GL_FALSE;
}
brw->curbe.total_size = reg;
if (0)
- _mesa_printf("curbe wm %d+%d clip %d+%d vs %d+%d\n",
- brw->curbe.wm_start,
- brw->curbe.wm_size,
- brw->curbe.clip_start,
- brw->curbe.clip_size,
- brw->curbe.vs_start,
- brw->curbe.vs_size );
+ printf("curbe wm %d+%d clip %d+%d vs %d+%d\n",
+ brw->curbe.wm_start,
+ brw->curbe.wm_size,
+ brw->curbe.clip_start,
+ brw->curbe.clip_size,
+ brw->curbe.vs_start,
+ brw->curbe.vs_size );
brw->state.dirty.brw |= BRW_NEW_CURBE_OFFSETS;
}
if (0) {
for (i = 0; i < sz*16; i+=4)
- _mesa_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
- buf[i+0], buf[i+1], buf[i+2], buf[i+3]);
+ printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
+ buf[i+0], buf[i+1], buf[i+2], buf[i+3]);
- _mesa_printf("last_buf %p buf %p sz %d/%d cmp %d\n",
- brw->curbe.last_buf, buf,
- bufsz, brw->curbe.last_bufsz,
- brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1);
+ printf("last_buf %p buf %p sz %d/%d cmp %d\n",
+ brw->curbe.last_buf, buf,
+ bufsz, brw->curbe.last_bufsz,
+ brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1);
}
if (brw->curbe.curbe_bo != NULL &&
GLcontext *ctx = &brw->intel.ctx;
if (INTEL_DEBUG & DEBUG_PRIMS)
- _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim));
+ printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim));
/* Slight optimization to avoid the GS program when not needed:
*/
struct intel_context *intel = &brw->intel;
if (INTEL_DEBUG & DEBUG_PRIMS)
- _mesa_printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode),
+ printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode),
prim->start, prim->count);
prim_packet.header.opcode = CMD_3D_PRIM;
GLenum format, GLboolean normalized )
{
if (INTEL_DEBUG & DEBUG_VERTS)
- _mesa_printf("type %s size %d normalized %d\n",
+ printf("type %s size %d normalized %d\n",
_mesa_lookup_enum_by_nr(type), size, normalized);
if (normalized) {
/* First build an array of pointers to ve's in vb.inputs_read
*/
if (0)
- _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
+ printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
/* Accumulate the list of enabled arrays. */
brw->vb.nr_enabled = 0;
"f"
};
- _mesa_printf("%s%s",
- hwreg.abs ? "abs/" : "",
- hwreg.negate ? "-" : "");
+ printf("%s%s",
+ hwreg.abs ? "abs/" : "",
+ hwreg.negate ? "-" : "");
if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
hwreg.nr % 2 == 0 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
/* vector register */
- _mesa_printf("vec%d", hwreg.nr);
+ printf("vec%d", hwreg.nr);
}
else if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
hwreg.vstride == BRW_VERTICAL_STRIDE_0 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
/* "scalar" register */
- _mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
+ printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
}
else if (hwreg.file == BRW_IMMEDIATE_VALUE) {
- _mesa_printf("imm %f", hwreg.dw1.f);
+ printf("imm %f", hwreg.dw1.f);
}
else {
- _mesa_printf("%s%d.%d<%d;%d,%d>:%s",
+ printf("%s%d.%d<%d;%d,%d>:%s",
file[hwreg.file],
hwreg.nr,
hwreg.subnr / type_sz(hwreg.type),
GLboolean need_stall = 0;
if (writemask == 0) {
- /*_mesa_printf("%s: zero writemask??\n", __FUNCTION__); */
+ /*printf("%s: zero writemask??\n", __FUNCTION__); */
return;
}
if (newmask != writemask) {
need_stall = 1;
- /* _mesa_printf("need stall %x %x\n", newmask , writemask); */
+ /* printf("need stall %x %x\n", newmask , writemask); */
}
else {
struct brw_reg m1 = brw_message_reg(msg_reg_nr);
}
if (INTEL_DEBUG & DEBUG_STATE)
- _mesa_printf("upload %s: %d bytes to cache id %d\n",
+ printf("upload %s: %d bytes to cache id %d\n",
cache->name[cache_id],
data_size, cache_id);
GLuint i;
if (INTEL_DEBUG & DEBUG_STATE)
- _mesa_printf("%s\n", __FUNCTION__);
+ printf("%s\n", __FUNCTION__);
for (i = 0; i < cache->size; i++) {
for (c = cache->items[i]; c; c = next) {
GLuint i;
if (INTEL_DEBUG & DEBUG_STATE)
- _mesa_printf("%s\n", __FUNCTION__);
+ printf("%s\n", __FUNCTION__);
for (i = 0; i < cache->size; i++) {
for (prev = &cache->items[i]; *prev;) {
brw_state_cache_check_size(struct brw_context *brw)
{
if (INTEL_DEBUG & DEBUG_STATE)
- _mesa_printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items);
+ printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items);
/* un-tuned guess. We've got around 20 state objects for a total of around
* 32k, so 1000 of them is around 1.5MB.
GLuint i;
if (INTEL_DEBUG & DEBUG_STATE)
- _mesa_printf("%s\n", __FUNCTION__);
+ printf("%s\n", __FUNCTION__);
brw_clear_cache(brw, cache);
for (i = 0; i < BRW_MAX_CACHE; i++) {
* entries and the values for minimum nr of entries
* provided above.
*/
- _mesa_printf("couldn't calculate URB layout!\n");
+ printf("couldn't calculate URB layout!\n");
exit(1);
}
if (INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
- _mesa_printf("URB CONSTRAINED\n");
+ printf("URB CONSTRAINED\n");
}
done:
if (INTEL_DEBUG & DEBUG_URB)
- _mesa_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
+ printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
brw->urb.vs_start,
brw->urb.gs_start,
brw->urb.clip_start,
c->prog_data.total_grf = reg;
if (INTEL_DEBUG & DEBUG_VS) {
- _mesa_printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs);
- _mesa_printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries);
- _mesa_printf("%s reg = %d\n", __FUNCTION__, reg);
+ printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs);
+ printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries);
+ printf("%s reg = %d\n", __FUNCTION__, reg);
}
}
GLuint file;
if (INTEL_DEBUG & DEBUG_VS) {
- _mesa_printf("vs-mesa:\n");
+ printf("vs-mesa:\n");
_mesa_print_program(&c->vp->program.Base);
- _mesa_printf("\n");
+ printf("\n");
}
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
if (INTEL_DEBUG & DEBUG_VS) {
int i;
- _mesa_printf("vs-native:\n");
+ printf("vs-native:\n");
for (i = 0; i < p->nr_insn; i++)
brw_disasm(stderr, &p->store[i]);
- _mesa_printf("\n");
+ printf("\n");
}
}
if (c->state >= PASS2_DONE)
brw_print_reg(value->hw_reg);
else if( value == &c->undef_value )
- _mesa_printf("undef");
+ printf("undef");
else if( value - c->vreg >= 0 &&
value - c->vreg < BRW_WM_MAX_VREG)
- _mesa_printf("r%d", value - c->vreg);
+ printf("r%d", value - c->vreg);
else if (value - c->creg >= 0 &&
value - c->creg < BRW_WM_MAX_PARAM)
- _mesa_printf("c%d", value - c->creg);
+ printf("c%d", value - c->creg);
else if (value - c->payload.input_interp >= 0 &&
value - c->payload.input_interp < FRAG_ATTRIB_MAX)
- _mesa_printf("i%d", value - c->payload.input_interp);
+ printf("i%d", value - c->payload.input_interp);
else if (value - c->payload.depth >= 0 &&
value - c->payload.depth < FRAG_ATTRIB_MAX)
- _mesa_printf("d%d", value - c->payload.depth);
+ printf("d%d", value - c->payload.depth);
else
- _mesa_printf("?");
+ printf("?");
}
void brw_wm_print_ref( struct brw_wm_compile *c,
struct brw_reg hw_reg = ref->hw_reg;
if (ref->unspill_reg)
- _mesa_printf("UNSPILL(%x)/", ref->value->spill_slot);
+ printf("UNSPILL(%x)/", ref->value->spill_slot);
if (c->state >= PASS2_DONE)
brw_print_reg(ref->hw_reg);
else {
- _mesa_printf("%s", hw_reg.negate ? "-" : "");
- _mesa_printf("%s", hw_reg.abs ? "abs/" : "");
+ printf("%s", hw_reg.negate ? "-" : "");
+ printf("%s", hw_reg.abs ? "abs/" : "");
brw_wm_print_value(c, ref->value);
if ((hw_reg.nr&1) || hw_reg.subnr) {
- _mesa_printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr);
+ printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr);
}
}
}
GLuint i, arg;
GLuint nr_args = brw_wm_nr_args(inst->opcode);
- _mesa_printf("[");
+ printf("[");
for (i = 0; i < 4; i++) {
if (inst->dst[i]) {
brw_wm_print_value(c, inst->dst[i]);
if (inst->dst[i]->spill_slot)
- _mesa_printf("/SPILL(%x)",inst->dst[i]->spill_slot);
+ printf("/SPILL(%x)",inst->dst[i]->spill_slot);
}
else
- _mesa_printf("#");
+ printf("#");
if (i < 3)
- _mesa_printf(",");
+ printf(",");
}
- _mesa_printf("]");
+ printf("]");
if (inst->writemask != WRITEMASK_XYZW)
- _mesa_printf(".%s%s%s%s",
+ printf(".%s%s%s%s",
GET_BIT(inst->writemask, 0) ? "x" : "",
GET_BIT(inst->writemask, 1) ? "y" : "",
GET_BIT(inst->writemask, 2) ? "z" : "",
switch (inst->opcode) {
case WM_PIXELXY:
- _mesa_printf(" = PIXELXY");
+ printf(" = PIXELXY");
break;
case WM_DELTAXY:
- _mesa_printf(" = DELTAXY");
+ printf(" = DELTAXY");
break;
case WM_PIXELW:
- _mesa_printf(" = PIXELW");
+ printf(" = PIXELW");
break;
case WM_WPOSXY:
- _mesa_printf(" = WPOSXY");
+ printf(" = WPOSXY");
break;
case WM_PINTERP:
- _mesa_printf(" = PINTERP");
+ printf(" = PINTERP");
break;
case WM_LINTERP:
- _mesa_printf(" = LINTERP");
+ printf(" = LINTERP");
break;
case WM_CINTERP:
- _mesa_printf(" = CINTERP");
+ printf(" = CINTERP");
break;
case WM_FB_WRITE:
- _mesa_printf(" = FB_WRITE");
+ printf(" = FB_WRITE");
break;
case WM_FRONTFACING:
- _mesa_printf(" = FRONTFACING");
+ printf(" = FRONTFACING");
break;
default:
- _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode));
+ printf(" = %s", _mesa_opcode_string(inst->opcode));
break;
}
if (inst->saturate)
- _mesa_printf("_SAT");
+ printf("_SAT");
for (arg = 0; arg < nr_args; arg++) {
- _mesa_printf(" [");
+ printf(" [");
for (i = 0; i < 4; i++) {
if (inst->src[arg][i]) {
brw_wm_print_ref(c, inst->src[arg][i]);
}
else
- _mesa_printf("%%");
+ printf("%%");
if (i < 3)
- _mesa_printf(",");
+ printf(",");
else
- _mesa_printf("]");
+ printf("]");
}
}
- _mesa_printf("\n");
+ printf("\n");
}
void brw_wm_print_program( struct brw_wm_compile *c,
{
GLuint insn;
- _mesa_printf("%s:\n", stage);
+ printf("%s:\n", stage);
for (insn = 0; insn < c->nr_insns; insn++)
brw_wm_print_insn(c, &c->instruction[insn]);
- _mesa_printf("\n");
+ printf("\n");
}
break;
default:
- _mesa_printf("Unsupported opcode %i (%s) in fragment shader\n",
- inst->opcode, inst->opcode < MAX_OPCODE ?
- _mesa_opcode_string(inst->opcode) :
- "unknown");
+ printf("Unsupported opcode %i (%s) in fragment shader\n",
+ inst->opcode, inst->opcode < MAX_OPCODE ?
+ _mesa_opcode_string(inst->opcode) :
+ "unknown");
}
for (i = 0; i < 4; i++)
if (INTEL_DEBUG & DEBUG_WM) {
int i;
- _mesa_printf("wm-native:\n");
+ printf("wm-native:\n");
for (i = 0; i < p->nr_insn; i++)
brw_disasm(stderr, &p->store[i]);
- _mesa_printf("\n");
+ printf("\n");
}
}
int bit = _mesa_ffs( ~c->fp_temp );
if (!bit) {
- _mesa_printf("%s: out of temporaries\n", __FILE__);
+ printf("%s: out of temporaries\n", __FILE__);
exit(1);
}
{
GLuint i;
for (i = 0; i < nr; i++, insn++) {
- _mesa_printf("%3d: ", i);
+ printf("%3d: ", i);
if (insn->Opcode < MAX_OPCODE)
_mesa_print_instruction(insn);
else if (insn->Opcode < MAX_WM_OPCODE) {
3);
}
else
- _mesa_printf("965 Opcode %d\n", insn->Opcode);
+ printf("965 Opcode %d\n", insn->Opcode);
}
}
GLuint insn;
if (INTEL_DEBUG & DEBUG_WM) {
- _mesa_printf("pre-fp:\n");
+ printf("pre-fp:\n");
_mesa_print_program(&fp->program.Base);
- _mesa_printf("\n");
+ printf("\n");
}
c->pixel_xy = src_undef();
}
if (INTEL_DEBUG & DEBUG_WM) {
- _mesa_printf("pass_fp:\n");
+ printf("pass_fp:\n");
print_insns( c->prog_instructions, c->nr_fp_insns );
- _mesa_printf("\n");
+ printf("\n");
}
}
c->cur_inst = i;
#if 0
- _mesa_printf("Inst %d: ", i);
+ printf("Inst %d: ", i);
_mesa_print_instruction(inst);
#endif
}
break;
default:
- _mesa_printf("unsupported IR in fragment shader %d\n",
+ printf("unsupported IR in fragment shader %d\n",
inst->Opcode);
}
post_wm_emit(c);
if (INTEL_DEBUG & DEBUG_WM) {
- _mesa_printf("wm-native:\n");
+ printf("wm-native:\n");
for (i = 0; i < p->nr_insn; i++)
brw_disasm(stderr, &p->store[i]);
- _mesa_printf("\n");
+ printf("\n");
}
}
void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c)
{
if (INTEL_DEBUG & DEBUG_WM) {
- _mesa_printf("brw_wm_glsl_emit:\n");
+ printf("brw_wm_glsl_emit:\n");
}
/* initial instruction translation/simplification */
GLuint i = c->prog_data.nr_params++;
if (i >= BRW_WM_MAX_PARAM) {
- _mesa_printf("%s: out of params\n", __FUNCTION__);
+ printf("%s: out of params\n", __FUNCTION__);
c->prog_data.error = 1;
return NULL;
}
return c->constref[i].ref;
}
else {
- _mesa_printf("%s: out of constrefs\n", __FUNCTION__);
+ printf("%s: out of constrefs\n", __FUNCTION__);
c->prog_data.error = 1;
return NULL;
}
int ret;
if (batch->ptr - batch->map > batch->buf->size)
- _mesa_printf ("bad relocation ptr %p map %p offset %d size %d\n",
- batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size);
+ printf ("bad relocation ptr %p map %p offset %d size %d\n",
+ batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size);
ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain,
delta, batch->ptr - batch->map, buffer);
if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
functions, (void *) intel)) {
- _mesa_printf("%s: failed to init mesa context\n", __FUNCTION__);
+ printf("%s: failed to init mesa context\n", __FUNCTION__);
return GL_FALSE;
}
#define DBG(...) do { \
if (INTEL_DEBUG & FILE_DEBUG_FLAG) \
- _mesa_printf(__VA_ARGS__); \
+ printf(__VA_ARGS__); \
} while(0)
#define PCI_CHIP_845_G 0x2562
GLuint count = 0;
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+ printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
__FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
if (invert) {
return;
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+ printf("%s: fallback to swrast\n", __FUNCTION__);
_swrast_Bitmap(ctx, x, y, width, height, unpack, pixels);
}
GLint dst_x, dst_y;
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s\n", __FUNCTION__);
+ printf("%s\n", __FUNCTION__);
if (!src)
return GL_FALSE;
/* PBO only for now:
*/
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s - not PBO\n", __FUNCTION__);
+ printf("%s - not PBO\n", __FUNCTION__);
return GL_FALSE;
}
if (ctx->_ImageTransferState ||
!intel_check_blit_format(src, format, type)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s - bad format for blit\n", __FUNCTION__);
+ printf("%s - bad format for blit\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s: bad packing params\n", __FUNCTION__);
+ printf("%s: bad packing params\n", __FUNCTION__);
return GL_FALSE;
}
if (pack->Invert) {
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
+ printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
return GL_FALSE;
}
else {
}
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s - DONE\n", __FUNCTION__);
+ printf("%s - DONE\n", __FUNCTION__);
return GL_TRUE;
}
return;
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
+ printf("%s: fallback to swrast\n", __FUNCTION__);
/* Update Mesa state before calling down into _swrast_ReadPixels, as
* the spans code requires the computed buffer states to be up to date,
double rate;
if ((((unsigned) src) & 63) || (((unsigned) dest) & 63))
- _mesa_printf("Warning - non-aligned texture copy!\n");
+ printf("Warning - non-aligned texture copy!\n");
t1 = fastrdtsc();
ret = do_memcpy(dest, src, n);
rate = time_diff(t1, t2);
rate /= (double) n;
- _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate);
+ printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate);
return ret;
}
#endif /* DO_DEBUG */
};
#define nouveau_error(format, ...) \
- _mesa_fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__)
+ fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__)
void
nouveau_clear(GLcontext *ctx, GLbitfield buffers);
if (compiler.Base.Debug) {
fflush(stderr);
- _mesa_printf("Fragment Program: Initial program:\n");
+ printf("Fragment Program: Initial program:\n");
_mesa_print_program(&cont->Base.Base);
fflush(stderr);
}
if (mode) {
if ((fallback_warn & bit) == 0) {
if (RADEON_DEBUG & RADEON_FALLBACKS)
- _mesa_fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit));
+ fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit));
fallback_warn |= bit;
}
rmesa->fallback |= bit;
/* should only happenen once, just after context is created */
/* TODO: shouldn't we fallback to sw here? */
if (!ctx->FragmentProgram._Current) {
- _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
+ fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
return;
}
/* should only happenen once, just after context is created */
/* TODO: shouldn't we fallback to sw here? */
if (!ctx->FragmentProgram._Current) {
- _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
+ fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
return;
}
#define FILE_DEBUG_FLAG RADEON_TEXTURE
#define DBG(...) do { \
if (RADEON_DEBUG & FILE_DEBUG_FLAG) \
- _mesa_printf(__VA_ARGS__); \
+ printf(__VA_ARGS__); \
} while(0)
static struct gl_framebuffer *
#define DEBUG_SPAN 0
#if DEBUG_CORE
-#define TRACE _mesa_printf("--> %s\n", __FUNCTION__)
+#define TRACE printf("--> %s\n", __FUNCTION__)
#else
#define TRACE
#endif
#if DEBUG_SPAN
-#define TRACE_SPAN _mesa_printf("--> %s\n", __FUNCTION__)
+#define TRACE_SPAN printf("--> %s\n", __FUNCTION__)
#else
#define TRACE_SPAN
#endif
#include "xmesaP.h"
#ifdef __VMS
-#define _mesa_sprintf sprintf
+#define sprintf sprintf
#endif
/* This indicates the client-side GLX API and GLX encoder version. */
Fake_glXQueryServerString( Display *dpy, int screen, int name )
{
static char version[1000];
- _mesa_sprintf(version, "%d.%d %s",
- SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
+ sprintf(version, "%d.%d %s",
+ SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
(void) screen;
Fake_glXGetClientString( Display *dpy, int name )
{
static char version[1000];
- _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
- CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
+ sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
+ CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
(void) dpy;
* reports bugs.
*/
if (_mesa_getenv("MESA_INFO")) {
- _mesa_printf("X/Mesa visual = %p\n", (void *) v);
- _mesa_printf("X/Mesa dithered pf = %u\n", v->dithered_pf);
- _mesa_printf("X/Mesa undithered pf = %u\n", v->undithered_pf);
- _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level);
- _mesa_printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v));
- _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
+ printf("X/Mesa visual = %p\n", (void *) v);
+ printf("X/Mesa dithered pf = %u\n", v->dithered_pf);
+ printf("X/Mesa undithered pf = %u\n", v->undithered_pf);
+ printf("X/Mesa level = %d\n", v->mesa_visual.level);
+ printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v));
+ printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel);
}
if (b && window) {
extern void _xmesa_print_triangle_func( swrast_tri_func triFunc );
void _xmesa_print_triangle_func( swrast_tri_func triFunc )
{
- _mesa_printf("XMesa tri func = ");
+ printf("XMesa tri func = ");
if (triFunc ==smooth_TRUECOLOR_z_triangle)
- _mesa_printf("smooth_TRUECOLOR_z_triangle\n");
+ printf("smooth_TRUECOLOR_z_triangle\n");
else if (triFunc ==smooth_8A8B8G8R_z_triangle)
- _mesa_printf("smooth_8A8B8G8R_z_triangle\n");
+ printf("smooth_8A8B8G8R_z_triangle\n");
else if (triFunc ==smooth_8A8R8G8B_z_triangle)
- _mesa_printf("smooth_8A8R8G8B_z_triangle\n");
+ printf("smooth_8A8R8G8B_z_triangle\n");
else if (triFunc ==smooth_8R8G8B_z_triangle)
- _mesa_printf("smooth_8R8G8B_z_triangle\n");
+ printf("smooth_8R8G8B_z_triangle\n");
else if (triFunc ==smooth_8R8G8B24_z_triangle)
- _mesa_printf("smooth_8R8G8B24_z_triangle\n");
+ printf("smooth_8R8G8B24_z_triangle\n");
else if (triFunc ==smooth_TRUEDITHER_z_triangle)
- _mesa_printf("smooth_TRUEDITHER_z_triangle\n");
+ printf("smooth_TRUEDITHER_z_triangle\n");
else if (triFunc ==smooth_5R6G5B_z_triangle)
- _mesa_printf("smooth_5R6G5B_z_triangle\n");
+ printf("smooth_5R6G5B_z_triangle\n");
else if (triFunc ==smooth_DITHER_5R6G5B_z_triangle)
- _mesa_printf("smooth_DITHER_5R6G5B_z_triangle\n");
+ printf("smooth_DITHER_5R6G5B_z_triangle\n");
else if (triFunc ==smooth_HPCR_z_triangle)
- _mesa_printf("smooth_HPCR_z_triangle\n");
+ printf("smooth_HPCR_z_triangle\n");
else if (triFunc ==smooth_DITHER8_z_triangle)
- _mesa_printf("smooth_DITHER8_z_triangle\n");
+ printf("smooth_DITHER8_z_triangle\n");
else if (triFunc ==smooth_LOOKUP8_z_triangle)
- _mesa_printf("smooth_LOOKUP8_z_triangle\n");
+ printf("smooth_LOOKUP8_z_triangle\n");
else if (triFunc ==flat_TRUECOLOR_z_triangle)
- _mesa_printf("flat_TRUECOLOR_z_triangle\n");
+ printf("flat_TRUECOLOR_z_triangle\n");
else if (triFunc ==flat_8A8B8G8R_z_triangle)
- _mesa_printf("flat_8A8B8G8R_z_triangle\n");
+ printf("flat_8A8B8G8R_z_triangle\n");
else if (triFunc ==flat_8A8R8G8B_z_triangle)
- _mesa_printf("flat_8A8R8G8B_z_triangle\n");
+ printf("flat_8A8R8G8B_z_triangle\n");
else if (triFunc ==flat_8R8G8B_z_triangle)
- _mesa_printf("flat_8R8G8B_z_triangle\n");
+ printf("flat_8R8G8B_z_triangle\n");
else if (triFunc ==flat_8R8G8B24_z_triangle)
- _mesa_printf("flat_8R8G8B24_z_triangle\n");
+ printf("flat_8R8G8B24_z_triangle\n");
else if (triFunc ==flat_TRUEDITHER_z_triangle)
- _mesa_printf("flat_TRUEDITHER_z_triangle\n");
+ printf("flat_TRUEDITHER_z_triangle\n");
else if (triFunc ==flat_5R6G5B_z_triangle)
- _mesa_printf("flat_5R6G5B_z_triangle\n");
+ printf("flat_5R6G5B_z_triangle\n");
else if (triFunc ==flat_DITHER_5R6G5B_z_triangle)
- _mesa_printf("flat_DITHER_5R6G5B_z_triangle\n");
+ printf("flat_DITHER_5R6G5B_z_triangle\n");
else if (triFunc ==flat_HPCR_z_triangle)
- _mesa_printf("flat_HPCR_z_triangle\n");
+ printf("flat_HPCR_z_triangle\n");
else if (triFunc ==flat_DITHER8_z_triangle)
- _mesa_printf("flat_DITHER8_z_triangle\n");
+ printf("flat_DITHER8_z_triangle\n");
else if (triFunc ==flat_LOOKUP8_z_triangle)
- _mesa_printf("flat_LOOKUP8_z_triangle\n");
+ printf("flat_LOOKUP8_z_triangle\n");
else if (triFunc ==smooth_TRUECOLOR_triangle)
- _mesa_printf("smooth_TRUECOLOR_triangle\n");
+ printf("smooth_TRUECOLOR_triangle\n");
else if (triFunc ==smooth_8A8B8G8R_triangle)
- _mesa_printf("smooth_8A8B8G8R_triangle\n");
+ printf("smooth_8A8B8G8R_triangle\n");
else if (triFunc ==smooth_8A8R8G8B_triangle)
- _mesa_printf("smooth_8A8R8G8B_triangle\n");
+ printf("smooth_8A8R8G8B_triangle\n");
else if (triFunc ==smooth_8R8G8B_triangle)
- _mesa_printf("smooth_8R8G8B_triangle\n");
+ printf("smooth_8R8G8B_triangle\n");
else if (triFunc ==smooth_8R8G8B24_triangle)
- _mesa_printf("smooth_8R8G8B24_triangle\n");
+ printf("smooth_8R8G8B24_triangle\n");
else if (triFunc ==smooth_TRUEDITHER_triangle)
- _mesa_printf("smooth_TRUEDITHER_triangle\n");
+ printf("smooth_TRUEDITHER_triangle\n");
else if (triFunc ==smooth_5R6G5B_triangle)
- _mesa_printf("smooth_5R6G5B_triangle\n");
+ printf("smooth_5R6G5B_triangle\n");
else if (triFunc ==smooth_DITHER_5R6G5B_triangle)
- _mesa_printf("smooth_DITHER_5R6G5B_triangle\n");
+ printf("smooth_DITHER_5R6G5B_triangle\n");
else if (triFunc ==smooth_HPCR_triangle)
- _mesa_printf("smooth_HPCR_triangle\n");
+ printf("smooth_HPCR_triangle\n");
else if (triFunc ==smooth_DITHER8_triangle)
- _mesa_printf("smooth_DITHER8_triangle\n");
+ printf("smooth_DITHER8_triangle\n");
else if (triFunc ==smooth_LOOKUP8_triangle)
- _mesa_printf("smooth_LOOKUP8_triangle\n");
+ printf("smooth_LOOKUP8_triangle\n");
else if (triFunc ==flat_TRUECOLOR_triangle)
- _mesa_printf("flat_TRUECOLOR_triangle\n");
+ printf("flat_TRUECOLOR_triangle\n");
else if (triFunc ==flat_TRUEDITHER_triangle)
- _mesa_printf("flat_TRUEDITHER_triangle\n");
+ printf("flat_TRUEDITHER_triangle\n");
else if (triFunc ==flat_8A8B8G8R_triangle)
- _mesa_printf("flat_8A8B8G8R_triangle\n");
+ printf("flat_8A8B8G8R_triangle\n");
else if (triFunc ==flat_8A8R8G8B_triangle)
- _mesa_printf("flat_8A8R8G8B_triangle\n");
+ printf("flat_8A8R8G8B_triangle\n");
else if (triFunc ==flat_8R8G8B_triangle)
- _mesa_printf("flat_8R8G8B_triangle\n");
+ printf("flat_8R8G8B_triangle\n");
else if (triFunc ==flat_8R8G8B24_triangle)
- _mesa_printf("flat_8R8G8B24_triangle\n");
+ printf("flat_8R8G8B24_triangle\n");
else if (triFunc ==flat_5R6G5B_triangle)
- _mesa_printf("flat_5R6G5B_triangle\n");
+ printf("flat_5R6G5B_triangle\n");
else if (triFunc ==flat_DITHER_5R6G5B_triangle)
- _mesa_printf("flat_DITHER_5R6G5B_triangle\n");
+ printf("flat_DITHER_5R6G5B_triangle\n");
else if (triFunc ==flat_HPCR_triangle)
- _mesa_printf("flat_HPCR_triangle\n");
+ printf("flat_HPCR_triangle\n");
else if (triFunc ==flat_DITHER8_triangle)
- _mesa_printf("flat_DITHER8_triangle\n");
+ printf("flat_DITHER8_triangle\n");
else if (triFunc ==flat_LOOKUP8_triangle)
- _mesa_printf("flat_LOOKUP8_triangle\n");
+ printf("flat_LOOKUP8_triangle\n");
else
- _mesa_printf("???\n");
+ printf("???\n");
}
#endif
}
else {
/* this is not re-entrant safe, no big deal here */
- _mesa_sprintf(token_tmp, "0x%x", nr);
+ sprintf(token_tmp, "0x%x", nr);
return token_tmp;
}
}
- (GLsizeiptrARB) array->Ptr + array->StrideB
- array->_ElementSize) / array->StrideB;
if (0)
- _mesa_printf("%s Object %u Size %u MaxElement %u\n",
- __FUNCTION__,
- array->BufferObj->Name,
- (GLuint) array->BufferObj->Size,
- array->_MaxElement);
+ printf("%s Object %u Size %u MaxElement %u\n",
+ __FUNCTION__,
+ array->BufferObj->Name,
+ (GLuint) array->BufferObj->Size,
+ array->_MaxElement);
}
else {
/* user-space array, no idea how big it is */
bufObj->Written = GL_TRUE;
#ifdef VBO_DEBUG
- _mesa_printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n",
+ printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n",
bufObj->Name, size, data, usage);
#endif
bufObj->Written = GL_TRUE;
#ifdef VBO_DEBUG
- _mesa_printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n",
- bufObj->Name, bufObj->Size, access);
+ printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n",
+ bufObj->Name, bufObj->Size, access);
if (access == GL_WRITE_ONLY_ARB) {
GLuint i;
GLubyte *b = (GLubyte *) bufObj->Pointer;
}
}
if (unchanged) {
- _mesa_printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n",
+ printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n",
bufObj->Name, unchanged, bufObj->Size, pos);
}
}
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 */
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);
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);
}
_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",
+ ctx->ReadBuffer->_ColorReadBuffer,
+ ctx->ReadBuffer->ColorReadBuffer,
+ 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();
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();
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();
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
}
default:
{
char msg[1000];
- _mesa_sprintf(msg, "Error in execute_list: opcode=%d",
+ sprintf(msg, "Error in execute_list: opcode=%d",
(int) opcode);
_mesa_problem(ctx, msg);
}
GLboolean done;
if (!islist(ctx, list)) {
- _mesa_printf("%u is not a display list ID\n", list);
+ printf("%u is not a display list ID\n", list);
return;
}
n = dlist->Head;
- _mesa_printf("START-LIST %u, address %p\n", list, (void *) n);
+ printf("START-LIST %u, address %p\n", list, (void *) n);
done = n ? GL_FALSE : GL_TRUE;
while (!done) {
else {
switch (opcode) {
case OPCODE_ACCUM:
- _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
+ printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
break;
case OPCODE_BITMAP:
- _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
+ printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data);
break;
case OPCODE_CALL_LIST:
- _mesa_printf("CallList %d\n", (int) n[1].ui);
+ printf("CallList %d\n", (int) n[1].ui);
break;
case OPCODE_CALL_LIST_OFFSET:
- _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
+ printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
- _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
+ printf("ColorTableParameterfv %s %s %f %f %f %f\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
- _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
+ printf("ColorTableParameteriv %s %s %d %d %d %d\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].i, n[4].i, n[5].i, n[6].i);
break;
case OPCODE_DISABLE:
- _mesa_printf("Disable %s\n", enum_string(n[1].e));
+ printf("Disable %s\n", enum_string(n[1].e));
break;
case OPCODE_ENABLE:
- _mesa_printf("Enable %s\n", enum_string(n[1].e));
+ printf("Enable %s\n", enum_string(n[1].e));
break;
case OPCODE_FRUSTUM:
- _mesa_printf("Frustum %g %g %g %g %g %g\n",
+ printf("Frustum %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_LINE_STIPPLE:
- _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
+ printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
break;
case OPCODE_LOAD_IDENTITY:
- _mesa_printf("LoadIdentity\n");
+ printf("LoadIdentity\n");
break;
case OPCODE_LOAD_MATRIX:
- _mesa_printf("LoadMatrix\n");
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf("LoadMatrix\n");
+ printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_MULT_MATRIX:
- _mesa_printf("MultMatrix (or Rotate)\n");
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf("MultMatrix (or Rotate)\n");
+ printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_ORTHO:
- _mesa_printf("Ortho %g %g %g %g %g %g\n",
+ printf("Ortho %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_POP_ATTRIB:
- _mesa_printf("PopAttrib\n");
+ printf("PopAttrib\n");
break;
case OPCODE_POP_MATRIX:
- _mesa_printf("PopMatrix\n");
+ printf("PopMatrix\n");
break;
case OPCODE_POP_NAME:
- _mesa_printf("PopName\n");
+ printf("PopName\n");
break;
case OPCODE_PUSH_ATTRIB:
- _mesa_printf("PushAttrib %x\n", n[1].bf);
+ printf("PushAttrib %x\n", n[1].bf);
break;
case OPCODE_PUSH_MATRIX:
- _mesa_printf("PushMatrix\n");
+ printf("PushMatrix\n");
break;
case OPCODE_PUSH_NAME:
- _mesa_printf("PushName %d\n", (int) n[1].ui);
+ printf("PushName %d\n", (int) n[1].ui);
break;
case OPCODE_RASTER_POS:
- _mesa_printf("RasterPos %g %g %g %g\n",
+ printf("RasterPos %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ROTATE:
- _mesa_printf("Rotate %g %g %g %g\n",
+ printf("Rotate %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_SCALE:
- _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_TRANSLATE:
- _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_BIND_TEXTURE:
- _mesa_printf("BindTexture %s %d\n",
+ printf("BindTexture %s %d\n",
_mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
break;
case OPCODE_SHADE_MODEL:
- _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
+ printf("Map1 %s %.3f %.3f %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
- _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
_mesa_lookup_enum_by_nr(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_MAPGRID1:
- _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
+ printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
break;
case OPCODE_EVALMESH1:
- _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_EVALMESH2:
- _mesa_printf("EvalMesh2 %d %d %d %d\n",
+ printf("EvalMesh2 %d %d %d %d\n",
n[1].i, n[2].i, n[3].i, n[4].i);
break;
case OPCODE_ATTR_1F_NV:
- _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
+ printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
break;
case OPCODE_ATTR_2F_NV:
- _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
+ printf("ATTR_2F_NV attr %d: %f %f\n",
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_ATTR_3F_NV:
- _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
+ printf("ATTR_3F_NV attr %d: %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ATTR_4F_NV:
- _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
+ printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
break;
case OPCODE_ATTR_1F_ARB:
- _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
+ printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
break;
case OPCODE_ATTR_2F_ARB:
- _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
+ printf("ATTR_2F_ARB attr %d: %f %f\n",
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_ATTR_3F_ARB:
- _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
+ printf("ATTR_3F_ARB attr %d: %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ATTR_4F_ARB:
- _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
+ printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
break;
case OPCODE_MATERIAL:
- _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
+ printf("MATERIAL %x %x: %f %f %f %f\n",
n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_BEGIN:
- _mesa_printf("BEGIN %x\n", n[1].i);
+ printf("BEGIN %x\n", n[1].i);
break;
case OPCODE_END:
- _mesa_printf("END\n");
+ printf("END\n");
break;
case OPCODE_RECTF:
- _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
+ printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
n[4].f);
break;
case OPCODE_EVAL_C1:
- _mesa_printf("EVAL_C1 %f\n", n[1].f);
+ printf("EVAL_C1 %f\n", n[1].f);
break;
case OPCODE_EVAL_C2:
- _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
+ printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
break;
case OPCODE_EVAL_P1:
- _mesa_printf("EVAL_P1 %d\n", n[1].i);
+ printf("EVAL_P1 %d\n", n[1].i);
break;
case OPCODE_EVAL_P2:
- _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
+ printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_PROVOKING_VERTEX:
- _mesa_printf("ProvokingVertex %s\n",
+ printf("ProvokingVertex %s\n",
_mesa_lookup_enum_by_nr(n[1].ui));
break;
* meta opcodes/commands
*/
case OPCODE_ERROR:
- _mesa_printf("Error: %s %s\n",
+ printf("Error: %s %s\n",
enum_string(n[1].e), (const char *) n[2].data);
break;
case OPCODE_CONTINUE:
- _mesa_printf("DISPLAY-LIST-CONTINUE\n");
+ printf("DISPLAY-LIST-CONTINUE\n");
n = (Node *) n[1].next;
break;
case OPCODE_END_OF_LIST:
- _mesa_printf("END-LIST %u\n", list);
+ printf("END-LIST %u\n", list);
done = GL_TRUE;
break;
default:
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- _mesa_printf
+ printf
("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
opcode, (void *) n);
return;
}
else {
- _mesa_printf("command %d, %u operands\n", opcode,
+ printf("command %d, %u operands\n", opcode,
InstSize[opcode]);
}
}
}
else {
/* this is not re-entrant safe, no big deal here */
- _mesa_sprintf(token_tmp, "0x%x", nr);
+ sprintf(token_tmp, "0x%x", nr);
return token_tmp;
}
}
if (block)
addr = exec_mem + block->ofs;
else
- _mesa_printf("_mesa_exec_malloc failed\n");
+ printf("_mesa_exec_malloc failed\n");
bail:
_glthread_UNLOCK_MUTEX(exec_mutex);
}
if (texImage->Width < 1 || texImage->Height < 1) {
att_incomplete("teximage width/height=0");
- _mesa_printf("texobj = %u\n", texObj->Name);
- _mesa_printf("level = %d\n", att->TextureLevel);
+ printf("texobj = %u\n", texObj->Name);
+ printf("level = %d\n", att->TextureLevel);
att->Complete = GL_FALSE;
return;
}
/* Debug code */
if (DEBUG_BLIT) {
- _mesa_printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d,"
- " 0x%x, 0x%x)\n",
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
+ printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d,"
+ " 0x%x, 0x%x)\n",
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
if (colorReadRb) {
const struct gl_renderbuffer_attachment *att;
att = find_attachment(readFb, colorReadRb);
- _mesa_printf(" Src FBO %u RB %u (%dx%d) ",
- readFb->Name, colorReadRb->Name,
- colorReadRb->Width, colorReadRb->Height);
+ printf(" Src FBO %u RB %u (%dx%d) ",
+ readFb->Name, colorReadRb->Name,
+ colorReadRb->Width, colorReadRb->Height);
if (att && att->Texture) {
- _mesa_printf("Tex %u tgt 0x%x level %u face %u",
- att->Texture->Name,
- att->Texture->Target,
- att->TextureLevel,
- att->CubeMapFace);
+ printf("Tex %u tgt 0x%x level %u face %u",
+ att->Texture->Name,
+ att->Texture->Target,
+ att->TextureLevel,
+ att->CubeMapFace);
}
- _mesa_printf("\n");
+ printf("\n");
att = find_attachment(drawFb, colorDrawRb);
- _mesa_printf(" Dst FBO %u RB %u (%dx%d) ",
- drawFb->Name, colorDrawRb->Name,
- colorDrawRb->Width, colorDrawRb->Height);
+ printf(" Dst FBO %u RB %u (%dx%d) ",
+ drawFb->Name, colorDrawRb->Name,
+ colorDrawRb->Width, colorDrawRb->Height);
if (att && att->Texture) {
- _mesa_printf("Tex %u tgt 0x%x level %u face %u",
- att->Texture->Name,
- att->Texture->Target,
- att->TextureLevel,
- att->CubeMapFace);
+ printf("Tex %u tgt 0x%x level %u face %u",
+ att->Texture->Name,
+ att->Texture->Target,
+ att->TextureLevel,
+ att->CubeMapFace);
}
- _mesa_printf("\n");
+ printf("\n");
}
}
if (fn != last_fn) {
last_fn = fn;
- _mesa_printf("%s:\n", fn);
+ printf("%s:\n", fn);
}
- _mesa_printf("%d:\t", line);
+ printf("%d:\t", line);
_mesa_print_instruction(inst);
}
}
/* Disassemble:
*/
if (DISASSEM) {
- _mesa_printf ("\n");
+ printf ("\n");
}
}
if (!prog) {
/* OK, we'll have to build a new one */
if (0)
- _mesa_printf("Build new TNL program\n");
+ printf("Build new TNL program\n");
prog = (struct gl_vertex_program *)
ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
/*@}*/
-/**********************************************************************/
-/** \name I/O */
-/*@{*/
-
-/** Wrapper around vsprintf() */
-int
-_mesa_sprintf( char *str, const char *fmt, ... )
-{
- int r;
- va_list args;
- va_start( args, fmt );
- r = vsprintf( str, fmt, args );
- va_end( args );
- return r;
-}
-
-/** Wrapper around vsnprintf() */
-int
-_mesa_snprintf( char *str, size_t size, const char *fmt, ... )
-{
- int r;
- va_list args;
- va_start( args, fmt );
- r = vsnprintf( str, size, fmt, args );
- va_end( args );
- return r;
-}
-
-/** Wrapper around printf(), using vsprintf() for the formatting. */
-void
-_mesa_printf( const char *fmtString, ... )
-{
- va_list args;
- va_start( args, fmtString );
- vfprintf(stderr, fmtString, args);
- va_end( args );
-}
-
-/** Wrapper around fprintf(), using vsprintf() for the formatting. */
-void
-_mesa_fprintf( FILE *f, const char *fmtString, ... )
-{
- char s[MAXSTRING];
- va_list args;
- va_start( args, fmtString );
- vsnprintf(s, MAXSTRING, fmtString, args);
- va_end( args );
- fprintf(f, "%s", s);
-}
-
-
-/** Wrapper around vsprintf() */
-int
-_mesa_vsprintf( char *str, const char *fmt, va_list args )
-{
- return vsprintf( str, fmt, args );
-}
-
-/*@}*/
-
-
/**********************************************************************/
/** \name Diagnostics */
/*@{*/
* visible, so communicate with the debugger instead */
{
char buf[4096];
- _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
+ snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
OutputDebugStringA(buf);
}
#endif
char s[MAXSTRING];
if (ctx->ErrorDebugCount) {
- _mesa_snprintf(s, MAXSTRING, "%d similar %s errors",
+ snprintf(s, MAXSTRING, "%d similar %s errors",
ctx->ErrorDebugCount,
error_string(ctx->ErrorValue));
vsnprintf(s, MAXSTRING, fmtString, args);
va_end(args);
- _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s);
+ snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s);
output_if_debug("Mesa: User error", s2, GL_TRUE);
ctx->ErrorDebugFmtString = fmtString;
extern unsigned int
_mesa_str_checksum(const char *str);
-extern int
-_mesa_sprintf( char *str, const char *fmt, ... );
-
-extern int
-_mesa_snprintf( char *str, size_t size, const char *fmt, ... );
-
-extern void
-_mesa_printf( const char *fmtString, ... );
-
-extern void
-_mesa_fprintf( FILE *f, const char *fmtString, ... );
-
-extern int
-_mesa_vsprintf( char *str, const char *fmt, va_list args );
-
-
extern void
_mesa_warning( __GLcontext *gc, const char *fmtString, ... );
*/
/*
- _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n",
+ printf("mip3d %d x %d x %d -> %d x %d x %d\n",
srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth);
*/
newSource = _mesa_read_shader(filename);
if (newSource) {
- _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n",
+ fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n",
shaderObj, checksum, filename);
free(source);
source = newSource;
if (ctx->varying_vp_inputs != varying_inputs) {
ctx->varying_vp_inputs = varying_inputs;
ctx->NewState |= _NEW_ARRAY;
- /*_mesa_printf("%s %x\n", __FUNCTION__, varying_inputs);*/
+ /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
}
}
if (DISASSEM) {
_mesa_print_program(&p.program->Base);
- _mesa_printf("\n");
+ printf("\n");
}
}
if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
char message[100];
- _mesa_sprintf(message,
+ sprintf(message,
"glTexImage%d(format/type YCBCR mismatch", dimensions);
_mesa_error(ctx, GL_INVALID_ENUM, message);
return GL_TRUE; /* error */
if (border != 0) {
if (!isProxy) {
char message[100];
- _mesa_sprintf(message,
+ sprintf(message,
"glTexImage%d(format=GL_YCBCR_MESA and border=%d)",
dimensions, border);
_mesa_error(ctx, GL_INVALID_VALUE, message);
static void
incomplete(const struct gl_texture_object *t, const char *why)
{
- _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
+ printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
}
#else
#define incomplete(t, why)
*/
if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
char s[100];
- _mesa_sprintf(s, "base level = %d is invalid", baseLevel);
+ sprintf(s, "base level = %d is invalid", baseLevel);
incomplete(t, s);
t->_Complete = GL_FALSE;
return;
/* Always need the base level image */
if (!t->Image[0][baseLevel]) {
char s[100];
- _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel);
+ sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel);
incomplete(t, s);
t->_Complete = GL_FALSE;
return;
_mesa_print_texunit_state( GLcontext *ctx, GLuint unit )
{
const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
- _mesa_printf("Texture Unit %d\n", unit);
- _mesa_printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
- _mesa_printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
- _mesa_printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
- _mesa_printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
- _mesa_printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
- _mesa_printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
- _mesa_printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
- _mesa_printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
- _mesa_printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
- _mesa_printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
- _mesa_printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
- _mesa_printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
- _mesa_printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
- _mesa_printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
- _mesa_printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
- _mesa_printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
- _mesa_printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
- _mesa_printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]);
+ 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_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]);
}
map[ONE] = ONE;
#if 0
- _mesa_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),
- map[0],
- map[1],
- map[2],
- map[3],
- map[4],
- map[5]);
+ 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),
+ map[0],
+ map[1],
+ map[2],
+ map[3],
+ map[4],
+ map[5]);
#endif
}
for (i = 0; i < 4; i++)
map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]];
-/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */
+/* printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */
if (srcComponents == dstComponents &&
srcRowStride == dstRowStride &&
print_array(const char *name, GLint index, const struct gl_client_array *array)
{
if (index >= 0)
- _mesa_printf(" %s[%d]: ", name, index);
+ printf(" %s[%d]: ", name, index);
else
- _mesa_printf(" %s: ", name);
- _mesa_printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n",
- array->Ptr, array->Type, array->Size,
- array->_ElementSize, array->StrideB,
- array->BufferObj->Name, array->BufferObj->Size,
- array->_MaxElement);
+ printf(" %s: ", name);
+ printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n",
+ array->Ptr, array->Type, array->Size,
+ array->_ElementSize, array->StrideB,
+ array->BufferObj->Name, array->BufferObj->Size,
+ array->_MaxElement);
}
_mesa_update_array_object_max_element(ctx, arrayObj);
- _mesa_printf("Array Object %u\n", arrayObj->Name);
+ printf("Array Object %u\n", arrayObj->Name);
if (arrayObj->Vertex.Enabled)
print_array("Vertex", -1, &arrayObj->Vertex);
if (arrayObj->Normal.Enabled)
for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
if (arrayObj->VertexAttrib[i].Enabled)
print_array("Attrib", i, &arrayObj->VertexAttrib[i]);
- _mesa_printf(" _MaxElement = %u\n", arrayObj->_MaxElement);
+ printf(" _MaxElement = %u\n", arrayObj->_MaxElement);
}
ctx->VersionString = (char *) malloc(max);
if (ctx->VersionString) {
- _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING,
- ctx->VersionMajor, ctx->VersionMinor);
+ snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING,
+ ctx->VersionMajor, ctx->VersionMinor);
}
}
}
if ( dco != rco ) {
- _mesa_printf( "\n-----------------------------\n" );
- _mesa_printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco );
+ printf( "\n-----------------------------\n" );
+ printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco );
return 0;
}
if ( dca != rca ) {
- _mesa_printf( "\n-----------------------------\n" );
- _mesa_printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca );
+ printf( "\n-----------------------------\n" );
+ printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca );
return 0;
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
if ( dm[i] != rm[i] ) {
- _mesa_printf( "\n-----------------------------\n" );
- _mesa_printf( "(i = %i)\n", i );
- _mesa_printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] );
+ printf( "\n-----------------------------\n" );
+ printf( "(i = %i)\n", i );
+ printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] );
return 0;
}
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 4 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- _mesa_printf( "\n-----------------------------\n" );
- _mesa_printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n",
+ printf( "\n-----------------------------\n" );
+ printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n",
i, j, dm[i], rm[i] );
- _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]-d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]-d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]-d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
- _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][3], r[i][3], r[i][3]-d[i][3],
MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
return 0;
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+ printf( "counter overhead: %ld cycles\n\n", counter_overhead );
}
- _mesa_printf( "cliptest results after hooking in %s functions:\n", description );
+ printf( "cliptest results after hooking in %s functions:\n", description );
}
#endif
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- _mesa_printf( "\n\t" );
+ printf( "\n\t" );
for ( psize = 2 ; psize <= 4 ; psize++ ) {
- _mesa_printf( " p%d\t", psize );
+ printf( " p%d\t", psize );
}
- _mesa_printf( "\n--------------------------------------------------------\n\t" );
+ printf( "\n--------------------------------------------------------\n\t" );
}
#endif
if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) {
char buf[100];
- _mesa_sprintf( buf, "%s[%d] failed test (%s)",
+ sprintf( buf, "%s[%d] failed test (%s)",
cnames[np], psize, description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf( " %li\t", benchmark_tab[np][psize-1] );
+ printf( " %li\t", benchmark_tab[np][psize-1] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf( " | [%s]\n\t", cstrings[np] );
+ printf( " | [%s]\n\t", cstrings[np] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf( "\n" );
+ printf( "\n" );
#endif
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 3 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- _mesa_printf( "-----------------------------\n" );
- _mesa_printf( "(i = %i, j = %i)\n", i, j );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "-----------------------------\n" );
+ printf( "(i = %i, j = %i)\n", i, j );
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]/d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]/d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]/d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
return 0;
if ( norm_normalize_types[mtype] != 0 ) {
if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) {
- _mesa_printf( "------------------- precalculated length case ------\n" );
- _mesa_printf( "(i = %i, j = %i)\n", i, j );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "------------------- precalculated length case ------\n" );
+ printf( "(i = %i, j = %i)\n", i, j );
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][0], r2[i][0], r2[i][0]/d2[i][0],
MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][1], r2[i][1], r2[i][1]/d2[i][1],
MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) );
- _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
+ printf( "%f \t %f \t [ratio = %e - %i bit missed]\n",
d2[i][2], r2[i][2], r2[i][2]/d2[i][2],
MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) );
return 0;
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead );
+ printf( "counter overhead: %ld cycles\n\n", counter_overhead );
}
- _mesa_printf( "normal transform results after hooking in %s functions:\n",
+ printf( "normal transform results after hooking in %s functions:\n",
description );
- _mesa_printf( "\n-------------------------------------------------------\n" );
+ printf( "\n-------------------------------------------------------\n" );
}
#endif
if ( test_norm_function( func, mtype, cycles ) == 0 ) {
char buf[100];
- _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
+ sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)",
norm_strings[mtype], description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- _mesa_printf( " %li\t", benchmark_tab[mtype] );
- _mesa_printf( " | [%s]\n", norm_strings[mtype] );
+ printf( " %li\t", benchmark_tab[mtype] );
+ printf( " | [%s]\n", norm_strings[mtype] );
}
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- _mesa_printf( "\n" );
+ printf( "\n" );
}
#endif
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
for ( j = 0 ; j < 4 ; j++ ) {
if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) {
- _mesa_printf("-----------------------------\n" );
- _mesa_printf("(i = %i, j = %i)\n", i, j );
- _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf("-----------------------------\n" );
+ printf("(i = %i, j = %i)\n", i, j );
+ printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][0], r[i][0], r[i][0]-d[i][0],
MAX_PRECISION - significand_match( d[i][0], r[i][0] ) );
- _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][1], r[i][1], r[i][1]-d[i][1],
MAX_PRECISION - significand_match( d[i][1], r[i][1] ) );
- _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][2], r[i][2], r[i][2]-d[i][2],
MAX_PRECISION - significand_match( d[i][2], r[i][2] ) );
- _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n",
+ printf("%f \t %f \t [diff = %e - %i bit missed]\n",
d[i][3], r[i][3], r[i][3]-d[i][3],
MAX_PRECISION - significand_match( d[i][3], r[i][3] ) );
return 0;
if ( mesa_profile ) {
if ( !counter_overhead ) {
INIT_COUNTER();
- _mesa_printf("counter overhead: %lu cycles\n\n", counter_overhead );
+ printf("counter overhead: %lu cycles\n\n", counter_overhead );
}
- _mesa_printf("transform results after hooking in %s functions:\n", description );
+ printf("transform results after hooking in %s functions:\n", description );
}
#endif
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- _mesa_printf("\n" );
+ printf("\n" );
for ( psize = 1 ; psize <= 4 ; psize++ ) {
- _mesa_printf(" p%d\t", psize );
+ printf(" p%d\t", psize );
}
- _mesa_printf("\n--------------------------------------------------------\n" );
+ printf("\n--------------------------------------------------------\n" );
}
#endif
if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) {
char buf[100];
- _mesa_sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
- psize, mstrings[mtype], description );
+ sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)",
+ psize, mstrings[mtype], description );
_mesa_problem( NULL, buf );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf(" %li\t", benchmark_tab[psize-1][mtype] );
+ printf(" %li\t", benchmark_tab[psize-1][mtype] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf(" | [%s]\n", mstrings[mtype] );
+ printf(" | [%s]\n", mstrings[mtype] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- _mesa_printf( "\n" );
+ printf( "\n" );
#endif
}
GLfloat *d = (GLfloat *)v->data;
GLuint j, i = 0, count;
- _mesa_printf("data-start\n");
+ printf("data-start\n");
for (; d != v->start; STRIDE_F(d, v->stride), i++)
- _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
+ printf(t, i, d[0], d[1], d[2], d[3]);
- _mesa_printf("start-count(%u)\n", v->count);
+ printf("start-count(%u)\n", v->count);
count = i + v->count;
if (culling) {
for (; i < count; STRIDE_F(d, v->stride), i++)
if (cullmask[i])
- _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
+ printf(t, i, d[0], d[1], d[2], d[3]);
}
else {
for (; i < count; STRIDE_F(d, v->stride), i++)
- _mesa_printf(t, i, d[0], d[1], d[2], d[3]);
+ printf(t, i, d[0], d[1], d[2], d[3]);
}
for (j = v->size; j < 4; j++) {
if ((v->flags & (1<<j)) == 0) {
- _mesa_printf("checking col %u is clean as advertised ", j);
+ printf("checking col %u is clean as advertised ", j);
for (i = 0, d = (GLfloat *) v->data;
i < count && d[j] == c[j];
}
if (i == count)
- _mesa_printf(" --> ok\n");
+ printf(" --> ok\n");
else
- _mesa_printf(" --> Failed at %u ******\n", i);
+ printf(" --> Failed at %u ******\n", i);
}
}
}
}
#if DEBUG_FP
- _mesa_printf("____________Fragment program %u ________\n", program->Base.Id);
+ printf("____________Fragment program %u ________\n", program->Base.Id);
_mesa_print_program(&program->Base);
#endif
}
program->Base.Parameters = prog.Parameters;
#if DEBUG_VP
- _mesa_printf("____________Vertex program %u __________\n", program->Base.Id);
+ printf("____________Vertex program %u __________\n", program->Base.Id);
_mesa_print_program(&program->Base);
#endif
}
#define RETURN_ERROR2(msg1, msg2) \
do { \
char err[1000]; \
- _mesa_sprintf(err, "%s %s", msg1, msg2); \
+ sprintf(err, "%s %s", msg1, msg2); \
record_error(parseState, err, __LINE__); \
return GL_FALSE; \
} while(0)
#endif
#ifdef DEBUG_foo
- _mesa_printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id);
+ printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id);
_mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0);
- _mesa_printf("----------------------------------\n");
+ printf("----------------------------------\n");
#endif
}
else {
#define RETURN_ERROR2(msg1, msg2) \
do { \
char err[1000]; \
- _mesa_sprintf(err, "%s %s", msg1, msg2); \
+ sprintf(err, "%s %s", msg1, msg2); \
record_error(parseState, err, __LINE__); \
return GL_FALSE; \
} while(0)
program->IsNVProgram = GL_TRUE;
#ifdef DEBUG_foo
- _mesa_printf("--- glLoadProgramNV result ---\n");
+ printf("--- glLoadProgramNV result ---\n");
_mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0);
- _mesa_printf("------------------------------\n");
+ printf("------------------------------\n");
#endif
if (program->Base.Parameters)
{
GLfloat a[4];
fetch_vector4(&inst->SrcReg[0], machine, a);
- _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data,
- a[0], a[1], a[2], a[3]);
+ printf("%s%g, %g, %g, %g\n", (const char *) inst->Data,
+ a[0], a[1], a[2], a[3]);
}
break;
case OPCODE_END:
return InstInfo[opcode].Name;
else {
static char s[20];
- _mesa_snprintf(s, sizeof(s), "OP%u", opcode);
+ snprintf(s, sizeof(s), "OP%u", opcode);
return s;
}
}
GLuint tempMax = 0, i;
if (dbg) {
- _mesa_printf("Optimize: Begin register consolidation\n");
+ printf("Optimize: Begin register consolidation\n");
}
memset(tempUsed, 0, sizeof(tempUsed));
for (i = 0; i <= tempMax; i++) {
if (tempUsed[i]) {
tempMap[i] = freeTemp++;
- /*_mesa_printf("replace %u with %u\n", i, tempMap[i]);*/
+ /*printf("replace %u with %u\n", i, tempMap[i]);*/
}
}
if (freeTemp == tempMax + 1) {
return;
}
if (dbg) {
- _mesa_printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1);
+ printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1);
}
}
replace_regs(prog, PROGRAM_TEMPORARY, tempMap);
if (dbg) {
- _mesa_printf("Optimize: End register consolidation\n");
+ printf("Optimize: End register consolidation\n");
}
}
memset(tempRead, 0, sizeof(tempRead));
if (dbg) {
- _mesa_printf("Optimize: Begin dead code removal\n");
+ printf("Optimize: Begin dead code removal\n");
/*_mesa_print_program(prog);*/
}
if (inst->SrcReg[j].RelAddr) {
if (dbg)
- _mesa_printf("abort remove dead code (indirect temp)\n");
+ printf("abort remove dead code (indirect temp)\n");
goto done;
}
if (inst->DstReg.RelAddr) {
if (dbg)
- _mesa_printf("abort remove dead code (indirect temp)\n");
+ printf("abort remove dead code (indirect temp)\n");
goto done;
}
if (!tempRead[index][chan] &&
inst->DstReg.WriteMask & (1 << chan)) {
if (dbg) {
- _mesa_printf("Remove writemask on %u.%c\n", i,
+ printf("Remove writemask on %u.%c\n", i,
chan == 3 ? 'w' : 'x' + chan);
}
inst->DstReg.WriteMask &= ~(1 << chan);
if (inst->DstReg.WriteMask == 0) {
/* If we cleared all writes, the instruction can be removed. */
if (dbg)
- _mesa_printf("Remove instruction %u: \n", i);
+ printf("Remove instruction %u: \n", i);
removeInst[i] = GL_TRUE;
}
}
rem = remove_instructions(prog, removeInst);
if (dbg) {
- _mesa_printf("Optimize: End dead code removal.\n");
- _mesa_printf(" %u channel writes removed\n", rem);
- _mesa_printf(" %u instructions removed\n", rem);
+ printf("Optimize: End dead code removal.\n");
+ printf(" %u channel writes removed\n", rem);
+ printf(" %u instructions removed\n", rem);
/*_mesa_print_program(prog);*/
}
GLuint i, j;
if (dbg) {
- _mesa_printf("Optimize: Begin remove extra move use\n");
+ printf("Optimize: Begin remove extra move use\n");
_mesa_print_program(prog);
}
}
if (dbg) {
- _mesa_printf("Optimize: End remove extra move use.\n");
+ printf("Optimize: End remove extra move use.\n");
/*_mesa_print_program(prog);*/
}
}
GLuint i, rem, loopNesting = 0, subroutineNesting = 0;
if (dbg) {
- _mesa_printf("Optimize: Begin remove extra moves\n");
+ printf("Optimize: Begin remove extra moves\n");
_mesa_print_program(prog);
}
removeInst[i] = GL_TRUE;
if (dbg) {
- _mesa_printf("Remove MOV at %u\n", i);
- _mesa_printf("new prev inst %u: ", prevI);
+ printf("Remove MOV at %u\n", i);
+ printf("new prev inst %u: ", prevI);
_mesa_print_instruction(prevInst);
}
}
free(removeInst);
if (dbg) {
- _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
+ printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
/*_mesa_print_program(prog);*/
}
}
*/
if (dbg) {
- _mesa_printf("Optimize: Begin find intervals\n");
+ printf("Optimize: Begin find intervals\n");
}
/* build intermediate arrays */
/* print interval info */
for (i = 0; i < liveIntervals->Num; i++) {
const struct interval *inv = liveIntervals->Intervals + i;
- _mesa_printf("Reg[%d] live [%d, %d]:",
+ printf("Reg[%d] live [%d, %d]:",
inv->Reg, inv->Start, inv->End);
if (1) {
GLuint j;
for (j = 0; j < inv->Start; j++)
- _mesa_printf(" ");
+ printf(" ");
for (j = inv->Start; j <= inv->End; j++)
- _mesa_printf("x");
+ printf("x");
}
- _mesa_printf("\n");
+ printf("\n");
}
}
GLint maxTemp = -1;
if (dbg) {
- _mesa_printf("Optimize: Begin live-interval register reallocation\n");
+ printf("Optimize: Begin live-interval register reallocation\n");
_mesa_print_program(prog);
}
if (!find_live_intervals(prog, &liveIntervals)) {
if (dbg)
- _mesa_printf("Aborting register reallocation\n");
+ printf("Aborting register reallocation\n");
return;
}
const struct interval *live = liveIntervals.Intervals + i;
if (dbg)
- _mesa_printf("Consider register %u\n", live->Reg);
+ printf("Consider register %u\n", live->Reg);
/* Expire old intervals. Intervals which have ended with respect
* to the live interval can have their remapped registers freed.
ASSERT(regNew >= 0);
if (dbg)
- _mesa_printf(" expire interval for reg %u\n", inv->Reg);
+ printf(" expire interval for reg %u\n", inv->Reg);
/* remove interval j from active list */
remove_interval(&activeIntervals, inv);
/* return register regNew to the free pool */
if (dbg)
- _mesa_printf(" free reg %d\n", regNew);
+ printf(" free reg %d\n", regNew);
ASSERT(usedRegs[regNew] == GL_TRUE);
usedRegs[regNew] = GL_FALSE;
}
registerMap[live->Reg] = k;
maxTemp = MAX2(maxTemp, k);
if (dbg)
- _mesa_printf(" remap register %u -> %d\n", live->Reg, k);
+ printf(" remap register %u -> %d\n", live->Reg, k);
}
/* Insert this live interval into the active list which is sorted
}
if (dbg) {
- _mesa_printf("Optimize: End live-interval register reallocation\n");
- _mesa_printf("Num temp regs before: %u after: %u\n",
+ printf("Optimize: End live-interval register reallocation\n");
+ printf("Num temp regs before: %u after: %u\n",
liveIntervals.Num, maxTemp + 1);
_mesa_print_program(prog);
}
default:
{
static char s[20];
- _mesa_snprintf(s, sizeof(s), "FILE%u", f);
+ snprintf(s, sizeof(s), "FILE%u", f);
return s;
}
}
void
_mesa_print_vp_inputs(GLbitfield inputs)
{
- _mesa_printf("VP Inputs 0x%x: \n", inputs);
+ printf("VP Inputs 0x%x: \n", inputs);
while (inputs) {
GLint attr = _mesa_ffs(inputs) - 1;
const char *name = arb_input_attrib_string(attr,
GL_VERTEX_PROGRAM_ARB);
- _mesa_printf(" %d: %s\n", attr, name);
+ printf(" %d: %s\n", attr, name);
inputs &= ~(1 << attr);
}
}
void
_mesa_print_fp_inputs(GLbitfield inputs)
{
- _mesa_printf("FP Inputs 0x%x: \n", inputs);
+ printf("FP Inputs 0x%x: \n", inputs);
while (inputs) {
GLint attr = _mesa_ffs(inputs) - 1;
const char *name = arb_input_attrib_string(attr,
GL_FRAGMENT_PROGRAM_ARB);
- _mesa_printf(" %d: %s\n", attr, name);
+ printf(" %d: %s\n", attr, name);
inputs &= ~(1 << attr);
}
}
switch (mode) {
case PROG_PRINT_DEBUG:
- _mesa_sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index);
+ sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index);
break;
case PROG_PRINT_ARB:
switch (f) {
case PROGRAM_INPUT:
- _mesa_sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
+ sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
break;
case PROGRAM_OUTPUT:
- _mesa_sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
+ sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
break;
case PROGRAM_TEMPORARY:
- _mesa_sprintf(str, "temp%d", index);
+ sprintf(str, "temp%d", index);
break;
case PROGRAM_ENV_PARAM:
- _mesa_sprintf(str, "program.env[%s%d]", addr, index);
+ sprintf(str, "program.env[%s%d]", addr, index);
break;
case PROGRAM_LOCAL_PARAM:
- _mesa_sprintf(str, "program.local[%s%d]", addr, index);
+ sprintf(str, "program.local[%s%d]", addr, index);
break;
case PROGRAM_VARYING: /* extension */
- _mesa_sprintf(str, "varying[%s%d]", addr, index);
+ sprintf(str, "varying[%s%d]", addr, index);
break;
case PROGRAM_CONSTANT: /* extension */
- _mesa_sprintf(str, "constant[%s%d]", addr, index);
+ sprintf(str, "constant[%s%d]", addr, index);
break;
case PROGRAM_UNIFORM: /* extension */
- _mesa_sprintf(str, "uniform[%s%d]", addr, index);
+ sprintf(str, "uniform[%s%d]", addr, index);
break;
case PROGRAM_STATE_VAR:
{
struct gl_program_parameter *param
= prog->Parameters->Parameters + index;
char *state = _mesa_program_state_string(param->StateIndexes);
- _mesa_sprintf(str, state);
+ sprintf(str, state);
free(state);
}
break;
case PROGRAM_ADDRESS:
- _mesa_sprintf(str, "A%d", index);
+ sprintf(str, "A%d", index);
break;
default:
_mesa_problem(NULL, "bad file in reg_string()");
switch (f) {
case PROGRAM_INPUT:
if (prog->Target == GL_VERTEX_PROGRAM_ARB)
- _mesa_sprintf(str, "v[%d]", index);
+ sprintf(str, "v[%d]", index);
else
- _mesa_sprintf(str, "f[%d]", index);
+ sprintf(str, "f[%d]", index);
break;
case PROGRAM_OUTPUT:
- _mesa_sprintf(str, "o[%d]", index);
+ sprintf(str, "o[%d]", index);
break;
case PROGRAM_TEMPORARY:
- _mesa_sprintf(str, "R%d", index);
+ sprintf(str, "R%d", index);
break;
case PROGRAM_ENV_PARAM:
- _mesa_sprintf(str, "c[%d]", index);
+ sprintf(str, "c[%d]", index);
break;
case PROGRAM_VARYING: /* extension */
- _mesa_sprintf(str, "varying[%s%d]", addr, index);
+ sprintf(str, "varying[%s%d]", addr, index);
break;
case PROGRAM_UNIFORM: /* extension */
- _mesa_sprintf(str, "uniform[%s%d]", addr, index);
+ sprintf(str, "uniform[%s%d]", addr, index);
break;
case PROGRAM_CONSTANT: /* extension */
- _mesa_sprintf(str, "constant[%s%d]", addr, index);
+ sprintf(str, "constant[%s%d]", addr, index);
break;
case PROGRAM_STATE_VAR: /* extension */
- _mesa_sprintf(str, "state[%s%d]", addr, index);
+ sprintf(str, "state[%s%d]", addr, index);
break;
default:
_mesa_problem(NULL, "bad file in reg_string()");
_mesa_print_swizzle(GLuint swizzle)
{
if (swizzle == SWIZZLE_XYZW) {
- _mesa_printf(".xyzw\n");
+ printf(".xyzw\n");
}
else {
const char *s = _mesa_swizzle_string(swizzle, 0, 0);
- _mesa_printf("%s\n", s);
+ printf("%s\n", s);
}
}
gl_prog_print_mode mode,
const struct gl_program *prog)
{
- _mesa_fprintf(f, "%s%s",
- reg_string((gl_register_file) dstReg->File,
- dstReg->Index, mode, dstReg->RelAddr, prog),
- _mesa_writemask_string(dstReg->WriteMask));
-
+ fprintf(f, "%s%s",
+ reg_string((gl_register_file) dstReg->File,
+ dstReg->Index, mode, dstReg->RelAddr, prog),
+ _mesa_writemask_string(dstReg->WriteMask));
+
if (dstReg->CondMask != COND_TR) {
- _mesa_fprintf(f, " (%s.%s)",
- _mesa_condcode_string(dstReg->CondMask),
- _mesa_swizzle_string(dstReg->CondSwizzle,
- GL_FALSE, GL_FALSE));
+ fprintf(f, " (%s.%s)",
+ _mesa_condcode_string(dstReg->CondMask),
+ _mesa_swizzle_string(dstReg->CondSwizzle,
+ GL_FALSE, GL_FALSE));
}
#if 0
- _mesa_fprintf(f, "%s[%d]%s",
- file_string((gl_register_file) dstReg->File, mode),
- dstReg->Index,
- _mesa_writemask_string(dstReg->WriteMask));
+ fprintf(f, "%s[%d]%s",
+ file_string((gl_register_file) dstReg->File, mode),
+ dstReg->Index,
+ _mesa_writemask_string(dstReg->WriteMask));
#endif
}
{
const char *abs = srcReg->Abs ? "|" : "";
- _mesa_fprintf(f, "%s%s%s%s",
- abs,
- reg_string((gl_register_file) srcReg->File,
- srcReg->Index, mode, srcReg->RelAddr, prog),
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->Negate, GL_FALSE),
- abs);
+ fprintf(f, "%s%s%s%s",
+ abs,
+ reg_string((gl_register_file) srcReg->File,
+ srcReg->Index, mode, srcReg->RelAddr, prog),
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->Negate, GL_FALSE),
+ abs);
#if 0
- _mesa_fprintf(f, "%s[%d]%s",
- file_string((gl_register_file) srcReg->File, mode),
- srcReg->Index,
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->Negate, GL_FALSE));
+ fprintf(f, "%s[%d]%s",
+ file_string((gl_register_file) srcReg->File, mode),
+ srcReg->Index,
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->Negate, GL_FALSE));
#endif
}
fprint_comment(FILE *f, const struct prog_instruction *inst)
{
if (inst->Comment)
- _mesa_fprintf(f, "; # %s\n", inst->Comment);
+ fprintf(f, "; # %s\n", inst->Comment);
else
- _mesa_fprintf(f, ";\n");
+ fprintf(f, ";\n");
}
{
GLuint j;
- _mesa_fprintf(f, "%s", opcode_string);
+ fprintf(f, "%s", opcode_string);
if (inst->CondUpdate)
- _mesa_fprintf(f, ".C");
+ fprintf(f, ".C");
/* frag prog only */
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_fprintf(f, "_SAT");
+ fprintf(f, "_SAT");
- _mesa_fprintf(f, " ");
+ fprintf(f, " ");
if (inst->DstReg.File != PROGRAM_UNDEFINED) {
fprint_dst_reg(f, &inst->DstReg, mode, prog);
}
else {
- _mesa_fprintf(f, " ???");
+ fprintf(f, " ???");
}
if (numRegs > 0)
- _mesa_fprintf(f, ", ");
+ fprintf(f, ", ");
for (j = 0; j < numRegs; j++) {
fprint_src_reg(f, inst->SrcReg + j, mode, prog);
if (j + 1 < numRegs)
- _mesa_fprintf(f, ", ");
+ fprintf(f, ", ");
}
fprint_comment(f, inst);
indent -= 3;
}
for (i = 0; i < indent; i++) {
- _mesa_fprintf(f, " ");
+ fprintf(f, " ");
}
switch (inst->Opcode) {
case OPCODE_PRINT:
- _mesa_fprintf(f, "PRINT '%s'", inst->Data);
+ fprintf(f, "PRINT '%s'", inst->Data);
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
- _mesa_fprintf(f, ", ");
- _mesa_fprintf(f, "%s[%d]%s",
- file_string((gl_register_file) inst->SrcReg[0].File,
- mode),
- inst->SrcReg[0].Index,
- _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
- inst->SrcReg[0].Negate, GL_FALSE));
+ fprintf(f, ", ");
+ fprintf(f, "%s[%d]%s",
+ file_string((gl_register_file) inst->SrcReg[0].File,
+ mode),
+ inst->SrcReg[0].Index,
+ _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
+ inst->SrcReg[0].Negate, GL_FALSE));
}
if (inst->Comment)
- _mesa_fprintf(f, " # %s", inst->Comment);
+ fprintf(f, " # %s", inst->Comment);
fprint_comment(f, inst);
break;
case OPCODE_SWZ:
- _mesa_fprintf(f, "SWZ");
+ fprintf(f, "SWZ");
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_fprintf(f, "_SAT");
- _mesa_fprintf(f, " ");
+ fprintf(f, "_SAT");
+ fprintf(f, " ");
fprint_dst_reg(f, &inst->DstReg, mode, prog);
- _mesa_fprintf(f, ", %s[%d], %s",
- file_string((gl_register_file) inst->SrcReg[0].File,
- mode),
- inst->SrcReg[0].Index,
- _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
- inst->SrcReg[0].Negate, GL_TRUE));
+ fprintf(f, ", %s[%d], %s",
+ file_string((gl_register_file) inst->SrcReg[0].File,
+ mode),
+ inst->SrcReg[0].Index,
+ _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
+ inst->SrcReg[0].Negate, GL_TRUE));
fprint_comment(f, inst);
break;
case OPCODE_TEX:
case OPCODE_TXP:
case OPCODE_TXL:
case OPCODE_TXB:
- _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_fprintf(f, "_SAT");
- _mesa_fprintf(f, " ");
+ fprintf(f, "_SAT");
+ fprintf(f, " ");
fprint_dst_reg(f, &inst->DstReg, mode, prog);
- _mesa_fprintf(f, ", ");
+ fprintf(f, ", ");
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- _mesa_fprintf(f, ", texture[%d], ", inst->TexSrcUnit);
+ fprintf(f, ", texture[%d], ", inst->TexSrcUnit);
switch (inst->TexSrcTarget) {
- case TEXTURE_1D_INDEX: _mesa_fprintf(f, "1D"); break;
- case TEXTURE_2D_INDEX: _mesa_fprintf(f, "2D"); break;
- case TEXTURE_3D_INDEX: _mesa_fprintf(f, "3D"); break;
- case TEXTURE_CUBE_INDEX: _mesa_fprintf(f, "CUBE"); break;
- case TEXTURE_RECT_INDEX: _mesa_fprintf(f, "RECT"); break;
+ case TEXTURE_1D_INDEX: fprintf(f, "1D"); break;
+ case TEXTURE_2D_INDEX: fprintf(f, "2D"); break;
+ case TEXTURE_3D_INDEX: fprintf(f, "3D"); break;
+ case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break;
+ case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break;
default:
;
}
if (inst->TexShadow)
- _mesa_fprintf(f, " SHADOW");
+ fprintf(f, " SHADOW");
fprint_comment(f, inst);
break;
case OPCODE_KIL:
- _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
- _mesa_fprintf(f, " ");
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ fprintf(f, " ");
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
fprint_comment(f, inst);
break;
case OPCODE_KIL_NV:
- _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
- _mesa_fprintf(f, " ");
- _mesa_fprintf(f, "%s.%s",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle,
- GL_FALSE, GL_FALSE));
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ fprintf(f, " ");
+ fprintf(f, "%s.%s",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle,
+ GL_FALSE, GL_FALSE));
fprint_comment(f, inst);
break;
case OPCODE_ARL:
- _mesa_fprintf(f, "ARL ");
+ fprintf(f, "ARL ");
fprint_dst_reg(f, &inst->DstReg, mode, prog);
- _mesa_fprintf(f, ", ");
+ fprintf(f, ", ");
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
fprint_comment(f, inst);
break;
case OPCODE_BRA:
- _mesa_fprintf(f, "BRA %d (%s%s)",
- inst->BranchTarget,
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
+ fprintf(f, "BRA %d (%s%s)",
+ inst->BranchTarget,
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
fprint_comment(f, inst);
break;
case OPCODE_IF:
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
/* Use ordinary register */
- _mesa_fprintf(f, "IF ");
+ fprintf(f, "IF ");
fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- _mesa_fprintf(f, "; ");
+ fprintf(f, "; ");
}
else {
/* Use cond codes */
- _mesa_fprintf(f, "IF (%s%s);",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle,
- 0, GL_FALSE));
+ fprintf(f, "IF (%s%s);",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle,
+ 0, GL_FALSE));
}
- _mesa_fprintf(f, " # (if false, goto %d)", inst->BranchTarget);
+ fprintf(f, " # (if false, goto %d)", inst->BranchTarget);
fprint_comment(f, inst);
return indent + 3;
case OPCODE_ELSE:
- _mesa_fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget);
+ fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget);
return indent + 3;
case OPCODE_ENDIF:
- _mesa_fprintf(f, "ENDIF;\n");
+ fprintf(f, "ENDIF;\n");
break;
case OPCODE_BGNLOOP:
- _mesa_fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget);
+ fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget);
return indent + 3;
case OPCODE_ENDLOOP:
- _mesa_fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget);
+ fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget);
break;
case OPCODE_BRK:
case OPCODE_CONT:
- _mesa_fprintf(f, "%s (%s%s); # (goto %d)",
- _mesa_opcode_string(inst->Opcode),
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
- inst->BranchTarget);
+ fprintf(f, "%s (%s%s); # (goto %d)",
+ _mesa_opcode_string(inst->Opcode),
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
+ inst->BranchTarget);
fprint_comment(f, inst);
break;
case OPCODE_BGNSUB:
if (mode == PROG_PRINT_NV) {
- _mesa_fprintf(f, "%s:\n", inst->Comment); /* comment is label */
+ fprintf(f, "%s:\n", inst->Comment); /* comment is label */
return indent;
}
else {
- _mesa_fprintf(f, "BGNSUB");
+ fprintf(f, "BGNSUB");
fprint_comment(f, inst);
return indent + 3;
}
case OPCODE_ENDSUB:
if (mode == PROG_PRINT_DEBUG) {
- _mesa_fprintf(f, "ENDSUB");
+ fprintf(f, "ENDSUB");
fprint_comment(f, inst);
}
break;
case OPCODE_CAL:
if (mode == PROG_PRINT_NV) {
- _mesa_fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
+ fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
}
else {
- _mesa_fprintf(f, "CAL %u", inst->BranchTarget);
+ fprintf(f, "CAL %u", inst->BranchTarget);
fprint_comment(f, inst);
}
break;
case OPCODE_RET:
- _mesa_fprintf(f, "RET (%s%s)",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
+ fprintf(f, "RET (%s%s)",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
fprint_comment(f, inst);
break;
case OPCODE_END:
- _mesa_fprintf(f, "END\n");
+ fprintf(f, "END\n");
break;
case OPCODE_NOP:
if (mode == PROG_PRINT_DEBUG) {
- _mesa_fprintf(f, "NOP");
+ fprintf(f, "NOP");
fprint_comment(f, inst);
}
else if (inst->Comment) {
/* ARB/NV extensions don't have NOP instruction */
- _mesa_fprintf(f, "# %s\n", inst->Comment);
+ fprintf(f, "# %s\n", inst->Comment);
}
break;
/* XXX may need other special-case instructions */
switch (prog->Target) {
case GL_VERTEX_PROGRAM_ARB:
if (mode == PROG_PRINT_ARB)
- _mesa_fprintf(f, "!!ARBvp1.0\n");
+ fprintf(f, "!!ARBvp1.0\n");
else if (mode == PROG_PRINT_NV)
- _mesa_fprintf(f, "!!VP1.0\n");
+ fprintf(f, "!!VP1.0\n");
else
- _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id);
+ fprintf(f, "# Vertex Program/Shader %u\n", prog->Id);
break;
case GL_FRAGMENT_PROGRAM_ARB:
case GL_FRAGMENT_PROGRAM_NV:
if (mode == PROG_PRINT_ARB)
- _mesa_fprintf(f, "!!ARBfp1.0\n");
+ fprintf(f, "!!ARBfp1.0\n");
else if (mode == PROG_PRINT_NV)
- _mesa_fprintf(f, "!!FP1.0\n");
+ fprintf(f, "!!FP1.0\n");
else
- _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id);
+ fprintf(f, "# Fragment Program/Shader %u\n", prog->Id);
break;
}
for (i = 0; i < prog->NumInstructions; i++) {
if (lineNumbers)
- _mesa_fprintf(f, "%3d: ", i);
+ fprintf(f, "%3d: ", i);
indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i,
indent, mode, prog);
}
{
GLuint i;
- _mesa_fprintf(f, "InputsRead: 0x%x (0b%s)\n",
+ fprintf(f, "InputsRead: 0x%x (0b%s)\n",
prog->InputsRead, binary(prog->InputsRead));
- _mesa_fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
+ fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
prog->OutputsWritten, binary(prog->OutputsWritten));
- _mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
- _mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
- _mesa_fprintf(f, "NumParameters=%d\n", prog->NumParameters);
- _mesa_fprintf(f, "NumAttributes=%d\n", prog->NumAttributes);
- _mesa_fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs);
- _mesa_fprintf(f, "SamplersUsed: 0x%x (0b%s)\n",
+ fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
+ fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
+ fprintf(f, "NumParameters=%d\n", prog->NumParameters);
+ fprintf(f, "NumAttributes=%d\n", prog->NumAttributes);
+ fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs);
+ fprintf(f, "SamplersUsed: 0x%x (0b%s)\n",
prog->SamplersUsed, binary(prog->SamplersUsed));
- _mesa_fprintf(f, "Samplers=[ ");
+ fprintf(f, "Samplers=[ ");
for (i = 0; i < MAX_SAMPLERS; i++) {
- _mesa_fprintf(f, "%d ", prog->SamplerUnits[i]);
+ fprintf(f, "%d ", prog->SamplerUnits[i]);
}
- _mesa_fprintf(f, "]\n");
+ fprintf(f, "]\n");
_mesa_load_state_parameters(ctx, prog->Parameters);
#if 0
- _mesa_fprintf(f, "Local Params:\n");
+ fprintf(f, "Local Params:\n");
for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){
const GLfloat *p = prog->LocalParams[i];
- _mesa_fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
+ fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
}
#endif
_mesa_print_parameter_list(prog->Parameters);
return;
if (0)
- _mesa_fprintf(f, "param list %p\n", (void *) list);
- _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags);
+ fprintf(f, "param list %p\n", (void *) list);
+ fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags);
for (i = 0; i < list->NumParameters; i++){
struct gl_program_parameter *param = list->Parameters + i;
const GLfloat *v = list->ParameterValues[i];
- _mesa_fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
- i, param->Size,
- file_string(list->Parameters[i].Type, mode),
- param->Name, v[0], v[1], v[2], v[3]);
+ fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
+ i, param->Size,
+ file_string(list->Parameters[i].Type, mode),
+ param->Name, v[0], v[1], v[2], v[3]);
if (param->Flags & PROG_PARAM_BIT_CENTROID)
- _mesa_fprintf(f, " Centroid");
+ fprintf(f, " Centroid");
if (param->Flags & PROG_PARAM_BIT_INVARIANT)
- _mesa_fprintf(f, " Invariant");
+ fprintf(f, " Invariant");
if (param->Flags & PROG_PARAM_BIT_FLAT)
- _mesa_fprintf(f, " Flat");
+ fprintf(f, " Flat");
if (param->Flags & PROG_PARAM_BIT_LINEAR)
- _mesa_fprintf(f, " Linear");
- _mesa_fprintf(f, "\n");
+ fprintf(f, " Linear");
+ fprintf(f, "\n");
}
}
else
type = "vert";
- _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
+ snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
f = fopen(filename, "w");
if (!f) {
fprintf(stderr, "Unable to open %s for writing\n", filename);
else
type = "vert";
- _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
+ snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
f = fopen(filename, "a"); /* append */
if (!f) {
fprintf(stderr, "Unable to open %s for appending\n", filename);
append_index(char *dst, GLint index)
{
char s[20];
- _mesa_sprintf(s, "[%d]", index);
+ sprintf(s, "[%d]", index);
append(dst, s);
}
if (modifier)
append_token(str, modifier);
if (firstRow == lastRow)
- _mesa_sprintf(tmp, ".row[%d]", firstRow);
+ sprintf(tmp, ".row[%d]", firstRow);
else
- _mesa_sprintf(tmp, ".row[%d..%d]", firstRow, lastRow);
+ sprintf(tmp, ".row[%d..%d]", firstRow, lastRow);
append(str, tmp);
}
break;
{
if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) {
char s[100];
- _mesa_snprintf(s, sizeof(s),
+ snprintf(s, sizeof(s),
"relative address offset too large (%d)", (yyvsp[(1) - (1)].integer));
yyerror(& (yylsp[(1) - (1)]), state, s);
YYERROR;
{
if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) {
char s[100];
- _mesa_snprintf(s, sizeof(s),
+ snprintf(s, sizeof(s),
"relative address offset too large (%d)", (yyvsp[(1) - (1)].integer));
yyerror(& (yylsp[(1) - (1)]), state, s);
YYERROR;
if (exist != NULL) {
char m[1000];
- _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string));
+ snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string));
free((yyvsp[(2) - (4)].string));
yyerror(& (yylsp[(2) - (4)]), state, m);
YYERROR;
{
if (($1 < 0) || ($1 > 63)) {
char s[100];
- _mesa_snprintf(s, sizeof(s),
+ snprintf(s, sizeof(s),
"relative address offset too large (%d)", $1);
yyerror(& @1, state, s);
YYERROR;
{
if (($1 < 0) || ($1 > 64)) {
char s[100];
- _mesa_snprintf(s, sizeof(s),
+ snprintf(s, sizeof(s),
"relative address offset too large (%d)", $1);
yyerror(& @1, state, s);
YYERROR;
if (exist != NULL) {
char m[1000];
- _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2);
+ snprintf(m, sizeof(m), "redeclared identifier: %s", $2);
free($2);
yyerror(& @2, state, m);
YYERROR;
if (0) {
GLuint i;
- _mesa_printf("Link %u shaders in program %u: %s\n",
+ printf("Link %u shaders in program %u: %s\n",
shProg->NumShaders, shProg->Name,
shProg->LinkStatus ? "Success" : "Failed");
for (i = 0; i < shProg->NumShaders; i++) {
- _mesa_printf(" shader %u, type 0x%x\n",
+ printf(" shader %u, type 0x%x\n",
shProg->Shaders[i]->Name,
shProg->Shaders[i]->Type);
}
{
GLuint i;
- _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name);
+ printf("Mesa: glUseProgram(%u)\n", shProg->Name);
for (i = 0; i < shProg->NumShaders; i++) {
const char *s;
switch (shProg->Shaders[i]->Type) {
default:
s = "";
}
- _mesa_printf(" %s shader %u, checksum %u\n", s,
- shProg->Shaders[i]->Name,
- shProg->Shaders[i]->SourceChecksum);
+ printf(" %s shader %u, checksum %u\n", s,
+ shProg->Shaders[i]->Name,
+ shProg->Shaders[i]->SourceChecksum);
}
if (shProg->VertexProgram)
- _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id);
+ printf(" vert prog %u\n", shProg->VertexProgram->Base.Id);
if (shProg->FragmentProgram)
- _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id);
+ printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id);
}
/* This maps a sampler to a texture unit: */
if (sampler < MAX_SAMPLERS) {
#if 0
- _mesa_printf("Set program %p sampler %d '%s' to unit %u\n",
- program, sampler, param->Name, texUnit);
+ printf("Set program %p sampler %d '%s' to unit %u\n",
+ program, sampler, param->Name, texUnit);
#endif
if (program->SamplerUnits[sampler] != texUnit) {
program->SamplerUnits[sampler] = texUnit;
if (ctx->Shader.Flags & GLSL_UNIFORMS) {
GLint i;
- _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ",
- shProg->Name, uniform->Name, location);
+ printf("Mesa: set program %u uniform %s (loc %d) to: ",
+ shProg->Name, uniform->Name, location);
if (basicType == GL_INT) {
const GLint *v = (const GLint *) values;
for (i = 0; i < count * elems; i++) {
- _mesa_printf("%d ", v[i]);
+ printf("%d ", v[i]);
}
}
else {
const GLfloat *v = (const GLfloat *) values;
for (i = 0; i < count * elems; i++) {
- _mesa_printf("%g ", v[i]);
+ printf("%g ", v[i]);
}
}
- _mesa_printf("\n");
+ printf("\n");
}
/* A uniform var may be used by both a vertex shader and a fragment
unit = prog->SamplerUnits[sampler];
target = prog->SamplerTargets[sampler];
if (targetUsed[unit] != -1 && targetUsed[unit] != target) {
- _mesa_snprintf(errMsg, 100,
- "Texture unit %d is accessed both as %s and %s",
- unit, targetName[targetUsed[unit]], targetName[target]);
+ snprintf(errMsg, 100,
+ "Texture unit %d is accessed both as %s and %s",
+ unit, targetName[targetUsed[unit]], targetName[target]);
return GL_FALSE;
}
targetUsed[unit] = target;
if (A->pragmas->Debug) {
char s[1000];
- _mesa_snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name);
+ snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name);
n->Comment = _slang_strdup(s);
}
*/
slang_variable *p = slang_variable_scope_grow(fun->parameters);
char name[10];
- _mesa_snprintf(name, sizeof(name), "p%d", i);
+ snprintf(name, sizeof(name), "p%d", i);
p->a_name = slang_atom_pool_atom(A->atoms, name);
p->type.qualifier = SLANG_QUAL_CONST;
p->type.specifier.type = baseType;
/* error */
char s[100];
/* XXX isn't this really an out of memory/resources error? */
- _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'",
- (char *) n->Var->a_name);
+ snprintf(s, sizeof(s), "Undefined variable '%s'",
+ (char *) n->Var->a_name);
slang_info_log_error(emitInfo->log, s);
return NULL;
}
free(l);
return NULL;
}
- _mesa_sprintf(l->Name, "%s_%d", name, id);
+ sprintf(l->Name, "%s_%d", name, id);
id++;
l->Location = -1;
}
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) {
char msg[100];
- _mesa_snprintf(msg, sizeof(msg),
- "centroid modifier mismatch for '%s'", var->Name);
+ snprintf(msg, sizeof(msg),
+ "centroid modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
free(map);
return GL_FALSE;
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) {
char msg[100];
- _mesa_snprintf(msg, sizeof(msg),
- "invariant modifier mismatch for '%s'", var->Name);
+ snprintf(msg, sizeof(msg),
+ "invariant modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
free(map);
return GL_FALSE;
GLuint newSampNum = *numSamplers;
if (newSampNum >= ctx->Const.MaxTextureImageUnits) {
char s[100];
- _mesa_sprintf(s, "Too many texture samplers (%u, max is %u)",
- newSampNum, ctx->Const.MaxTextureImageUnits);
+ sprintf(s, "Too many texture samplers (%u, max is %u)",
+ newSampNum, ctx->Const.MaxTextureImageUnits);
link_error(shProg, s);
return GL_FALSE;
}
}
source[len] = '\0';
/*
- _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
+ printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
*/
free(shaderLengths);
vertNotify = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
&shProg->FragmentProgram->Base);
if (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Mesa pre-link fragment program:\n");
+ printf("Mesa pre-link fragment program:\n");
_mesa_print_program(&fragProg->Base);
_mesa_print_program_parameters(ctx, &fragProg->Base);
- _mesa_printf("Mesa post-link fragment program:\n");
+ printf("Mesa post-link fragment program:\n");
_mesa_print_program(&shProg->FragmentProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base);
}
fragNotify = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
&shProg->VertexProgram->Base);
if (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Mesa pre-link vertex program:\n");
+ printf("Mesa pre-link vertex program:\n");
_mesa_print_program(&vertProg->Base);
_mesa_print_program_parameters(ctx, &vertProg->Base);
- _mesa_printf("Mesa post-link vertex program:\n");
+ printf("Mesa post-link vertex program:\n");
_mesa_print_program(&shProg->VertexProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base);
}
}
if (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Varying vars:\n");
+ printf("Varying vars:\n");
_mesa_print_parameter_list(shProg->Varying);
if (shProg->InfoLog) {
- _mesa_printf("Info Log: %s\n", shProg->InfoLog);
+ printf("Info Log: %s\n", shProg->InfoLog);
}
}
char buf[1024];
va_start(va, msg);
- _mesa_vsprintf(buf, msg, va);
+ vsprintf(buf, msg, va);
va_end(va);
return slang_info_log_message(log, NULL, buf);
}
char buf[1024];
va_start(va, msg);
- _mesa_vsprintf(buf, msg, va);
+ vsprintf(buf, msg, va);
va_end(va);
log->error_flag = GL_TRUE;
if (slang_info_log_message(log, "Error", buf))
char buf[1024];
va_start(va, msg);
- _mesa_vsprintf(buf, msg, va);
+ vsprintf(buf, msg, va);
va_end(va);
if (slang_info_log_message(log, "Warning", buf))
return 1;
{
char buffer[12];
- _mesa_sprintf (buffer, "%d", i);
+ sprintf (buffer, "%d", i);
slang_string_pushs (self, buffer, strlen (buffer));
}
if (state->st == 0)
return;
- /*_mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/
+ /*printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/
if (1) {
/* Debug version which enforces various sanity checks on the
const struct st_tracked_state *atom = atoms[i];
struct st_state_flags generated;
- /*_mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/
+ /*printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/
if (!(atom->dirty.mesa || atom->dirty.st) ||
!atom->update) {
- _mesa_printf("malformed atom %s\n", atom->name);
+ printf("malformed atom %s\n", atom->name);
assert(0);
}
if (check_state(state, &atom->dirty)) {
atoms[i]->update( st );
- /*_mesa_printf("after: %x\n", atom->dirty.mesa);*/
+ /*printf("after: %x\n", atom->dirty.mesa);*/
}
accumulate_state(&examined, &atom->dirty);
assert(!check_state(&examined, &generated));
prev = *state;
}
- /*_mesa_printf("\n");*/
+ /*printf("\n");*/
}
else {
#define USE(lineFunc) \
do { \
lineFuncName = #lineFunc; \
- /*_mesa_printf("%s\n", lineFuncName);*/ \
+ /*printf("%s\n", lineFuncName);*/ \
swrast->Line = lineFunc; \
} while (0)
if (0)
{
- _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
+ printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
for (i = 0; i < nr_prims; i++)
- _mesa_printf("prim %d: %s start %d count %d\n", i,
- _mesa_lookup_enum_by_nr(prim[i].mode),
- prim[i].start,
- prim[i].count);
+ printf("prim %d: %s start %d count %d\n", i,
+ _mesa_lookup_enum_by_nr(prim[i].mode),
+ prim[i].start,
+ prim[i].count);
}
if (min_index) {
if (0) {
/* print pre-clip vertex coords */
GLuint i, j;
- _mesa_printf("pre clip:\n");
+ printf("pre clip:\n");
for (i = 0; i < n; i++) {
j = inlist[i];
- _mesa_printf(" %u: %u: %f, %f, %f, %f\n",
- i, j,
- coord[j][0], coord[j][1], coord[j][2], coord[j][3]);
+ printf(" %u: %u: %f, %f, %f, %f\n",
+ i, j,
+ coord[j][0], coord[j][1], coord[j][2], coord[j][3]);
assert(!IS_INF_OR_NAN(coord[j][0]));
assert(!IS_INF_OR_NAN(coord[j][1]));
assert(!IS_INF_OR_NAN(coord[j][2]));
if (0) {
/* print post-clip vertex coords */
GLuint i, j;
- _mesa_printf("post clip:\n");
+ printf("post clip:\n");
for (i = 0; i < n; i++) {
j = inlist[i];
- _mesa_printf(" %u: %u: %f, %f, %f, %f\n",
- i, j,
- coord[j][0], coord[j][1], coord[j][2], coord[j][3]);
+ printf(" %u: %u: %f, %f, %f, %f\n",
+ i, j,
+ coord[j][0], coord[j][1], coord[j][2], coord[j][3]);
}
}
const GLuint format = map[i].format;
if (format == EMIT_PAD) {
if (DBG)
- _mesa_printf("%d: pad %d, offset %d\n", i,
- map[i].offset, offset);
+ printf("%d: pad %d, offset %d\n", i,
+ map[i].offset, offset);
offset += map[i].offset;
if (DBG)
- _mesa_printf("%d: %s, vp %p, offset %d\n", i,
- _tnl_format_info[format].name, (void *)vp,
- vtx->attr[j].vertoffset);
+ printf("%d: %s, vp %p, offset %d\n", i,
+ _tnl_format_info[format].name, (void *)vp,
+ vtx->attr[j].vertoffset);
offset += _tnl_format_info[format].attrsize;
j++;
update_src_ptr(p, srcECX, vtxESI, a);
}
else {
- _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
+ printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
return GL_FALSE;
}
break;
j++; /* NOTE: two attrs consumed */
}
else {
- _mesa_printf("Can't emit 3ub\n");
+ printf("Can't emit 3ub\n");
return GL_FALSE; /* add this later */
}
break;
break;
case GL_UNSIGNED_SHORT:
default:
- _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
+ printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
return GL_FALSE;
}
break;
default:
- _mesa_printf("unknown a[%d].format %d\n", j, a->format);
+ printf("unknown a[%d].format %d\n", j, a->format);
return GL_FALSE; /* catch any new opcodes */
}
void vbo_exec_BeginVertices( GLcontext *ctx )
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- if (0) _mesa_printf("%s\n", __FUNCTION__);
+ if (0) printf("%s\n", __FUNCTION__);
vbo_exec_vtx_map( exec );
assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0);
assert(exec->flush_call_depth == 1);
#endif
- if (0) _mesa_printf("%s\n", __FUNCTION__);
+ if (0) printf("%s\n", __FUNCTION__);
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
- if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
+ if (0) printf("%s - inside begin/end\n", __FUNCTION__);
#ifdef DEBUG
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);
for (k = 0; k < array->Size; k++) {
if (IS_INF_OR_NAN(f[k]) ||
f[k] >= 1.0e20 || f[k] <= -1.0e10) {
- _mesa_printf("Bad array data:\n");
- _mesa_printf(" Element[%u].%u = %f\n", j, k, f[k]);
- _mesa_printf(" Array %u at %p\n", attrib, (void* ) array);
- _mesa_printf(" Type 0x%x, Size %d, Stride %d\n",
- array->Type, array->Size, array->Stride);
- _mesa_printf(" Address/offset %p in Buffer Object %u\n",
- array->Ptr, array->BufferObj->Name);
+ printf("Bad array data:\n");
+ printf(" Element[%u].%u = %f\n", j, k, f[k]);
+ printf(" Array %u at %p\n", attrib, (void* ) array);
+ printf(" Type 0x%x, Size %d, Stride %d\n",
+ array->Type, array->Size, array->Stride);
+ printf(" Address/offset %p in Buffer Object %u\n",
+ array->Ptr, array->BufferObj->Name);
f[k] = 1.0; /* XXX replace the bad value! */
}
/*assert(!IS_INF_OR_NAN(f[k]));*/
{
int i;
- _mesa_printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
- mode, start, count);
+ printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
+ mode, start, count);
for (i = 0; i < 32; i++) {
GLuint bufName = exec->array.inputs[i]->BufferObj->Name;
GLint stride = exec->array.inputs[i]->Stride;
- _mesa_printf("attr %2d: size %d stride %d enabled %d "
- "ptr %p Bufobj %u\n",
- i,
- exec->array.inputs[i]->Size,
- stride,
- /*exec->array.inputs[i]->Enabled,*/
- exec->array.legacy_array[i]->Enabled,
- exec->array.inputs[i]->Ptr,
- bufName);
+ printf("attr %2d: size %d stride %d enabled %d "
+ "ptr %p Bufobj %u\n",
+ i,
+ exec->array.inputs[i]->Size,
+ stride,
+ /*exec->array.inputs[i]->Enabled,*/
+ exec->array.legacy_array[i]->Enabled,
+ exec->array.inputs[i]->Ptr,
+ bufName);
if (bufName) {
struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName);
int n = (count * stride) / 4;
if (n > 32)
n = 32;
- _mesa_printf(" Data at offset %d:\n", offset);
+ printf(" Data at offset %d:\n", offset);
for (i = 0; i < n; i++) {
- _mesa_printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
+ printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
}
ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf);
}
const GLubyte *us = (const GLubyte *) map;
GLint i;
for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) {
- _mesa_printf("%02x ", us[i]);
+ printf("%02x ", us[i]);
if (i % 32 == 31)
- _mesa_printf("\n");
+ printf("\n");
}
- _mesa_printf("\n");
+ printf("\n");
}
break;
case GL_UNSIGNED_SHORT:
const GLushort *us = (const GLushort *) map;
GLint i;
for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) {
- _mesa_printf("%04x ", us[i]);
+ printf("%04x ", us[i]);
if (i % 16 == 15)
- _mesa_printf("\n");
+ printf("\n");
}
- _mesa_printf("\n");
+ printf("\n");
}
break;
case GL_UNSIGNED_INT:
const GLuint *us = (const GLuint *) map;
GLint i;
for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) {
- _mesa_printf("%08x ", us[i]);
+ printf("%08x ", us[i]);
if (i % 8 == 7)
- _mesa_printf("\n");
+ printf("\n");
}
- _mesa_printf("\n");
+ printf("\n");
}
break;
default:
end = ctx->Array.ArrayObj->_MaxElement - 1;
}
else if (0) {
- _mesa_printf("glDraw[Range]Elements{,BaseVertex}"
- "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
- "base %d\n",
- start, end, type, count,
- ctx->Array.ElementArrayBufferObj->Name,
- basevertex);
+ printf("glDraw[Range]Elements{,BaseVertex}"
+ "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
+ "base %d\n",
+ start, end, type, count,
+ ctx->Array.ElementArrayBufferObj->Name,
+ basevertex);
}
#if 0
GLuint count = exec->vtx.vert_count;
GLuint i;
- _mesa_printf("%s: %u vertices %d primitives, %d vertsize\n",
- __FUNCTION__,
- count,
- exec->vtx.prim_count,
- exec->vtx.vertex_size);
+ printf("%s: %u vertices %d primitives, %d vertsize\n",
+ __FUNCTION__,
+ count,
+ exec->vtx.prim_count,
+ exec->vtx.vertex_size);
for (i = 0 ; i < exec->vtx.prim_count ; i++) {
struct _mesa_prim *prim = &exec->vtx.prim[i];
- _mesa_printf(" prim %d: %s%s %d..%d %s %s\n",
- i,
- _mesa_lookup_prim_by_nr(prim->mode),
- prim->weak ? " (weak)" : "",
- prim->start,
- prim->start + prim->count,
- prim->begin ? "BEGIN" : "(wrap)",
- prim->end ? "END" : "(wrap)");
+ printf(" prim %d: %s%s %d..%d %s %s\n",
+ i,
+ _mesa_lookup_prim_by_nr(prim->mode),
+ prim->weak ? " (weak)" : "",
+ prim->start,
+ prim->start + prim->count,
+ prim->begin ? "BEGIN" : "(wrap)",
+ prim->end ? "END" : "(wrap)");
}
}
}
if (0)
- _mesa_printf("map %d..\n", exec->vtx.buffer_used);
+ printf("map %d..\n", exec->vtx.buffer_used);
}
}
if (0)
- _mesa_printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count,
- exec->vtx.vert_count);
+ printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count,
+ exec->vtx.vert_count);
vbo_context(ctx)->draw_prims( ctx,
exec->vtx.inputs,
assert(min_index != 0);
if (0)
- _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
+ printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
/* XXX this path is disabled for now.
GLuint i;
(void) ctx;
- _mesa_printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
- node->count,
- node->prim_count,
- node->vertex_size);
+ printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
+ node->count,
+ node->prim_count,
+ node->vertex_size);
for (i = 0 ; i < node->prim_count ; i++) {
struct _mesa_prim *prim = &node->prim[i];
* includes operations such as glBegin or glDrawArrays.
*/
if (0)
- _mesa_printf("displaylist recursive begin");
+ printf("displaylist recursive begin");
vbo_save_loopback_vertex_list( ctx, node );
return;
GLuint k;
if (0)
- _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n",
- _mesa_lookup_prim_by_nr(prim->mode),
- prim->begin ? "begin" : "..",
- prim->end ? "end" : "..",
- start,
- end);
+ printf("loopback prim %s(%s,%s) verts %d..%d\n",
+ _mesa_lookup_prim_by_nr(prim->mode),
+ prim->begin ? "begin" : "..",
+ prim->end ? "end" : "..",
+ start,
+ end);
if (prim->begin) {
CALL_Begin(GET_DISPATCH(), ( prim->mode ));
{
GLuint i, j;
- _mesa_printf("VBO Draw:\n");
+ printf("VBO Draw:\n");
for (i = 0; i < nr_prims; i++) {
- _mesa_printf("Prim %u of %u\n", i, nr_prims);
- _mesa_printf(" Prim mode 0x%x\n", prims[i].mode);
- _mesa_printf(" IB: %p\n", (void*) ib);
+ printf("Prim %u of %u\n", i, nr_prims);
+ printf(" Prim mode 0x%x\n", prims[i].mode);
+ printf(" IB: %p\n", (void*) ib);
for (j = 0; j < VERT_ATTRIB_MAX; j++) {
- _mesa_printf(" array %d at %p:\n", j, (void*) arrays[j]);
- _mesa_printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n",
- arrays[j]->Enabled, arrays[j]->Ptr,
- arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB);
+ printf(" array %d at %p:\n", j, (void*) arrays[j]);
+ printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n",
+ arrays[j]->Enabled, arrays[j]->Ptr,
+ arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB);
if (0) {
GLint k = prims[i].start + prims[i].count - 1;
GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k);
- _mesa_printf(" last: %f %f %f\n",
- last[0], last[1], last[2]);
+ printf(" last: %f %f %f\n",
+ last[0], last[1], last[2]);
}
}
}
GLuint elt = copy->srcelt[elt_idx];
GLuint slot = elt & (ELT_TABLE_SIZE-1);
-/* _mesa_printf("elt %d\n", elt); */
+/* printf("elt %d\n", elt); */
/* Look up the incoming element in the vertex cache. Re-emit if
* necessary.
GLubyte *csr = copy->dstptr;
GLuint i;
-/* _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */
+/* printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */
for (i = 0; i < copy->nr_varying; i++) {
const struct gl_client_array *srcarray = copy->varying[i].array;
{
const GLuint *f = (const GLuint *)srcptr;
GLuint j;
- _mesa_printf(" varying %d: ", i);
+ printf(" varying %d: ", i);
for(j = 0; j < copy->varying[i].size / 4; j++)
- _mesa_printf("%x ", f[j]);
- _mesa_printf("\n");
+ printf("%x ", f[j]);
+ printf("\n");
}
}
copy->dstbuf_nr * copy->vertex_size));
}
/* else */
-/* _mesa_printf(" --> reuse vertex\n"); */
+/* printf(" --> reuse vertex\n"); */
-/* _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out); */
+/* printf(" --> emit %d\n", copy->vert_cache[slot].out); */
copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out;
return check_flush(copy);
}
{
struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr];
-/* _mesa_printf("end (%d)\n", end_flag); */
+/* printf("end (%d)\n", end_flag); */
prim->end = end_flag;
prim->count = copy->dstelt_nr - prim->start;
const GLuint format = map[i].format;
if (format == EMIT_PAD) {
if (DBG)
- _mesa_printf("%d: pad %d, offset %d\n", i,
- map[i].offset, offset);
+ printf("%d: pad %d, offset %d\n", i,
+ map[i].offset, offset);
offset += map[i].offset;
vf->attr[j].vertoffset = offset;
if (DBG)
- _mesa_printf("%d: %s, offset %d\n", i,
- vf_format_info[format].name,
- vf->attr[j].vertoffset);
+ printf("%d: %s, offset %d\n", i,
+ vf_format_info[format].name,
+ vf->attr[j].vertoffset);
offset += vf_format_info[format].attrsize;
j++;
update_src_ptr(p, srcECX, vfESI, a);
}
else {
- _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
+ printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
return GL_FALSE;
}
break;
j++; /* NOTE: two attrs consumed */
}
else {
- _mesa_printf("Can't emit 3ub\n");
+ printf("Can't emit 3ub\n");
}
return GL_FALSE; /* add this later */
break;
break;
case GL_UNSIGNED_SHORT:
default:
- _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
+ printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
return GL_FALSE;
}
break;
default:
- _mesa_printf("unknown a[%d].format %d\n", j, a->format);
+ printf("unknown a[%d].format %d\n", j, a->format);
return GL_FALSE; /* catch any new opcodes */
}
void (*x86_get_func( struct x86_function *p ))(void)
{
if (DISASSEM && p->store)
- _mesa_printf("disassemble %p %p\n", p->store, p->csr);
+ printf("disassemble %p %p\n", p->store, p->csr);
return (void (*)(void)) (unsigned long) p->store;
}