Mesa (7.10): i965: Add support for gen6 constant-index constant loading.

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 27 14:31:23 PST 2010


Module: Mesa
Branch: 7.10
Commit: 0bb9a3215ecf4c6e4ef30a1e206f05f8183ef131
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bb9a3215ecf4c6e4ef30a1e206f05f8183ef131

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Dec  9 09:36:17 2010 -0800

i965: Add support for gen6 constant-index constant loading.
(cherry picked from commit 15566183a64ef3f9940962a3b08b1c3469c98566)

---

 src/mesa/drivers/dri/i965/brw_eu_emit.c |   10 +++++++++-
 src/mesa/drivers/dri/i965/brw_vs_emit.c |    2 --
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index dda4057..6efdd6a 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -1718,9 +1718,13 @@ void brw_dp_READ_4_vs(struct brw_compile *p,
                       GLuint location,
                       GLuint bind_table_index)
 {
+   struct intel_context *intel = &p->brw->intel;
    struct brw_instruction *insn;
    GLuint msg_reg_nr = 1;
 
+   if (intel->gen >= 6)
+      location /= 16;
+
    /* Setup MRF[1] with location/offset into const buffer */
    brw_push_insn_state(p);
    brw_set_access_mode(p, BRW_ALIGN_1);
@@ -1740,7 +1744,11 @@ void brw_dp_READ_4_vs(struct brw_compile *p,
    insn->header.mask_control = BRW_MASK_DISABLE;
 
    brw_set_dest(p, insn, dest);
-   brw_set_src0(insn, brw_null_reg());
+   if (intel->gen >= 6) {
+      brw_set_src0(insn, brw_message_reg(msg_reg_nr));
+   } else {
+      brw_set_src0(insn, brw_null_reg());
+   }
 
    brw_set_dp_read_message(p->brw,
 			   insn,
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 4873083..2b86a87 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -1119,8 +1119,6 @@ get_constant(struct brw_vs_compile *c,
 
    assert(argIndex < 3);
 
-   assert(c->func.brw->intel.gen < 6); /* FINISHME */
-
    if (c->current_const[argIndex].index != src->Index) {
       /* Keep track of the last constant loaded in this slot, for reuse. */
       c->current_const[argIndex].index = src->Index;



More information about the mesa-commit mailing list