diff options
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_buffer.c')
| -rw-r--r-- | src/VBox/GuestHost/OpenGL/packer/pack_buffer.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c b/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c index 48d1250a..d4ddaf5f 100644 --- a/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c +++ b/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c @@ -149,7 +149,11 @@ void crPackResetPointers( CRPackContext *pc ) const GLboolean canBarf = pc->buffer.canBarf; CRPackBuffer *buf = pc->currentBuffer; CRASSERT(buf); - crPackInitBuffer( buf, buf->pack, buf->size, buf->mtu ); + crPackInitBuffer( buf, buf->pack, buf->size, buf->mtu +#ifdef IN_RING0 + , 0 +#endif + ); pc->buffer.geometry_only = geom_only; /* restore the flag */ pc->buffer.holds_BeginEnd = holds_BeginEnd; pc->buffer.in_BeginEnd = in_BeginEnd; @@ -221,9 +225,15 @@ crPackMaxData( int buffer_size ) * has 'mtu' bytes in it, we have to send it. The MTU might * be somewhat smaller than the buffer size. */ -void crPackInitBuffer( CRPackBuffer *buf, void *pack, int size, int mtu ) +void crPackInitBuffer( CRPackBuffer *buf, void *pack, int size, int mtu +#ifdef IN_RING0 + , unsigned int num_opcodes +#endif + ) { +#ifndef IN_RING0 unsigned int num_opcodes; +#endif CRASSERT(mtu <= size); @@ -231,7 +241,16 @@ void crPackInitBuffer( CRPackBuffer *buf, void *pack, int size, int mtu ) buf->mtu = mtu; buf->pack = pack; - num_opcodes = crPackMaxOpcodes( buf->size ); +#ifdef IN_RING0 + if(num_opcodes) + { + num_opcodes = (num_opcodes + 0x3) & (~0x3); + } + else +#endif + { + num_opcodes = crPackMaxOpcodes( buf->size ); + } buf->data_start = (unsigned char *) buf->pack + num_opcodes + sizeof(CRMessageOpcodes); |
