mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
svga: document magic number of 8 render targets per batch
Grab the comments from commit message b84b7f19df to explain
what the code is doing.
This commit is contained in:
parent
dc21b36daf
commit
2182d2db28
1 changed files with 13 additions and 1 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue