VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_shaders.c@ 48328

Last change on this file since 48328 was 44529, checked in by vboxsync, 12 years ago

header (C) fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 27.3 KB
Line 
1/* $Id: pack_shaders.c 44529 2013-02-04 15:54:15Z vboxsync $ */
2
3/** @file
4 * VBox OpenGL DRI driver functions
5 */
6
7/*
8 * Copyright (C) 2009-2012 Oracle Corporation
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
19#include "packer.h"
20#include "cr_error.h"
21#include "cr_string.h"
22
23void PACK_APIENTRY crPackBindAttribLocation(GLuint program, GLuint index, const char *name)
24{
25 CR_GET_PACKER_CONTEXT(pc);
26 unsigned char *data_ptr;
27 int cbName = crStrlen(name)+1;
28 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+sizeof(index) + cbName*sizeof(*name);
29
30 CR_GET_BUFFERED_POINTER(pc, packet_length);
31 WRITE_DATA_AI(int, packet_length);
32 WRITE_DATA_AI(GLenum, CR_BINDATTRIBLOCATION_EXTEND_OPCODE);
33 WRITE_DATA_AI(GLuint, program);
34 WRITE_DATA_AI(GLuint, index);
35 crMemcpy(data_ptr, name, cbName*sizeof(*name));
36 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
37 CR_UNLOCK_PACKER_CONTEXT(pc);
38}
39
40void PACK_APIENTRY crPackShaderSource(GLuint shader, GLsizei count, const char **string, const GLint *length)
41{
42 CR_GET_PACKER_CONTEXT(pc);
43 unsigned char *data_ptr;
44 GLint *pLocalLength;
45 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(shader)+sizeof(count)+sizeof(GLint)+count*sizeof(*pLocalLength);
46 GLsizei i;
47
48 if ((0==count) || (!string)) return;
49
50 pLocalLength = crAlloc(count*sizeof(*length));
51 if (!pLocalLength) return;
52
53 for (i=0; i<count; ++i)
54 {
55 pLocalLength[i] = ((length && (length[i]>=0)) ? length[i] : crStrlen(string[i]))+1;
56 packet_length += pLocalLength[i];
57 }
58
59 if (length)
60 {
61 packet_length += count*sizeof(*length);
62 }
63
64 CR_GET_BUFFERED_POINTER(pc, packet_length);
65 WRITE_DATA_AI(int, packet_length);
66 WRITE_DATA_AI(GLenum, CR_SHADERSOURCE_EXTEND_OPCODE);
67 WRITE_DATA_AI(GLuint, shader);
68 WRITE_DATA_AI(GLsizei, count);
69 WRITE_DATA_AI(GLint, (GLint)(length ? 1:0));
70 crMemcpy(data_ptr, pLocalLength, count*sizeof(*pLocalLength));
71 data_ptr += count*sizeof(*pLocalLength);
72
73 if (length)
74 {
75 crMemcpy(data_ptr, length, count*sizeof(*length));
76 data_ptr += count*sizeof(*length);
77 }
78
79 for (i=0; i<count; ++i)
80 {
81 if (string[i])
82 {
83 if (length && (length[i]>=0))
84 {
85 /* include \0 in the string to make intel drivers happy */
86 crMemcpy(data_ptr, string[i], pLocalLength[i] - 1);
87 data_ptr[pLocalLength[i] - 1] = '\0';
88 }
89 else
90 {
91 /* the \0 s already in the string */
92 crMemcpy(data_ptr, string[i], pLocalLength[i]);
93 }
94 }
95 else
96 {
97 CRASSERT(pLocalLength[i]==1);
98 *data_ptr = 0;
99 }
100 data_ptr += pLocalLength[i];
101 }
102 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
103 CR_UNLOCK_PACKER_CONTEXT(pc);
104
105 crFree(pLocalLength);
106}
107
108void PACK_APIENTRY crPackUniform1fv(GLint location, GLsizei count, const GLfloat *value)
109{
110 CR_GET_PACKER_CONTEXT(pc);
111 unsigned char *data_ptr;
112 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
113
114 CR_GET_BUFFERED_POINTER(pc, packet_length);
115 WRITE_DATA_AI(int, packet_length);
116 WRITE_DATA_AI(GLenum, CR_UNIFORM1FV_EXTEND_OPCODE);
117 WRITE_DATA_AI(GLint, location);
118 WRITE_DATA_AI(GLsizei, count);
119 crMemcpy(data_ptr, value, count*sizeof(*value));
120 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
121 CR_UNLOCK_PACKER_CONTEXT(pc);
122}
123
124void PACK_APIENTRY crPackUniform1iv(GLint location, GLsizei count, const GLint *value)
125{
126 CR_GET_PACKER_CONTEXT(pc);
127 unsigned char *data_ptr;
128 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + count*sizeof(*value);
129
130 CR_GET_BUFFERED_POINTER(pc, packet_length);
131 WRITE_DATA_AI(int, packet_length);
132 WRITE_DATA_AI(GLenum, CR_UNIFORM1IV_EXTEND_OPCODE);
133 WRITE_DATA_AI(GLint, location);
134 WRITE_DATA_AI(GLsizei, count);
135 crMemcpy(data_ptr, value, count*sizeof(*value));
136 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
137 CR_UNLOCK_PACKER_CONTEXT(pc);
138}
139
140void PACK_APIENTRY crPackUniform2fv(GLint location, GLsizei count, const GLfloat *value)
141{
142 CR_GET_PACKER_CONTEXT(pc);
143 unsigned char *data_ptr;
144 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
145
146 CR_GET_BUFFERED_POINTER(pc, packet_length);
147 WRITE_DATA_AI(int, packet_length);
148 WRITE_DATA_AI(GLenum, CR_UNIFORM2FV_EXTEND_OPCODE);
149 WRITE_DATA_AI(GLint, location);
150 WRITE_DATA_AI(GLsizei, count);
151 crMemcpy(data_ptr, value, 2*count*sizeof(*value));
152 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
153 CR_UNLOCK_PACKER_CONTEXT(pc);
154}
155
156void PACK_APIENTRY crPackUniform2iv(GLint location, GLsizei count, const GLint *value)
157{
158 CR_GET_PACKER_CONTEXT(pc);
159 unsigned char *data_ptr;
160 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 2*count*sizeof(*value);
161
162 CR_GET_BUFFERED_POINTER(pc, packet_length);
163 WRITE_DATA_AI(int, packet_length);
164 WRITE_DATA_AI(GLenum, CR_UNIFORM2IV_EXTEND_OPCODE);
165 WRITE_DATA_AI(GLint, location);
166 WRITE_DATA_AI(GLsizei, count);
167 crMemcpy(data_ptr, value, 2*count*sizeof(*value));
168 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
169 CR_UNLOCK_PACKER_CONTEXT(pc);
170}
171
172void PACK_APIENTRY crPackUniform3fv(GLint location, GLsizei count, const GLfloat *value)
173{
174 CR_GET_PACKER_CONTEXT(pc);
175 unsigned char *data_ptr;
176 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
177
178 CR_GET_BUFFERED_POINTER(pc, packet_length);
179 WRITE_DATA_AI(int, packet_length);
180 WRITE_DATA_AI(GLenum, CR_UNIFORM3FV_EXTEND_OPCODE);
181 WRITE_DATA_AI(GLint, location);
182 WRITE_DATA_AI(GLsizei, count);
183 crMemcpy(data_ptr, value, 3*count*sizeof(*value));
184 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
185 CR_UNLOCK_PACKER_CONTEXT(pc);
186}
187
188void PACK_APIENTRY crPackUniform3iv(GLint location, GLsizei count, const GLint *value)
189{
190 CR_GET_PACKER_CONTEXT(pc);
191 unsigned char *data_ptr;
192 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 3*count*sizeof(*value);
193
194 CR_GET_BUFFERED_POINTER(pc, packet_length);
195 WRITE_DATA_AI(int, packet_length);
196 WRITE_DATA_AI(GLenum, CR_UNIFORM3IV_EXTEND_OPCODE);
197 WRITE_DATA_AI(GLint, location);
198 WRITE_DATA_AI(GLsizei, count);
199 crMemcpy(data_ptr, value, 3*count*sizeof(*value));
200 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
201 CR_UNLOCK_PACKER_CONTEXT(pc);
202}
203
204void PACK_APIENTRY crPackUniform4fv(GLint location, GLsizei count, const GLfloat *value)
205{
206 CR_GET_PACKER_CONTEXT(pc);
207 unsigned char *data_ptr;
208 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
209
210 CR_GET_BUFFERED_POINTER(pc, packet_length);
211 WRITE_DATA_AI(int, packet_length);
212 WRITE_DATA_AI(GLenum, CR_UNIFORM4FV_EXTEND_OPCODE);
213 WRITE_DATA_AI(GLint, location);
214 WRITE_DATA_AI(GLsizei, count);
215 crMemcpy(data_ptr, value, 4*count*sizeof(*value));
216 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
217 CR_UNLOCK_PACKER_CONTEXT(pc);
218}
219
220void PACK_APIENTRY crPackUniform4iv(GLint location, GLsizei count, const GLint *value)
221{
222 CR_GET_PACKER_CONTEXT(pc);
223 unsigned char *data_ptr;
224 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count) + 4*count*sizeof(*value);
225
226 CR_GET_BUFFERED_POINTER(pc, packet_length);
227 WRITE_DATA_AI(int, packet_length);
228 WRITE_DATA_AI(GLenum, CR_UNIFORM4IV_EXTEND_OPCODE);
229 WRITE_DATA_AI(GLint, location);
230 WRITE_DATA_AI(GLsizei, count);
231 crMemcpy(data_ptr, value, 4*count*sizeof(*value));
232 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
233 CR_UNLOCK_PACKER_CONTEXT(pc);
234}
235
236void PACK_APIENTRY crPackUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
237{
238 CR_GET_PACKER_CONTEXT(pc);
239 unsigned char *data_ptr;
240 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 2*2*count*sizeof(*value);
241
242 CR_GET_BUFFERED_POINTER(pc, packet_length);
243 WRITE_DATA_AI(int, packet_length);
244 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2FV_EXTEND_OPCODE);
245 WRITE_DATA_AI(GLint, location);
246 WRITE_DATA_AI(GLsizei, count);
247 WRITE_DATA_AI(GLboolean, transpose);
248 crMemcpy(data_ptr, value, 2*2*count*sizeof(*value));
249 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
250 CR_UNLOCK_PACKER_CONTEXT(pc);
251}
252
253void PACK_APIENTRY crPackUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
254{
255 CR_GET_PACKER_CONTEXT(pc);
256 unsigned char *data_ptr;
257 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 3*3*count*sizeof(*value);
258
259 CR_GET_BUFFERED_POINTER(pc, packet_length);
260 WRITE_DATA_AI(int, packet_length);
261 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3FV_EXTEND_OPCODE);
262 WRITE_DATA_AI(GLint, location);
263 WRITE_DATA_AI(GLsizei, count);
264 WRITE_DATA_AI(GLboolean, transpose);
265 crMemcpy(data_ptr, value, 3*3*count*sizeof(*value));
266 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
267 CR_UNLOCK_PACKER_CONTEXT(pc);
268}
269
270void PACK_APIENTRY crPackUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
271{
272 CR_GET_PACKER_CONTEXT(pc);
273 unsigned char *data_ptr;
274 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose) + 4*4*count*sizeof(*value);
275
276 CR_GET_BUFFERED_POINTER(pc, packet_length);
277 WRITE_DATA_AI(int, packet_length);
278 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4FV_EXTEND_OPCODE);
279 WRITE_DATA_AI(GLint, location);
280 WRITE_DATA_AI(GLsizei, count);
281 WRITE_DATA_AI(GLboolean, transpose);
282 crMemcpy(data_ptr, value, 4*4*count*sizeof(*value));
283 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
284 CR_UNLOCK_PACKER_CONTEXT(pc);
285}
286
287void PACK_APIENTRY crPackUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
288{
289 CR_GET_PACKER_CONTEXT(pc);
290 unsigned char *data_ptr;
291 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
292 + 2*3*count*sizeof(*value);
293
294 CR_GET_BUFFERED_POINTER(pc, packet_length);
295 WRITE_DATA_AI(int, packet_length);
296 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X3FV_EXTEND_OPCODE);
297 WRITE_DATA_AI(GLint, location);
298 WRITE_DATA_AI(GLsizei, count);
299 WRITE_DATA_AI(GLboolean, transpose);
300 crMemcpy(data_ptr, value, 2*3*count*sizeof(*value));
301 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
302 CR_UNLOCK_PACKER_CONTEXT(pc);
303}
304
305void PACK_APIENTRY crPackUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
306{
307 CR_GET_PACKER_CONTEXT(pc);
308 unsigned char *data_ptr;
309 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
310 + 3*2*count*sizeof(*value);
311
312 CR_GET_BUFFERED_POINTER(pc, packet_length);
313 WRITE_DATA_AI(int, packet_length);
314 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X2FV_EXTEND_OPCODE);
315 WRITE_DATA_AI(GLint, location);
316 WRITE_DATA_AI(GLsizei, count);
317 WRITE_DATA_AI(GLboolean, transpose);
318 crMemcpy(data_ptr, value, 3*2*count*sizeof(*value));
319 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
320 CR_UNLOCK_PACKER_CONTEXT(pc);
321}
322
323void PACK_APIENTRY crPackUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
324{
325 CR_GET_PACKER_CONTEXT(pc);
326 unsigned char *data_ptr;
327 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
328 + 2*4*count*sizeof(*value);
329
330 CR_GET_BUFFERED_POINTER(pc, packet_length);
331 WRITE_DATA_AI(int, packet_length);
332 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X4FV_EXTEND_OPCODE);
333 WRITE_DATA_AI(GLint, location);
334 WRITE_DATA_AI(GLsizei, count);
335 WRITE_DATA_AI(GLboolean, transpose);
336 crMemcpy(data_ptr, value, 2*4*count*sizeof(*value));
337 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
338 CR_UNLOCK_PACKER_CONTEXT(pc);
339}
340
341void PACK_APIENTRY crPackUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
342{
343 CR_GET_PACKER_CONTEXT(pc);
344 unsigned char *data_ptr;
345 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
346 + 4*2*count*sizeof(*value);
347
348 CR_GET_BUFFERED_POINTER(pc, packet_length);
349 WRITE_DATA_AI(int, packet_length);
350 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X2FV_EXTEND_OPCODE);
351 WRITE_DATA_AI(GLint, location);
352 WRITE_DATA_AI(GLsizei, count);
353 WRITE_DATA_AI(GLboolean, transpose);
354 crMemcpy(data_ptr, value, 4*2*count*sizeof(*value));
355 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
356 CR_UNLOCK_PACKER_CONTEXT(pc);
357}
358
359void PACK_APIENTRY crPackUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
360{
361 CR_GET_PACKER_CONTEXT(pc);
362 unsigned char *data_ptr;
363 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
364 + 3*4*count*sizeof(*value);
365
366 CR_GET_BUFFERED_POINTER(pc, packet_length);
367 WRITE_DATA_AI(int, packet_length);
368 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X4FV_EXTEND_OPCODE);
369 WRITE_DATA_AI(GLint, location);
370 WRITE_DATA_AI(GLsizei, count);
371 WRITE_DATA_AI(GLboolean, transpose);
372 crMemcpy(data_ptr, value, 3*4*count*sizeof(*value));
373 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
374 CR_UNLOCK_PACKER_CONTEXT(pc);
375}
376
377void PACK_APIENTRY crPackUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
378{
379 CR_GET_PACKER_CONTEXT(pc);
380 unsigned char *data_ptr;
381 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
382 + 4*3*count*sizeof(*value);
383
384 CR_GET_BUFFERED_POINTER(pc, packet_length);
385 WRITE_DATA_AI(int, packet_length);
386 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X3FV_EXTEND_OPCODE);
387 WRITE_DATA_AI(GLint, location);
388 WRITE_DATA_AI(GLsizei, count);
389 WRITE_DATA_AI(GLboolean, transpose);
390 crMemcpy(data_ptr, value, 4*3*count*sizeof(*value));
391 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
392 CR_UNLOCK_PACKER_CONTEXT(pc);
393}
394
395void PACK_APIENTRY crPackDrawBuffers(GLsizei n, const GLenum *bufs)
396{
397 CR_GET_PACKER_CONTEXT(pc);
398 unsigned char *data_ptr;
399 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(n) + n*sizeof(*bufs);
400
401 CR_GET_BUFFERED_POINTER(pc, packet_length);
402 WRITE_DATA_AI(int, packet_length);
403 WRITE_DATA_AI(GLenum, CR_DRAWBUFFERS_EXTEND_OPCODE);
404 WRITE_DATA_AI(GLsizei, n);
405 crMemcpy(data_ptr, bufs, n*sizeof(*bufs));
406 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
407 CR_UNLOCK_PACKER_CONTEXT(pc);
408}
409
410/*@todo next 8 functions are bit hacky,
411 * we expect packspu to pass a single structure with all output parameters via first output pointer.
412 * it'd be better to add CRMessageMultiReadback one day.
413 */
414void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
415{
416 CR_GET_PACKER_CONTEXT(pc);
417 unsigned char *data_ptr;
418 (void) pc;
419 (void) size;
420 (void) type;
421 (void) name;
422 CR_GET_BUFFERED_POINTER(pc, 36);
423 WRITE_DATA(0, GLint, 36);
424 WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE);
425 WRITE_DATA(8, GLuint, program);
426 WRITE_DATA(12, GLuint, index);
427 WRITE_DATA(16, GLsizei, bufSize);
428 WRITE_NETWORK_POINTER(20, (void *) length);
429 WRITE_NETWORK_POINTER(28, (void *) writeback);
430 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
431 CR_UNLOCK_PACKER_CONTEXT(pc);
432}
433
434void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
435{
436 CR_GET_PACKER_CONTEXT(pc);
437 unsigned char *data_ptr;
438 (void) pc;
439 (void) size;
440 (void) type;
441 (void) name;
442 CR_GET_BUFFERED_POINTER(pc, 36);
443 WRITE_DATA(0, GLint, 36);
444 WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE);
445 WRITE_DATA(8, GLuint, program);
446 WRITE_DATA(12, GLuint, index);
447 WRITE_DATA(16, GLsizei, bufSize);
448 WRITE_NETWORK_POINTER(20, (void *) length);
449 WRITE_NETWORK_POINTER(28, (void *) writeback);
450 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
451 CR_UNLOCK_PACKER_CONTEXT(pc);
452}
453
454void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback)
455{
456 CR_GET_PACKER_CONTEXT(pc);
457 unsigned char *data_ptr;
458 (void) pc;
459 (void) shaders;
460 CR_GET_BUFFERED_POINTER(pc, 32);
461 WRITE_DATA(0, GLint, 32);
462 WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE);
463 WRITE_DATA(8, GLuint, program);
464 WRITE_DATA(12, GLsizei, maxCount);
465 WRITE_NETWORK_POINTER(16, (void *) count);
466 WRITE_NETWORK_POINTER(24, (void *) writeback);
467 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
468 CR_UNLOCK_PACKER_CONTEXT(pc);
469}
470
471void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback)
472{
473 CR_GET_PACKER_CONTEXT(pc);
474 unsigned char *data_ptr;
475 (void) pc;
476 CR_GET_BUFFERED_POINTER(pc, 32);
477 WRITE_DATA(0, GLint, 32);
478 WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE);
479 WRITE_DATA(8, GLhandleARB, containerObj);
480 WRITE_DATA(12, GLsizei, maxCount);
481 WRITE_NETWORK_POINTER(16, (void *) count);
482 WRITE_NETWORK_POINTER(24, (void *) writeback);
483 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
484 CR_UNLOCK_PACKER_CONTEXT(pc);
485}
486
487void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
488{
489 CR_GET_PACKER_CONTEXT(pc);
490 unsigned char *data_ptr;
491 (void) pc;
492 CR_GET_BUFFERED_POINTER(pc, 32);
493 WRITE_DATA(0, GLint, 32);
494 WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE);
495 WRITE_DATA(8, GLhandleARB, obj);
496 WRITE_DATA(12, GLsizei, maxLength);
497 WRITE_NETWORK_POINTER(16, (void *) length);
498 WRITE_NETWORK_POINTER(24, (void *) writeback);
499 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
500 CR_UNLOCK_PACKER_CONTEXT(pc);
501}
502
503void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
504{
505 CR_GET_PACKER_CONTEXT(pc);
506 unsigned char *data_ptr;
507 (void) pc;
508 (void) infoLog;
509 CR_GET_BUFFERED_POINTER(pc, 32);
510 WRITE_DATA(0, GLint, 32);
511 WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE);
512 WRITE_DATA(8, GLuint, program);
513 WRITE_DATA(12, GLsizei, bufSize);
514 WRITE_NETWORK_POINTER(16, (void *) length);
515 WRITE_NETWORK_POINTER(24, (void *) writeback);
516 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
517 CR_UNLOCK_PACKER_CONTEXT(pc);
518}
519
520void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
521{
522 CR_GET_PACKER_CONTEXT(pc);
523 unsigned char *data_ptr;
524 (void) pc;
525 (void) infoLog;
526 CR_GET_BUFFERED_POINTER(pc, 32);
527 WRITE_DATA(0, GLint, 32);
528 WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE);
529 WRITE_DATA(8, GLuint, shader);
530 WRITE_DATA(12, GLsizei, bufSize);
531 WRITE_NETWORK_POINTER(16, (void *) length);
532 WRITE_NETWORK_POINTER(24, (void *) writeback);
533 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
534 CR_UNLOCK_PACKER_CONTEXT(pc);
535}
536
537void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback)
538{
539 CR_GET_PACKER_CONTEXT(pc);
540 unsigned char *data_ptr;
541 (void) pc;
542 (void) source;
543 CR_GET_BUFFERED_POINTER(pc, 32);
544 WRITE_DATA(0, GLint, 32);
545 WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE);
546 WRITE_DATA(8, GLuint, shader);
547 WRITE_DATA(12, GLsizei, bufSize);
548 WRITE_NETWORK_POINTER(16, (void *) length);
549 WRITE_NETWORK_POINTER(24, (void *) writeback);
550 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
551 CR_UNLOCK_PACKER_CONTEXT(pc);
552}
553
554void PACK_APIENTRY crPackGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback)
555{
556 CR_GET_PACKER_CONTEXT(pc);
557 unsigned char *data_ptr;
558 (void) pData;
559 CR_GET_BUFFERED_POINTER(pc, 32);
560 WRITE_DATA(0, GLint, 32);
561 WRITE_DATA(4, GLenum, CR_GETUNIFORMSLOCATIONS_EXTEND_OPCODE);
562 WRITE_DATA(8, GLuint, program);
563 WRITE_DATA(12, GLsizei, maxcbData);
564 WRITE_NETWORK_POINTER(16, (void *) cbData);
565 WRITE_NETWORK_POINTER(24, (void *) writeback);
566 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
567 CR_UNLOCK_PACKER_CONTEXT(pc);
568}
569
570void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
571{
572 CR_GET_PACKER_CONTEXT(pc);
573 unsigned char *data_ptr;
574 int cbName = crStrlen(name)+1;
575 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
576
577 CR_GET_BUFFERED_POINTER(pc, packet_length);
578 WRITE_DATA_AI(int, packet_length);
579 WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE);
580 WRITE_DATA_AI(GLuint, program);
581 crMemcpy(data_ptr, name, cbName*sizeof(*name));
582 data_ptr += cbName*sizeof(*name);
583 WRITE_NETWORK_POINTER(0, (void *) return_value);
584 WRITE_NETWORK_POINTER(8, (void *) writeback);
585 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
586 CR_UNLOCK_PACKER_CONTEXT(pc);
587}
588
589void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
590{
591 CR_GET_PACKER_CONTEXT(pc);
592 unsigned char *data_ptr;
593 int cbName = crStrlen(name)+1;
594 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
595
596 CR_GET_BUFFERED_POINTER(pc, packet_length);
597 WRITE_DATA_AI(int, packet_length);
598 WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE);
599 WRITE_DATA_AI(GLuint, program);
600 crMemcpy(data_ptr, name, cbName*sizeof(*name));
601 data_ptr += cbName*sizeof(*name);
602 WRITE_NETWORK_POINTER(0, (void *) return_value);
603 WRITE_NETWORK_POINTER(8, (void *) writeback);
604 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
605 CR_UNLOCK_PACKER_CONTEXT(pc);
606}
607
608void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name)
609{
610 CR_GET_PACKER_CONTEXT(pc);
611 (void)program;
612 (void)index;
613 (void)name;
614 (void)pc;
615 crError ("No swap version");
616}
617
618void PACK_APIENTRY crPackShaderSourceSWAP(GLuint shader, GLsizei count, const char **string, const GLint *length)
619{
620 CR_GET_PACKER_CONTEXT(pc);
621 (void)shader;
622 (void)count;
623 (void)string;
624 (void)length;
625 (void)pc;
626 crError ("No swap version");
627}
628
629void PACK_APIENTRY crPackUniform1fvSWAP(GLint location, GLsizei count, const GLfloat *value)
630{
631 CR_GET_PACKER_CONTEXT(pc);
632 (void)location;
633 (void)count;
634 (void)value;
635 (void)pc;
636 crError ("No swap version");
637}
638
639
640void PACK_APIENTRY crPackUniform1ivSWAP(GLint location, GLsizei count, const GLint *value)
641{
642 CR_GET_PACKER_CONTEXT(pc);
643 (void)location;
644 (void)count;
645 (void)value;
646 (void)pc;
647 crError ("No swap version");
648}
649
650void PACK_APIENTRY crPackUniform2fvSWAP(GLint location, GLsizei count, const GLfloat *value)
651{
652 CR_GET_PACKER_CONTEXT(pc);
653 (void)location;
654 (void)count;
655 (void)value;
656 (void)pc;
657 crError ("No swap version");
658}
659
660void PACK_APIENTRY crPackUniform2ivSWAP(GLint location, GLsizei count, const GLint * value)
661{
662 CR_GET_PACKER_CONTEXT(pc);
663 (void)location;
664 (void)count;
665 (void)value;
666 (void)pc;
667 crError ("No swap version");
668}
669
670void PACK_APIENTRY crPackUniform3fvSWAP(GLint location, GLsizei count, const GLfloat *value)
671{
672 CR_GET_PACKER_CONTEXT(pc);
673 (void)location;
674 (void)count;
675 (void)value;
676 (void)pc;
677 crError ("No swap version");
678}
679
680void PACK_APIENTRY crPackUniform3ivSWAP(GLint location, GLsizei count, const GLint *value)
681{
682 CR_GET_PACKER_CONTEXT(pc);
683 (void)location;
684 (void)count;
685 (void)value;
686 (void)pc;
687 crError ("No swap version");
688}
689
690void PACK_APIENTRY crPackUniform4fvSWAP(GLint location, GLsizei count, const GLfloat *value)
691{
692 CR_GET_PACKER_CONTEXT(pc);
693 (void)location;
694 (void)count;
695 (void)value;
696 (void)pc;
697 crError ("No swap version");
698}
699
700void PACK_APIENTRY crPackUniform4ivSWAP(GLint location, GLsizei count, const GLint *value)
701{
702 CR_GET_PACKER_CONTEXT(pc);
703 (void)location;
704 (void)count;
705 (void)value;
706 (void)pc;
707 crError ("No swap version");
708}
709
710void PACK_APIENTRY crPackUniformMatrix2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
711{
712 CR_GET_PACKER_CONTEXT(pc);
713 (void)location;
714 (void)count;
715 (void)transpose;
716 (void)value;
717 (void)pc;
718 crError ("No swap version");
719}
720
721void PACK_APIENTRY crPackUniformMatrix3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
722{
723 CR_GET_PACKER_CONTEXT(pc);
724 (void)location;
725 (void)count;
726 (void)transpose;
727 (void)value;
728 (void)pc;
729 crError ("No swap version");
730}
731
732void PACK_APIENTRY crPackUniformMatrix4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
733{
734 CR_GET_PACKER_CONTEXT(pc);
735 (void)location;
736 (void)count;
737 (void)transpose;
738 (void)value;
739 (void)pc;
740 crError ("No swap version");
741}
742
743void PACK_APIENTRY crPackUniformMatrix2x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
744{
745 CR_GET_PACKER_CONTEXT(pc);
746 (void)location;
747 (void)count;
748 (void)transpose;
749 (void)value;
750 (void)pc;
751 crError ("No swap version");
752}
753
754void PACK_APIENTRY crPackUniformMatrix3x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
755{
756 CR_GET_PACKER_CONTEXT(pc);
757 (void)location;
758 (void)count;
759 (void)transpose;
760 (void)value;
761 (void)pc;
762 crError ("No swap version");
763}
764
765void PACK_APIENTRY crPackUniformMatrix2x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
766{
767 CR_GET_PACKER_CONTEXT(pc);
768 (void)location;
769 (void)count;
770 (void)transpose;
771 (void)value;
772 (void)pc;
773 crError ("No swap version");
774}
775
776void PACK_APIENTRY crPackUniformMatrix4x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
777{
778 CR_GET_PACKER_CONTEXT(pc);
779 (void)location;
780 (void)count;
781 (void)transpose;
782 (void)value;
783 (void)pc;
784 crError ("No swap version");
785}
786
787void PACK_APIENTRY crPackUniformMatrix3x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
788{
789 CR_GET_PACKER_CONTEXT(pc);
790 (void)location;
791 (void)count;
792 (void)transpose;
793 (void)value;
794 (void)pc;
795 crError ("No swap version");
796}
797
798void PACK_APIENTRY crPackUniformMatrix4x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
799{
800 CR_GET_PACKER_CONTEXT(pc);
801 (void)location;
802 (void)count;
803 (void)transpose;
804 (void)value;
805 (void)pc;
806 crError ("No swap version");
807}
808
809void PACK_APIENTRY crPackDrawBuffersSWAP(GLsizei n, const GLenum *bufs)
810{
811 CR_GET_PACKER_CONTEXT(pc);
812 (void)n;
813 (void)bufs;
814 (void)pc;
815 crError ("No swap version");
816}
817
818void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
819{
820 CR_GET_PACKER_CONTEXT(pc);
821 (void)program;
822 (void)name;
823 (void)return_value;
824 (void)writeback;
825 (void)pc;
826 crError ("No swap version");
827}
828
829void PACK_APIENTRY crPackGetUniformLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
830{
831 CR_GET_PACKER_CONTEXT(pc);
832 (void)program;
833 (void)name;
834 (void)return_value;
835 (void)writeback;
836 (void)pc;
837 crError ("No swap version");
838}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette