brw->prim_restart.enable_cut_index = false;
brw->gs.enabled = false;
- if (brw->gen < 6) {
- brw->curbe.last_buf = calloc(1, 4096);
- brw->curbe.next_buf = calloc(1, 4096);
- }
-
ctx->VertexProgram._MaintainTnlProgram = true;
ctx->FragmentProgram._MaintainTexEnvProgram = true;
drm_intel_bo_unreference(brw->curbe.curbe_bo);
- free(brw->curbe.last_buf);
- free(brw->curbe.next_buf);
-
drm_intel_gem_context_destroy(brw->hw_ctx);
if (ctx->swrast_context) {
drm_intel_bo *curbe_bo;
/** Offset within curbe_bo of space for current curbe entry */
GLuint curbe_offset;
-
- /**
- * Copy of the last set of CURBEs uploaded. Frequently we'll end up
- * in brw_curbe.c with the same set of constant data to be uploaded,
- * so we'd rather not upload new constants in that case (it can cause
- * a pipeline bubble since only up to 4 can be pipelined at a time).
- */
- GLfloat *last_buf;
- /**
- * Allocation for where to calculate the next set of CURBEs.
- * It's a hot enough path that malloc/free of that data matters.
- */
- GLfloat *next_buf;
- GLuint last_bufsz;
} curbe;
/**
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) {
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