diff options
author | Eric Anholt <eric@anholt.net> | 2009-08-03 17:12:43 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-09-04 14:12:35 -0700 |
commit | 217af32c2d6afab5e1907cc16fb4b6feb982abe7 (patch) | |
tree | 2e47479d8882fb459bc28bcd6290f0c17caf0563 | |
parent | 456a16491bc757af6ba9a98e5706a78f748e9a79 (diff) |
i965: Even if no VS inputs are set, still load some amount of URB as required.
See comment on Vertex URB Entry Read Length for VS_STATE.
This, combined with the previous three commits, fixes #22945.
(cherry picked from commit e340d4f9866db4bae391288e83a630a310b0dd2b)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_emit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 6792c3a34e..b95079a5d1 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -124,6 +124,11 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) reg++; } } + /* If there are no inputs, we'll still be reading one attribute's worth + * because it's required -- see urb_read_length setting. + */ + if (c->nr_inputs == 0) + reg++; /* Allocate outputs: TODO: could organize the non-position outputs * to go straight into message regs. @@ -201,6 +206,12 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) * vertex urb, so is half the amount: */ c->prog_data.urb_read_length = (c->nr_inputs + 1) / 2; + /* Setting this field to 0 leads to undefined behavior according to the + * the VS_STATE docs. Our VUEs will always have at least one attribute + * sitting in them, even if it's padding. + */ + if (c->prog_data.urb_read_length == 0) + c->prog_data.urb_read_length = 1; /* The VS VUEs are shared by VF (outputting our inputs) and VS, so size * them to fit the biggest thing they need to. |