summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2011-09-19 18:25:54 +0800
committerJosé Fonseca <jose.r.fonseca@gmail.com>2012-03-01 08:15:36 +0000
commit9f44387e4868e90044750c7183fcd4cfb107621f (patch)
tree60c1e5d2e1e056ec350791d1cd49e596e3c9aafb
parent16cc79f975816c0741711560be48fc498d4b4794 (diff)
mesa: let GL3 buf obj queries not depend on opengl major version
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 <yuanhan.liu@linux.intel.com> Signed-off-by: José Fonseca <jfonseca@vmware.com> Acked-by: Brian Paul <brianp@vmware.com> Acked-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/mesa/main/bufferobj.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index a2959a82108..4b27e061637 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1159,17 +1159,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;
@@ -1210,7 +1210,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;
@@ -1218,12 +1218,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;