radeon: ensure cmdbuf space for state + AOS is available
[mesa.git] / src / mesa / drivers / dri / r300 / r300_draw.c
index 20fe8dbf17f7290048e70946e7e4bd6cf8c87e3b..fe8014b35883b776a1c99e32246c83df59f4a730 100644 (file)
@@ -417,6 +417,12 @@ static GLboolean r300TryDrawPrims(GLcontext *ctx,
 
        r300FixupIndexBuffer(ctx, ib, bo, &nr_bo);
 
+       /* ensure we have the cmd buf space in advance to cover
+        * the state + DMA AOS pointers */
+       rcommonEnsureCmdBufSpace(&r300->radeon,
+                           r300->radeon.hw.max_state_size + (50*sizeof(int)),
+                           __FUNCTION__);
+
        r300SetVertexFormat(ctx, arrays, max_index + 1, bo, &nr_bo);
 
        if (r300->fallback)