Fixes GL_OUT_OF_MEMORY from streaming-texture-leak (and will hopefully
keep piglit from ooming on my no-swap platform, as well).
*/
struct set *bos;
+ /** Sum of the sizes of the BOs referenced by the job. */
+ uint32_t referenced_size;
+
struct set *write_prscs;
/* Size of the submit.bo_handles array. */
vc5_job_add_bo(job, rsc->bo);
}
+ if (job->referenced_size > 768 * 1024 * 1024) {
+ perf_debug("Flushing job with %dkb to try to free up memory\n",
+ job->referenced_size / 1024);
+ vc5_flush(pctx);
+ }
+
if (V3D_DEBUG & V3D_DEBUG_ALWAYS_FLUSH)
vc5_flush(pctx);
}
vc5_bo_reference(bo);
_mesa_set_add(job->bos, bo);
+ job->referenced_size += bo->size;
uint32_t *bo_handles = (void *)(uintptr_t)job->submit.bo_handles;