aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-06-13 17:06:44 +0000
committerBrian Paul <[email protected]>2006-06-13 17:06:44 +0000
commit44b82dffe836b25d42c7a3d7b4e62d0eb7cc033f (patch)
tree0a880f448a2fe003ffca3e3dd5a1bad0dc3349cc /src
parent5c7c5a762e602b67e404e04db5ab429bdf2fce1a (diff)
In import_attrib(), use the from->Normalized flag to choose the right
translation function. Before this fix the 'normalized' flag to glVertexAttribPointerARB() was ignored.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/array_cache/ac_import.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c
index deae44ab726..3612a1e019b 100644
--- a/src/mesa/array_cache/ac_import.c
+++ b/src/mesa/array_cache/ac_import.c
@@ -185,6 +185,9 @@ reset_edgeflag( GLcontext *ctx )
}
+/**
+ * \param index the generic vertex array number.
+ */
static void
reset_attrib( GLcontext *ctx, GLuint index )
{
@@ -453,6 +456,9 @@ import_edgeflag( GLcontext *ctx, GLenum type, GLuint stride )
ac->IsCached.EdgeFlag = GL_TRUE;
}
+/**
+ * \param index the generic vertex array number
+ */
static void
import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride )
{
@@ -469,13 +475,24 @@ import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride )
ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
ASSERT(ac->count - ac->start < ctx->Const.MaxArrayLockSize);
- _math_trans_4f( (GLfloat (*)[4]) to->Ptr,
- from->Ptr,
- from->StrideB,
- from->Type,
- from->Size,
- 0,
- ac->count - ac->start);
+ if (from->Normalized) {
+ _math_trans_4fc( (GLfloat (*)[4]) to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ 0,
+ ac->count - ac->start);
+ }
+ else {
+ _math_trans_4f( (GLfloat (*)[4]) to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ 0,
+ ac->count - ac->start);
+ }
to->Size = from->Size;
to->StrideB = 4 * sizeof(GLfloat);
@@ -768,7 +785,10 @@ _ac_import_edgeflag( GLcontext *ctx,
}
}
-/* GL_NV_vertex_program */
+/**
+ * For GL_ARB/NV_vertex_program
+ * \param index index of the vertex array, starting at zero.
+ */
struct gl_client_array *
_ac_import_attrib( GLcontext *ctx,
GLuint index,