[Mesa-dev] [PATCH 3/5] i965: Add perf debug for a corner case.

Eric Anholt eric at anholt.net
Mon Feb 4 19:31:51 PST 2013


There's some weird text I'd never noticed in the VBO spec suggesting
that we don't need to deal with misaligned data within buffers at all,
but I imagine apps all over the place would fail if we started relying
on that text.  Just warn the developer when they stumble over this.
---
 src/mesa/drivers/dri/i965/brw_draw_upload.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 29ec9bb..07f9f00 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -808,6 +808,9 @@ static void brw_upload_indices(struct brw_context *brw)
        * rebase it into a temporary.
        */
        if ((ib_type_size - 1) & offset) {
+          perf_debug("copying index buffer to a temporary to work around "
+                     "misaligned offset %d\n", offset);
+
           GLubyte *map = ctx->Driver.MapBufferRange(ctx,
                                                     offset,
                                                     ib_size,
-- 
1.7.10.4



More information about the mesa-dev mailing list