2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
30 * frame buffer texture by Gary Wong <gtw@gnu.org>
35 #include "main/glheader.h"
36 #include "main/context.h"
37 #include "main/macros.h"
39 #include "shader/arbprogparse.h"
41 #include "intel_screen.h"
42 #include "intel_batchbuffer.h"
43 #include "intel_regions.h"
44 #include "intel_buffers.h"
46 #include "brw_context.h"
47 #include "brw_defines.h"
49 #include "brw_fallback.h"
51 #define INIT(brw, STRUCT, ATTRIB) \
53 brw->attribs.ATTRIB = &ctx->ATTRIB; \
56 #define DUP(brw, STRUCT, ATTRIB) \
58 brw->metaops.attribs.ATTRIB = MALLOC_STRUCT(STRUCT); \
59 memcpy(brw->metaops.attribs.ATTRIB, \
60 brw->attribs.ATTRIB, \
61 sizeof(struct STRUCT)); \
65 #define INSTALL(brw, ATTRIB, STATE) \
67 brw->attribs.ATTRIB = brw->metaops.attribs.ATTRIB; \
68 brw->state.dirty.mesa |= STATE; \
71 #define RESTORE(brw, ATTRIB, STATE) \
73 brw->attribs.ATTRIB = &brw->intel.ctx.ATTRIB; \
74 brw->state.dirty.mesa |= STATE; \
77 static void init_attribs( struct brw_context
*brw
)
79 DUP(brw
, gl_colorbuffer_attrib
, Color
);
80 DUP(brw
, gl_depthbuffer_attrib
, Depth
);
81 DUP(brw
, gl_fog_attrib
, Fog
);
82 DUP(brw
, gl_hint_attrib
, Hint
);
83 DUP(brw
, gl_light_attrib
, Light
);
84 DUP(brw
, gl_line_attrib
, Line
);
85 DUP(brw
, gl_point_attrib
, Point
);
86 DUP(brw
, gl_polygon_attrib
, Polygon
);
87 DUP(brw
, gl_scissor_attrib
, Scissor
);
88 DUP(brw
, gl_stencil_attrib
, Stencil
);
89 DUP(brw
, gl_texture_attrib
, Texture
);
90 DUP(brw
, gl_transform_attrib
, Transform
);
91 DUP(brw
, gl_viewport_attrib
, Viewport
);
92 DUP(brw
, gl_vertex_program_state
, VertexProgram
);
93 DUP(brw
, gl_fragment_program_state
, FragmentProgram
);
96 static void install_attribs( struct brw_context
*brw
)
98 INSTALL(brw
, Color
, _NEW_COLOR
);
99 INSTALL(brw
, Depth
, _NEW_DEPTH
);
100 INSTALL(brw
, Fog
, _NEW_FOG
);
101 INSTALL(brw
, Hint
, _NEW_HINT
);
102 INSTALL(brw
, Light
, _NEW_LIGHT
);
103 INSTALL(brw
, Line
, _NEW_LINE
);
104 INSTALL(brw
, Point
, _NEW_POINT
);
105 INSTALL(brw
, Polygon
, _NEW_POLYGON
);
106 INSTALL(brw
, Scissor
, _NEW_SCISSOR
);
107 INSTALL(brw
, Stencil
, _NEW_STENCIL
);
108 INSTALL(brw
, Texture
, _NEW_TEXTURE
);
109 INSTALL(brw
, Transform
, _NEW_TRANSFORM
);
110 INSTALL(brw
, Viewport
, _NEW_VIEWPORT
);
111 INSTALL(brw
, VertexProgram
, _NEW_PROGRAM
);
112 INSTALL(brw
, FragmentProgram
, _NEW_PROGRAM
);
115 static void restore_attribs( struct brw_context
*brw
)
117 RESTORE(brw
, Color
, _NEW_COLOR
);
118 RESTORE(brw
, Depth
, _NEW_DEPTH
);
119 RESTORE(brw
, Fog
, _NEW_FOG
);
120 RESTORE(brw
, Hint
, _NEW_HINT
);
121 RESTORE(brw
, Light
, _NEW_LIGHT
);
122 RESTORE(brw
, Line
, _NEW_LINE
);
123 RESTORE(brw
, Point
, _NEW_POINT
);
124 RESTORE(brw
, Polygon
, _NEW_POLYGON
);
125 RESTORE(brw
, Scissor
, _NEW_SCISSOR
);
126 RESTORE(brw
, Stencil
, _NEW_STENCIL
);
127 RESTORE(brw
, Texture
, _NEW_TEXTURE
);
128 RESTORE(brw
, Transform
, _NEW_TRANSFORM
);
129 RESTORE(brw
, Viewport
, _NEW_VIEWPORT
);
130 RESTORE(brw
, VertexProgram
, _NEW_PROGRAM
);
131 RESTORE(brw
, FragmentProgram
, _NEW_PROGRAM
);
135 static const char *vp_prog
=
137 "MOV result.color, vertex.color;\n"
138 "MOV result.position, vertex.position;\n"
141 static const char *fp_prog
=
143 "MOV result.color, fragment.color;\n"
146 static const char *fp_tex_prog
=
149 "ADD a, fragment.position, program.local[0];\n"
150 "MUL a, a, program.local[1];\n"
151 "TEX result.color, a, texture[0], 2D;\n"
152 "MOV result.depth.z, fragment.position;\n"
155 /* Derived values of importance:
157 * FragmentProgram->_Current
158 * VertexProgram->_Enabled
159 * brw->vertex_program
160 * DrawBuffer->_ColorDrawBufferIndexes[0]
163 * More if drawpixels-through-texture is added.
165 static void init_metaops_state( struct brw_context
*brw
)
167 GLcontext
*ctx
= &brw
->intel
.ctx
;
169 brw
->metaops
.vbo
= ctx
->Driver
.NewBufferObject(ctx
, 1, GL_ARRAY_BUFFER_ARB
);
171 ctx
->Driver
.BufferData(ctx
,
178 brw
->metaops
.fp
= (struct gl_fragment_program
*)
179 ctx
->Driver
.NewProgram(ctx
, GL_FRAGMENT_PROGRAM_ARB
, 1 );
181 brw
->metaops
.fp_tex
= (struct gl_fragment_program
*)
182 ctx
->Driver
.NewProgram(ctx
, GL_FRAGMENT_PROGRAM_ARB
, 1 );
184 brw
->metaops
.vp
= (struct gl_vertex_program
*)
185 ctx
->Driver
.NewProgram(ctx
, GL_VERTEX_PROGRAM_ARB
, 1 );
187 _mesa_parse_arb_fragment_program(ctx
, GL_FRAGMENT_PROGRAM_ARB
,
188 fp_prog
, strlen(fp_prog
),
191 _mesa_parse_arb_fragment_program(ctx
, GL_FRAGMENT_PROGRAM_ARB
,
192 fp_tex_prog
, strlen(fp_tex_prog
),
193 brw
->metaops
.fp_tex
);
195 _mesa_parse_arb_vertex_program(ctx
, GL_VERTEX_PROGRAM_ARB
,
196 vp_prog
, strlen(vp_prog
),
199 brw
->metaops
.attribs
.VertexProgram
->_Current
= brw
->metaops
.vp
;
200 brw
->metaops
.attribs
.VertexProgram
->_Enabled
= GL_TRUE
;
202 brw
->metaops
.attribs
.FragmentProgram
->_Current
= brw
->metaops
.fp
;
205 static void meta_flat_shade( struct intel_context
*intel
)
207 struct brw_context
*brw
= brw_context(&intel
->ctx
);
209 brw
->metaops
.attribs
.Light
->ShadeModel
= GL_FLAT
;
210 brw
->state
.dirty
.mesa
|= _NEW_LIGHT
;
214 static void meta_no_stencil_write( struct intel_context
*intel
)
216 struct brw_context
*brw
= brw_context(&intel
->ctx
);
218 brw
->metaops
.attribs
.Stencil
->Enabled
= GL_FALSE
;
219 brw
->metaops
.attribs
.Stencil
->WriteMask
[0] = GL_FALSE
;
220 brw
->state
.dirty
.mesa
|= _NEW_STENCIL
;
223 static void meta_no_depth_write( struct intel_context
*intel
)
225 struct brw_context
*brw
= brw_context(&intel
->ctx
);
227 brw
->metaops
.attribs
.Depth
->Test
= GL_FALSE
;
228 brw
->metaops
.attribs
.Depth
->Mask
= GL_FALSE
;
229 brw
->state
.dirty
.mesa
|= _NEW_DEPTH
;
233 static void meta_depth_replace( struct intel_context
*intel
)
235 struct brw_context
*brw
= brw_context(&intel
->ctx
);
237 /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE )
238 * ctx->Driver.DepthMask( ctx, GL_TRUE )
240 brw
->metaops
.attribs
.Depth
->Test
= GL_TRUE
;
241 brw
->metaops
.attribs
.Depth
->Mask
= GL_TRUE
;
242 brw
->state
.dirty
.mesa
|= _NEW_DEPTH
;
244 /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS )
246 brw
->metaops
.attribs
.Depth
->Func
= GL_ALWAYS
;
248 brw
->state
.dirty
.mesa
|= _NEW_DEPTH
;
252 static void meta_stencil_replace( struct intel_context
*intel
,
256 struct brw_context
*brw
= brw_context(&intel
->ctx
);
258 brw
->metaops
.attribs
.Stencil
->Enabled
= GL_TRUE
;
259 brw
->metaops
.attribs
.Stencil
->WriteMask
[0] = s_mask
;
260 brw
->metaops
.attribs
.Stencil
->ValueMask
[0] = 0xff;
261 brw
->metaops
.attribs
.Stencil
->Ref
[0] = s_clear
;
262 brw
->metaops
.attribs
.Stencil
->Function
[0] = GL_ALWAYS
;
263 brw
->metaops
.attribs
.Stencil
->FailFunc
[0] = GL_REPLACE
;
264 brw
->metaops
.attribs
.Stencil
->ZPassFunc
[0] = GL_REPLACE
;
265 brw
->metaops
.attribs
.Stencil
->ZFailFunc
[0] = GL_REPLACE
;
266 brw
->state
.dirty
.mesa
|= _NEW_STENCIL
;
270 static void meta_color_mask( struct intel_context
*intel
, GLboolean state
)
272 struct brw_context
*brw
= brw_context(&intel
->ctx
);
275 COPY_4V(brw
->metaops
.attribs
.Color
->ColorMask
,
276 brw
->intel
.ctx
.Color
.ColorMask
);
278 ASSIGN_4V(brw
->metaops
.attribs
.Color
->ColorMask
, 0, 0, 0, 0);
280 brw
->state
.dirty
.mesa
|= _NEW_COLOR
;
283 static void meta_no_texture( struct intel_context
*intel
)
285 struct brw_context
*brw
= brw_context(&intel
->ctx
);
287 brw
->metaops
.attribs
.FragmentProgram
->_Current
= brw
->metaops
.fp
;
289 brw
->metaops
.attribs
.Texture
->CurrentUnit
= 0;
290 brw
->metaops
.attribs
.Texture
->_EnabledUnits
= 0;
291 brw
->metaops
.attribs
.Texture
->_EnabledCoordUnits
= 0;
292 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ].Enabled
= 0;
293 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ]._ReallyEnabled
= 0;
295 brw
->state
.dirty
.mesa
|= _NEW_TEXTURE
| _NEW_PROGRAM
;
298 static void meta_texture_blend_replace(struct intel_context
*intel
)
300 struct brw_context
*brw
= brw_context(&intel
->ctx
);
302 brw
->metaops
.attribs
.Texture
->CurrentUnit
= 0;
303 brw
->metaops
.attribs
.Texture
->_EnabledUnits
= 1;
304 brw
->metaops
.attribs
.Texture
->_EnabledCoordUnits
= 1;
305 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ].Enabled
= TEXTURE_2D_BIT
;
306 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ]._ReallyEnabled
= TEXTURE_2D_BIT
;
307 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ].Current2D
=
308 intel
->frame_buffer_texobj
;
309 brw
->metaops
.attribs
.Texture
->Unit
[ 0 ]._Current
=
310 intel
->frame_buffer_texobj
;
312 brw
->state
.dirty
.mesa
|= _NEW_TEXTURE
| _NEW_PROGRAM
;
315 static void meta_import_pixel_state(struct intel_context
*intel
)
317 struct brw_context
*brw
= brw_context(&intel
->ctx
);
319 RESTORE(brw
, Color
, _NEW_COLOR
);
320 RESTORE(brw
, Depth
, _NEW_DEPTH
);
321 RESTORE(brw
, Fog
, _NEW_FOG
);
322 RESTORE(brw
, Scissor
, _NEW_SCISSOR
);
323 RESTORE(brw
, Stencil
, _NEW_STENCIL
);
324 RESTORE(brw
, Texture
, _NEW_TEXTURE
);
325 RESTORE(brw
, FragmentProgram
, _NEW_PROGRAM
);
328 static void meta_frame_buffer_texture( struct intel_context
*intel
,
329 GLint xoff
, GLint yoff
)
331 struct brw_context
*brw
= brw_context(&intel
->ctx
);
332 struct intel_region
*region
= intel_drawbuf_region( intel
);
334 INSTALL(brw
, FragmentProgram
, _NEW_PROGRAM
);
336 brw
->metaops
.attribs
.FragmentProgram
->_Current
= brw
->metaops
.fp_tex
;
337 /* This is unfortunate, but seems to be necessary, since later on we
338 will end up calling _mesa_load_state_parameters to lookup the
339 local params (below), and that will want to look in ctx.FragmentProgram
340 instead of brw->attribs.FragmentProgram. */
341 intel
->ctx
.FragmentProgram
.Current
= brw
->metaops
.fp_tex
;
343 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 0 ][ 0 ] = xoff
;
344 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 0 ][ 1 ] = yoff
;
345 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 0 ][ 2 ] = 0.0;
346 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 0 ][ 3 ] = 0.0;
347 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 1 ][ 0 ] =
349 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 1 ][ 1 ] =
350 -1.0 / region
->height
;
351 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 1 ][ 2 ] = 0.0;
352 brw
->metaops
.fp_tex
->Base
.LocalParams
[ 1 ][ 3 ] = 1.0;
354 brw
->state
.dirty
.mesa
|= _NEW_PROGRAM
;
358 static void meta_draw_region( struct intel_context
*intel
,
359 struct intel_region
*draw_region
,
360 struct intel_region
*depth_region
)
362 struct brw_context
*brw
= brw_context(&intel
->ctx
);
364 if (!brw
->metaops
.saved_draw_region
) {
365 brw
->metaops
.saved_draw_region
= brw
->state
.draw_regions
[0];
366 brw
->metaops
.saved_nr_draw_regions
= brw
->state
.nr_draw_regions
;
367 brw
->metaops
.saved_depth_region
= brw
->state
.depth_region
;
370 brw
->state
.draw_regions
[0] = draw_region
;
371 brw
->state
.nr_draw_regions
= 1;
372 brw
->state
.depth_region
= depth_region
;
374 if (intel
->frame_buffer_texobj
!= NULL
)
375 brw_FrameBufferTexDestroy(brw
);
378 brw_FrameBufferTexInit(brw
, draw_region
);
380 brw
->state
.dirty
.mesa
|= _NEW_BUFFERS
;
384 static void meta_draw_quad(struct intel_context
*intel
,
385 GLfloat x0
, GLfloat x1
,
386 GLfloat y0
, GLfloat y1
,
389 GLfloat s0
, GLfloat s1
,
390 GLfloat t0
, GLfloat t1
)
392 GLcontext
*ctx
= &intel
->ctx
;
393 struct brw_context
*brw
= brw_context(&intel
->ctx
);
394 struct gl_client_array pos_array
;
395 struct gl_client_array color_array
;
396 struct gl_client_array
*attribs
[VERT_ATTRIB_MAX
];
397 struct _mesa_prim prim
[1];
400 ctx
->Driver
.BufferData(ctx
,
402 sizeof(pos
) + sizeof(color
),
423 ctx
->Driver
.BufferSubData(ctx
,
430 /* Convert incoming ARGB to required RGBA */
431 /* Note this color is stored as GL_UNSIGNED_BYTE */
432 color
= (color
& 0xff00ff00) | (((color
>> 16) | (color
<< 16)) & 0xff00ff);
434 ctx
->Driver
.BufferSubData(ctx
,
441 /* Ignoring texture coords.
444 memset(attribs
, 0, VERT_ATTRIB_MAX
* sizeof(*attribs
));
446 attribs
[VERT_ATTRIB_POS
] = &pos_array
;
447 attribs
[VERT_ATTRIB_POS
]->Ptr
= 0;
448 attribs
[VERT_ATTRIB_POS
]->Type
= GL_FLOAT
;
449 attribs
[VERT_ATTRIB_POS
]->Enabled
= 1;
450 attribs
[VERT_ATTRIB_POS
]->Size
= 3;
451 attribs
[VERT_ATTRIB_POS
]->StrideB
= 3 * sizeof(GLfloat
);
452 attribs
[VERT_ATTRIB_POS
]->Stride
= 3 * sizeof(GLfloat
);
453 attribs
[VERT_ATTRIB_POS
]->_MaxElement
= 4;
454 attribs
[VERT_ATTRIB_POS
]->Normalized
= 0;
455 attribs
[VERT_ATTRIB_POS
]->BufferObj
= brw
->metaops
.vbo
;
457 attribs
[VERT_ATTRIB_COLOR0
] = &color_array
;
458 attribs
[VERT_ATTRIB_COLOR0
]->Ptr
= (const GLubyte
*)sizeof(pos
);
459 attribs
[VERT_ATTRIB_COLOR0
]->Type
= GL_UNSIGNED_BYTE
;
460 attribs
[VERT_ATTRIB_COLOR0
]->Enabled
= 1;
461 attribs
[VERT_ATTRIB_COLOR0
]->Size
= 4;
462 attribs
[VERT_ATTRIB_COLOR0
]->StrideB
= 0;
463 attribs
[VERT_ATTRIB_COLOR0
]->Stride
= 0;
464 attribs
[VERT_ATTRIB_COLOR0
]->_MaxElement
= 1;
465 attribs
[VERT_ATTRIB_COLOR0
]->Normalized
= 1;
466 attribs
[VERT_ATTRIB_COLOR0
]->BufferObj
= brw
->metaops
.vbo
;
468 /* Just ignoring texture coordinates for now.
471 memset(prim
, 0, sizeof(*prim
));
473 prim
[0].mode
= GL_TRIANGLE_FAN
;
481 brw_draw_prims(&brw
->intel
.ctx
,
482 (const struct gl_client_array
**)attribs
,
490 static void install_meta_state( struct intel_context
*intel
)
492 GLcontext
*ctx
= &intel
->ctx
;
493 struct brw_context
*brw
= brw_context(ctx
);
496 if (!brw
->metaops
.vbo
) {
497 init_metaops_state(brw
);
500 install_attribs(brw
);
502 meta_no_texture(&brw
->intel
);
503 meta_flat_shade(&brw
->intel
);
504 for (i
= 0; i
< ctx
->Const
.MaxDrawBuffers
; i
++) {
505 brw
->metaops
.restore_draw_buffers
[i
]
506 = ctx
->DrawBuffer
->_ColorDrawBufferIndexes
[i
];
508 brw
->metaops
.restore_num_draw_buffers
= ctx
->DrawBuffer
->_NumColorDrawBuffers
;
510 brw
->metaops
.restore_fp
= ctx
->FragmentProgram
.Current
;
512 /* This works without adjusting refcounts. Fix later?
514 brw
->metaops
.saved_draw_region
= brw
->state
.draw_regions
[0];
515 brw
->metaops
.saved_nr_draw_regions
= brw
->state
.nr_draw_regions
;
516 brw
->metaops
.saved_depth_region
= brw
->state
.depth_region
;
517 brw
->metaops
.active
= 1;
519 brw
->state
.dirty
.brw
|= BRW_NEW_METAOPS
;
522 static void leave_meta_state( struct intel_context
*intel
)
524 GLcontext
*ctx
= &intel
->ctx
;
525 struct brw_context
*brw
= brw_context(ctx
);
528 restore_attribs(brw
);
530 for (i
= 0; i
< ctx
->Const
.MaxDrawBuffers
; i
++) {
531 ctx
->DrawBuffer
->_ColorDrawBufferIndexes
[i
]
532 = brw
->metaops
.restore_draw_buffers
[i
];
534 ctx
->DrawBuffer
->_NumColorDrawBuffers
= brw
->metaops
.restore_num_draw_buffers
;
536 ctx
->FragmentProgram
.Current
= brw
->metaops
.restore_fp
;
538 brw
->state
.draw_regions
[0] = brw
->metaops
.saved_draw_region
;
539 brw
->state
.nr_draw_regions
= brw
->metaops
.saved_nr_draw_regions
;
540 brw
->state
.depth_region
= brw
->metaops
.saved_depth_region
;
541 brw
->metaops
.saved_draw_region
= NULL
;
542 brw
->metaops
.saved_depth_region
= NULL
;
543 brw
->metaops
.active
= 0;
545 brw
->state
.dirty
.mesa
|= _NEW_BUFFERS
;
546 brw
->state
.dirty
.brw
|= BRW_NEW_METAOPS
;
551 void brw_init_metaops( struct brw_context
*brw
)
556 brw
->intel
.vtbl
.install_meta_state
= install_meta_state
;
557 brw
->intel
.vtbl
.leave_meta_state
= leave_meta_state
;
558 brw
->intel
.vtbl
.meta_no_depth_write
= meta_no_depth_write
;
559 brw
->intel
.vtbl
.meta_no_stencil_write
= meta_no_stencil_write
;
560 brw
->intel
.vtbl
.meta_stencil_replace
= meta_stencil_replace
;
561 brw
->intel
.vtbl
.meta_depth_replace
= meta_depth_replace
;
562 brw
->intel
.vtbl
.meta_color_mask
= meta_color_mask
;
563 brw
->intel
.vtbl
.meta_no_texture
= meta_no_texture
;
564 brw
->intel
.vtbl
.meta_import_pixel_state
= meta_import_pixel_state
;
565 brw
->intel
.vtbl
.meta_frame_buffer_texture
= meta_frame_buffer_texture
;
566 brw
->intel
.vtbl
.meta_draw_region
= meta_draw_region
;
567 brw
->intel
.vtbl
.meta_draw_quad
= meta_draw_quad
;
568 brw
->intel
.vtbl
.meta_texture_blend_replace
= meta_texture_blend_replace
;
569 /* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */
570 /* brw->intel.vtbl.meta_draw_format = set_draw_format; */
573 void brw_destroy_metaops( struct brw_context
*brw
)
575 GLcontext
*ctx
= &brw
->intel
.ctx
;
577 if (brw
->metaops
.vbo
)
578 ctx
->Driver
.DeleteBuffer( ctx
, brw
->metaops
.vbo
);
580 /* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */
581 /* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */
582 /* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */