summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/APIspec.xml4
-rw-r--r--src/mesa/main/bufferobj.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index 3d47624c7fd..83a32d8e355 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -1814,10 +1814,6 @@
<param name="target" type="GLenum"/>
<param name="access" type="GLenum"/>
</proto>
-
- <desc name="access">
- <value name="GL_WRITE_ONLY_OES"/>
- </desc>
</template>
<template name="UnmapBuffer" direction="get">
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index a5c2a7a1064..d800a4f0f96 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1135,20 +1135,29 @@ _mesa_MapBufferARB(GLenum target, GLenum access)
struct gl_buffer_object * bufObj;
GLbitfield accessFlags;
void *map;
+ bool valid_access;
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
switch (access) {
case GL_READ_ONLY_ARB:
accessFlags = GL_MAP_READ_BIT;
+ valid_access = _mesa_is_desktop_gl(ctx);
break;
case GL_WRITE_ONLY_ARB:
accessFlags = GL_MAP_WRITE_BIT;
+ valid_access = true;
break;
case GL_READ_WRITE_ARB:
accessFlags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
+ valid_access = _mesa_is_desktop_gl(ctx);
break;
default:
+ valid_access = false;
+ break;
+ }
+
+ if (!valid_access) {
_mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(access)");
return NULL;
}