aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-06 19:47:46 +0100
committerMarc Haesen <marc@hc-consult.be>2012-01-06 19:47:46 +0100
commit2d52fd67e716caae85bce150b01bc5c284b12de7 (patch)
tree2a641392a6affe99603cbaf169c1ab5173879d27 /mesalib/src/mesa/main/bufferobj.c
parentd515b895dc5151d102f33b577cafbf63473bbafa (diff)
parent7e9f4ea970e8f7008c212d7d3918a974eb0066da (diff)
downloadvcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.gz
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.bz2
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/link_uniforms.cpp mesalib/src/mesa/drivers/dri/common/drisw_util.c
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 9e6f56b14..63eb6faaa 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);