From ffee498fb848b253a7833373fe5430f8c7ca0c5f Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Mon, 19 Sep 2011 18:25:54 +0800 Subject: [PATCH] mesa: let GL3 buf obj queries not depend on opengl major version MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While the ARB_map_buffer_range extension spec says nothing about these queries -- they were added in GL 3.0 --, it seems like this could be an error in the extension spec. This is one of the extensions, like ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to previous versions. These extensions are supposed to provide identical functionality to OpenGL 3.0. The other cases of mismatches have been determined to be bugs in the extension specs. And tools like apitrace rely on such queries to function properly. Signed-off-by: Yuanhan Liu Signed-off-by: José Fonseca Acked-by: Brian Paul Acked-by: Ian Romanick --- src/mesa/main/bufferobj.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 2483f1905a5..eef10c42213 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1172,17 +1172,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params) *params = _mesa_bufferobj_mapped(bufObj); return; case GL_BUFFER_ACCESS_FLAGS: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = bufObj->AccessFlags; return; case GL_BUFFER_MAP_OFFSET: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = (GLint) bufObj->Offset; return; case GL_BUFFER_MAP_LENGTH: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = (GLint) bufObj->Length; return; @@ -1223,7 +1223,7 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params) *params = simplified_access_mode(bufObj->AccessFlags); return; case GL_BUFFER_ACCESS_FLAGS: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = bufObj->AccessFlags; return; @@ -1231,12 +1231,12 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params) *params = _mesa_bufferobj_mapped(bufObj); return; case GL_BUFFER_MAP_OFFSET: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = bufObj->Offset; return; case GL_BUFFER_MAP_LENGTH: - if (ctx->VersionMajor < 3) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = bufObj->Length; return; -- 2.30.2