VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_program.c@ 19223

Last change on this file since 19223 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 16.1 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7/*
8 * Packer functions for GL_NV_vertex_program extension.
9 * XXX: Quite a few of these functions are unfinished.
10 */
11
12
13#include "packer.h"
14#include "cr_error.h"
15
16
17void PACK_APIENTRY crPackProgramParameters4dvNV (GLenum target, GLuint index, GLuint num, const GLdouble * params)
18{
19 GET_PACKER_CONTEXT(pc);
20 unsigned char *data_ptr;
21 int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLdouble);
22
23 GET_BUFFERED_POINTER(pc, packet_length);
24 WRITE_DATA(0, int, packet_length);
25 WRITE_DATA(sizeof(int) + 0, GLenum, target);
26 WRITE_DATA(sizeof(int) + 4, GLuint, index);
27 WRITE_DATA(sizeof(int) + 8, GLuint, num);
28 crMemcpy(data_ptr + sizeof(int) + 12, params, num * 4 * sizeof(GLdouble));
29
30 WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4DVNV_EXTEND_OPCODE);
31}
32
33
34void PACK_APIENTRY crPackProgramParameters4fvNV (GLenum target, GLuint index, GLuint num, const GLfloat * params)
35{
36 GET_PACKER_CONTEXT(pc);
37 unsigned char *data_ptr;
38 int packet_length = sizeof(int) + sizeof(target) + sizeof(index) + sizeof(num) + num * 4 * sizeof(GLfloat);
39
40 GET_BUFFERED_POINTER(pc, packet_length);
41 WRITE_DATA(0, int, packet_length);
42 WRITE_DATA(sizeof(int) + 0, GLenum, target);
43 WRITE_DATA(sizeof(int) + 4, GLuint, index);
44 WRITE_DATA(sizeof(int) + 8, GLuint, num);
45 crMemcpy(data_ptr + sizeof(int) + 12, params, num * 4 * sizeof(GLfloat));
46
47 WRITE_OPCODE(pc, CR_PROGRAMPARAMETERS4FVNV_EXTEND_OPCODE);
48}
49
50
51void PACK_APIENTRY crPackVertexAttribs1dvNV( GLuint index, GLsizei n, const GLdouble *v )
52{
53 GLint i;
54 /* reverse order so we hit index 0 last (provoking glVertex) */
55 for (i = n - 1; i >= 0; i--)
56 crPackVertexAttrib1dvARB(index + i, v + i);
57}
58
59
60void PACK_APIENTRY crPackVertexAttribs1fvNV( GLuint index, GLsizei n, const GLfloat *v )
61{
62 GLint i;
63 /* reverse order so we hit index 0 last (provoking glVertex) */
64 for (i = n - 1; i >= 0; i--)
65 crPackVertexAttrib1fvARB(index + i, v + i);
66}
67
68
69void PACK_APIENTRY crPackVertexAttribs1svNV( GLuint index, GLsizei n, const GLshort *v )
70{
71 GLint i;
72 /* reverse order so we hit index 0 last (provoking glVertex) */
73 for (i = n - 1; i >= 0; i--)
74 crPackVertexAttrib1svARB(index + i, v + i);
75}
76
77
78void PACK_APIENTRY crPackVertexAttribs2dvNV( GLuint index, GLsizei n, const GLdouble *v )
79{
80 GLint i;
81 /* reverse order so we hit index 0 last (provoking glVertex) */
82 for (i = n - 1; i >= 0; i--)
83 crPackVertexAttrib2dvARB(index + i, v + 2 * i);
84}
85
86void PACK_APIENTRY crPackVertexAttribs2fvNV( GLuint index, GLsizei n, const GLfloat *v )
87{
88 GLint i;
89 /* reverse order so we hit index 0 last (provoking glVertex) */
90 for (i = n - 1; i >= 0; i--)
91 crPackVertexAttrib2fvARB(index + i, v + 2 * i);
92}
93
94void PACK_APIENTRY crPackVertexAttribs2svNV( GLuint index, GLsizei n, const GLshort *v )
95{
96 GLint i;
97 /* reverse order so we hit index 0 last (provoking glVertex) */
98 for (i = n - 1; i >= 0; i--)
99 crPackVertexAttrib2svARB(index + i, v + 2 * i);
100}
101
102void PACK_APIENTRY crPackVertexAttribs3dvNV( GLuint index, GLsizei n, const GLdouble *v )
103{
104 GLint i;
105 /* reverse order so we hit index 0 last (provoking glVertex) */
106 for (i = n - 1; i >= 0; i--)
107 crPackVertexAttrib3dvARB(index + i, v + 3 * i);
108}
109
110void PACK_APIENTRY crPackVertexAttribs3fvNV( GLuint index, GLsizei n, const GLfloat *v )
111{
112 GLint i;
113 /* reverse order so we hit index 0 last (provoking glVertex) */
114 for (i = n - 1; i >= 0; i--)
115 crPackVertexAttrib3fvARB(index + i, v + 3 * i);
116}
117
118void PACK_APIENTRY crPackVertexAttribs3svNV( GLuint index, GLsizei n, const GLshort *v )
119{
120 GLint i;
121 /* reverse order so we hit index 0 last (provoking glVertex) */
122 for (i = n - 1; i >= 0; i--)
123 crPackVertexAttrib3svARB(index + i, v + 3 * i);
124}
125
126void PACK_APIENTRY crPackVertexAttribs4dvNV( GLuint index, GLsizei n, const GLdouble *v )
127{
128 GLint i;
129 /* reverse order so we hit index 0 last (provoking glVertex) */
130 for (i = n - 1; i >= 0; i--)
131 crPackVertexAttrib4dvARB(index + i, v + 4 * i);
132}
133
134void PACK_APIENTRY crPackVertexAttribs4fvNV( GLuint index, GLsizei n, const GLfloat *v )
135{
136 GLint i;
137 /* reverse order so we hit index 0 last (provoking glVertex) */
138 for (i = n - 1; i >= 0; i--)
139 crPackVertexAttrib4fvARB(index + i, v + 4 * i);
140}
141
142void PACK_APIENTRY crPackVertexAttribs4svNV( GLuint index, GLsizei n, const GLshort *v )
143{
144 GLint i;
145 /* reverse order so we hit index 0 last (provoking glVertex) */
146 for (i = n - 1; i >= 0; i--)
147 crPackVertexAttrib4svARB(index + i, v + 4 * i);
148}
149
150void PACK_APIENTRY crPackVertexAttribs4ubvNV( GLuint index, GLsizei n, const GLubyte *v )
151{
152 GLint i;
153 /* reverse order so we hit index 0 last (provoking glVertex) */
154 for (i = n - 1; i >= 0; i--)
155 crPackVertexAttrib4ubvARB(index + i, v + 4 * i);
156}
157
158
159void PACK_APIENTRY crPackExecuteProgramNV( GLenum target, GLuint id, const GLfloat *params )
160{
161 const int packet_length = 32;
162 unsigned char *data_ptr;
163 GET_PACKER_CONTEXT(pc);
164
165 GET_BUFFERED_POINTER(pc, packet_length);
166 WRITE_DATA(0, int, packet_length);
167 WRITE_DATA(4, GLenum, CR_EXECUTEPROGRAMNV_EXTEND_OPCODE);
168 WRITE_DATA(8, GLenum, target);
169 WRITE_DATA(12, GLuint, id);
170 WRITE_DATA(16, GLfloat, params[0] );
171 WRITE_DATA(20, GLfloat, params[1] );
172 WRITE_DATA(24, GLfloat, params[2] );
173 WRITE_DATA(28, GLfloat, params[3] );
174 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
175}
176
177void PACK_APIENTRY crPackLoadProgramNV( GLenum target, GLuint id, GLsizei len, const GLubyte *program )
178{
179 const int packet_length = 20 + len;
180 unsigned char *data_ptr;
181 GET_PACKER_CONTEXT(pc);
182
183 GET_BUFFERED_POINTER(pc, packet_length);
184 WRITE_DATA(0, int, packet_length);
185 WRITE_DATA(4, GLenum, CR_LOADPROGRAMNV_EXTEND_OPCODE);
186 WRITE_DATA(8, GLenum, target);
187 WRITE_DATA(12, GLuint, id);
188 WRITE_DATA(16, GLsizei, len );
189 crMemcpy( (void *) (data_ptr + 20), program, len );
190 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
191}
192
193void PACK_APIENTRY crPackRequestResidentProgramsNV( GLsizei n, const GLuint *ids )
194{
195 GET_PACKER_CONTEXT(pc);
196 (void) pc;
197 (void) n;
198 (void) ids;
199 /* We're no-op'ing this function for now. */
200}
201
202
203void PACK_APIENTRY crPackProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
204{
205 GET_PACKER_CONTEXT(pc);
206 unsigned char *data_ptr;
207 int packet_length = 32 + len;
208
209 GET_BUFFERED_POINTER(pc, packet_length);
210 WRITE_DATA(0, GLint, packet_length);
211 WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4FNV_EXTEND_OPCODE);
212 WRITE_DATA(8, GLuint, id);
213 WRITE_DATA(12, GLsizei, len);
214 WRITE_DATA(16, GLfloat, x);
215 WRITE_DATA(20, GLfloat, y);
216 WRITE_DATA(24, GLfloat, z);
217 WRITE_DATA(28, GLfloat, w);
218 crMemcpy( (void *) (data_ptr + 32), name, len );
219 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
220}
221
222void PACK_APIENTRY crPackProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
223{
224 GET_PACKER_CONTEXT(pc);
225 unsigned char *data_ptr;
226 int packet_length = 48 + len;
227
228 GET_BUFFERED_POINTER(pc, packet_length);
229 WRITE_DATA(0, GLint, packet_length);
230 WRITE_DATA(4, GLenum, CR_PROGRAMNAMEDPARAMETER4DNV_EXTEND_OPCODE);
231 WRITE_DATA(8, GLenum, id);
232 WRITE_DATA(12, GLuint, len);
233 WRITE_DOUBLE(16, x);
234 WRITE_DOUBLE(24, y);
235 WRITE_DOUBLE(32, z);
236 WRITE_DOUBLE(40, w);
237 crMemcpy( (void *) (data_ptr + 48), name, len );
238
239 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
240}
241
242void PACK_APIENTRY crPackProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
243{
244 crPackProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]);
245}
246
247void PACK_APIENTRY crPackProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
248{
249 crPackProgramNamedParameter4dNV(id, len, name, v[0], v[1], v[2], v[3]);
250}
251
252
253void PACK_APIENTRY
254crPackAreProgramsResidentNV(GLsizei n, const GLuint * programs,
255 GLboolean *residences, GLboolean *return_val,
256 int *writeback)
257{
258 GET_PACKER_CONTEXT(pc);
259 unsigned char *data_ptr;
260 int packet_length;
261
262 (void) return_val; /* Caller must compute this from residences!!! */
263
264 packet_length = sizeof(int) + /* packet length */
265 sizeof(GLenum) + /* extend opcode */
266 sizeof(n) + /* num programs */
267 n * sizeof(*programs) + /* programs */
268 8 + 8;
269
270 GET_BUFFERED_POINTER(pc, packet_length);
271 WRITE_DATA(0, int, packet_length);
272 WRITE_DATA(4, GLenum, CR_AREPROGRAMSRESIDENTNV_EXTEND_OPCODE);
273 WRITE_DATA(8, GLsizei, n);
274 crMemcpy(data_ptr + 12, programs, n * sizeof(*programs));
275 WRITE_NETWORK_POINTER(12 + n * sizeof(*programs), (void *) residences);
276 WRITE_NETWORK_POINTER(20 + n * sizeof(*programs), (void *) writeback);
277 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
278}
279
280
281void PACK_APIENTRY crPackGetProgramNamedParameterfvNV( GLuint id, GLsizei len, const GLubyte *name, GLfloat *params, int *writeback )
282{
283 int packet_length = 32 + len;
284 GET_PACKER_CONTEXT(pc);
285 unsigned char *data_ptr;
286 GET_BUFFERED_POINTER( pc, packet_length );
287 WRITE_DATA( 0, GLint, packet_length );
288 WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERFVNV_EXTEND_OPCODE );
289 WRITE_DATA( 8, GLuint, id );
290 WRITE_DATA( 12, GLsizei, len );
291 crMemcpy(data_ptr + 16, name, len);
292 WRITE_NETWORK_POINTER( 16 + len, (void *) params );
293 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback );
294 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
295}
296
297void PACK_APIENTRY crPackGetProgramNamedParameterdvNV( GLuint id, GLsizei len, const GLubyte *name, GLdouble *params, int *writeback )
298{
299 int packet_length = 32 + len;
300 GET_PACKER_CONTEXT(pc);
301 unsigned char *data_ptr;
302 GET_BUFFERED_POINTER( pc, packet_length );
303 WRITE_DATA( 0, GLint, packet_length );
304 WRITE_DATA( 4, GLenum, CR_GETPROGRAMNAMEDPARAMETERDVNV_EXTEND_OPCODE );
305 WRITE_DATA( 8, GLuint, id );
306 WRITE_DATA( 12, GLsizei, len );
307 crMemcpy(data_ptr + 16, name, len);
308 WRITE_NETWORK_POINTER( 16 + len, (void *) params );
309 WRITE_NETWORK_POINTER( 16 + len + 8, (void *) writeback );
310 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
311}
312
313
314void PACK_APIENTRY crPackDeleteProgramsARB( GLsizei n, const GLuint *ids )
315{
316 unsigned char *data_ptr;
317 int packet_length = sizeof(GLenum) + sizeof(n) + n * sizeof(*ids);
318
319 if (!ids)
320 return;
321
322 data_ptr = (unsigned char *) crPackAlloc(packet_length);
323 WRITE_DATA( 0, GLenum, CR_DELETEPROGRAMSARB_EXTEND_OPCODE );
324 WRITE_DATA( 4, GLsizei, n );
325 crMemcpy( data_ptr + 8, ids, n * sizeof(*ids) );
326 crHugePacket( CR_EXTEND_OPCODE, data_ptr );
327 crPackFree( data_ptr );
328}
329
330
331void PACK_APIENTRY crPackProgramStringARB( GLenum target, GLenum format, GLsizei len, const void *string )
332{
333 const int packet_length = 20 + len;
334 unsigned char *data_ptr;
335 GET_PACKER_CONTEXT(pc);
336
337 GET_BUFFERED_POINTER(pc, packet_length);
338 WRITE_DATA(0, int, packet_length);
339 WRITE_DATA(4, GLenum, CR_PROGRAMSTRINGARB_EXTEND_OPCODE);
340 WRITE_DATA(8, GLenum, target);
341 WRITE_DATA(12, GLuint, format);
342 WRITE_DATA(16, GLsizei, len );
343 crMemcpy( (void *) (data_ptr + 20), string, len );
344 WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
345}
346
347
348/*
349 * Can't easily auto-generate these functions since there aren't
350 * non-vector versions.
351 */
352
353void PACK_APIENTRY crPackVertexAttrib4NbvARB( GLuint index, const GLbyte *v )
354{
355 GET_PACKER_CONTEXT(pc);
356 unsigned char *data_ptr;
357 (void) pc;
358 GET_BUFFERED_POINTER( pc, 8 );
359 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
360 pc->current.attribsUsedMask |= (1 << index);
361 WRITE_DATA( 0, GLuint, index );
362 WRITE_DATA( 4, GLbyte, v[0] );
363 WRITE_DATA( 5, GLbyte, v[1] );
364 WRITE_DATA( 6, GLbyte, v[2] );
365 WRITE_DATA( 7, GLbyte, v[3] );
366 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NBVARB_OPCODE );
367}
368
369void PACK_APIENTRY crPackVertexAttrib4NivARB( GLuint index, const GLint *v )
370{
371 GET_PACKER_CONTEXT(pc);
372 unsigned char *data_ptr;
373 (void) pc;
374 GET_BUFFERED_POINTER( pc, 20 );
375 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
376 pc->current.attribsUsedMask |= (1 << index);
377 WRITE_DATA( 0, GLuint, index );
378 WRITE_DATA( 4, GLint, v[0] );
379 WRITE_DATA( 8, GLint, v[1] );
380 WRITE_DATA( 12, GLint, v[2] );
381 WRITE_DATA( 16, GLint, v[3] );
382 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NIVARB_OPCODE );
383}
384
385void PACK_APIENTRY crPackVertexAttrib4NsvARB( GLuint index, const GLshort *v )
386{
387 GET_PACKER_CONTEXT(pc);
388 unsigned char *data_ptr;
389 (void) pc;
390 GET_BUFFERED_POINTER( pc, 12 );
391 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
392 pc->current.attribsUsedMask |= (1 << index);
393 WRITE_DATA( 0, GLuint, index );
394 WRITE_DATA( 4, GLshort, v[0] );
395 WRITE_DATA( 6, GLshort, v[1] );
396 WRITE_DATA( 8, GLshort, v[2] );
397 WRITE_DATA( 10, GLshort, v[3] );
398 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NSVARB_OPCODE );
399}
400
401void PACK_APIENTRY crPackVertexAttrib4NubvARB(GLuint index, const GLubyte * v)
402{
403 GET_PACKER_CONTEXT(pc);
404 unsigned char *data_ptr;
405 (void) pc;
406 GET_BUFFERED_POINTER( pc, 8 );
407 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
408 pc->current.attribsUsedMask |= (1 << index);
409 WRITE_DATA( 0, GLuint, index );
410 WRITE_DATA( 4, GLubyte, v[0] );
411 WRITE_DATA( 5, GLubyte, v[1] );
412 WRITE_DATA( 6, GLubyte, v[2] );
413 WRITE_DATA( 7, GLubyte, v[3] );
414 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUBVARB_OPCODE );
415}
416
417void PACK_APIENTRY crPackVertexAttrib4NuivARB(GLuint index, const GLuint * v)
418{
419 GET_PACKER_CONTEXT(pc);
420 unsigned char *data_ptr;
421 (void) pc;
422 GET_BUFFERED_POINTER( pc, 20 );
423 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
424 pc->current.attribsUsedMask |= (1 << index);
425 WRITE_DATA( 0, GLuint, index );
426 WRITE_DATA( 4, GLuint, v[0] );
427 WRITE_DATA( 8, GLuint, v[1] );
428 WRITE_DATA( 12, GLuint, v[2] );
429 WRITE_DATA( 16, GLuint, v[3] );
430 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUIVARB_OPCODE );
431}
432
433void PACK_APIENTRY crPackVertexAttrib4NusvARB(GLuint index, const GLushort * v)
434{
435 GET_PACKER_CONTEXT(pc);
436 unsigned char *data_ptr;
437 (void) pc;
438 GET_BUFFERED_POINTER( pc, 12 );
439 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
440 pc->current.attribsUsedMask |= (1 << index);
441 WRITE_DATA( 0, GLuint, index );
442 WRITE_DATA( 4, GLushort, v[0] );
443 WRITE_DATA( 6, GLushort, v[1] );
444 WRITE_DATA( 8, GLushort, v[2] );
445 WRITE_DATA( 10, GLushort, v[3] );
446 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUSVARB_OPCODE );
447}
448
449void PACK_APIENTRY crPackVertexAttrib4bvARB(GLuint index, const GLbyte * v)
450{
451 GET_PACKER_CONTEXT(pc);
452 unsigned char *data_ptr;
453 (void) pc;
454 GET_BUFFERED_POINTER( pc, 8 );
455 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
456 pc->current.attribsUsedMask |= (1 << index);
457 WRITE_DATA( 0, GLuint, index );
458 WRITE_DATA( 4, GLbyte, v[0] );
459 WRITE_DATA( 5, GLbyte, v[1] );
460 WRITE_DATA( 6, GLbyte, v[2] );
461 WRITE_DATA( 7, GLbyte, v[3] );
462 WRITE_OPCODE( pc, CR_VERTEXATTRIB4BVARB_OPCODE );
463}
464
465void PACK_APIENTRY crPackVertexAttrib4ivARB(GLuint index, const GLint * v)
466{
467 GET_PACKER_CONTEXT(pc);
468 unsigned char *data_ptr;
469 (void) pc;
470 GET_BUFFERED_POINTER( pc, 20 );
471 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
472 pc->current.attribsUsedMask |= (1 << index);
473 WRITE_DATA( 0, GLuint, index );
474 WRITE_DATA( 4, GLint, v[0] );
475 WRITE_DATA( 8, GLint, v[1] );
476 WRITE_DATA( 12, GLint, v[2] );
477 WRITE_DATA( 16, GLint, v[3] );
478 WRITE_OPCODE( pc, CR_VERTEXATTRIB4IVARB_OPCODE );
479}
480
481void PACK_APIENTRY crPackVertexAttrib4uivARB(GLuint index, const GLuint * v)
482{
483 GET_PACKER_CONTEXT(pc);
484 unsigned char *data_ptr;
485 (void) pc;
486 GET_BUFFERED_POINTER( pc, 20 );
487 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
488 pc->current.attribsUsedMask |= (1 << index);
489 WRITE_DATA( 0, GLuint, index );
490 WRITE_DATA( 4, GLuint, v[0] );
491 WRITE_DATA( 8, GLuint, v[1] );
492 WRITE_DATA( 12, GLuint, v[2] );
493 WRITE_DATA( 16, GLuint, v[3] );
494 WRITE_OPCODE( pc, CR_VERTEXATTRIB4UIVARB_OPCODE );
495}
496
497void PACK_APIENTRY crPackVertexAttrib4usvARB(GLuint index, const GLushort * v)
498{
499 GET_PACKER_CONTEXT(pc);
500 unsigned char *data_ptr;
501 (void) pc;
502 GET_BUFFERED_POINTER( pc, 12 );
503 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
504 pc->current.attribsUsedMask |= (1 << index);
505 WRITE_DATA( 0, GLuint, index );
506 WRITE_DATA( 4, GLushort, v[0] );
507 WRITE_DATA( 6, GLushort, v[1] );
508 WRITE_DATA( 8, GLushort, v[2] );
509 WRITE_DATA( 10, GLushort, v[3] );
510 WRITE_OPCODE( pc, CR_VERTEXATTRIB4USVARB_OPCODE );
511}
512
513
514void PACK_APIENTRY crPackVertexAttrib4ubvARB(GLuint index, const GLubyte * v)
515{
516 GET_PACKER_CONTEXT(pc);
517 unsigned char *data_ptr;
518 (void) pc;
519 GET_BUFFERED_POINTER( pc, 8 );
520 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
521 pc->current.attribsUsedMask |= (1 << index);
522 WRITE_DATA( 0, GLuint, index );
523 WRITE_DATA( 4, GLubyte, v[0] );
524 WRITE_DATA( 5, GLubyte, v[1] );
525 WRITE_DATA( 6, GLubyte, v[2] );
526 WRITE_DATA( 7, GLubyte, v[3] );
527 WRITE_OPCODE( pc, CR_VERTEXATTRIB4UBVARB_OPCODE );
528}
529
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