summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-11-07 16:57:23 -0700
committerBrian Paul <brianp@vmware.com>2013-11-11 08:12:18 -0700
commit2182d2db28e9ae5c276dcbad1309cf3484a4476e (patch)
tree5b11e50266e46e9082551aff5f86e595949872a7 /src/gallium
parentdc21b36daf9037f0747071e124b73f48ea5ff117 (diff)
svga: document magic number of 8 render targets per batch
Grab the comments from commit message b84b7f19dfdc0 to explain what the code is doing.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_state_framebuffer.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index 8232c328233..42544047bdc 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -33,6 +33,18 @@
#include "svga_debug.h"
+/*
+ * flush our command buffer after the 8th distinct render target
+ *
+ * This helps improve the surface cache behaviour in the face of the
+ * large number of single-use render targets generated by EXA and the xorg
+ * state tracker. Without this we can reference hundreds of individual
+ * render targets from a command buffer, which leaves little scope for
+ * sharing or reuse of those targets.
+ */
+#define MAX_RT_PER_BATCH 8
+
+
/***********************************************************************
* Hardware state update
*/
@@ -56,7 +68,7 @@ emit_framebuffer( struct svga_context *svga,
for(i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
if (curr->cbufs[i] != hw->cbufs[i] ||
(reemit && hw->cbufs[i])) {
- if (svga->curr.nr_fbs++ > 8)
+ if (svga->curr.nr_fbs++ > MAX_RT_PER_BATCH)
return PIPE_ERROR_OUT_OF_MEMORY;
ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_COLOR0 + i, curr->cbufs[i]);