aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-06 19:27:25 +0100
committerMarc Haesen <marc@hc-consult.be>2012-01-06 19:27:25 +0100
commit7e9f4ea970e8f7008c212d7d3918a974eb0066da (patch)
tree92cf7fcdf6e8093e743346af2397f3caa17cffe3 /mesalib/src/mesa/main/bufferobj.c
parent9715b7fab0757c86e1bb151f3dce0b324bcff692 (diff)
downloadvcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.gz
vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.bz2
vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.zip
libX11 mesa pixman git update 6 jan 2012
Diffstat (limited to 'mesalib/src/mesa/main/bufferobj.c')
-rw-r--r--mesalib/src/mesa/main/bufferobj.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index cc6f6753d..462519895 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -184,7 +184,10 @@ buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target,
}
if (offset + size > bufObj->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "%s(size + offset > buffer size)", caller);
+ "%s(offset %lu + size %lu > buffer size %lu)", caller,
+ (unsigned long) offset,
+ (unsigned long) size,
+ (unsigned long) bufObj->Size);
return NULL;
}
if (_mesa_bufferobj_mapped(bufObj)) {
@@ -499,19 +502,20 @@ _mesa_copy_buffer_subdata(struct gl_context *ctx,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size)
{
- GLubyte *srcPtr, *dstPtr;
+ void *srcPtr, *dstPtr;
/* buffer should not already be mapped */
assert(!_mesa_bufferobj_mapped(src));
assert(!_mesa_bufferobj_mapped(dst));
- srcPtr = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, src->Size,
- GL_MAP_READ_BIT, src);
- dstPtr = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, dst->Size,
- GL_MAP_WRITE_BIT, dst);
+ srcPtr = ctx->Driver.MapBufferRange(ctx, readOffset, size,
+ GL_MAP_READ_BIT, src);
+ dstPtr = ctx->Driver.MapBufferRange(ctx, writeOffset, size,
+ (GL_MAP_WRITE_BIT |
+ GL_MAP_INVALIDATE_RANGE_BIT), dst);
if (srcPtr && dstPtr)
- memcpy(dstPtr + writeOffset, srcPtr + readOffset, size);
+ memcpy(dstPtr, srcPtr, size);
ctx->Driver.UnmapBuffer(ctx, src);
ctx->Driver.UnmapBuffer(ctx, dst);