diff options
author | Marek Olšák <[email protected]> | 2012-10-30 14:44:22 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-11-06 01:13:48 +0100 |
commit | acf438f5375e2426386694e541b843dc6f8fd11a (patch) | |
tree | 6aaa04f8419661892a74168d144537905efac8a2 /src/mesa/vbo/vbo_exec_draw.c | |
parent | a196f43596f6cb85a8f3e446596a2fb8e0ee7872 (diff) |
vbo: fix glVertexAttribI* functions
The functions were broken, because they converted ints to floats.
Now we can finally advertise OpenGL 3.0. ;)
In this commit, the vbo module also tracks the type for each attrib
in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT.
The little ugliness is the vertex attribs are declared as floats even though
there may be integer values. The code just copies integer values into them
without any conversion.
This implementation passes the glVertexAttribI piglit test which I am going
to commit in piglit soon. The test covers vertex arrays, immediate mode and
display lists.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <[email protected]>
v2: cosmetic changes as suggested by Brian
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 817af4dd52b..9529ce0698e 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -207,9 +207,6 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) assert(0); } - /* Make all active attributes (including edgeflag) available as - * arrays of floats. - */ for (attr = 0; attr < VERT_ATTRIB_MAX ; attr++) { const GLuint src = map[attr]; @@ -235,7 +232,9 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) arrays[attr].Size = exec->vtx.attrsz[src]; arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); - arrays[attr].Type = GL_FLOAT; + arrays[attr].Type = exec->vtx.attrtype[src]; + arrays[attr].Integer = + vbo_attrtype_to_integer_flag(exec->vtx.attrtype[src]); arrays[attr].Format = GL_RGBA; arrays[attr].Enabled = 1; arrays[attr]._ElementSize = arrays[attr].Size * sizeof(GLfloat); |