.IsNativeSwizzle = &r500FPIsNativeSwizzle,
.BuildSwizzle = &r500FPBuildSwizzle
};
- radeonNqssaDce(c->ctx, c->program, &nqssadce);
+ radeonNqssaDce(c->program, &nqssadce, 0);
} else {
struct radeon_nqssadce_descr nqssadce = {
.Init = &nqssadce_init,
.IsNativeSwizzle = &r300FPIsNativeSwizzle,
.BuildSwizzle = &r300FPBuildSwizzle
};
- radeonNqssaDce(c->ctx, c->program, &nqssadce);
+ radeonNqssaDce(c->program, &nqssadce, 0);
}
if (c->debug) {
if (inst->Opcode != OPCODE_KIL) {
struct register_state *regstate = get_reg_state(s, inst->DstReg.File, inst->DstReg.Index);
if (!regstate) {
- _mesa_problem(s->Ctx, "NqssaDce: bad destination register (%i[%i])\n",
+ fprintf(stderr, "r300 driver: NqssaDce: bad destination register (%i[%i])\n",
inst->DstReg.File, inst->DstReg.Index);
return;
}
inst = track_used_srcreg(s, inst, 0, 0xb);
break;
default:
- _mesa_problem(s->Ctx, "NqssaDce: Unknown opcode %d\n", inst->Opcode);
+ fprintf(stderr, "r300 driver: NqssaDce: Unknown opcode %d\n", inst->Opcode);
return;
}
}
p->OutputsWritten = OutputsWritten;
}
-void radeonNqssaDce(GLcontext *ctx, struct gl_program *p, struct radeon_nqssadce_descr* descr)
+void radeonNqssaDce(struct gl_program *p, struct radeon_nqssadce_descr* descr, void * data)
{
struct nqssadce_state s;
_mesa_bzero(&s, sizeof(s));
- s.Ctx = ctx;
s.Program = p;
s.Descr = descr;
+ s.UserData = data;
s.Descr->Init(&s);
s.IP = p->NumInstructions;
* read from, etc.
*/
struct nqssadce_state {
- GLcontext *Ctx;
struct gl_program *Program;
struct radeon_nqssadce_descr *Descr;
struct register_state Temps[MAX_PROGRAM_TEMPS];
struct register_state Outputs[VERT_RESULT_MAX];
struct register_state Address;
+
+ void * UserData;
};
* The transformation will work recursively on the emitted instruction(s).
*/
void (*BuildSwizzle)(struct nqssadce_state*, struct prog_dst_register dst, struct prog_src_register src);
-
- void *Data;
};
-void radeonNqssaDce(GLcontext *ctx, struct gl_program *p, struct radeon_nqssadce_descr* descr);
+void radeonNqssaDce(struct gl_program *p, struct radeon_nqssadce_descr* descr, void * data);
struct prog_src_register lmul_swizzle(GLuint swizzle, struct prog_src_register srcreg);
#endif /* __RADEON_PROGRAM_NQSSADCE_H_ */
static void nqssadceInit(struct nqssadce_state* s)
{
- r300ContextPtr r300 = R300_CONTEXT(s->Ctx);
+ r300ContextPtr r300 = (r300ContextPtr)(s->UserData);
GLuint fp_reads;
fp_reads = r300->selected_fp->Base->InputsRead;
.IsNativeSwizzle = &swizzleIsNative,
.BuildSwizzle = NULL
};
- radeonNqssaDce(ctx, prog, &nqssadce);
+ radeonNqssaDce(prog, &nqssadce, r300);
/* We need this step for reusing temporary registers */
_mesa_optimize_program(ctx, prog);