aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-20 08:33:45 +0200
committermarha <marha@users.sourceforge.net>2012-09-20 08:33:45 +0200
commit210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282 (patch)
tree906904bdff9c33a3f9ded24ba8c89488469c5d94 /mesalib/src
parent821b51e814fe14d35f3807c525e4387022b9ed80 (diff)
parent06d4ea68085558b94d8e9c937091e7b7fcc5d95a (diff)
downloadvcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.tar.gz
vcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.tar.bz2
vcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libxcb xserver pixman mesa git update 20 sep 2012 Conflicts: libxcb/src/xcb_conn.c
Diffstat (limited to 'mesalib/src')
-rw-r--r--mesalib/src/mesa/program/register_allocate.c15
-rw-r--r--mesalib/src/mesa/program/register_allocate.h4
2 files changed, 17 insertions, 2 deletions
diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c
index f08c9d28d..97d4e331c 100644
--- a/mesalib/src/mesa/program/register_allocate.c
+++ b/mesalib/src/mesa/program/register_allocate.c
@@ -255,9 +255,11 @@ ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int r)
/**
* Must be called after all conflicts and register classes have been
* set up and before the register set is used for allocation.
+ * To avoid costly q value computation, use the q_values paramater
+ * to pass precomputed q values to this function.
*/
void
-ra_set_finalize(struct ra_regs *regs)
+ra_set_finalize(struct ra_regs *regs, unsigned int **q_values)
{
unsigned int b, c;
@@ -265,6 +267,15 @@ ra_set_finalize(struct ra_regs *regs)
regs->classes[b]->q = ralloc_array(regs, unsigned int, regs->class_count);
}
+ if (q_values) {
+ for (b = 0; b < regs->class_count; b++) {
+ for (c = 0; c < regs->class_count; c++) {
+ regs->classes[b]->q[c] = q_values[b][c];
+ }
+ }
+ return;
+ }
+
/* Compute, for each class B and C, how many regs of B an
* allocation to C could conflict with.
*/
@@ -490,6 +501,8 @@ ra_get_node_reg(struct ra_graph *g, unsigned int n)
* input data). These nodes do not end up in the stack during
* ra_simplify(), and thus at ra_select() time it is as if they were
* the first popped off the stack and assigned their fixed locations.
+ * Nodes that use this function do not need to be assigned a register
+ * class.
*
* Must be called before ra_simplify().
*/
diff --git a/mesalib/src/mesa/program/register_allocate.h b/mesalib/src/mesa/program/register_allocate.h
index 00b851ec2..2a9d61191 100644
--- a/mesalib/src/mesa/program/register_allocate.h
+++ b/mesalib/src/mesa/program/register_allocate.h
@@ -43,7 +43,9 @@ void ra_add_reg_conflict(struct ra_regs *regs,
void ra_add_transitive_reg_conflict(struct ra_regs *regs,
unsigned int base_reg, unsigned int reg);
void ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int reg);
-void ra_set_finalize(struct ra_regs *regs);
+void ra_set_num_conflicts(struct ra_regs *regs, unsigned int class_a,
+ unsigned int class_b, unsigned int num_conflicts);
+void ra_set_finalize(struct ra_regs *regs, unsigned int **conflicts);
/** @} */
/** @{ Interference graph setup.