aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs_emit.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-04-27 09:51:46 -0600
committerBrian Paul <[email protected]>2009-04-27 09:51:46 -0600
commitdc9705d12d162ba6d087eb762e315de9f97bc456 (patch)
tree0e81e37c6c2e21456e16e892c877a448545e0ac6 /src/mesa/drivers/dri/i965/brw_vs_emit.c
parent5250eec652af46d20261624fd043992355a0b4ba (diff)
i965: only upload constant buffer data when we actually need the const buffer
Make the use_const_buffer field per-program and only call the code which updates the constant buffer's data if the flag is set. This should undo the perf regression from 20f3497e4b6756e330f7b3f54e8acaa1d6c92052
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs_emit.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 524f1211cee..b69616d6e52 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -71,10 +71,10 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
#if 0
if (c->vp->program.Base.Parameters->NumParameters >= 6)
- c->use_const_buffer = 1;
+ c->vp->use_const_buffer = 1;
else
#endif
- c->use_const_buffer = GL_FALSE;
+ c->vp->use_const_buffer = GL_FALSE;
/*printf("use_const_buffer = %d\n", c->use_const_buffer);*/
/* r0 -- reserved as usual
@@ -96,7 +96,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
/* Vertex program parameters from curbe:
*/
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
/* get constants from a real constant buffer */
c->prog_data.curb_read_length = 0;
c->prog_data.nr_params = 4; /* XXX 0 causes a bug elsewhere... */
@@ -172,7 +172,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
reg++;
}
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
for (i = 0; i < 3; i++) {
c->current_const[i].index = -1;
c->current_const[i].reg = brw_vec8_grf(reg, 0);
@@ -869,7 +869,7 @@ get_src_reg( struct brw_vs_compile *c,
case PROGRAM_STATE_VAR:
case PROGRAM_CONSTANT:
case PROGRAM_UNIFORM:
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
return get_constant(c, inst, argIndex);
}
else if (relAddr) {