summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-01-01 17:50:02 -0700
committerBrian Paul <[email protected]>2010-01-02 10:32:37 -0700
commit1fbc71937f7da1339c4a456b0bac48881b7e2b7c (patch)
treec7fbc01449a03cd3f0bb9d457535d11fa2d984f4 /src
parent52eb3e4235cc661ab9626a704c555a5f096c628a (diff)
mesa: added _mesa_GetBufferParameteri64v()
This is a new function in GL 3.2. No dispatch for this function yet.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/bufferobj.c42
-rw-r--r--src/mesa/main/bufferobj.h3
2 files changed, 45 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 52c4995b0ad..9e765b21d2f 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1389,6 +1389,48 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
}
+/**
+ * New in GL 3.2
+ * This is pretty much a duplicate of GetBufferParameteriv() but the
+ * GL_BUFFER_SIZE_ARB attribute will be 64-bits on a 64-bit system.
+ */
+void GLAPIENTRY
+_mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_buffer_object *bufObj;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ bufObj = get_buffer(ctx, target);
+ if (!bufObj) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "GetBufferParameteri64v(target)" );
+ return;
+ }
+ if (!_mesa_is_bufferobj(bufObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "GetBufferParameteri64v" );
+ return;
+ }
+
+ switch (pname) {
+ case GL_BUFFER_SIZE_ARB:
+ *params = bufObj->Size;
+ break;
+ case GL_BUFFER_USAGE_ARB:
+ *params = bufObj->Usage;
+ break;
+ case GL_BUFFER_ACCESS_ARB:
+ *params = simplified_access_mode(bufObj->AccessFlags);
+ break;
+ case GL_BUFFER_MAPPED_ARB:
+ *params = _mesa_bufferobj_mapped(bufObj);
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameteri64v(pname)");
+ return;
+ }
+}
+
+
void GLAPIENTRY
_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
{
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 9f732ec0c07..2931962ac08 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -155,6 +155,9 @@ extern void GLAPIENTRY
_mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params);
extern void GLAPIENTRY
+_mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
+
+extern void GLAPIENTRY
_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params);
extern void GLAPIENTRY