aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_curbe.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-05-20 11:54:26 -0700
committerKenneth Graunke <[email protected]>2014-07-02 12:45:58 -0700
commitccda1b9ba92d6644a61e646908a8c6e55e310f2e (patch)
tree405486212ce936867c199da4ff12fd5fe66f9d34 /src/mesa/drivers/dri/i965/brw_curbe.c
parent44c63bdd401df9bd4095f4f081e5ab48c9044ce6 (diff)
i965: Drop the memcmp for finding duplicated CURBE uploads.
At this point, the extra copy of the data and memcmp are as expensive as just re-uploading. Note: now that we'll always upload, and brw_constant_buffer watches BRW_NEW_BATCH anyway, we don't need to explicitly unref the old curbe_bo at batch reset time. No significant performance difference on glamor copywinwin10 (n=55), despite that test having a 98% hit rate on the cache. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_curbe.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index b776bdc8c8f..0db3b9419bb 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -188,11 +188,11 @@ brw_upload_constant_buffer(struct brw_context *brw)
gl_clip_plane *clip_planes;
if (sz == 0) {
- brw->curbe.last_bufsz = 0;
goto emit;
}
- buf = brw->curbe.next_buf;
+ buf = intel_upload_space(brw, bufsz, 64,
+ &brw->curbe.curbe_bo, &brw->curbe.curbe_offset);
/* fragment shader constants */
if (brw->curbe.wm_size) {
@@ -246,27 +246,6 @@ brw_upload_constant_buffer(struct brw_context *brw)
for (i = 0; i < sz*16; i+=4)
fprintf(stderr, "curbe %d.%d: %f %f %f %f\n", i/8, i&4,
buf[i+0], buf[i+1], buf[i+2], buf[i+3]);
-
- fprintf(stderr, "last_buf %p buf %p sz %d/%d cmp %d\n",
- brw->curbe.last_buf, buf,
- bufsz, brw->curbe.last_bufsz,
- brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1);
- }
-
- if (brw->curbe.curbe_bo != NULL &&
- bufsz == brw->curbe.last_bufsz &&
- memcmp(buf, brw->curbe.last_buf, bufsz) == 0) {
- /* constants have not changed */
- } else {
- /* Update the record of what our last set of constants was. We
- * don't just flip the pointers because we don't fill in the
- * data in the padding between the entries.
- */
- memcpy(brw->curbe.last_buf, buf, bufsz);
- brw->curbe.last_bufsz = bufsz;
-
- intel_upload_data(brw, buf, bufsz, 64,
- &brw->curbe.curbe_bo, &brw->curbe.curbe_offset);
}
/* Because this provokes an action (ie copy the constants into the