Add _tnl_set_attr() to complement existing get_attr() call.
This commit is contained in:
@@ -937,11 +937,31 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Else return the value from ctx->Current
|
/* Else return the value from ctx->Current -- dangerous???
|
||||||
*/
|
*/
|
||||||
_mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat));
|
_mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Complementary operation to the above.
|
||||||
|
*/
|
||||||
|
void _tnl_set_attr( GLcontext *ctx, void *vout,
|
||||||
|
GLenum attr, const GLfloat *src )
|
||||||
|
{
|
||||||
|
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
|
||||||
|
const struct tnl_clipspace_attr *a = vtx->attr;
|
||||||
|
int attr_count = vtx->attr_count;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
for (j = 0; j < attr_count; j++) {
|
||||||
|
if (a[j].attrib == (int)attr) {
|
||||||
|
a[j].insert[4-1]( &a[j], (GLubyte *)vout + a[j].vertoffset, src );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void *_tnl_get_vertex( GLcontext *ctx, GLuint nr )
|
void *_tnl_get_vertex( GLcontext *ctx, GLuint nr )
|
||||||
{
|
{
|
||||||
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
|
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
|
||||||
|
@@ -82,6 +82,12 @@ extern void _tnl_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc );
|
|||||||
extern void _tnl_get_attr( GLcontext *ctx, const void *vertex, GLenum attrib,
|
extern void _tnl_get_attr( GLcontext *ctx, const void *vertex, GLenum attrib,
|
||||||
GLfloat *dest );
|
GLfloat *dest );
|
||||||
|
|
||||||
|
/* Complementary to the above.
|
||||||
|
*/
|
||||||
|
extern void _tnl_set_attr( GLcontext *ctx, void *vout, GLenum attrib,
|
||||||
|
const GLfloat *src );
|
||||||
|
|
||||||
|
|
||||||
extern void *_tnl_get_vertex( GLcontext *ctx, GLuint nr );
|
extern void *_tnl_get_vertex( GLcontext *ctx, GLuint nr );
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user