diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index d19a2b02bd1..f15e8ee7879 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -1806,11 +1806,6 @@
-
-
-
-
-
@@ -1820,11 +1815,6 @@
-
-
-
-
-
@@ -1835,11 +1825,6 @@
-
-
-
-
-
@@ -1848,11 +1833,6 @@
-
-
-
-
-
@@ -1864,11 +1844,6 @@
-
-
-
-
-
@@ -1884,11 +1859,6 @@
-
-
-
-
-
@@ -1915,11 +1885,6 @@
-
-
-
-
-
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index df559821cc1..6cdf2116723 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -68,6 +68,12 @@ static struct gl_buffer_object DummyBufferObject;
static inline struct gl_buffer_object **
get_buffer_target(struct gl_context *ctx, GLenum target)
{
+ /* Other targets are only supported in desktop OpenGL and OpenGL ES 3.0.
+ */
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)
+ && target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER)
+ return NULL;
+
switch (target) {
case GL_ARRAY_BUFFER_ARB:
return &ctx->Array.ArrayBufferObj;
@@ -89,7 +95,8 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
break;
#endif
case GL_TEXTURE_BUFFER:
- if (ctx->Extensions.ARB_texture_buffer_object) {
+ if (_mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ARB_texture_buffer_object) {
return &ctx->Texture.BufferObject;
}
break;