diff options
author | Eric Anholt <[email protected]> | 2012-07-26 15:10:04 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-29 15:09:36 -0700 |
commit | bb4a39ec951a696efa07a120c9446b677703abab (patch) | |
tree | 793d16ecf01a6f2caab64c6c067e3dc1203948b4 /src/mesa/main/teximage.c | |
parent | 1b86a91c643fdd4c3de1a2f5e84f94e812105766 (diff) |
mesa: Expose texture buffer objects when the context is GL 3.1 core.
v2: Use API_OPENGL_CORE.
v3: Only require desktop GL. If a driver can't support TexBOs in a non-core
context, it should not enable them.
Signed-off-by: Eric Anholt <[email protected]>
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 59b38dee4aa..94a8bb795fc 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -754,7 +754,8 @@ _mesa_select_tex_object(struct gl_context *ctx, case GL_PROXY_TEXTURE_2D_ARRAY_EXT: return arrayTex ? ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX] : NULL; case GL_TEXTURE_BUFFER: - return ctx->Extensions.ARB_texture_buffer_object + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.ARB_texture_buffer_object ? texUnit->CurrentTex[TEXTURE_BUFFER_INDEX] : NULL; case GL_TEXTURE_EXTERNAL_OES: return ctx->Extensions.OES_EGL_image_external @@ -947,9 +948,9 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target) ctx->Extensions.EXT_texture_array) ? ctx->Const.MaxTextureLevels : 0; case GL_TEXTURE_BUFFER: - return _mesa_is_desktop_gl(ctx) && - (ctx->Extensions.ARB_texture_buffer_object || - (ctx->Version >= 31)) ? 1 : 0; + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.ARB_texture_buffer_object + ? 1 : 0; case GL_TEXTURE_EXTERNAL_OES: /* fall-through */ default: @@ -3975,7 +3976,8 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.ARB_texture_buffer_object) { + if (!(ctx->Extensions.ARB_texture_buffer_object + && _mesa_is_desktop_gl(ctx))) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer"); return; } |