VirtualBox

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

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

crOpenGL: tabs to spaces

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 17.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 GET_BUFFERED_POINTER( pc, 8 );
358 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
359 pc->current.attribsUsedMask |= (1 << index);
360 WRITE_DATA( 0, GLuint, index );
361 WRITE_DATA( 4, GLbyte, v[0] );
362 WRITE_DATA( 5, GLbyte, v[1] );
363 WRITE_DATA( 6, GLbyte, v[2] );
364 WRITE_DATA( 7, GLbyte, v[3] );
365 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NBVARB_OPCODE );
366}
367
368void PACK_APIENTRY crPackVertexAttrib4NivARB( GLuint index, const GLint *v )
369{
370 GET_PACKER_CONTEXT(pc);
371 unsigned char *data_ptr;
372 GET_BUFFERED_POINTER( pc, 20 );
373 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
374 pc->current.attribsUsedMask |= (1 << index);
375 WRITE_DATA( 0, GLuint, index );
376 WRITE_DATA( 4, GLint, v[0] );
377 WRITE_DATA( 8, GLint, v[1] );
378 WRITE_DATA( 12, GLint, v[2] );
379 WRITE_DATA( 16, GLint, v[3] );
380 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NIVARB_OPCODE );
381}
382
383void PACK_APIENTRY crPackVertexAttrib4NsvARB( GLuint index, const GLshort *v )
384{
385 GET_PACKER_CONTEXT(pc);
386 unsigned char *data_ptr;
387 GET_BUFFERED_POINTER( pc, 12 );
388 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
389 pc->current.attribsUsedMask |= (1 << index);
390 WRITE_DATA( 0, GLuint, index );
391 WRITE_DATA( 4, GLshort, v[0] );
392 WRITE_DATA( 6, GLshort, v[1] );
393 WRITE_DATA( 8, GLshort, v[2] );
394 WRITE_DATA( 10, GLshort, v[3] );
395 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NSVARB_OPCODE );
396}
397
398void PACK_APIENTRY crPackVertexAttrib4NubvARB(GLuint index, const GLubyte * v)
399{
400 GET_PACKER_CONTEXT(pc);
401 unsigned char *data_ptr;
402 GET_BUFFERED_POINTER( pc, 8 );
403 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
404 pc->current.attribsUsedMask |= (1 << index);
405 WRITE_DATA( 0, GLuint, index );
406 WRITE_DATA( 4, GLubyte, v[0] );
407 WRITE_DATA( 5, GLubyte, v[1] );
408 WRITE_DATA( 6, GLubyte, v[2] );
409 WRITE_DATA( 7, GLubyte, v[3] );
410 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUBVARB_OPCODE );
411}
412
413void PACK_APIENTRY crPackVertexAttrib4NuivARB(GLuint index, const GLuint * v)
414{
415 GET_PACKER_CONTEXT(pc);
416 unsigned char *data_ptr;
417 GET_BUFFERED_POINTER( pc, 20 );
418 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
419 pc->current.attribsUsedMask |= (1 << index);
420 WRITE_DATA( 0, GLuint, index );
421 WRITE_DATA( 4, GLuint, v[0] );
422 WRITE_DATA( 8, GLuint, v[1] );
423 WRITE_DATA( 12, GLuint, v[2] );
424 WRITE_DATA( 16, GLuint, v[3] );
425 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUIVARB_OPCODE );
426}
427
428void PACK_APIENTRY crPackVertexAttrib4NusvARB(GLuint index, const GLushort * v)
429{
430 GET_PACKER_CONTEXT(pc);
431 unsigned char *data_ptr;
432 GET_BUFFERED_POINTER( pc, 12 );
433 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
434 pc->current.attribsUsedMask |= (1 << index);
435 WRITE_DATA( 0, GLuint, index );
436 WRITE_DATA( 4, GLushort, v[0] );
437 WRITE_DATA( 6, GLushort, v[1] );
438 WRITE_DATA( 8, GLushort, v[2] );
439 WRITE_DATA( 10, GLushort, v[3] );
440 WRITE_OPCODE( pc, CR_VERTEXATTRIB4NUSVARB_OPCODE );
441}
442
443void PACK_APIENTRY crPackVertexAttrib4bvARB(GLuint index, const GLbyte * v)
444{
445 GET_PACKER_CONTEXT(pc);
446 unsigned char *data_ptr;
447 GET_BUFFERED_POINTER( pc, 8 );
448 pc->current.c.vertexAttrib.b4[index] = data_ptr + 12;
449 pc->current.attribsUsedMask |= (1 << index);
450 WRITE_DATA( 0, GLuint, index );
451 WRITE_DATA( 4, GLbyte, v[0] );
452 WRITE_DATA( 5, GLbyte, v[1] );
453 WRITE_DATA( 6, GLbyte, v[2] );
454 WRITE_DATA( 7, GLbyte, v[3] );
455 WRITE_OPCODE( pc, CR_VERTEXATTRIB4BVARB_OPCODE );
456}
457
458void PACK_APIENTRY crPackVertexAttrib4ivARB(GLuint index, const GLint * v)
459{
460 GET_PACKER_CONTEXT(pc);
461 unsigned char *data_ptr;
462 GET_BUFFERED_POINTER( pc, 20 );
463 pc->current.c.vertexAttrib.i4[index] = data_ptr + 12;
464 pc->current.attribsUsedMask |= (1 << index);
465 WRITE_DATA( 0, GLuint, index );
466 WRITE_DATA( 4, GLint, v[0] );
467 WRITE_DATA( 8, GLint, v[1] );
468 WRITE_DATA( 12, GLint, v[2] );
469 WRITE_DATA( 16, GLint, v[3] );
470 WRITE_OPCODE( pc, CR_VERTEXATTRIB4IVARB_OPCODE );
471}
472
473void PACK_APIENTRY crPackVertexAttrib4uivARB(GLuint index, const GLuint * v)
474{
475 GET_PACKER_CONTEXT(pc);
476 unsigned char *data_ptr;
477 GET_BUFFERED_POINTER( pc, 20 );
478 pc->current.c.vertexAttrib.ui4[index] = data_ptr + 12;
479 pc->current.attribsUsedMask |= (1 << index);
480 WRITE_DATA( 0, GLuint, index );
481 WRITE_DATA( 4, GLuint, v[0] );
482 WRITE_DATA( 8, GLuint, v[1] );
483 WRITE_DATA( 12, GLuint, v[2] );
484 WRITE_DATA( 16, GLuint, v[3] );
485 WRITE_OPCODE( pc, CR_VERTEXATTRIB4UIVARB_OPCODE );
486}
487
488void PACK_APIENTRY crPackVertexAttrib4usvARB(GLuint index, const GLushort * v)
489{
490 GET_PACKER_CONTEXT(pc);
491 unsigned char *data_ptr;
492 GET_BUFFERED_POINTER( pc, 12 );
493 pc->current.c.vertexAttrib.s4[index] = data_ptr + 12;
494 pc->current.attribsUsedMask |= (1 << index);
495 WRITE_DATA( 0, GLuint, index );
496 WRITE_DATA( 4, GLushort, v[0] );
497 WRITE_DATA( 6, GLushort, v[1] );
498 WRITE_DATA( 8, GLushort, v[2] );
499 WRITE_DATA( 10, GLushort, v[3] );
500 WRITE_OPCODE( pc, CR_VERTEXATTRIB4USVARB_OPCODE );
501}
502
503
504void PACK_APIENTRY crPackVertexAttrib4ubvARB(GLuint index, const GLubyte * v)
505{
506 GET_PACKER_CONTEXT(pc);
507 unsigned char *data_ptr;
508 GET_BUFFERED_POINTER( pc, 8 );
509 pc->current.c.vertexAttrib.ub4[index] = data_ptr + 12;
510 pc->current.attribsUsedMask |= (1 << index);
511 WRITE_DATA( 0, GLuint, index );
512 WRITE_DATA( 4, GLubyte, v[0] );
513 WRITE_DATA( 5, GLubyte, v[1] );
514 WRITE_DATA( 6, GLubyte, v[2] );
515 WRITE_DATA( 7, GLubyte, v[3] );
516 WRITE_OPCODE( pc, CR_VERTEXATTRIB4UBVARB_OPCODE );
517}
518
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