How about this? I'm using it locally for nv40 immediate mode vertex emission.
--- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -236,6 +236,8 @@ enum pipe_transfer_usage { #define PIPE_BUFFER_USAGE_VERTEX (1 << 5) #define PIPE_BUFFER_USAGE_INDEX (1 << 6) #define PIPE_BUFFER_USAGE_CONSTANT (1 << 7) +#define PIPE_BUFFER_USAGE_DYNAMIC (1 << 8) +#define PIPE_BUFFER_USAGE_STREAM (1 << 9) /* * CPU access flags. --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -182,6 +182,16 @@ st_bufferobj_data(GLcontext *ctx, buffer_usage = 0; } + if (!(usage & 1)) // not READ + buffer_usage |= PIPE_BUFFER_USAGE_CPU_WRITE; + if (usage & 3) // READ or COPY + buffer_usage |= PIPE_BUFFER_USAGE_CPU_READ; + + if(usage >= GL_DYNAMIC_DRAW) + buffer_usage |= PIPE_BUFFER_USAGE_DYNAMIC; + else if(usage < GL_STATIC_DRAW) + buffer_usage |= PIPE_BUFFER_USAGE_STREAM; + pipe_buffer_reference( &st_obj->buffer, NULL ); if (size != 0) { ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev