nv50: RCP and RSQ cannot load from VP inputs
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 24 Sep 2009 15:24:48 +0000 (17:24 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 25 Sep 2009 09:01:45 +0000 (11:01 +0200)
src/gallium/drivers/nv50/nv50_program.c

index 2ad8cdf65c39e4fcd4043b000b93c298895e7250..272fd8d90ba93d57271347d0f48f8e84bf0cfb1a 100644 (file)
@@ -573,6 +573,22 @@ check_swap_src_0_1(struct nv50_pc *pc,
        return FALSE;
 }
 
+static void
+set_src_0_restricted(struct nv50_pc *pc, struct nv50_reg *src,
+                    struct nv50_program_exec *e)
+{
+       struct nv50_reg *temp;
+
+       if (src->type != P_TEMP) {
+               temp = temp_temp(pc);
+               emit_mov(pc, temp, src);
+               src = temp;
+       }
+
+       alloc_reg(pc, src);
+       e->inst[0] |= (src->hw << 9);
+}
+
 static void
 set_src_0(struct nv50_pc *pc, struct nv50_reg *src, struct nv50_program_exec *e)
 {
@@ -775,7 +791,11 @@ emit_flop(struct nv50_pc *pc, unsigned sub,
        }
 
        set_dst(pc, dst, e);
-       set_src_0(pc, src, e);
+
+       if (sub == 0 || sub == 2)
+               set_src_0_restricted(pc, src, e);
+       else
+               set_src_0(pc, src, e);
 
        emit(pc, e);
 }