VirtualBox

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

Last change on this file since 27244 was 27244, checked in by vboxsync, 15 years ago

crOpenGL: non square uniform matricies support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 25.8 KB
Line 
1/* $Id: pack_shaders.c 27244 2010-03-10 11:43:03Z 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
27void 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
43void 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
92void 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
107void 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
122void 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
137void 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
152void 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
167void 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
182void 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
197void 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
212void 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
228void 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
244void 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
260void PACK_APIENTRY crPackUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
261{
262 GET_PACKER_CONTEXT(pc);
263 unsigned char *data_ptr;
264 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
265 + 2*3*count*sizeof(*value);
266
267 GET_BUFFERED_POINTER(pc, packet_length);
268 WRITE_DATA_AI(int, packet_length);
269 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X3FV_EXTEND_OPCODE);
270 WRITE_DATA_AI(GLint, location);
271 WRITE_DATA_AI(GLsizei, count);
272 WRITE_DATA_AI(GLboolean, transpose);
273 crMemcpy(data_ptr, value, 2*3*count*sizeof(*value));
274 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
275}
276
277void PACK_APIENTRY crPackUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
278{
279 GET_PACKER_CONTEXT(pc);
280 unsigned char *data_ptr;
281 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
282 + 3*2*count*sizeof(*value);
283
284 GET_BUFFERED_POINTER(pc, packet_length);
285 WRITE_DATA_AI(int, packet_length);
286 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X2FV_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, 3*2*count*sizeof(*value));
291 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
292}
293
294void PACK_APIENTRY crPackUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
295{
296 GET_PACKER_CONTEXT(pc);
297 unsigned char *data_ptr;
298 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
299 + 2*4*count*sizeof(*value);
300
301 GET_BUFFERED_POINTER(pc, packet_length);
302 WRITE_DATA_AI(int, packet_length);
303 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX2X4FV_EXTEND_OPCODE);
304 WRITE_DATA_AI(GLint, location);
305 WRITE_DATA_AI(GLsizei, count);
306 WRITE_DATA_AI(GLboolean, transpose);
307 crMemcpy(data_ptr, value, 2*4*count*sizeof(*value));
308 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
309}
310
311void PACK_APIENTRY crPackUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
312{
313 GET_PACKER_CONTEXT(pc);
314 unsigned char *data_ptr;
315 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
316 + 4*2*count*sizeof(*value);
317
318 GET_BUFFERED_POINTER(pc, packet_length);
319 WRITE_DATA_AI(int, packet_length);
320 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X2FV_EXTEND_OPCODE);
321 WRITE_DATA_AI(GLint, location);
322 WRITE_DATA_AI(GLsizei, count);
323 WRITE_DATA_AI(GLboolean, transpose);
324 crMemcpy(data_ptr, value, 4*2*count*sizeof(*value));
325 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
326}
327
328void PACK_APIENTRY crPackUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
329{
330 GET_PACKER_CONTEXT(pc);
331 unsigned char *data_ptr;
332 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
333 + 3*4*count*sizeof(*value);
334
335 GET_BUFFERED_POINTER(pc, packet_length);
336 WRITE_DATA_AI(int, packet_length);
337 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX3X4FV_EXTEND_OPCODE);
338 WRITE_DATA_AI(GLint, location);
339 WRITE_DATA_AI(GLsizei, count);
340 WRITE_DATA_AI(GLboolean, transpose);
341 crMemcpy(data_ptr, value, 3*4*count*sizeof(*value));
342 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
343}
344
345void PACK_APIENTRY crPackUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
346{
347 GET_PACKER_CONTEXT(pc);
348 unsigned char *data_ptr;
349 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(location)+sizeof(count)+sizeof(transpose)
350 + 4*3*count*sizeof(*value);
351
352 GET_BUFFERED_POINTER(pc, packet_length);
353 WRITE_DATA_AI(int, packet_length);
354 WRITE_DATA_AI(GLenum, CR_UNIFORMMATRIX4X3FV_EXTEND_OPCODE);
355 WRITE_DATA_AI(GLint, location);
356 WRITE_DATA_AI(GLsizei, count);
357 WRITE_DATA_AI(GLboolean, transpose);
358 crMemcpy(data_ptr, value, 4*3*count*sizeof(*value));
359 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
360}
361
362void PACK_APIENTRY crPackDrawBuffers(GLsizei n, const GLenum *bufs)
363{
364 GET_PACKER_CONTEXT(pc);
365 unsigned char *data_ptr;
366 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(n) + n*sizeof(*bufs);
367
368 GET_BUFFERED_POINTER(pc, packet_length);
369 WRITE_DATA_AI(int, packet_length);
370 WRITE_DATA_AI(GLenum, CR_DRAWBUFFERS_EXTEND_OPCODE);
371 WRITE_DATA_AI(GLsizei, n);
372 crMemcpy(data_ptr, bufs, n*sizeof(*bufs));
373 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
374}
375
376/*@todo next 8 functions are bit hacky,
377 * we expect packspu to pass a single structure with all output parameters via first output pointer.
378 * it'd be better to add CRMessageMultiReadback one day.
379 */
380void PACK_APIENTRY crPackGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
381{
382 GET_PACKER_CONTEXT(pc);
383 unsigned char *data_ptr;
384 (void) pc;
385 (void) size;
386 (void) type;
387 (void) name;
388 GET_BUFFERED_POINTER(pc, 36);
389 WRITE_DATA(0, GLint, 36);
390 WRITE_DATA(4, GLenum, CR_GETACTIVEATTRIB_EXTEND_OPCODE);
391 WRITE_DATA(8, GLuint, program);
392 WRITE_DATA(12, GLuint, index);
393 WRITE_DATA(16, GLsizei, bufSize);
394 WRITE_NETWORK_POINTER(20, (void *) length);
395 WRITE_NETWORK_POINTER(28, (void *) writeback);
396 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
397}
398
399void PACK_APIENTRY crPackGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, char * name, int * writeback)
400{
401 GET_PACKER_CONTEXT(pc);
402 unsigned char *data_ptr;
403 (void) pc;
404 (void) size;
405 (void) type;
406 (void) name;
407 GET_BUFFERED_POINTER(pc, 36);
408 WRITE_DATA(0, GLint, 36);
409 WRITE_DATA(4, GLenum, CR_GETACTIVEUNIFORM_EXTEND_OPCODE);
410 WRITE_DATA(8, GLuint, program);
411 WRITE_DATA(12, GLuint, index);
412 WRITE_DATA(16, GLsizei, bufSize);
413 WRITE_NETWORK_POINTER(20, (void *) length);
414 WRITE_NETWORK_POINTER(28, (void *) writeback);
415 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
416}
417
418void PACK_APIENTRY crPackGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders, int * writeback)
419{
420 GET_PACKER_CONTEXT(pc);
421 unsigned char *data_ptr;
422 (void) pc;
423 (void) shaders;
424 GET_BUFFERED_POINTER(pc, 32);
425 WRITE_DATA(0, GLint, 32);
426 WRITE_DATA(4, GLenum, CR_GETATTACHEDSHADERS_EXTEND_OPCODE);
427 WRITE_DATA(8, GLuint, program);
428 WRITE_DATA(12, GLsizei, maxCount);
429 WRITE_NETWORK_POINTER(16, (void *) count);
430 WRITE_NETWORK_POINTER(24, (void *) writeback);
431 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
432}
433
434void PACK_APIENTRY crPackGetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj, int * writeback)
435{
436 GET_PACKER_CONTEXT(pc);
437 unsigned char *data_ptr;
438 (void) pc;
439 GET_BUFFERED_POINTER(pc, 32);
440 WRITE_DATA(0, GLint, 32);
441 WRITE_DATA(4, GLenum, CR_GETATTACHEDOBJECTSARB_EXTEND_OPCODE);
442 WRITE_DATA(8, GLhandleARB, containerObj);
443 WRITE_DATA(12, GLsizei, maxCount);
444 WRITE_NETWORK_POINTER(16, (void *) count);
445 WRITE_NETWORK_POINTER(24, (void *) writeback);
446 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
447}
448
449void PACK_APIENTRY crPackGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog, int * writeback)
450{
451 GET_PACKER_CONTEXT(pc);
452 unsigned char *data_ptr;
453 (void) pc;
454 GET_BUFFERED_POINTER(pc, 32);
455 WRITE_DATA(0, GLint, 32);
456 WRITE_DATA(4, GLenum, CR_GETINFOLOGARB_EXTEND_OPCODE);
457 WRITE_DATA(8, GLhandleARB, obj);
458 WRITE_DATA(12, GLsizei, maxLength);
459 WRITE_NETWORK_POINTER(16, (void *) length);
460 WRITE_NETWORK_POINTER(24, (void *) writeback);
461 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
462}
463
464void PACK_APIENTRY crPackGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
465{
466 GET_PACKER_CONTEXT(pc);
467 unsigned char *data_ptr;
468 (void) pc;
469 (void) infoLog;
470 GET_BUFFERED_POINTER(pc, 32);
471 WRITE_DATA(0, GLint, 32);
472 WRITE_DATA(4, GLenum, CR_GETPROGRAMINFOLOG_EXTEND_OPCODE);
473 WRITE_DATA(8, GLuint, program);
474 WRITE_DATA(12, GLsizei, bufSize);
475 WRITE_NETWORK_POINTER(16, (void *) length);
476 WRITE_NETWORK_POINTER(24, (void *) writeback);
477 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
478}
479
480void PACK_APIENTRY crPackGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, char * infoLog, int * writeback)
481{
482 GET_PACKER_CONTEXT(pc);
483 unsigned char *data_ptr;
484 (void) pc;
485 (void) infoLog;
486 GET_BUFFERED_POINTER(pc, 32);
487 WRITE_DATA(0, GLint, 32);
488 WRITE_DATA(4, GLenum, CR_GETSHADERINFOLOG_EXTEND_OPCODE);
489 WRITE_DATA(8, GLuint, shader);
490 WRITE_DATA(12, GLsizei, bufSize);
491 WRITE_NETWORK_POINTER(16, (void *) length);
492 WRITE_NETWORK_POINTER(24, (void *) writeback);
493 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
494}
495
496void PACK_APIENTRY crPackGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source, int * writeback)
497{
498 GET_PACKER_CONTEXT(pc);
499 unsigned char *data_ptr;
500 (void) pc;
501 (void) source;
502 GET_BUFFERED_POINTER(pc, 32);
503 WRITE_DATA(0, GLint, 32);
504 WRITE_DATA(4, GLenum, CR_GETSHADERSOURCE_EXTEND_OPCODE);
505 WRITE_DATA(8, GLuint, shader);
506 WRITE_DATA(12, GLsizei, bufSize);
507 WRITE_NETWORK_POINTER(16, (void *) length);
508 WRITE_NETWORK_POINTER(24, (void *) writeback);
509 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
510}
511
512void PACK_APIENTRY crPackGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData, int * writeback)
513{
514 GET_PACKER_CONTEXT(pc);
515 unsigned char *data_ptr;
516 (void) pData;
517 GET_BUFFERED_POINTER(pc, 32);
518 WRITE_DATA(0, GLint, 32);
519 WRITE_DATA(4, GLenum, CR_GETUNIFORMSLOCATIONS_EXTEND_OPCODE);
520 WRITE_DATA(8, GLuint, program);
521 WRITE_DATA(12, GLsizei, maxcbData);
522 WRITE_NETWORK_POINTER(16, (void *) cbData);
523 WRITE_NETWORK_POINTER(24, (void *) writeback);
524 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
525}
526
527void PACK_APIENTRY crPackGetAttribLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
528{
529 GET_PACKER_CONTEXT(pc);
530 unsigned char *data_ptr;
531 int cbName = crStrlen(name)+1;
532 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
533
534 GET_BUFFERED_POINTER(pc, packet_length);
535 WRITE_DATA_AI(int, packet_length);
536 WRITE_DATA_AI(GLenum, CR_GETATTRIBLOCATION_EXTEND_OPCODE);
537 WRITE_DATA_AI(GLuint, program);
538 crMemcpy(data_ptr, name, cbName*sizeof(*name));
539 data_ptr += cbName*sizeof(*name);
540 WRITE_NETWORK_POINTER(0, (void *) return_value);
541 WRITE_NETWORK_POINTER(8, (void *) writeback);
542 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
543}
544
545void PACK_APIENTRY crPackGetUniformLocation(GLuint program, const char * name, GLint * return_value, int * writeback)
546{
547 GET_PACKER_CONTEXT(pc);
548 unsigned char *data_ptr;
549 int cbName = crStrlen(name)+1;
550 int packet_length = sizeof(int)+sizeof(GLenum)+sizeof(program)+cbName*sizeof(*name)+16;
551
552 GET_BUFFERED_POINTER(pc, packet_length);
553 WRITE_DATA_AI(int, packet_length);
554 WRITE_DATA_AI(GLenum, CR_GETUNIFORMLOCATION_EXTEND_OPCODE);
555 WRITE_DATA_AI(GLuint, program);
556 crMemcpy(data_ptr, name, cbName*sizeof(*name));
557 data_ptr += cbName*sizeof(*name);
558 WRITE_NETWORK_POINTER(0, (void *) return_value);
559 WRITE_NETWORK_POINTER(8, (void *) writeback);
560 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
561}
562
563void PACK_APIENTRY crPackBindAttribLocationSWAP(GLuint program, GLuint index, const char *name)
564{
565 GET_PACKER_CONTEXT(pc);
566 (void)program;
567 (void)index;
568 (void)name;
569 crError ("No swap version");
570 (void) pc;
571}
572
573void PACK_APIENTRY crPackShaderSourceSWAP(GLuint shader, GLsizei count, const char **string, const GLint *length)
574{
575 GET_PACKER_CONTEXT(pc);
576 (void)shader;
577 (void)count;
578 (void)string;
579 (void)length;
580 crError ("No swap version");
581 (void) pc;
582}
583
584void PACK_APIENTRY crPackUniform1fvSWAP(GLint location, GLsizei count, const GLfloat *value)
585{
586 GET_PACKER_CONTEXT(pc);
587 (void)location;
588 (void)count;
589 (void)value;
590 crError ("No swap version");
591 (void) pc;
592}
593
594
595void PACK_APIENTRY crPackUniform1ivSWAP(GLint location, GLsizei count, const GLint *value)
596{
597 GET_PACKER_CONTEXT(pc);
598 (void)location;
599 (void)count;
600 (void)value;
601 crError ("No swap version");
602 (void) pc;
603}
604
605void PACK_APIENTRY crPackUniform2fvSWAP(GLint location, GLsizei count, const GLfloat *value)
606{
607 GET_PACKER_CONTEXT(pc);
608 (void)location;
609 (void)count;
610 (void)value;
611 crError ("No swap version");
612 (void) pc;
613}
614
615void PACK_APIENTRY crPackUniform2ivSWAP(GLint location, GLsizei count, const GLint * value)
616{
617 GET_PACKER_CONTEXT(pc);
618 (void)location;
619 (void)count;
620 (void)value;
621 crError ("No swap version");
622 (void) pc;
623}
624
625void PACK_APIENTRY crPackUniform3fvSWAP(GLint location, GLsizei count, const GLfloat *value)
626{
627 GET_PACKER_CONTEXT(pc);
628 (void)location;
629 (void)count;
630 (void)value;
631 crError ("No swap version");
632 (void) pc;
633}
634
635void PACK_APIENTRY crPackUniform3ivSWAP(GLint location, GLsizei count, const GLint *value)
636{
637 GET_PACKER_CONTEXT(pc);
638 (void)location;
639 (void)count;
640 (void)value;
641 crError ("No swap version");
642 (void) pc;
643}
644
645void PACK_APIENTRY crPackUniform4fvSWAP(GLint location, GLsizei count, const GLfloat *value)
646{
647 GET_PACKER_CONTEXT(pc);
648 (void)location;
649 (void)count;
650 (void)value;
651 crError ("No swap version");
652 (void) pc;
653}
654
655void PACK_APIENTRY crPackUniform4ivSWAP(GLint location, GLsizei count, const GLint *value)
656{
657 GET_PACKER_CONTEXT(pc);
658 (void)location;
659 (void)count;
660 (void)value;
661 crError ("No swap version");
662 (void) pc;
663}
664
665void PACK_APIENTRY crPackUniformMatrix2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
666{
667 GET_PACKER_CONTEXT(pc);
668 (void)location;
669 (void)count;
670 (void)transpose;
671 (void)value;
672 crError ("No swap version");
673 (void) pc;
674}
675
676void PACK_APIENTRY crPackUniformMatrix3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
677{
678 GET_PACKER_CONTEXT(pc);
679 (void)location;
680 (void)count;
681 (void)transpose;
682 (void)value;
683 crError ("No swap version");
684 (void) pc;
685}
686
687void PACK_APIENTRY crPackUniformMatrix4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
688{
689 GET_PACKER_CONTEXT(pc);
690 (void)location;
691 (void)count;
692 (void)transpose;
693 (void)value;
694 crError ("No swap version");
695 (void) pc;
696}
697
698void PACK_APIENTRY crPackUniformMatrix2x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
699{
700 GET_PACKER_CONTEXT(pc);
701 (void)location;
702 (void)count;
703 (void)transpose;
704 (void)value;
705 crError ("No swap version");
706 (void) pc;
707}
708
709void PACK_APIENTRY crPackUniformMatrix3x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
710{
711 GET_PACKER_CONTEXT(pc);
712 (void)location;
713 (void)count;
714 (void)transpose;
715 (void)value;
716 crError ("No swap version");
717 (void) pc;
718}
719
720void PACK_APIENTRY crPackUniformMatrix2x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
721{
722 GET_PACKER_CONTEXT(pc);
723 (void)location;
724 (void)count;
725 (void)transpose;
726 (void)value;
727 crError ("No swap version");
728 (void) pc;
729}
730
731void PACK_APIENTRY crPackUniformMatrix4x2fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
732{
733 GET_PACKER_CONTEXT(pc);
734 (void)location;
735 (void)count;
736 (void)transpose;
737 (void)value;
738 crError ("No swap version");
739 (void) pc;
740}
741
742void PACK_APIENTRY crPackUniformMatrix3x4fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
743{
744 GET_PACKER_CONTEXT(pc);
745 (void)location;
746 (void)count;
747 (void)transpose;
748 (void)value;
749 crError ("No swap version");
750 (void) pc;
751}
752
753void PACK_APIENTRY crPackUniformMatrix4x3fvSWAP(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
754{
755 GET_PACKER_CONTEXT(pc);
756 (void)location;
757 (void)count;
758 (void)transpose;
759 (void)value;
760 crError ("No swap version");
761 (void) pc;
762}
763
764void PACK_APIENTRY crPackDrawBuffersSWAP(GLsizei n, const GLenum *bufs)
765{
766 GET_PACKER_CONTEXT(pc);
767 (void)n;
768 (void)bufs;
769 crError ("No swap version");
770 (void) pc;
771}
772
773void PACK_APIENTRY crPackGetAttribLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
774{
775 GET_PACKER_CONTEXT(pc);
776 (void)program;
777 (void)name;
778 (void)return_value;
779 (void)writeback;
780 crError ("No swap version");
781 (void) pc;
782}
783
784void PACK_APIENTRY crPackGetUniformLocationSWAP(GLuint program, const char * name, GLint * return_value, int * writeback)
785{
786 GET_PACKER_CONTEXT(pc);
787 (void)program;
788 (void)name;
789 (void)return_value;
790 (void)writeback;
791 crError ("No swap version");
792 (void) pc;
793}
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