diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2008-06-01 23:16:17 +1000 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-06-29 15:46:13 +1000 |
commit | 41cd9bddf77ea60f84a957e83ddf098818c95c41 (patch) | |
tree | a253e6adb7a81958f85311a99f7f4e49f6b7a6db | |
parent | 716c1cd2ecbc1e86c0fd747c9fa9e095ded5fd5d (diff) |
nv50: fucking horrible hack, I really hate G8x shaders..
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 0a43646923..1b192b897c 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -135,10 +135,18 @@ emit(struct nv50_pc *pc, unsigned op, struct nv50_reg *dst, struct nv50_reg *src0, struct nv50_reg *src1, struct nv50_reg *src2) { struct nv50_program *p = pc->p; - struct nv50_reg *tmp = NULL, *tmp2 = NULL; + struct nv50_reg *tmp0 = NULL, *tmp = NULL, *tmp2 = NULL; unsigned inst[2] = { 0, 0 }; /* Grr.. Fun restrictions on where attribs can be sourced from.. */ + if (src0 && (src0->type == P_CONST || src0->type == P_IMMD) && + (op == 0xc || op == 0xe)) { + tmp = src1; + src1 = src0; + src0 = tmp; + tmp = NULL; + } + if (src1 && src1->type == P_ATTR) { tmp = alloc_temp(pc, dst); emit(pc, 1, tmp, src1, NULL, NULL); @@ -243,6 +251,7 @@ emit(struct nv50_pc *pc, unsigned op, struct nv50_reg *dst, } } + if (tmp0) free_temp(pc, tmp0); if (tmp) free_temp(pc, tmp); if (tmp2) free_temp(pc, tmp2); |