void (* SetupFragmentShaderTextures)(GLcontext *ctx, int *tmu_mappings);
void (* TranslateFragmentShader)(GLcontext *ctx, struct gl_fragment_program *fp);
GLboolean (* FragmentProgramEmit)(struct r300_fragment_program_compiler *compiler);
+ void (* FragmentProgramDump)(union rX00_fragment_program_code *code);
GLboolean (* SetupPixelShader)(GLcontext *ctx);
};
r300_fp->translated = GL_TRUE;
- if (r300_fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
- r300FragmentProgramDump(r300_fp, &r300_fp->code.r300);
r300UpdateStateParameters(ctx, _NEW_PROGRAM);
+
+ if (r300_fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
+ r300->vtbl.FragmentProgramDump(&r300_fp->code);
}
update_params(ctx, fp);
}
/* just some random things... */
-void r300FragmentProgramDump(
- struct r300_fragment_program *fp,
- struct r300_fragment_program_code *code)
+void r300FragmentProgramDump(union rX00_fragment_program_code *c)
{
+ struct r300_fragment_program_code *code = &c->r300;
int n, i, j;
static int pc = 0;
extern GLboolean r300FragmentProgramEmit(struct r300_fragment_program_compiler *compiler);
-
-extern void r300FragmentProgramDump(
- struct r300_fragment_program *fp,
- struct r300_fragment_program_code *code);
+extern void r300FragmentProgramDump(union rX00_fragment_program_code *c);
#endif
r300->vtbl.SetupFragmentShaderTextures = r500SetupFragmentShaderTextures;
r300->vtbl.TranslateFragmentShader = r500TranslateFragmentShader;
r300->vtbl.FragmentProgramEmit = r500FragmentProgramEmit;
+ r300->vtbl.FragmentProgramDump = r500FragmentProgramDump;
} else {
r300->vtbl.SetupRSUnit = r300SetupRSUnit;
r300->vtbl.SetupPixelShader = r300SetupPixelShader;
r300->vtbl.SetupFragmentShaderTextures = r300SetupFragmentShaderTextures;
r300->vtbl.TranslateFragmentShader = r300TranslateFragmentShader;
r300->vtbl.FragmentProgramEmit = r300FragmentProgramEmit;
+ r300->vtbl.FragmentProgramDump = r300FragmentProgramDump;
}
}
}
}
-static void dump_program(struct r500_fragment_program_code *code);
-
void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
if (!r300->vtbl.FragmentProgramEmit(&compiler))
r300_fp->error = GL_TRUE;
- r300_fp->translated = GL_TRUE;
-
/* Subtle: Rescue any parameters that have been added during transformations */
_mesa_free_parameter_list(fp->Base.Parameters);
fp->Base.Parameters = compiler.program->Parameters;
compiler.program->Parameters = 0;
- _mesa_reference_program(ctx, &compiler.program, 0);
+ _mesa_reference_program(ctx, &compiler.program, NULL);
- r300UpdateStateParameters(ctx, _NEW_PROGRAM);
+ r300_fp->translated = GL_TRUE;
- if (RADEON_DEBUG & DEBUG_PIXEL) {
- if (!r300_fp->error) {
- _mesa_printf("Machine-readable code:\n");
- dump_program(&r300_fp->code.r500);
- }
- }
+ r300UpdateStateParameters(ctx, _NEW_PROGRAM);
+ if (r300_fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
+ r300->vtbl.FragmentProgramDump(&r300_fp->code);
}
update_params(ctx, fp);
return NULL;
}
-static void dump_program(struct r500_fragment_program_code *code)
+void r500FragmentProgramDump(union rX00_fragment_program_code *c)
{
-
+ struct r500_fragment_program_code *code = &c->r500;
fprintf(stderr, "R500 Fragment Program:\n--------\n");
int n;
extern GLboolean r500FragmentProgramEmit(struct r300_fragment_program_compiler *compiler);
+extern void r500FragmentProgramDump(union rX00_fragment_program_code *c);
#endif