1 | /* $Id: pack_shaders.c 20511 2009-06-12 13:00:53Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL DRI driver functions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include "packer.h"
|
---|
24 | #include "cr_error.h"
|
---|
25 | #include "cr_string.h"
|
---|
26 |
|
---|
27 | void PACK_APIENTRY crPackBindAttribLocation(GLuint program, GLuint index, const char *name)
|
---|
28 | {
|
---|
29 | GET_PACKER_CONTEXT(pc);
|
---|
30 | unsigned char *data_ptr;
|
---|
31 | int cbName = crStrlen(name)+1;
|
---|
32 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+sizeof(index) + cbName*sizeof(*name);
|
---|
33 |
|
---|
34 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
35 | WRITE_DATA_AI(int, packet_length);
|
---|
36 | WRITE_DATA_AI(GLenum, CR_BINDATTRIBLOCATION_EXTEND_OPCODE);
|
---|
37 | WRITE_DATA_AI(GLuint, program);
|
---|
38 | WRITE_DATA_AI(GLuint, index);
|
---|
39 | crMemcpy(data_ptr, name, cbName*sizeof(*name));
|
---|
40 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
41 | }
|
---|
42 |
|
---|
43 | void PACK_APIENTRY crPackShaderSource(GLuint shader, GLsizei count, const char **string, const GLint *length)
|
---|
44 | {
|
---|
45 | GET_PACKER_CONTEXT(pc);
|
---|
46 | unsigned char *data_ptr;
|
---|
47 | GLint *pLocalLength;
|
---|
48 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(shader)+sizeof(count)+sizeof(GLint)+count*sizeof(*pLocalLength);
|
---|
49 | GLsizei i;
|
---|
50 |
|
---|
51 | if ((0==count) || (!string)) return;
|
---|
52 |
|
---|
53 | pLocalLength = crAlloc(count*sizeof(*length));
|
---|
54 | if (!pLocalLength) return;
|
---|
55 |
|
---|
56 | for (i=0; i<count; ++i)
|
---|
57 | {
|
---|
58 | pLocalLength[i] = (length && (length[i]>=0)) ? length[i] : crStrlen(string[i])+1;
|
---|
59 | packet_length += pLocalLength[i];
|
---|
60 | }
|
---|
61 |
|
---|
62 | if (length)
|
---|
63 | {
|
---|
64 | packet_length += count*sizeof(*length);
|
---|
65 | }
|
---|
66 |
|
---|
67 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
68 | WRITE_DATA_AI(int, packet_length);
|
---|
69 | WRITE_DATA_AI(GLenum, CR_SHADERSOURCE_EXTEND_OPCODE);
|
---|
70 | WRITE_DATA_AI(GLuint, shader);
|
---|
71 | WRITE_DATA_AI(GLsizei, count);
|
---|
72 | WRITE_DATA_AI(GLint, (GLint)(length ? 1:0));
|
---|
73 | crMemcpy(data_ptr, pLocalLength, count*sizeof(*pLocalLength));
|
---|
74 | data_ptr += count*sizeof(*pLocalLength);
|
---|
75 |
|
---|
76 | if (length)
|
---|
77 | {
|
---|
78 | crMemcpy(data_ptr, length, count*sizeof(*length));
|
---|
79 | data_ptr += count*sizeof(*length);
|
---|
80 | }
|
---|
81 |
|
---|
82 | for (i=0; i<count; ++i)
|
---|
83 | {
|
---|
84 | crMemcpy(data_ptr, string[i], pLocalLength[i]);
|
---|
85 | data_ptr += pLocalLength[i];
|
---|
86 | }
|
---|
87 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
88 |
|
---|
89 | crFree(pLocalLength);
|
---|
90 | }
|
---|
91 |
|
---|
92 | void PACK_APIENTRY crPackUniform1fv(GLint location, GLsizei count, const GLfloat *value)
|
---|
93 | {
|
---|
94 | GET_PACKER_CONTEXT(pc);
|
---|
95 | unsigned char *data_ptr;
|
---|
96 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
|
---|
97 |
|
---|
98 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
99 | WRITE_DATA_AI(int, packet_length);
|
---|
100 | WRITE_DATA_AI(GLenum, CR_UNIFORM1FV_EXTEND_OPCODE);
|
---|
101 | WRITE_DATA_AI(GLint, location);
|
---|
102 | WRITE_DATA_AI(GLsizei, count);
|
---|
103 | crMemcpy(data_ptr, value, count*sizeof(*value));
|
---|
104 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
105 | }
|
---|
106 |
|
---|
107 | void PACK_APIENTRY crPackUniform1iv(GLint location, GLsizei count, const GLint *value)
|
---|
108 | {
|
---|
109 | GET_PACKER_CONTEXT(pc);
|
---|
110 | unsigned char *data_ptr;
|
---|
111 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
|
---|
112 |
|
---|
113 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
114 | WRITE_DATA_AI(int, packet_length);
|
---|
115 | WRITE_DATA_AI(GLenum, CR_UNIFORM1IV_EXTEND_OPCODE);
|
---|
116 | WRITE_DATA_AI(GLint, location);
|
---|
117 | WRITE_DATA_AI(GLsizei, count);
|
---|
118 | crMemcpy(data_ptr, value, count*sizeof(*value));
|
---|
119 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
120 | }
|
---|
121 |
|
---|
122 | void PACK_APIENTRY crPackUniform2fv(GLint location, GLsizei count, const GLfloat *value)
|
---|
123 | {
|
---|
124 | GET_PACKER_CONTEXT(pc);
|
---|
125 | unsigned char *data_ptr;
|
---|
126 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
|
---|
127 |
|
---|
128 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
129 | WRITE_DATA_AI(int, packet_length);
|
---|
130 | WRITE_DATA_AI(GLenum, CR_UNIFORM2FV_EXTEND_OPCODE);
|
---|
131 | WRITE_DATA_AI(GLint, location);
|
---|
132 | WRITE_DATA_AI(GLsizei, count);
|
---|
133 | crMemcpy(data_ptr, value, 2*count*sizeof(*value));
|
---|
134 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
135 | }
|
---|
136 |
|
---|
137 | void PACK_APIENTRY crPackUniform2iv(GLint location, GLsizei count, const GLint *value)
|
---|
138 | {
|
---|
139 | GET_PACKER_CONTEXT(pc);
|
---|
140 | unsigned char *data_ptr;
|
---|
141 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
|
---|
142 |
|
---|
143 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
144 | WRITE_DATA_AI(int, packet_length);
|
---|
145 | WRITE_DATA_AI(GLenum, CR_UNIFORM2IV_EXTEND_OPCODE);
|
---|
146 | WRITE_DATA_AI(GLint, location);
|
---|
147 | WRITE_DATA_AI(GLsizei, count);
|
---|
148 | crMemcpy(data_ptr, value, 2*count*sizeof(*value));
|
---|
149 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
150 | }
|
---|
151 |
|
---|
152 | void PACK_APIENTRY crPackUniform3fv(GLint location, GLsizei count, const GLfloat *value)
|
---|
153 | {
|
---|
154 | GET_PACKER_CONTEXT(pc);
|
---|
155 | unsigned char *data_ptr;
|
---|
156 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
|
---|
157 |
|
---|
158 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
159 | WRITE_DATA_AI(int, packet_length);
|
---|
160 | WRITE_DATA_AI(GLenum, CR_UNIFORM3FV_EXTEND_OPCODE);
|
---|
161 | WRITE_DATA_AI(GLint, location);
|
---|
162 | WRITE_DATA_AI(GLsizei, count);
|
---|
163 | crMemcpy(data_ptr, value, 3*count*sizeof(*value));
|
---|
164 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
165 | }
|
---|
166 |
|
---|
167 | void PACK_APIENTRY crPackUniform3iv(GLint location, GLsizei count, const GLint *value)
|
---|
168 | {
|
---|
169 | GET_PACKER_CONTEXT(pc);
|
---|
170 | unsigned char *data_ptr;
|
---|
171 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
|
---|
172 |
|
---|
173 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
174 | WRITE_DATA_AI(int, packet_length);
|
---|
175 | WRITE_DATA_AI(GLenum, CR_UNIFORM3IV_EXTEND_OPCODE);
|
---|
176 | WRITE_DATA_AI(GLint, location);
|
---|
177 | WRITE_DATA_AI(GLsizei, count);
|
---|
178 | crMemcpy(data_ptr, value, 3*count*sizeof(*value));
|
---|
179 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
180 | }
|
---|
181 |
|
---|
182 | void PACK_APIENTRY crPackUniform4fv(GLint location, GLsizei count, const GLfloat *value)
|
---|
183 | {
|
---|
184 | GET_PACKER_CONTEXT(pc);
|
---|
185 | unsigned char *data_ptr;
|
---|
186 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
|
---|
187 |
|
---|
188 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
189 | WRITE_DATA_AI(int, packet_length);
|
---|
190 | WRITE_DATA_AI(GLenum, CR_UNIFORM4FV_EXTEND_OPCODE);
|
---|
191 | WRITE_DATA_AI(GLint, location);
|
---|
192 | WRITE_DATA_AI(GLsizei, count);
|
---|
193 | crMemcpy(data_ptr, value, 4*count*sizeof(*value));
|
---|
194 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
195 | }
|
---|
196 |
|
---|
197 | void PACK_APIENTRY crPackUniform4iv(GLint location, GLsizei count, const GLint *value)
|
---|
198 | {
|
---|
199 | GET_PACKER_CONTEXT(pc);
|
---|
200 | unsigned char *data_ptr;
|
---|
201 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
|
---|
202 |
|
---|
203 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
204 | WRITE_DATA_AI(int, packet_length);
|
---|
205 | WRITE_DATA_AI(GLenum, CR_UNIFORM4IV_EXTEND_OPCODE);
|
---|
206 | WRITE_DATA_AI(GLint, location);
|
---|
207 | WRITE_DATA_AI(GLsizei, count);
|
---|
208 | crMemcpy(data_ptr, value, 4*count*sizeof(*value));
|
---|
209 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
210 | }
|
---|
211 |
|
---|
212 | void PACK_APIENTRY crPackUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
213 | {
|
---|
214 | GET_PACKER_CONTEXT(pc);
|
---|
215 | unsigned char *data_ptr;
|
---|
216 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 2*2*count*sizeof(*value);
|
---|
217 |
|
---|
218 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
219 | WRITE_DATA_AI(int, packet_length);
|
---|
220 | WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2FV_EXTEND_OPCODE);
|
---|
221 | WRITE_DATA_AI(GLint, location);
|
---|
222 | WRITE_DATA_AI(GLsizei, count);
|
---|
223 | WRITE_DATA_AI(GLboolean, transpose);
|
---|
224 | crMemcpy(data_ptr, value, 2*2*count*sizeof(*value));
|
---|
225 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
226 | }
|
---|
227 |
|
---|
228 | void PACK_APIENTRY crPackUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
229 | {
|
---|
230 | GET_PACKER_CONTEXT(pc);
|
---|
231 | unsigned char *data_ptr;
|
---|
232 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 3*3*count*sizeof(*value);
|
---|
233 |
|
---|
234 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
235 | WRITE_DATA_AI(int, packet_length);
|
---|
236 | WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3FV_EXTEND_OPCODE);
|
---|
237 | WRITE_DATA_AI(GLint, location);
|
---|
238 | WRITE_DATA_AI(GLsizei, count);
|
---|
239 | WRITE_DATA_AI(GLboolean, transpose);
|
---|
240 | crMemcpy(data_ptr, value, 3*3*count*sizeof(*value));
|
---|
241 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
242 | }
|
---|
243 |
|
---|
244 | void PACK_APIENTRY crPackUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
245 | {
|
---|
246 | GET_PACKER_CONTEXT(pc);
|
---|
247 | unsigned char *data_ptr;
|
---|
248 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 4*4*count*sizeof(*value);
|
---|
249 |
|
---|
250 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
251 | WRITE_DATA_AI(int, packet_length);
|
---|
252 | WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4FV_EXTEND_OPCODE);
|
---|
253 | WRITE_DATA_AI(GLint, location);
|
---|
254 | WRITE_DATA_AI(GLsizei, count);
|
---|
255 | WRITE_DATA_AI(GLboolean, transpose);
|
---|
256 | crMemcpy(data_ptr, value, 4*4*count*sizeof(*value));
|
---|
257 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
258 | }
|
---|
259 |
|
---|
260 | void PACK_APIENTRY crPackDrawBuffers(GLsizei n, const GLenum *bufs)
|
---|
261 | {
|
---|
262 | GET_PACKER_CONTEXT(pc);
|
---|
263 | unsigned char *data_ptr;
|
---|
264 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(n) + n*sizeof(*bufs);
|
---|
265 |
|
---|
266 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
267 | WRITE_DATA_AI(int, packet_length);
|
---|
268 | WRITE_DATA_AI(GLenum, CR_DRAWBUFFERS_EXTEND_OPCODE);
|
---|
269 | WRITE_DATA_AI(GLsizei, n);
|
---|
270 | crMemcpy(data_ptr, bufs, n*sizeof(*bufs));
|
---|
271 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
272 | }
|
---|
273 |
|
---|
274 | /*@todo next 7 functions are bit hacky,
|
---|
275 | * we expect packspu to pass a single structure with all output parameters via first output pointer.
|
---|
276 | * it'd be better to add CRMessageMultiReadback one day.
|
---|
277 | */
|
---|
278 | void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
|
---|
279 | {
|
---|
280 | GET_PACKER_CONTEXT(pc);
|
---|
281 | unsigned char *data_ptr;
|
---|
282 | (void) pc;
|
---|
283 | (void) size;
|
---|
284 | (void) type;
|
---|
285 | (void) name;
|
---|
286 | GET_BUFFERED_POINTER(pc, 36);
|
---|
287 | WRITE_DATA(0, GLint, 36);
|
---|
288 | WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE);
|
---|
289 | WRITE_DATA(8, GLuint, program);
|
---|
290 | WRITE_DATA(12, GLuint, index);
|
---|
291 | WRITE_DATA(16, GLsizei, bufSize);
|
---|
292 | WRITE_NETWORK_POINTER(20, (void *) length);
|
---|
293 | WRITE_NETWORK_POINTER(28, (void *) writeback);
|
---|
294 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
295 | }
|
---|
296 |
|
---|
297 | void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
|
---|
298 | {
|
---|
299 | GET_PACKER_CONTEXT(pc);
|
---|
300 | unsigned char *data_ptr;
|
---|
301 | (void) pc;
|
---|
302 | (void) size;
|
---|
303 | (void) type;
|
---|
304 | (void) name;
|
---|
305 | GET_BUFFERED_POINTER(pc, 36);
|
---|
306 | WRITE_DATA(0, GLint, 36);
|
---|
307 | WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE);
|
---|
308 | WRITE_DATA(8, GLuint, program);
|
---|
309 | WRITE_DATA(12, GLuint, index);
|
---|
310 | WRITE_DATA(16, GLsizei, bufSize);
|
---|
311 | WRITE_NETWORK_POINTER(20, (void *) length);
|
---|
312 | WRITE_NETWORK_POINTER(28, (void *) writeback);
|
---|
313 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
314 | }
|
---|
315 |
|
---|
316 | void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback)
|
---|
317 | {
|
---|
318 | GET_PACKER_CONTEXT(pc);
|
---|
319 | unsigned char *data_ptr;
|
---|
320 | (void) pc;
|
---|
321 | (void) shaders;
|
---|
322 | GET_BUFFERED_POINTER(pc, 32);
|
---|
323 | WRITE_DATA(0, GLint, 32);
|
---|
324 | WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE);
|
---|
325 | WRITE_DATA(8, GLuint, program);
|
---|
326 | WRITE_DATA(12, GLsizei, maxCount);
|
---|
327 | WRITE_NETWORK_POINTER(16, (void *) count);
|
---|
328 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
329 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
330 | }
|
---|
331 |
|
---|
332 | void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback)
|
---|
333 | {
|
---|
334 | GET_PACKER_CONTEXT(pc);
|
---|
335 | unsigned char *data_ptr;
|
---|
336 | (void) pc;
|
---|
337 | GET_BUFFERED_POINTER(pc, 32);
|
---|
338 | WRITE_DATA(0, GLint, 32);
|
---|
339 | WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE);
|
---|
340 | WRITE_DATA(8, GLhandleARB, containerObj);
|
---|
341 | WRITE_DATA(12, GLsizei, maxCount);
|
---|
342 | WRITE_NETWORK_POINTER(16, (void *) count);
|
---|
343 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
344 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
345 | }
|
---|
346 |
|
---|
347 | void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
|
---|
348 | {
|
---|
349 | GET_PACKER_CONTEXT(pc);
|
---|
350 | unsigned char *data_ptr;
|
---|
351 | (void) pc;
|
---|
352 | GET_BUFFERED_POINTER(pc, 32);
|
---|
353 | WRITE_DATA(0, GLint, 32);
|
---|
354 | WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE);
|
---|
355 | WRITE_DATA(8, GLhandleARB, obj);
|
---|
356 | WRITE_DATA(12, GLsizei, maxLength);
|
---|
357 | WRITE_NETWORK_POINTER(16, (void *) length);
|
---|
358 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
359 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
360 | }
|
---|
361 |
|
---|
362 | void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
|
---|
363 | {
|
---|
364 | GET_PACKER_CONTEXT(pc);
|
---|
365 | unsigned char *data_ptr;
|
---|
366 | (void) pc;
|
---|
367 | (void) infoLog;
|
---|
368 | GET_BUFFERED_POINTER(pc, 32);
|
---|
369 | WRITE_DATA(0, GLint, 32);
|
---|
370 | WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE);
|
---|
371 | WRITE_DATA(8, GLuint, program);
|
---|
372 | WRITE_DATA(12, GLsizei, bufSize);
|
---|
373 | WRITE_NETWORK_POINTER(16, (void *) length);
|
---|
374 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
375 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
376 | }
|
---|
377 |
|
---|
378 | void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
|
---|
379 | {
|
---|
380 | GET_PACKER_CONTEXT(pc);
|
---|
381 | unsigned char *data_ptr;
|
---|
382 | (void) pc;
|
---|
383 | (void) infoLog;
|
---|
384 | GET_BUFFERED_POINTER(pc, 32);
|
---|
385 | WRITE_DATA(0, GLint, 32);
|
---|
386 | WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE);
|
---|
387 | WRITE_DATA(8, GLuint, shader);
|
---|
388 | WRITE_DATA(12, GLsizei, bufSize);
|
---|
389 | WRITE_NETWORK_POINTER(16, (void *) length);
|
---|
390 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
391 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
392 | }
|
---|
393 |
|
---|
394 | void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback)
|
---|
395 | {
|
---|
396 | GET_PACKER_CONTEXT(pc);
|
---|
397 | unsigned char *data_ptr;
|
---|
398 | (void) pc;
|
---|
399 | (void) source;
|
---|
400 | GET_BUFFERED_POINTER(pc, 32);
|
---|
401 | WRITE_DATA(0, GLint, 32);
|
---|
402 | WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE);
|
---|
403 | WRITE_DATA(8, GLuint, shader);
|
---|
404 | WRITE_DATA(12, GLsizei, bufSize);
|
---|
405 | WRITE_NETWORK_POINTER(16, (void *) length);
|
---|
406 | WRITE_NETWORK_POINTER(24, (void *) writeback);
|
---|
407 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
408 | }
|
---|
409 |
|
---|
410 | void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
|
---|
411 | {
|
---|
412 | GET_PACKER_CONTEXT(pc);
|
---|
413 | unsigned char *data_ptr;
|
---|
414 | int cbName = crStrlen(name)+1;
|
---|
415 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
|
---|
416 |
|
---|
417 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
418 | WRITE_DATA_AI(int, packet_length);
|
---|
419 | WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE);
|
---|
420 | WRITE_DATA_AI(GLuint, program);
|
---|
421 | crMemcpy(data_ptr, name, cbName*sizeof(*name));
|
---|
422 | data_ptr += cbName*sizeof(*name);
|
---|
423 | WRITE_NETWORK_POINTER(0, (void *) return_value);
|
---|
424 | WRITE_NETWORK_POINTER(8, (void *) writeback);
|
---|
425 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
426 | }
|
---|
427 |
|
---|
428 | void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
|
---|
429 | {
|
---|
430 | GET_PACKER_CONTEXT(pc);
|
---|
431 | unsigned char *data_ptr;
|
---|
432 | int cbName = crStrlen(name)+1;
|
---|
433 | int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
|
---|
434 |
|
---|
435 | GET_BUFFERED_POINTER(pc, packet_length);
|
---|
436 | WRITE_DATA_AI(int, packet_length);
|
---|
437 | WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE);
|
---|
438 | WRITE_DATA_AI(GLuint, program);
|
---|
439 | crMemcpy(data_ptr, name, cbName*sizeof(*name));
|
---|
440 | data_ptr += cbName*sizeof(*name);
|
---|
441 | WRITE_NETWORK_POINTER(0, (void *) return_value);
|
---|
442 | WRITE_NETWORK_POINTER(8, (void *) writeback);
|
---|
443 | WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
|
---|
444 | }
|
---|
445 |
|
---|
446 | void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name)
|
---|
447 | {
|
---|
448 | GET_PACKER_CONTEXT(pc);
|
---|
449 | (void)program;
|
---|
450 | (void)index;
|
---|
451 | (void)name;
|
---|
452 | crError ("No swap version");
|
---|
453 | (void) pc;
|
---|
454 | }
|
---|
455 |
|
---|
456 | void PACK_APIENTRY crPackShaderSourceSWAP(GLuint shader, GLsizei count, const char **string, const GLint *length)
|
---|
457 | {
|
---|
458 | GET_PACKER_CONTEXT(pc);
|
---|
459 | (void)shader;
|
---|
460 | (void)count;
|
---|
461 | (void)string;
|
---|
462 | (void)length;
|
---|
463 | crError ("No swap version");
|
---|
464 | (void) pc;
|
---|
465 | }
|
---|
466 |
|
---|
467 | void PACK_APIENTRY crPackUniform1fvSWAP(GLint location, GLsizei count, const GLfloat *value)
|
---|
468 | {
|
---|
469 | GET_PACKER_CONTEXT(pc);
|
---|
470 | (void)location;
|
---|
471 | (void)count;
|
---|
472 | (void)value;
|
---|
473 | crError ("No swap version");
|
---|
474 | (void) pc;
|
---|
475 | }
|
---|
476 |
|
---|
477 |
|
---|
478 | void PACK_APIENTRY crPackUniform1ivSWAP(GLint location, GLsizei count, const GLint *value)
|
---|
479 | {
|
---|
480 | GET_PACKER_CONTEXT(pc);
|
---|
481 | (void)location;
|
---|
482 | (void)count;
|
---|
483 | (void)value;
|
---|
484 | crError ("No swap version");
|
---|
485 | (void) pc;
|
---|
486 | }
|
---|
487 |
|
---|
488 | void PACK_APIENTRY crPackUniform2fvSWAP(GLint location, GLsizei count, const GLfloat *value)
|
---|
489 | {
|
---|
490 | GET_PACKER_CONTEXT(pc);
|
---|
491 | (void)location;
|
---|
492 | (void)count;
|
---|
493 | (void)value;
|
---|
494 | crError ("No swap version");
|
---|
495 | (void) pc;
|
---|
496 | }
|
---|
497 |
|
---|
498 | void PACK_APIENTRY crPackUniform2ivSWAP(GLint location, GLsizei count, const GLint * value)
|
---|
499 | {
|
---|
500 | GET_PACKER_CONTEXT(pc);
|
---|
501 | (void)location;
|
---|
502 | (void)count;
|
---|
503 | (void)value;
|
---|
504 | crError ("No swap version");
|
---|
505 | (void) pc;
|
---|
506 | }
|
---|
507 |
|
---|
508 | void PACK_APIENTRY crPackUniform3fvSWAP(GLint location, GLsizei count, const GLfloat *value)
|
---|
509 | {
|
---|
510 | GET_PACKER_CONTEXT(pc);
|
---|
511 | (void)location;
|
---|
512 | (void)count;
|
---|
513 | (void)value;
|
---|
514 | crError ("No swap version");
|
---|
515 | (void) pc;
|
---|
516 | }
|
---|
517 |
|
---|
518 | void PACK_APIENTRY crPackUniform3ivSWAP(GLint location, GLsizei count, const GLint *value)
|
---|
519 | {
|
---|
520 | GET_PACKER_CONTEXT(pc);
|
---|
521 | (void)location;
|
---|
522 | (void)count;
|
---|
523 | (void)value;
|
---|
524 | crError ("No swap version");
|
---|
525 | (void) pc;
|
---|
526 | }
|
---|
527 |
|
---|
528 | void PACK_APIENTRY crPackUniform4fvSWAP(GLint location, GLsizei count, const GLfloat *value)
|
---|
529 | {
|
---|
530 | GET_PACKER_CONTEXT(pc);
|
---|
531 | (void)location;
|
---|
532 | (void)count;
|
---|
533 | (void)value;
|
---|
534 | crError ("No swap version");
|
---|
535 | (void) pc;
|
---|
536 | }
|
---|
537 |
|
---|
538 | void PACK_APIENTRY crPackUniform4ivSWAP(GLint location, GLsizei count, const GLint *value)
|
---|
539 | {
|
---|
540 | GET_PACKER_CONTEXT(pc);
|
---|
541 | (void)location;
|
---|
542 | (void)count;
|
---|
543 | (void)value;
|
---|
544 | crError ("No swap version");
|
---|
545 | (void) pc;
|
---|
546 | }
|
---|
547 |
|
---|
548 | void PACK_APIENTRY crPackUniformMatrix2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
549 | {
|
---|
550 | GET_PACKER_CONTEXT(pc);
|
---|
551 | (void)location;
|
---|
552 | (void)count;
|
---|
553 | (void)transpose;
|
---|
554 | (void)value;
|
---|
555 | crError ("No swap version");
|
---|
556 | (void) pc;
|
---|
557 | }
|
---|
558 |
|
---|
559 | void PACK_APIENTRY crPackUniformMatrix3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
560 | {
|
---|
561 | GET_PACKER_CONTEXT(pc);
|
---|
562 | (void)location;
|
---|
563 | (void)count;
|
---|
564 | (void)transpose;
|
---|
565 | (void)value;
|
---|
566 | crError ("No swap version");
|
---|
567 | (void) pc;
|
---|
568 | }
|
---|
569 |
|
---|
570 | void PACK_APIENTRY crPackUniformMatrix4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
|
---|
571 | {
|
---|
572 | GET_PACKER_CONTEXT(pc);
|
---|
573 | (void)location;
|
---|
574 | (void)count;
|
---|
575 | (void)transpose;
|
---|
576 | (void)value;
|
---|
577 | crError ("No swap version");
|
---|
578 | (void) pc;
|
---|
579 | }
|
---|
580 |
|
---|
581 | void PACK_APIENTRY crPackDrawBuffersSWAP(GLsizei n, const GLenum *bufs)
|
---|
582 | {
|
---|
583 | GET_PACKER_CONTEXT(pc);
|
---|
584 | (void)n;
|
---|
585 | (void)bufs;
|
---|
586 | crError ("No swap version");
|
---|
587 | (void) pc;
|
---|
588 | }
|
---|
589 |
|
---|
590 | void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
|
---|
591 | {
|
---|
592 | GET_PACKER_CONTEXT(pc);
|
---|
593 | (void)program;
|
---|
594 | (void)name;
|
---|
595 | (void)return_value;
|
---|
596 | (void)writeback;
|
---|
597 | crError ("No swap version");
|
---|
598 | (void) pc;
|
---|
599 | }
|
---|
600 |
|
---|
601 | void PACK_APIENTRY crPackGetUniformLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
|
---|
602 | {
|
---|
603 | GET_PACKER_CONTEXT(pc);
|
---|
604 | (void)program;
|
---|
605 | (void)name;
|
---|
606 | (void)return_value;
|
---|
607 | (void)writeback;
|
---|
608 | crError ("No swap version");
|
---|
609 | (void) pc;
|
---|
610 | }
|
---|