summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_context.c4
-rw-r--r--src/gallium/drivers/svga/svga_context.h5
-rw-r--r--src/gallium/drivers/svga/svga_state_framebuffer.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index 73233957f36..c3de12b4a39 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -230,7 +230,9 @@ void svga_context_flush( struct svga_context *svga,
struct pipe_fence_handle **pfence )
{
struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
-
+
+ svga->curr.nr_fbs = 0;
+
/* Unmap upload manager buffers:
*/
u_upload_flush(svga->upload_vb);
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 9a3e92fd8d1..e650a251d19 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -191,6 +191,11 @@ struct svga_state
struct pipe_framebuffer_state framebuffer;
float depthscale;
+ /* Hack to limit the number of different render targets between
+ * flushes. Helps avoid blowing out our surface cache in EXA.
+ */
+ int nr_fbs;
+
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
struct pipe_blend_color blend_color;
diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index 7d7f93d8e3c..cfdcae4ee4a 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -54,6 +54,9 @@ static int emit_framebuffer( struct svga_context *svga,
for(i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
if (curr->cbufs[i] != hw->cbufs[i]) {
+ if (svga->curr.nr_fbs++ > 8)
+ return PIPE_ERROR_OUT_OF_MEMORY;
+
ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_COLOR0 + i, curr->cbufs[i]);
if (ret != PIPE_OK)
return ret;