summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/prog_print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/prog_print.c')
-rw-r--r--src/mesa/shader/prog_print.c330
1 files changed, 165 insertions, 165 deletions
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);