summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaciej Cencora <m.cencora@gmail.com>2009-04-18 04:00:51 +0200
committerDave Airlie <airlied@linux.ie>2009-04-19 22:14:53 +1000
commit155cc1647fb7ec488fb1d93ba68bc2523ffee381 (patch)
treee103fab1a316b2657e24f0733169130e2b8d07f5 /src
parent97104c255942ee781777818633ca6c17b4fea312 (diff)
r300: more prepare for merge
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h1
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c10
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.h5
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c2
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c21
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.h1
6 files changed, 17 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 41417f3122..904218fde2 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -616,6 +616,7 @@ struct r300_vtable {
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);
};
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index d58b092122..a8b885a4c6 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -464,19 +464,19 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
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;
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h
index 631e40913c..5c2cb312af 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.h
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.h
@@ -114,9 +114,6 @@ extern void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_progr
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
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 95380a2870..64b462bc90 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -2584,11 +2584,13 @@ void r300InitShaderFunctions(r300ContextPtr r300)
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;
}
}
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c
index 3e21e0f497..3b45eee537 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.c
@@ -435,8 +435,6 @@ static void build_state(
}
}
-static void dump_program(struct r500_fragment_program_code *code);
-
void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
@@ -494,24 +492,19 @@ void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
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);
@@ -615,9 +608,9 @@ static char *to_texop(int val)
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;
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.h b/src/mesa/drivers/dri/r300/r500_fragprog.h
index 4e72ef7aac..5bda0d1d0d 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.h
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.h
@@ -49,4 +49,5 @@ extern void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_progr
extern GLboolean r500FragmentProgramEmit(struct r300_fragment_program_compiler *compiler);
+extern void r500FragmentProgramDump(union rX00_fragment_program_code *c);
#endif