{
int i;
+ /* There are two memory usage counters in the winsys for all buffers
+ * that have been added (cs_add_reloc) and two counters in the pipe
+ * driver for those that haven't been added yet.
+ * */
+ if (!ctx->b.ws->cs_memory_below_limit(ctx->b.rings.gfx.cs, ctx->b.vram, ctx->b.gtt)) {
+ ctx->b.gtt = 0;
+ ctx->b.vram = 0;
+ ctx->b.rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
+ return;
+ }
+ ctx->b.gtt = 0;
+ ctx->b.vram = 0;
+
/* The number of dwords we already used in the CS so far. */
num_dw += ctx->b.rings.gfx.cs->cdw;
if (rtex->fmask.size && rtex->cmask.size) {
sctx->framebuffer.compressed_cb_mask |= 1 << i;
}
+ r600_context_add_resource_size(ctx, surf->base.texture);
}
/* Set the 16BPC export for possible dual-src blending. */
if (i == 1 && surf && surf->export_16bpc) {
if (!surf->depth_initialized) {
si_init_depth_surface(sctx, surf);
}
+ r600_context_add_resource_size(ctx, surf->base.texture);
}
si_update_fb_rs_state(sctx);
pipe_resource_reference(&dsti->buffer, src->buffer);
dsti->buffer_offset = src->buffer_offset;
dsti->stride = src->stride;
+ r600_context_add_resource_size(ctx, src->buffer);
}
} else {
for (i = 0; i < count; i++) {
if (ib) {
pipe_resource_reference(&sctx->index_buffer.buffer, ib->buffer);
memcpy(&sctx->index_buffer, ib, sizeof(*ib));
+ r600_context_add_resource_size(ctx, ib->buffer);
} else {
pipe_resource_reference(&sctx->index_buffer.buffer, NULL);
}