aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-17 08:07:33 +0200
committermarha <marha@users.sourceforge.net>2012-10-17 08:07:33 +0200
commit856fbbaf1e53303d8307bfae1761f1ba96871f1e (patch)
treee029665439ddbccfb253271a5f5290d72c2b2168 /mesalib/src/mesa/main/bufferobj.c
parentf15a40afaf6d1b3a4841d25631f947da1b289f89 (diff)
parentded57b5a4131a213d57f5a20d50b819b7a8924df (diff)
downloadvcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.gz
vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.bz2
vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.zip
Merge remote-tracking branch 'origin/released'
* origin/released: pixman mesa git update 17 oct 2012
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 efb8df894..d6b886e8d 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 |