Mesa (master): i965: Make sure the VS URB size is big enough to fit a VF VUE.

Eric Anholt anholt at kemper.freedesktop.org
Tue Aug 4 00:19:42 UTC 2009


Module: Mesa
Branch: master
Commit: e93848e595176ae0bad3bfe64e0ca63fd089bb72
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e93848e595176ae0bad3bfe64e0ca63fd089bb72

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Aug  3 15:24:02 2009 -0700

i965: Make sure the VS URB size is big enough to fit a VF VUE.

This fix is just from code and docs inspection, but it may fix hangs on
some applications.

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 514f15d..d27b1c8 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -68,6 +68,7 @@ static void release_tmps( struct brw_vs_compile *c )
 static void brw_vs_alloc_regs( struct brw_vs_compile *c )
 {
    GLuint i, reg = 0, mrf;
+   int attributes_in_vue;
 
    /* Determine whether to use a real constant buffer or use a block
     * of GRF registers for constants.  The later is faster but only
@@ -221,10 +222,15 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
     */
    c->prog_data.urb_read_length = (c->nr_inputs + 1) / 2;
 
+   /* The VS VUEs are shared by VF (outputting our inputs) and VS, so size
+    * them to fit the biggest thing they need to.
+    */
+   attributes_in_vue = MAX2(c->nr_outputs, c->nr_inputs);
+
    if (BRW_IS_IGDNG(c->func.brw))
-       c->prog_data.urb_entry_size = (c->nr_outputs + 6 + 3) / 4;
+       c->prog_data.urb_entry_size = (attributes_in_vue + 6 + 3) / 4;
    else
-       c->prog_data.urb_entry_size = (c->nr_outputs + 2 + 3) / 4;
+       c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4;
 
    c->prog_data.total_grf = reg;
 




More information about the mesa-commit mailing list