Left unchecked, an app that just did an endless series of draws could
result in VSC buffer sizes >4GB, which doesn't work out well.
This limit is semi-arbitrary (ie. it is lower than hw limit, but 32*8MB
seems a bit excessive and not a limit that you'd hit in the real world).
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8842>
return;
}
+ /* Place a reasonable upper bound on prim/draw stream buffer size: */
+ const unsigned limit_bits = 8 * 8 * 1024 * 1024;
+ if ((batch->prim_strm_bits > limit_bits) || (batch->draw_strm_bits > limit_bits)) {
+ fd_batch_flush(batch);
+ return;
+ }
+
if (fd_device_version(batch->ctx->screen->dev) >= FD_VERSION_UNLIMITED_CMDS)
return;