From e759a44442fcbc0e715b2dadb8cc748c02ee39b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 19 Sep 2011 21:25:48 +0200 Subject: [PATCH] upload-debug --- src/gallium/auxiliary/util/u_upload_mgr.c | 5 ++++- src/gallium/auxiliary/util/u_vbuf_mgr.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index 71fe53e..f0882a5 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -36,7 +36,7 @@ #include "util/u_math.h" #include "u_upload_mgr.h" - +#include struct u_upload_mgr { struct pipe_context *pipe; @@ -189,6 +189,9 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload, &upload->transfer); } + if (offset >= upload->buffer->width0) + fprintf(stderr, "%s:%i: min_out_offset = %u, size = %u, alloc_size = %u, alloc_offset = %u, upload->offset = %u, upload->size = %u, upload->buffer->width0 = %u, offset = %u\n", + __func__, __LINE__, min_out_offset, size, alloc_size, alloc_offset, upload->offset, upload->size, upload->buffer->width0, offset); assert(offset < upload->buffer->width0); assert(offset + size <= upload->buffer->width0); assert(size); diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c index d9b39e5..109b370 100644 --- a/src/gallium/auxiliary/util/u_vbuf_mgr.c +++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c @@ -33,6 +33,7 @@ #include "util/u_upload_mgr.h" #include "translate/translate.h" #include "translate/translate_cache.h" +#include struct u_vbuf_mgr_elements { unsigned count; @@ -232,6 +233,7 @@ u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr, /* Create and map the output buffer. */ num_verts = max_index + 1 - min_index; + fprintf(stderr, "%s\n", __func__); u_upload_alloc(mgr->b.uploader, key.output_stride * min_index, key.output_stride * num_verts, @@ -538,6 +540,7 @@ u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr, size = mgr->ve->native_format_size[i]; } + fprintf(stderr, "%s\n", __func__); u_upload_data(mgr->b.uploader, first, size, u_vbuf_resource(vb->buffer)->user_ptr + first, &vb->buffer_offset, -- 1.7.4.1