VirtualBox

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

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

crOpenGL/wddm: multithreading fix

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