summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_draw.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-07-06 20:35:15 +1000
committerDave Airlie <airlied@redhat.com>2009-07-06 20:39:49 +1000
commitd66de6c341a859a30ef010c527f9a0c5865b5d65 (patch)
treecc1948b00a345d7165ecf482a4c63c28e44e28c4 /src/mesa/drivers/dri/r300/r300_draw.c
parent7266e33abd9723fcec47933ed9ff4132abbd6eba (diff)
radeon: ensure cmdbuf space for state + AOS is available
The problem is if we find out later we don't have any cmdbuf space but we've already written the arrays to the DMA buffer object, we end up emitting the current cmdbuf which has references to the current DMA object we then send that to the hw and we can't reference the arrays we just emitted to the old DMA buffer. things go bad, crash boom. This can probably be tuned further + swtcl probably needs some fixes
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_draw.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_draw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c
index 20fe8dbf17..fe8014b358 100644
--- a/src/mesa/drivers/dri/r300/r300_draw.c
+++ b/src/mesa/drivers/dri/r300/r300_draw.c
@@ -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)