Mesa (master): mesa: Fix glGetVertexAttribI[u] iv now that we have real integer attribs.

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Nov 9 06:54:35 UTC 2012


Module: Mesa
Branch: master
Commit: c299f44782d7d7d6719fce622a121aad58856139
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c299f44782d7d7d6719fce622a121aad58856139

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Nov  7 20:29:40 2012 -0800

mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.

Since cf438f5375e242, we store actual integers for the attribute data.
We just need to reinterpret the GLfloat array as a GLint/GLuint array
so we can read the proper data.

Fixes oglconform's glsl-vertex-attrib/basic.VertexAttribI[1234][u]i
subtests (after fixing an unrelated bug in those test cases).

v2: Use the COPY_4V macro to be concise.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Marek Olšák <maraeo at gmail.com> [v1]

---

 src/mesa/main/varray.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 522f5a7..3974787 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -701,14 +701,10 @@ _mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params)
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-      const GLfloat *v =
+      const GLint *v = (const GLint *)
 	 get_current_attrib(ctx, index, "glGetVertexAttribIiv");
       if (v != NULL) {
-         /* XXX we don't have true integer-valued vertex attribs yet */
-         params[0] = (GLint) v[0];
-         params[1] = (GLint) v[1];
-         params[2] = (GLint) v[2];
-         params[3] = (GLint) v[3];
+         COPY_4V(params, v);
       }
    }
    else {
@@ -726,14 +722,10 @@ _mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params)
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-      const GLfloat *v =
+      const GLuint *v = (const GLuint *)
 	 get_current_attrib(ctx, index, "glGetVertexAttribIuiv");
       if (v != NULL) {
-         /* XXX we don't have true integer-valued vertex attribs yet */
-         params[0] = (GLuint) v[0];
-         params[1] = (GLuint) v[1];
-         params[2] = (GLuint) v[2];
-         params[3] = (GLuint) v[3];
+         COPY_4V(params, v);
       }
    }
    else {




More information about the mesa-commit mailing list