[Mesa-dev] [PATCH 1/3] i965: Add a warning if something ever hits a bug I noticed.

Eric Anholt eric at anholt.net
Tue Nov 5 17:35:20 PST 2013


We'd have to map the VBO and rewrite things to a lower stride to fix it.
---
 src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 4da1b7e..8b1f0c5 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -607,6 +607,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
 
 static void brw_emit_vertices(struct brw_context *brw)
 {
+   struct gl_context *ctx = &brw->ctx;
    GLuint i, nr_elements;
 
    brw_prepare_vertices(brw);
@@ -678,6 +679,9 @@ static void brw_emit_vertices(struct brw_context *brw)
          if (brw->gen == 7)
 	    dw0 |= GEN7_MOCS_L3 << 16;
 
+         WARN_ONCE(buffer->stride >= (brw->gen >= 5 ? 2048 : 2047),
+                   "VBO stride %d too large, bad rendering may occur\n",
+                   buffer->stride);
 	 OUT_BATCH(dw0 | (buffer->stride << BRW_VB0_PITCH_SHIFT));
 	 OUT_RELOC(buffer->bo, I915_GEM_DOMAIN_VERTEX, 0, buffer->offset);
 	 if (brw->gen >= 5) {
-- 
1.8.4.rc3



More information about the mesa-dev mailing list