Changeset 21306 in vbox for trunk/src/VBox/GuestHost/OpenGL/packer/pack_bufferobject.c
- Timestamp:
- Jul 7, 2009 10:34:22 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/packer/pack_bufferobject.c
r15532 r21306 13 13 void PACK_APIENTRY 14 14 crPackMapBufferARB( GLenum target, GLenum access, 15 15 void * return_value, int * writeback ) 16 16 { 17 17 (void)writeback; … … 35 35 void PACK_APIENTRY 36 36 crPackBufferDataARB( GLenum target, GLsizeiptrARB size, 37 37 const GLvoid * data, GLenum usage ) 38 38 { 39 40 39 unsigned char *data_ptr; 40 int packet_length; 41 41 42 43 42 packet_length = sizeof(GLenum) 43 + sizeof(target) + sizeof(size) + sizeof(usage) + size; 44 44 45 45 data_ptr = (unsigned char *) crPackAlloc( packet_length ); 46 46 47 48 49 50 51 52 47 WRITE_DATA( 0, GLenum, CR_BUFFERDATAARB_EXTEND_OPCODE ); 48 WRITE_DATA( 4, GLenum, target ); 49 WRITE_DATA( 8, GLsizeiptrARB, size ); /* XXX or 8 bytes? */ 50 WRITE_DATA( 12, GLenum, usage ); 51 if (data) 52 crMemcpy( data_ptr + 16, data, size ); 53 53 54 54 crHugePacket( CR_EXTEND_OPCODE, data_ptr ); 55 55 crPackFree( data_ptr ); 56 56 } … … 59 59 void PACK_APIENTRY 60 60 crPackBufferSubDataARB( GLenum target, GLintptrARB offset, GLsizeiptrARB size, 61 61 const GLvoid * data ) 62 62 { 63 64 63 unsigned char *data_ptr; 64 int packet_length; 65 65 66 67 66 if (!data) 67 return; 68 68 69 70 69 packet_length = sizeof(GLenum) 70 + sizeof(target) + sizeof(offset) + sizeof(size) + size; 71 71 72 73 74 75 76 77 72 data_ptr = (unsigned char *) crPackAlloc( packet_length ); 73 WRITE_DATA( 0, GLenum, CR_BUFFERSUBDATAARB_EXTEND_OPCODE ); 74 WRITE_DATA( 4, GLenum, target ); 75 WRITE_DATA( 8, GLintptrARB, offset ); /* XXX or 8 bytes? */ 76 WRITE_DATA( 12, GLsizeiptrARB, size ); /* XXX or 8 bytes? */ 77 crMemcpy( data_ptr + 16, data, size ); 78 78 79 79 crHugePacket( CR_EXTEND_OPCODE, data_ptr ); 80 80 crPackFree( data_ptr ); 81 81 } … … 85 85 crPackDeleteBuffersARB(GLsizei n, const GLuint * buffers) 86 86 { 87 88 87 unsigned char *data_ptr; 88 int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*buffers); 89 89 90 91 90 if (!buffers) 91 return; 92 92 93 94 95 96 97 93 data_ptr = (unsigned char *) crPackAlloc(packet_length); 94 WRITE_DATA( 0, GLenum, CR_DELETEBUFFERSARB_EXTEND_OPCODE ); 95 WRITE_DATA( 4, GLsizei, n ); 96 crMemcpy( data_ptr + 8, buffers, n * sizeof(*buffers) ); 97 crHugePacket( CR_EXTEND_OPCODE, data_ptr ); 98 98 crPackFree( data_ptr ); 99 99 }
Note:
See TracChangeset
for help on using the changeset viewer.