summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2010-03-04 12:46:20 -0800
committerCorbin Simpson <[email protected]>2010-03-04 12:49:44 -0800
commit566390bedf4e5f24b5234e9dc08ecb1a6fd4d13b (patch)
tree65e538490408f5917e90fd7dafa80624a8e4fe5a
parent4c0c728b2a3c8ebee09ddacd1390be31b1a73e23 (diff)
r300g: Fix indexbuf upper limits.
Wine tends to pessimistically use ~0 for its max index, but r300s only can go up to 2^24-1, causing the kernel checker to freak out. Civ4 is marginally improved now. Still crashes, but not as bad.
-rw-r--r--src/gallium/drivers/r300/r300_render.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 770a92be74f..6c891029a56 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -273,9 +273,14 @@ static void r300_emit_draw_elements(struct r300_context *r300,
CS_LOCALS(r300);
assert((start * indexSize) % 4 == 0);
+ assert(count < (1 << 24));
+
+ DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n",
+ count, minIndex, maxIndex);
+
+ maxIndex = MIN2(maxIndex, ((1 << 24) - 1));
if (alt_num_verts) {
- assert(count < (1 << 24));
BEGIN_CS(16);
OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count);
} else {