diff options
author | Brian Paul <brianp@vmware.com> | 2009-05-21 15:57:29 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-05-21 16:10:45 -0600 |
commit | 254845fad064eabd92c7a72322e647137ec719e9 (patch) | |
tree | 575c11b2b28d67df5bce6f0099aa3a2254df656a /src | |
parent | 6a2211f00077f49af42e6f087e3120abfb1be5ae (diff) |
mesa: minor code simplification in _mesa_GetVertexAttribfvARB()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/arbprogram.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 317d623a22..98c2e3019a 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -302,6 +302,7 @@ _mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble *params) void GLAPIENTRY _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) { + const struct gl_client_array *array; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -310,21 +311,23 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) return; } + array = &ctx->Array.ArrayObj->VertexAttrib[index]; + switch (pname) { case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Enabled; + params[0] = (GLfloat) array->Enabled; break; case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Size; + params[0] = (GLfloat) array->Size; break; case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Stride; + params[0] = (GLfloat) array->Stride; break; case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type; + params[0] = (GLfloat) array->Type; break; case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB: - params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized; + params[0] = array->Normalized; break; case GL_CURRENT_VERTEX_ATTRIB_ARB: if (index == 0) { @@ -336,7 +339,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params) COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]); break; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; + params[0] = (GLfloat) array->BufferObj->Name; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribfvARB(pname)"); |