summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-02-19 12:32:24 -0500
committerKristian Høgsberg <[email protected]>2010-02-19 12:32:24 -0500
commit298be2b028263b2c343a707662c6fbfa18293cb2 (patch)
tree97ebdbbd457cbb2803ab03125355885c49d22f55 /src/mesa/shader
parent32f2fd1c5d6088692551c80352b7d6fa35b0cd09 (diff)
Replace the _mesa_*printf() wrappers with the plain libc versions
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c4
-rw-r--r--src/mesa/shader/nvfragparse.c6
-rw-r--r--src/mesa/shader/nvvertparse.c6
-rw-r--r--src/mesa/shader/prog_execute.c4
-rw-r--r--src/mesa/shader/prog_instruction.c2
-rw-r--r--src/mesa/shader/prog_optimize.c62
-rw-r--r--src/mesa/shader/prog_print.c330
-rw-r--r--src/mesa/shader/prog_statevars.c6
-rw-r--r--src/mesa/shader/program_parse.tab.c6
-rw-r--r--src/mesa/shader/program_parse.y6
-rw-r--r--src/mesa/shader/shader_api.c36
-rw-r--r--src/mesa/shader/slang/slang_codegen.c4
-rw-r--r--src/mesa/shader/slang/slang_emit.c4
-rw-r--r--src/mesa/shader/slang/slang_label.c2
-rw-r--r--src/mesa/shader/slang/slang_link.c26
-rw-r--r--src/mesa/shader/slang/slang_log.c6
-rw-r--r--src/mesa/shader/slang/slang_utility.c2
17 files changed, 256 insertions, 256 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 03ff30a2394..6373529e4e8 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -148,7 +148,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
}
#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
}
@@ -211,7 +211,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
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
}
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 4f02703619c..d03cb4e493b 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -200,7 +200,7 @@ do { \
#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)
@@ -1566,9 +1566,9 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
#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 {
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index fb36303bb97..631b315af3a 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -111,7 +111,7 @@ do { \
#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)
@@ -1397,9 +1397,9 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
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)
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index ee422e7ec8f..3b51f986e84 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -1782,8 +1782,8 @@ _mesa_execute_program(GLcontext * ctx,
{
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:
diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c
index 81099cb99c5..e5534b20e34 100644
--- a/src/mesa/shader/prog_instruction.c
+++ b/src/mesa/shader/prog_instruction.c
@@ -345,7 +345,7 @@ _mesa_opcode_string(gl_inst_opcode opcode)
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;
}
}
diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c
index 09816d5044d..2941a17da3f 100644
--- a/src/mesa/shader/prog_optimize.c
+++ b/src/mesa/shader/prog_optimize.c
@@ -159,7 +159,7 @@ _mesa_consolidate_registers(struct gl_program *prog)
GLuint tempMax = 0, i;
if (dbg) {
- _mesa_printf("Optimize: Begin register consolidation\n");
+ printf("Optimize: Begin register consolidation\n");
}
memset(tempUsed, 0, sizeof(tempUsed));
@@ -196,7 +196,7 @@ _mesa_consolidate_registers(struct gl_program *prog)
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) {
@@ -204,14 +204,14 @@ _mesa_consolidate_registers(struct gl_program *prog)
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");
}
}
@@ -232,7 +232,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
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);*/
}
@@ -255,7 +255,7 @@ _mesa_remove_dead_code(struct gl_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;
}
@@ -290,7 +290,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
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;
}
@@ -319,7 +319,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
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);
@@ -330,7 +330,7 @@ _mesa_remove_dead_code(struct gl_program *prog)
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;
}
}
@@ -340,9 +340,9 @@ _mesa_remove_dead_code(struct gl_program *prog)
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);*/
}
@@ -427,7 +427,7 @@ _mesa_remove_extra_move_use(struct gl_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);
}
@@ -518,7 +518,7 @@ _mesa_remove_extra_move_use(struct gl_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);*/
}
}
@@ -533,7 +533,7 @@ _mesa_remove_extra_moves(struct gl_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);
}
@@ -605,8 +605,8 @@ _mesa_remove_extra_moves(struct gl_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);
}
}
@@ -624,7 +624,7 @@ _mesa_remove_extra_moves(struct gl_program *prog)
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);*/
}
}
@@ -837,7 +837,7 @@ find_live_intervals(struct gl_program *prog,
*/
if (dbg) {
- _mesa_printf("Optimize: Begin find intervals\n");
+ printf("Optimize: Begin find intervals\n");
}
/* build intermediate arrays */
@@ -864,16 +864,16 @@ find_live_intervals(struct gl_program *prog,
/* 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");
}
}
@@ -914,7 +914,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
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);
}
@@ -925,7 +925,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
if (!find_live_intervals(prog, &liveIntervals)) {
if (dbg)
- _mesa_printf("Aborting register reallocation\n");
+ printf("Aborting register reallocation\n");
return;
}
@@ -938,7 +938,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
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.
@@ -959,7 +959,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
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);
@@ -967,7 +967,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
/* 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;
}
@@ -984,7 +984,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
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
@@ -1005,8 +1005,8 @@ _mesa_reallocate_registers(struct gl_program *prog)
}
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);
}
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index b238537673e..a933f21857e 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -77,7 +77,7 @@ file_string(gl_register_file f, gl_prog_print_mode mode)
default:
{
static char s[20];
- _mesa_snprintf(s, sizeof(s), "FILE%u", f);
+ snprintf(s, sizeof(s), "FILE%u", f);
return s;
}
}
@@ -172,12 +172,12 @@ arb_input_attrib_string(GLint index, GLenum progType)
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);
}
}
@@ -190,12 +190,12 @@ _mesa_print_vp_inputs(GLbitfield inputs)
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);
}
}
@@ -274,46 +274,46 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
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()");
@@ -324,30 +324,30 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
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()");
@@ -419,11 +419,11 @@ void
_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);
}
}
@@ -476,23 +476,23 @@ fprint_dst_reg(FILE * f,
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
}
@@ -505,19 +505,19 @@ fprint_src_reg(FILE *f,
{
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
}
@@ -526,9 +526,9 @@ static void
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");
}
@@ -541,29 +541,29 @@ fprint_alu_instruction(FILE *f,
{
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);
@@ -598,177 +598,177 @@ _mesa_fprint_instruction_opt(FILE *f,
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 */
@@ -825,26 +825,26 @@ _mesa_fprint_program_opt(FILE *f,
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);
}
@@ -896,30 +896,30 @@ _mesa_fprint_program_parameters(FILE *f,
{
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);
@@ -950,24 +950,24 @@ _mesa_fprint_parameter_list(FILE *f,
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");
}
}
@@ -997,7 +997,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader)
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);
@@ -1047,7 +1047,7 @@ _mesa_append_uniforms_to_file(const struct gl_shader *shader,
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);
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 2c844490dd7..ead3ece95d4 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -950,7 +950,7 @@ static void
append_index(char *dst, GLint index)
{
char s[20];
- _mesa_sprintf(s, "[%d]", index);
+ sprintf(s, "[%d]", index);
append(dst, s);
}
@@ -1029,9 +1029,9 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
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;
diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c
index e5ef25ec38a..3f26f9f84a7 100644
--- a/src/mesa/shader/program_parse.tab.c
+++ b/src/mesa/shader/program_parse.tab.c
@@ -2984,7 +2984,7 @@ yyreduce:
{
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;
@@ -3001,7 +3001,7 @@ yyreduce:
{
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;
@@ -4915,7 +4915,7 @@ yyreduce:
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;
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 299e2477e48..1c856d859d6 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -936,7 +936,7 @@ addrRegPosOffset: INTEGER
{
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;
@@ -950,7 +950,7 @@ addrRegNegOffset: INTEGER
{
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;
@@ -2173,7 +2173,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
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;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index ad3ff26c58f..8bd780b0b0f 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1483,12 +1483,12 @@ _mesa_link_program(GLcontext *ctx, GLuint program)
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);
}
@@ -1504,7 +1504,7 @@ print_shader_info(const struct gl_shader_program *shProg)
{
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) {
@@ -1520,14 +1520,14 @@ print_shader_info(const struct gl_shader_program *shProg)
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);
}
@@ -1697,8 +1697,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
/* 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;
@@ -1861,21 +1861,21 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
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
@@ -2076,9 +2076,9 @@ validate_samplers(GLcontext *ctx, const struct gl_program *prog, char *errMsg)
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;
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 6901b93d5de..b17256bb1e1 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -1643,7 +1643,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun,
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);
}
@@ -2190,7 +2190,7 @@ _slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper)
*/
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;
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 8bd699ff9dc..52fe7868906 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -2303,8 +2303,8 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n)
/* 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;
}
diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c
index 7e00b5787fb..225612a9369 100644
--- a/src/mesa/shader/slang/slang_label.c
+++ b/src/mesa/shader/slang/slang_label.c
@@ -37,7 +37,7 @@ _slang_label_new_unique(const char *name)
free(l);
return NULL;
}
- _mesa_sprintf(l->Name, "%s_%d", name, id);
+ sprintf(l->Name, "%s_%d", name, id);
id++;
l->Location = -1;
}
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 89658c1a398..b59fc0a43a9 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -139,16 +139,16 @@ link_varying_vars(GLcontext *ctx,
}
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;
@@ -269,8 +269,8 @@ link_uniform_vars(GLcontext *ctx,
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;
}
@@ -631,7 +631,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType)
}
source[len] = '\0';
/*
- _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
+ printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
*/
free(shaderLengths);
@@ -875,11 +875,11 @@ _slang_link(GLcontext *ctx,
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);
}
@@ -893,11 +893,11 @@ _slang_link(GLcontext *ctx,
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);
}
@@ -912,10 +912,10 @@ _slang_link(GLcontext *ctx,
}
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);
}
}
diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c
index 23917fbd2cf..9ff21417bc5 100644
--- a/src/mesa/shader/slang/slang_log.c
+++ b/src/mesa/shader/slang/slang_log.c
@@ -86,7 +86,7 @@ slang_info_log_print(slang_info_log * log, const char *msg, ...)
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);
}
@@ -98,7 +98,7 @@ slang_info_log_error(slang_info_log * log, const char *msg, ...)
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))
@@ -114,7 +114,7 @@ slang_info_log_warning(slang_info_log * log, const char *msg, ...)
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;
diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c
index dc1e196bde5..e77404f6928 100644
--- a/src/mesa/shader/slang/slang_utility.c
+++ b/src/mesa/shader/slang/slang_utility.c
@@ -120,7 +120,7 @@ slang_string_pushi (slang_string *self, GLint i)
{
char buffer[12];
- _mesa_sprintf (buffer, "%d", i);
+ sprintf (buffer, "%d", i);
slang_string_pushs (self, buffer, strlen (buffer));
}