diff options
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_fence.c')
-rw-r--r-- | src/VBox/GuestHost/OpenGL/packer/pack_fence.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/packer/pack_fence.c b/src/VBox/GuestHost/OpenGL/packer/pack_fence.c new file mode 100644 index 00000000..f42f1a06 --- /dev/null +++ b/src/VBox/GuestHost/OpenGL/packer/pack_fence.c @@ -0,0 +1,45 @@ +/* Copyright (c) 2001, Stanford University + * All rights reserved + * + * See the file LICENSE.txt for information on redistributing this software. + */ + +#include "packer.h" + +void PACK_APIENTRY +crPackDeleteFencesNV(GLsizei n, const GLuint * fences) +{ + unsigned char *data_ptr; + int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*fences); + + if( !fences ) + return; + + data_ptr = (unsigned char *) crPackAlloc(packet_length); + WRITE_DATA(0, GLenum, CR_DELETEFENCESNV_EXTEND_OPCODE); + WRITE_DATA(4, GLsizei, n); + crMemcpy(data_ptr + 8, fences, n * sizeof(*fences)); + crHugePacket(CR_EXTEND_OPCODE, data_ptr); + crPackFree(data_ptr); +} + +void PACK_APIENTRY crPackDeleteFencesNVSWAP( GLsizei n, const GLuint *fences ) +{ + unsigned char *data_ptr; + int i; + int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*fences); + + if( !fences ) + return; + + data_ptr = (unsigned char *) crPackAlloc( packet_length ); + WRITE_DATA(0, GLenum, CR_DELETEFENCESNV_EXTEND_OPCODE); + WRITE_DATA(4, GLsizei, n); + for (i = 0 ; i < n ; i++) + { + WRITE_DATA(i*sizeof(GLuint) + 8, GLuint, SWAP32(fences[i])); + } + crHugePacket(CR_EXTEND_OPCODE, data_ptr); + crPackFree(data_ptr); +} + |