summaryrefslogtreecommitdiff
path: root/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/GuestHost/OpenGL/packer/pack_buffer.c
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_buffer.c')
-rw-r--r--src/VBox/GuestHost/OpenGL/packer/pack_buffer.c25
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);