diff options
author | Ian Romanick <[email protected]> | 2012-07-25 15:29:48 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-24 19:13:18 -0700 |
commit | b0b6b76d5213587250c567d7ca62451813a10366 (patch) | |
tree | af65d2e69e43424148a406de46fb832478db5671 /src/mesa/main/bufferobj.c | |
parent | e2cf14d7b273657cce364236cd041c4ca3f94a6b (diff) |
mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r-- | src/mesa/main/bufferobj.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; |