VirtualBox

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

Last change on this file since 41057 was 37393, checked in by vboxsync, 14 years ago

OpenGL/packer/pack_shaders.c: more dead code false positives

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