summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_exec_generic.c
blob: 11d1ef76f59f364b6abe23a49dc6121242686076 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
/**************************************************************************

Copyright 2004 Tungsten Graphics Inc., Cedar Park, Texas.

All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
on the rights to use, copy, modify, merge, publish, distribute, sub
license, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

**************************************************************************/

/*
 * Authors:
 *   Keith Whitwell <keith@tungstengraphics.com>
 */

#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "vtxfmt.h"
#include "dlist.h"
#include "state.h"
#include "light.h"
#include "api_arrayelt.h"
#include "api_noop.h"

#include "brw_exec.h"


/* Versions of all the entrypoints for situations where codegen isn't
 * available.  
 *
 * Note: Only one size for each attribute may be active at once.
 * Eg. if Color3f is installed/active, then Color4f may not be, even
 * if the vertex actually contains 4 color coordinates.  This is
 * because the 3f version won't otherwise set color[3] to 1.0 -- this
 * is the job of the chooser function when switching between Color4f
 * and Color3f.
 */
#define ATTRFV( ATTR, N )				\
static void attrib_##ATTR##_##N( const GLfloat *v )	\
{							\
   GET_CURRENT_CONTEXT( ctx );				\
   struct brw_exec_context *exec = IMM_CONTEXT(ctx)->exec;			\
							\
   if ((ATTR) == 0) {					\
      GLuint i;						\
							\
      if (N>0) exec->vtx.vbptr[0] = v[0];		\
      if (N>1) exec->vtx.vbptr[1] = v[1];		\
      if (N>2) exec->vtx.vbptr[2] = v[2];		\
      if (N>3) exec->vtx.vbptr[3] = v[3];		\
							\
      for (i = N; i < exec->vtx.vertex_size; i++)	\
	 exec->vtx.vbptr[i] = exec->vtx.vertex[i];	\
							\
      exec->vtx.vbptr += exec->vtx.vertex_size;		\
      exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; \
							\
      if (++exec->vtx.vert_count >= exec->vtx.max_vert)	\
	 brw_exec_vtx_wrap( exec );		\
   }							\
   else {						\
      GLfloat *dest = exec->vtx.attrptr[ATTR];		\
      if (N>0) dest[0] = v[0];				\
      if (N>1) dest[1] = v[1];				\
      if (N>2) dest[2] = v[2];				\
      if (N>3) dest[3] = v[3];				\
   }							\
}

#define INIT(TAB, ATTR)						\
   TAB[ATTR][0] = attrib_##ATTR##_1;				\
   TAB[ATTR][1] = attrib_##ATTR##_2;				\
   TAB[ATTR][2] = attrib_##ATTR##_3;				\
   TAB[ATTR][3] = attrib_##ATTR##_4;


#define ATTRS( ATTRIB )				\
   ATTRFV( ATTRIB, 1 )				\
   ATTRFV( ATTRIB, 2 )				\
   ATTRFV( ATTRIB, 3 )				\
   ATTRFV( ATTRIB, 4 )			

ATTRS( 0 )
ATTRS( 1 )
ATTRS( 2 )
ATTRS( 3 )
ATTRS( 4 )
ATTRS( 5 )
ATTRS( 6 )
ATTRS( 7 )
ATTRS( 8 )
ATTRS( 9 )
ATTRS( 10 )
ATTRS( 11 )
ATTRS( 12 )
ATTRS( 13 )
ATTRS( 14 )
ATTRS( 15 )

void brw_exec_generic_attr_table_init( brw_attrfv_func (*tab)[4] )
{
   INIT( tab, 0 );
   INIT( tab, 1 );
   INIT( tab, 2 );
   INIT( tab, 3 );
   INIT( tab, 4 );
   INIT( tab, 5 );
   INIT( tab, 6 );
   INIT( tab, 7 );
   INIT( tab, 8 );
   INIT( tab, 9 );
   INIT( tab, 10 );
   INIT( tab, 11 );
   INIT( tab, 12 );
   INIT( tab, 13 );
   INIT( tab, 14 );
   INIT( tab, 15 );
}

/* These can be made efficient with codegen.  Further, by adding more
 * logic to do_choose(), the double-dispatch for legacy entrypoints
 * like glVertex3f() can be removed.
 */
#define DISPATCH_ATTRFV( ATTR, COUNT, P )	\
do {						\
   GET_CURRENT_CONTEXT( ctx ); 			\
   struct brw_exec_context *exec = IMM_CONTEXT(ctx)->exec; 		\
   exec->vtx.tabfv[ATTR][COUNT-1]( P );		\
} while (0)

#define DISPATCH_ATTR1FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 1, V )
#define DISPATCH_ATTR2FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 2, V )
#define DISPATCH_ATTR3FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 3, V )
#define DISPATCH_ATTR4FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 4, V )

#define DISPATCH_ATTR1F( ATTR, S ) DISPATCH_ATTRFV( ATTR, 1, &(S) )

#define DISPATCH_ATTR2F( ATTR, S,T ) 		\
do { 						\
   GLfloat v[2]; 				\
   v[0] = S; v[1] = T;				\
   DISPATCH_ATTR2FV( ATTR, v );			\
} while (0)
#define DISPATCH_ATTR3F( ATTR, S,T,R ) 		\
do { 						\
   GLfloat v[3]; 				\
   v[0] = S; v[1] = T; v[2] = R;		\
   DISPATCH_ATTR3FV( ATTR, v );			\
} while (0)
#define DISPATCH_ATTR4F( ATTR, S,T,R,Q )	\
do { 						\
   GLfloat v[4]; 				\
   v[0] = S; v[1] = T; v[2] = R; v[3] = Q;	\
   DISPATCH_ATTR4FV( ATTR, v );			\
} while (0)


static void GLAPIENTRY brw_Vertex2f( GLfloat x, GLfloat y )
{
   DISPATCH_ATTR2F( BRW_ATTRIB_POS, x, y );
}

static void GLAPIENTRY brw_Vertex2fv( const GLfloat *v )
{
   DISPATCH_ATTR2FV( BRW_ATTRIB_POS, v );
}

static void GLAPIENTRY brw_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
{
   DISPATCH_ATTR3F( BRW_ATTRIB_POS, x, y, z );
}

static void GLAPIENTRY brw_Vertex3fv( const GLfloat *v )
{
   DISPATCH_ATTR3FV( BRW_ATTRIB_POS, v );
}

static void GLAPIENTRY brw_Vertex4f( GLfloat x, GLfloat y, GLfloat z, 
				      GLfloat w )
{
   DISPATCH_ATTR4F( BRW_ATTRIB_POS, x, y, z, w );
}

static void GLAPIENTRY brw_Vertex4fv( const GLfloat *v )
{
   DISPATCH_ATTR4FV( BRW_ATTRIB_POS, v );
}

static void GLAPIENTRY brw_TexCoord1f( GLfloat x )
{
   DISPATCH_ATTR1F( BRW_ATTRIB_TEX0, x );
}

static void GLAPIENTRY brw_TexCoord1fv( const GLfloat *v )
{
   DISPATCH_ATTR1FV( BRW_ATTRIB_TEX0, v );
}

static void GLAPIENTRY brw_TexCoord2f( GLfloat x, GLfloat y )
{
   DISPATCH_ATTR2F( BRW_ATTRIB_TEX0, x, y );
}

static void GLAPIENTRY brw_TexCoord2fv( const GLfloat *v )
{
   DISPATCH_ATTR2FV( BRW_ATTRIB_TEX0, v );
}

static void GLAPIENTRY brw_TexCoord3f( GLfloat x, GLfloat y, GLfloat z )
{
   DISPATCH_ATTR3F( BRW_ATTRIB_TEX0, x, y, z );
}

static void GLAPIENTRY brw_TexCoord3fv( const GLfloat *v )
{
   DISPATCH_ATTR3FV( BRW_ATTRIB_TEX0, v );
}

static void GLAPIENTRY brw_TexCoord4f( GLfloat x, GLfloat y, GLfloat z,
					GLfloat w )
{
   DISPATCH_ATTR4F( BRW_ATTRIB_TEX0, x, y, z, w );
}

static void GLAPIENTRY brw_TexCoord4fv( const GLfloat *v )
{
   DISPATCH_ATTR4FV( BRW_ATTRIB_TEX0, v );
}

static void GLAPIENTRY brw_Normal3f( GLfloat x, GLfloat y, GLfloat z )
{
   DISPATCH_ATTR3F( BRW_ATTRIB_NORMAL, x, y, z );
}

static void GLAPIENTRY brw_Normal3fv( const GLfloat *v )
{
   DISPATCH_ATTR3FV( BRW_ATTRIB_NORMAL, v );
}

static void GLAPIENTRY brw_FogCoordfEXT( GLfloat x )
{
   DISPATCH_ATTR1F( BRW_ATTRIB_FOG, x );
}

static void GLAPIENTRY brw_FogCoordfvEXT( const GLfloat *v )
{
   DISPATCH_ATTR1FV( BRW_ATTRIB_FOG, v );
}

static void GLAPIENTRY brw_Color3f( GLfloat x, GLfloat y, GLfloat z )
{
   DISPATCH_ATTR3F( BRW_ATTRIB_COLOR0, x, y, z );
}

static void GLAPIENTRY brw_Color3fv( const GLfloat *v )
{
   DISPATCH_ATTR3FV( BRW_ATTRIB_COLOR0, v );
}

static void GLAPIENTRY brw_Color4f( GLfloat x, GLfloat y, GLfloat z, 
				     GLfloat w )
{
   DISPATCH_ATTR4F( BRW_ATTRIB_COLOR0, x, y, z, w );
}

static void GLAPIENTRY brw_Color4fv( const GLfloat *v )
{
   DISPATCH_ATTR4FV( BRW_ATTRIB_COLOR0, v );
}

static void GLAPIENTRY brw_SecondaryColor3fEXT( GLfloat x, GLfloat y, 
						 GLfloat z )
{
   DISPATCH_ATTR3F( BRW_ATTRIB_COLOR1, x, y, z );
}

static void GLAPIENTRY brw_SecondaryColor3fvEXT( const GLfloat *v )
{
   DISPATCH_ATTR3FV( BRW_ATTRIB_COLOR1, v );
}

static void GLAPIENTRY brw_MultiTexCoord1f( GLenum target, GLfloat x  )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR1F( attr, x );
}

static void GLAPIENTRY brw_MultiTexCoord1fv( GLenum target,
					      const GLfloat *v )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR1FV( attr, v );
}

static void GLAPIENTRY brw_MultiTexCoord2f( GLenum target, GLfloat x, 
					     GLfloat y )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR2F( attr, x, y );
}

static void GLAPIENTRY brw_MultiTexCoord2fv( GLenum target, 
					      const GLfloat *v )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR2FV( attr, v );
}

static void GLAPIENTRY brw_MultiTexCoord3f( GLenum target, GLfloat x, 
					     GLfloat y, GLfloat z)
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR3F( attr, x, y, z );
}

static void GLAPIENTRY brw_MultiTexCoord3fv( GLenum target, 
					      const GLfloat *v )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR3FV( attr, v );
}

static void GLAPIENTRY brw_MultiTexCoord4f( GLenum target, GLfloat x, 
					     GLfloat y, GLfloat z,
					     GLfloat w )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR4F( attr, x, y, z, w );
}

static void GLAPIENTRY brw_MultiTexCoord4fv( GLenum target, 
					      const GLfloat *v )
{
   GLuint attr = (target & 0x7) + BRW_ATTRIB_TEX0;
   DISPATCH_ATTR4FV( attr, v );
}


static void GLAPIENTRY brw_VertexAttrib1fNV( GLuint index, GLfloat x )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR1F( index, x );
}

static void GLAPIENTRY brw_VertexAttrib1fvNV( GLuint index, 
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR1FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib2fNV( GLuint index, GLfloat x, 
					      GLfloat y )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR2F( index, x, y );
}

static void GLAPIENTRY brw_VertexAttrib2fvNV( GLuint index,
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR2FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib3fNV( GLuint index, GLfloat x,
					      GLfloat y, GLfloat z )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR3F( index, x, y, z );
}

static void GLAPIENTRY brw_VertexAttrib3fvNV( GLuint index,
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR3FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib4fNV( GLuint index, GLfloat x,
					      GLfloat y, GLfloat z,
					      GLfloat w )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR4F( index, x, y, z, w );
}

static void GLAPIENTRY brw_VertexAttrib4fvNV( GLuint index, 
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR4FV( index, v );
}


/*
 * XXX adjust index
 */

static void GLAPIENTRY brw_VertexAttrib1fARB( GLuint index, GLfloat x )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR1F( index, x );
}

static void GLAPIENTRY brw_VertexAttrib1fvARB( GLuint index, 
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR1FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib2fARB( GLuint index, GLfloat x, 
					      GLfloat y )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR2F( index, x, y );
}

static void GLAPIENTRY brw_VertexAttrib2fvARB( GLuint index,
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR2FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib3fARB( GLuint index, GLfloat x,
					      GLfloat y, GLfloat z )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR3F( index, x, y, z );
}

static void GLAPIENTRY brw_VertexAttrib3fvARB( GLuint index,
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR3FV( index, v );
}

static void GLAPIENTRY brw_VertexAttrib4fARB( GLuint index, GLfloat x,
					      GLfloat y, GLfloat z,
					      GLfloat w )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR4F( index, x, y, z, w );
}

static void GLAPIENTRY brw_VertexAttrib4fvARB( GLuint index, 
					       const GLfloat *v )
{
   if (index >= BRW_ATTRIB_FIRST_MATERIAL) index = ERROR_ATTRIB;
   DISPATCH_ATTR4FV( index, v );
}


/* Install the generic versions of the 2nd level dispatch
 * functions.  Some of these have a codegen alternative.
 */
void brw_exec_vtx_generic_init( struct brw_exec_context *exec )
{
   GLvertexformat *vfmt = &exec->vtxfmt;

   vfmt->Color3f = brw_Color3f;
   vfmt->Color3fv = brw_Color3fv;
   vfmt->Color4f = brw_Color4f;
   vfmt->Color4fv = brw_Color4fv;
   vfmt->FogCoordfEXT = brw_FogCoordfEXT;
   vfmt->FogCoordfvEXT = brw_FogCoordfvEXT;
   vfmt->MultiTexCoord1fARB = brw_MultiTexCoord1f;
   vfmt->MultiTexCoord1fvARB = brw_MultiTexCoord1fv;
   vfmt->MultiTexCoord2fARB = brw_MultiTexCoord2f;
   vfmt->MultiTexCoord2fvARB = brw_MultiTexCoord2fv;
   vfmt->MultiTexCoord3fARB = brw_MultiTexCoord3f;
   vfmt->MultiTexCoord3fvARB = brw_MultiTexCoord3fv;
   vfmt->MultiTexCoord4fARB = brw_MultiTexCoord4f;
   vfmt->MultiTexCoord4fvARB = brw_MultiTexCoord4fv;
   vfmt->Normal3f = brw_Normal3f;
   vfmt->Normal3fv = brw_Normal3fv;
   vfmt->SecondaryColor3fEXT = brw_SecondaryColor3fEXT;
   vfmt->SecondaryColor3fvEXT = brw_SecondaryColor3fvEXT;
   vfmt->TexCoord1f = brw_TexCoord1f;
   vfmt->TexCoord1fv = brw_TexCoord1fv;
   vfmt->TexCoord2f = brw_TexCoord2f;
   vfmt->TexCoord2fv = brw_TexCoord2fv;
   vfmt->TexCoord3f = brw_TexCoord3f;
   vfmt->TexCoord3fv = brw_TexCoord3fv;
   vfmt->TexCoord4f = brw_TexCoord4f;
   vfmt->TexCoord4fv = brw_TexCoord4fv;
   vfmt->Vertex2f = brw_Vertex2f;
   vfmt->Vertex2fv = brw_Vertex2fv;
   vfmt->Vertex3f = brw_Vertex3f;
   vfmt->Vertex3fv = brw_Vertex3fv;
   vfmt->Vertex4f = brw_Vertex4f;
   vfmt->Vertex4fv = brw_Vertex4fv;
   vfmt->VertexAttrib1fNV = brw_VertexAttrib1fNV;
   vfmt->VertexAttrib1fvNV = brw_VertexAttrib1fvNV;
   vfmt->VertexAttrib2fNV = brw_VertexAttrib2fNV;
   vfmt->VertexAttrib2fvNV = brw_VertexAttrib2fvNV;
   vfmt->VertexAttrib3fNV = brw_VertexAttrib3fNV;
   vfmt->VertexAttrib3fvNV = brw_VertexAttrib3fvNV;
   vfmt->VertexAttrib4fNV = brw_VertexAttrib4fNV;
   vfmt->VertexAttrib4fvNV = brw_VertexAttrib4fvNV;
   vfmt->VertexAttrib1fARB = brw_VertexAttrib1fARB;
   vfmt->VertexAttrib1fvARB = brw_VertexAttrib1fvARB;
   vfmt->VertexAttrib2fARB = brw_VertexAttrib2fARB;
   vfmt->VertexAttrib2fvARB = brw_VertexAttrib2fvARB;
   vfmt->VertexAttrib3fARB = brw_VertexAttrib3fARB;
   vfmt->VertexAttrib3fvARB = brw_VertexAttrib3fvARB;
   vfmt->VertexAttrib4fARB = brw_VertexAttrib4fARB;
   vfmt->VertexAttrib4fvARB = brw_VertexAttrib4fvARB;
}