aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-17 08:04:15 +0200
committermarha <marha@users.sourceforge.net>2012-10-17 08:04:15 +0200
commitded57b5a4131a213d57f5a20d50b819b7a8924df (patch)
tree5be4cc93cf5d77df72f8ae6e34953e026bde071f /mesalib/src/mesa/main/bufferobj.c
parent54db46582aba2252d544fa3956522f9ef06b49cb (diff)
downloadvcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.tar.gz
vcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.tar.bz2
vcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.zip
pixman mesa git update 17 oct 2012
pixman: 6e56098c0338ce74228187e4c96fed1a66cb0956 mesa: 0199ff7fe323cf527ffacfdef3258ab85799dd13
Diffstat (limited to 'mesalib/src/mesa/main/bufferobj.c')
-rw-r--r--mesalib/src/mesa/main/bufferobj.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index d9afe37a0..ac6bbc56b 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -1312,20 +1312,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
*params = _mesa_bufferobj_mapped(bufObj);
return;
case GL_BUFFER_ACCESS_FLAGS:
- if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
- && !_mesa_is_gles3(ctx))
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = bufObj->AccessFlags;
return;
case GL_BUFFER_MAP_OFFSET:
- if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
- && !_mesa_is_gles3(ctx))
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = (GLint) bufObj->Offset;
return;
case GL_BUFFER_MAP_LENGTH:
- if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
- && !_mesa_is_gles3(ctx))
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = (GLint) bufObj->Length;
return;
@@ -1524,6 +1521,19 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
return NULL;
}
+ /* Page 38 of the PDF of the OpenGL ES 3.0 spec says:
+ *
+ * "An INVALID_OPERATION error is generated for any of the following
+ * conditions:
+ *
+ * * <length> is zero."
+ */
+ if (_mesa_is_gles(ctx) && length == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glMapBufferRange(length = 0)");
+ return NULL;
+ }
+
if (access & ~(GL_MAP_READ_BIT |
GL_MAP_WRITE_BIT |
GL_MAP_INVALIDATE_RANGE_BIT |