i965: Add support for gen6 constant-index constant loading.
authorEric Anholt <eric@anholt.net>
Thu, 9 Dec 2010 17:36:17 +0000 (09:36 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 10 Dec 2010 04:25:34 +0000 (20:25 -0800)
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_vs_emit.c

index b20d88280f9ba45048d3a22e9bd220c8242a9dad..93ccdde44b5c755e490388c0a6beac2fa482dc11 100644 (file)
@@ -1708,9 +1708,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_compression_control(p, BRW_COMPRESSION_NONE);
@@ -1729,7 +1733,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,
index b7771e66d5910d8e136c9c330d72a7a1ea2d3a6d..eccc6b7584eb7d92805ba061cf7c559a53e7cab4 100644 (file)
@@ -1072,8 +1072,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;