aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/shader/program.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-03-07 16:00:29 +0000
committermarha <marha@users.sourceforge.net>2010-03-07 16:00:29 +0000
commitb40894093babb10f3cd155f11ff2d6c710372395 (patch)
treee6e94e5aa39ca9d5a653af567145e4b5dda25d61 /mesalib/src/mesa/shader/program.c
parentd27419efcdaaccb40e0f10c549a6b732a2f29e81 (diff)
parent14b1cb8d5a27ec9716d3f790fce95f0469e35605 (diff)
downloadvcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.tar.gz
vcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.tar.bz2
vcxsrv-b40894093babb10f3cd155f11ff2d6c710372395.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/shader/program.c')
-rw-r--r--mesalib/src/mesa/shader/program.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/mesalib/src/mesa/shader/program.c b/mesalib/src/mesa/shader/program.c
index 2cd6eb8a3..6b8d94e66 100644
--- a/mesalib/src/mesa/shader/program.c
+++ b/mesalib/src/mesa/shader/program.c
@@ -351,13 +351,6 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
_mesa_free_parameter_list(prog->Attributes);
}
- /* XXX this is a little ugly */
- if (prog->Target == GL_VERTEX_PROGRAM_ARB) {
- struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog;
- if (vprog->TnlData)
- _mesa_free(vprog->TnlData);
- }
-
_mesa_free(prog);
}
@@ -813,9 +806,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile)
const struct prog_instruction *inst = prog->Instructions + i;
const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
- for (k = 0; k < n; k++) {
- if (inst->SrcReg[k].File == regFile) {
- used[inst->SrcReg[k].Index] = GL_TRUE;
+ /* check dst reg first */
+ if (inst->DstReg.File == regFile) {
+ used[inst->DstReg.Index] = GL_TRUE;
+ }
+ else {
+ /* check src regs otherwise */
+ for (k = 0; k < n; k++) {
+ if (inst->SrcReg[k].File == regFile) {
+ used[inst->SrcReg[k].Index] = GL_TRUE;
+ break;
+ }
}
}
}