1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include "packer.h"
|
---|
8 |
|
---|
9 | void PACK_APIENTRY
|
---|
10 | crPackDeleteFencesNV(GLsizei n, const GLuint * fences)
|
---|
11 | {
|
---|
12 | unsigned char *data_ptr;
|
---|
13 | int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*fences);
|
---|
14 |
|
---|
15 | if( !fences )
|
---|
16 | return;
|
---|
17 |
|
---|
18 | data_ptr = (unsigned char *) crPackAlloc(packet_length);
|
---|
19 | WRITE_DATA(0, GLenum, CR_DELETEFENCESNV_EXTEND_OPCODE);
|
---|
20 | WRITE_DATA(4, GLsizei, n);
|
---|
21 | crMemcpy(data_ptr + 8, fences, n * sizeof(*fences));
|
---|
22 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
23 | crPackFree(data_ptr);
|
---|
24 | }
|
---|
25 |
|
---|
26 | void PACK_APIENTRY crPackDeleteFencesNVSWAP( GLsizei n, const GLuint *fences )
|
---|
27 | {
|
---|
28 | unsigned char *data_ptr;
|
---|
29 | int i;
|
---|
30 | int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*fences);
|
---|
31 |
|
---|
32 | if( !fences )
|
---|
33 | return;
|
---|
34 |
|
---|
35 | data_ptr = (unsigned char *) crPackAlloc( packet_length );
|
---|
36 | WRITE_DATA(0, GLenum, CR_DELETEFENCESNV_EXTEND_OPCODE);
|
---|
37 | WRITE_DATA(4, GLsizei, n);
|
---|
38 | for (i = 0 ; i < n ; i++)
|
---|
39 | {
|
---|
40 | WRITE_DATA(i*sizeof(GLuint) + 8, GLuint, SWAP32(fences[i]));
|
---|
41 | }
|
---|
42 | crHugePacket(CR_EXTEND_OPCODE, data_ptr);
|
---|
43 | crPackFree(data_ptr);
|
---|
44 | }
|
---|
45 |
|
---|