gallium: free bitmap fragment shaders, misc clean-up
[mesa.git] / src / mesa / state_tracker / st_draw.c
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * 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, sub license, 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:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 /*
29 * Authors:
30 * Keith Whitwell <keith@tungstengraphics.com>
31 */
32
33 #include "main/imports.h"
34 #include "main/image.h"
35
36 #include "vbo/vbo.h"
37
38 #include "st_atom.h"
39 #include "st_context.h"
40 #include "st_cb_bufferobjects.h"
41 #include "st_draw.h"
42 #include "st_program.h"
43
44 #include "pipe/p_context.h"
45 #include "pipe/p_defines.h"
46 #include "pipe/p_winsys.h"
47 #include "pipe/p_inlines.h"
48
49 #include "draw/draw_private.h"
50 #include "draw/draw_context.h"
51
52
53 static GLuint double_types[4] = {
54 PIPE_FORMAT_R64_FLOAT,
55 PIPE_FORMAT_R64G64_FLOAT,
56 PIPE_FORMAT_R64G64B64_FLOAT,
57 PIPE_FORMAT_R64G64B64A64_FLOAT
58 };
59
60 static GLuint float_types[4] = {
61 PIPE_FORMAT_R32_FLOAT,
62 PIPE_FORMAT_R32G32_FLOAT,
63 PIPE_FORMAT_R32G32B32_FLOAT,
64 PIPE_FORMAT_R32G32B32A32_FLOAT
65 };
66
67 static GLuint uint_types_norm[4] = {
68 PIPE_FORMAT_R32_UNORM,
69 PIPE_FORMAT_R32G32_UNORM,
70 PIPE_FORMAT_R32G32B32_UNORM,
71 PIPE_FORMAT_R32G32B32A32_UNORM
72 };
73
74 static GLuint uint_types_scale[4] = {
75 PIPE_FORMAT_R32_USCALED,
76 PIPE_FORMAT_R32G32_USCALED,
77 PIPE_FORMAT_R32G32B32_USCALED,
78 PIPE_FORMAT_R32G32B32A32_USCALED
79 };
80
81 static GLuint int_types_norm[4] = {
82 PIPE_FORMAT_R32_SNORM,
83 PIPE_FORMAT_R32G32_SNORM,
84 PIPE_FORMAT_R32G32B32_SNORM,
85 PIPE_FORMAT_R32G32B32A32_SNORM
86 };
87
88 static GLuint int_types_scale[4] = {
89 PIPE_FORMAT_R32_SSCALED,
90 PIPE_FORMAT_R32G32_SSCALED,
91 PIPE_FORMAT_R32G32B32_SSCALED,
92 PIPE_FORMAT_R32G32B32A32_SSCALED
93 };
94
95 static GLuint ushort_types_norm[4] = {
96 PIPE_FORMAT_R16_UNORM,
97 PIPE_FORMAT_R16G16_UNORM,
98 PIPE_FORMAT_R16G16B16_UNORM,
99 PIPE_FORMAT_R16G16B16A16_UNORM
100 };
101
102 static GLuint ushort_types_scale[4] = {
103 PIPE_FORMAT_R16_USCALED,
104 PIPE_FORMAT_R16G16_USCALED,
105 PIPE_FORMAT_R16G16B16_USCALED,
106 PIPE_FORMAT_R16G16B16A16_USCALED
107 };
108
109 static GLuint short_types_norm[4] = {
110 PIPE_FORMAT_R16_SNORM,
111 PIPE_FORMAT_R16G16_SNORM,
112 PIPE_FORMAT_R16G16B16_SNORM,
113 PIPE_FORMAT_R16G16B16A16_SNORM
114 };
115
116 static GLuint short_types_scale[4] = {
117 PIPE_FORMAT_R16_SSCALED,
118 PIPE_FORMAT_R16G16_SSCALED,
119 PIPE_FORMAT_R16G16B16_SSCALED,
120 PIPE_FORMAT_R16G16B16A16_SSCALED
121 };
122
123 static GLuint ubyte_types_norm[4] = {
124 PIPE_FORMAT_R8_UNORM,
125 PIPE_FORMAT_R8G8_UNORM,
126 PIPE_FORMAT_R8G8B8_UNORM,
127 PIPE_FORMAT_R8G8B8A8_UNORM
128 };
129
130 static GLuint ubyte_types_scale[4] = {
131 PIPE_FORMAT_R8_USCALED,
132 PIPE_FORMAT_R8G8_USCALED,
133 PIPE_FORMAT_R8G8B8_USCALED,
134 PIPE_FORMAT_R8G8B8A8_USCALED
135 };
136
137 static GLuint byte_types_norm[4] = {
138 PIPE_FORMAT_R8_SNORM,
139 PIPE_FORMAT_R8G8_SNORM,
140 PIPE_FORMAT_R8G8B8_SNORM,
141 PIPE_FORMAT_R8G8B8A8_SNORM
142 };
143
144 static GLuint byte_types_scale[4] = {
145 PIPE_FORMAT_R8_SSCALED,
146 PIPE_FORMAT_R8G8_SSCALED,
147 PIPE_FORMAT_R8G8B8_SSCALED,
148 PIPE_FORMAT_R8G8B8A8_SSCALED
149 };
150
151
152 /**
153 * Return a PIPE_FORMAT_x for the given GL datatype and size.
154 */
155 static GLuint
156 pipe_vertex_format(GLenum type, GLuint size, GLboolean normalized)
157 {
158 assert(type >= GL_BYTE);
159 assert(type <= GL_DOUBLE);
160 assert(size >= 1);
161 assert(size <= 4);
162
163 if (normalized) {
164 switch (type) {
165 case GL_DOUBLE: return double_types[size-1];
166 case GL_FLOAT: return float_types[size-1];
167 case GL_INT: return int_types_norm[size-1];
168 case GL_SHORT: return short_types_norm[size-1];
169 case GL_BYTE: return byte_types_norm[size-1];
170 case GL_UNSIGNED_INT: return uint_types_norm[size-1];
171 case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
172 case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
173 default: assert(0); return 0;
174 }
175 }
176 else {
177 switch (type) {
178 case GL_DOUBLE: return double_types[size-1];
179 case GL_FLOAT: return float_types[size-1];
180 case GL_INT: return int_types_scale[size-1];
181 case GL_SHORT: return short_types_scale[size-1];
182 case GL_BYTE: return byte_types_scale[size-1];
183 case GL_UNSIGNED_INT: return uint_types_scale[size-1];
184 case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
185 case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
186 default: assert(0); return 0;
187 }
188 }
189 return 0; /* silence compiler warning */
190 }
191
192
193 /**
194 * This function gets plugged into the VBO module and is called when
195 * we have something to render.
196 * Basically, translate the information into the format expected by pipe.
197 */
198 void
199 st_draw_vbo(GLcontext *ctx,
200 const struct gl_client_array **arrays,
201 const struct _mesa_prim *prims,
202 GLuint nr_prims,
203 const struct _mesa_index_buffer *ib,
204 GLuint min_index,
205 GLuint max_index)
206 {
207 struct pipe_context *pipe = ctx->st->pipe;
208 struct pipe_winsys *winsys = pipe->winsys;
209 const struct st_vertex_program *vp;
210 const struct pipe_shader_state *vs;
211 struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
212 GLuint attr;
213
214 /* sanity check for pointer arithmetic below */
215 assert(sizeof(arrays[0]->Ptr[0]) == 1);
216
217 st_validate_state(ctx->st);
218
219 /* must get these after state validation! */
220 vp = ctx->st->vp;
221 vs = &ctx->st->vp->state;
222
223 /* loop over TGSI shader inputs to determine vertex buffer
224 * and attribute info
225 */
226 for (attr = 0; attr < vp->num_inputs; attr++) {
227 const GLuint mesaAttr = vp->index_to_input[attr];
228 struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
229 struct pipe_vertex_element velement;
230
231 if (bufobj && bufobj->Name) {
232 /* Attribute data is in a VBO.
233 * Recall that for VBOs, the gl_client_array->Ptr field is
234 * really an offset from the start of the VBO, not a pointer.
235 */
236 struct st_buffer_object *stobj = st_buffer_object(bufobj);
237 assert(stobj->buffer);
238
239 vbuffer[attr].buffer = NULL;
240 pipe_buffer_reference(winsys, &vbuffer[attr].buffer, stobj->buffer);
241 vbuffer[attr].buffer_offset = (unsigned) arrays[0]->Ptr;/* in bytes */
242 velement.src_offset = arrays[mesaAttr]->Ptr - arrays[0]->Ptr;
243 assert(velement.src_offset <= 2048); /* 11-bit field */
244 }
245 else {
246 /* attribute data is in user-space memory, not a VBO */
247 uint bytes;
248
249 if (!arrays[mesaAttr]->StrideB) {
250 bytes = arrays[mesaAttr]->Size
251 * _mesa_sizeof_type(arrays[mesaAttr]->Type);
252 } else {
253 bytes = arrays[mesaAttr]->StrideB * (max_index + 1);
254 }
255
256 /* wrap user data */
257 vbuffer[attr].buffer
258 = winsys->user_buffer_create(winsys,
259 (void *) arrays[mesaAttr]->Ptr,
260 bytes);
261 vbuffer[attr].buffer_offset = 0;
262 velement.src_offset = 0;
263 }
264
265 /* common-case setup */
266 vbuffer[attr].pitch = arrays[mesaAttr]->StrideB; /* in bytes */
267 vbuffer[attr].max_index = max_index;
268 velement.vertex_buffer_index = attr;
269 velement.nr_components = arrays[mesaAttr]->Size;
270 velement.src_format = pipe_vertex_format(arrays[mesaAttr]->Type,
271 arrays[mesaAttr]->Size,
272 arrays[mesaAttr]->Normalized);
273 assert(velement.src_format);
274
275 /* tell pipe about this attribute */
276 pipe->set_vertex_buffer(pipe, attr, &vbuffer[attr]);
277 pipe->set_vertex_element(pipe, attr, &velement);
278 }
279
280
281 /* do actual drawing */
282 if (ib) {
283 /* indexed primitive */
284 struct gl_buffer_object *bufobj = ib->obj;
285 struct pipe_buffer *indexBuf = NULL;
286 unsigned indexSize, indexOffset, i;
287
288 switch (ib->type) {
289 case GL_UNSIGNED_INT:
290 indexSize = 4;
291 break;
292 case GL_UNSIGNED_SHORT:
293 indexSize = 2;
294 break;
295 case GL_UNSIGNED_BYTE:
296 indexSize = 1;
297 break;
298 default:
299 assert(0);
300 return;
301 }
302
303 /* get/create the index buffer object */
304 if (bufobj && bufobj->Name) {
305 /* elements/indexes are in a real VBO */
306 struct st_buffer_object *stobj = st_buffer_object(bufobj);
307 pipe_buffer_reference(winsys, &indexBuf, stobj->buffer);
308 indexOffset = (unsigned) ib->ptr / indexSize;
309 }
310 else {
311 /* element/indicies are in user space memory */
312 indexBuf = winsys->user_buffer_create(winsys,
313 (void *) ib->ptr,
314 ib->count * indexSize);
315 indexOffset = 0;
316 }
317
318 /* draw */
319 for (i = 0; i < nr_prims; i++) {
320 pipe->draw_elements(pipe, indexBuf, indexSize,
321 prims[i].mode,
322 prims[i].start + indexOffset, prims[i].count);
323 }
324
325 pipe_buffer_reference(winsys, &indexBuf, NULL);
326 }
327 else {
328 /* non-indexed */
329 GLuint i;
330 for (i = 0; i < nr_prims; i++) {
331 pipe->draw_arrays(pipe, prims[i].mode, prims[i].start, prims[i].count);
332 }
333 }
334
335 /* unreference buffers (frees wrapped user-space buffer objects) */
336 for (attr = 0; attr < vp->num_inputs; attr++) {
337 pipe_buffer_reference(winsys, &vbuffer[attr].buffer, NULL);
338 assert(!vbuffer[attr].buffer);
339 pipe->set_vertex_buffer(pipe, attr, &vbuffer[attr]);
340 }
341 }
342
343
344
345 /**
346 * Utility function for drawing simple primitives (such as quads for
347 * glClear and glDrawPixels). Coordinates are in screen space.
348 * \param mode one of PIPE_PRIM_x
349 * \param numVertex number of vertices
350 * \param verts vertex data (all attributes are float[4])
351 * \param numAttribs number of attributes per vertex
352 */
353 void
354 st_draw_vertices(GLcontext *ctx, unsigned prim,
355 unsigned numVertex, float *verts,
356 unsigned numAttribs,
357 GLboolean inClipCoords)
358 {
359 const float width = ctx->DrawBuffer->Width;
360 const float height = ctx->DrawBuffer->Height;
361 const unsigned vertex_bytes = numVertex * numAttribs * 4 * sizeof(float);
362 struct pipe_context *pipe = ctx->st->pipe;
363 struct pipe_buffer *vbuf;
364 struct pipe_vertex_buffer vbuffer;
365 struct pipe_vertex_element velement;
366 unsigned i;
367
368 assert(numAttribs > 0);
369
370 if (!inClipCoords) {
371 /* convert to clip coords */
372 for (i = 0; i < numVertex; i++) {
373 float x = verts[i * numAttribs * 4 + 0];
374 float y = verts[i * numAttribs * 4 + 1];
375 x = x / width * 2.0 - 1.0;
376 y = y / height * 2.0 - 1.0;
377 verts[i * numAttribs * 4 + 0] = x;
378 verts[i * numAttribs * 4 + 1] = y;
379 }
380 }
381
382 /* XXX create one-time */
383 vbuf = pipe->winsys->buffer_create(pipe->winsys, 32,
384 PIPE_BUFFER_USAGE_VERTEX, vertex_bytes);
385 assert(vbuf);
386
387 memcpy(pipe->winsys->buffer_map(pipe->winsys, vbuf,
388 PIPE_BUFFER_USAGE_CPU_WRITE),
389 verts, vertex_bytes);
390 pipe->winsys->buffer_unmap(pipe->winsys, vbuf);
391
392 /* tell pipe about the vertex buffer */
393 vbuffer.buffer = vbuf;
394 vbuffer.pitch = numAttribs * 4 * sizeof(float); /* vertex size */
395 vbuffer.buffer_offset = 0;
396 pipe->set_vertex_buffer(pipe, 0, &vbuffer);
397
398 /* tell pipe about the vertex attributes */
399 for (i = 0; i < numAttribs; i++) {
400 velement.src_offset = i * 4 * sizeof(GLfloat);
401 velement.vertex_buffer_index = 0;
402 velement.src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
403 velement.nr_components = 4;
404 pipe->set_vertex_element(pipe, i, &velement);
405 }
406
407 /* draw */
408 pipe->draw_arrays(pipe, prim, 0, numVertex);
409
410 /* XXX: do one-time */
411 pipe_buffer_reference(pipe->winsys, &vbuf, NULL);
412 }
413
414
415 /**
416 * Set the (private) draw module's post-transformed vertex format when in
417 * GL_SELECT or GL_FEEDBACK mode or for glRasterPos.
418 */
419 static void
420 set_feedback_vertex_format(GLcontext *ctx)
421 {
422 #if 0
423 struct st_context *st = ctx->st;
424 struct vertex_info vinfo;
425 GLuint i;
426
427 memset(&vinfo, 0, sizeof(vinfo));
428
429 if (ctx->RenderMode == GL_SELECT) {
430 assert(ctx->RenderMode == GL_SELECT);
431 vinfo.num_attribs = 1;
432 vinfo.format[0] = FORMAT_4F;
433 vinfo.interp_mode[0] = INTERP_LINEAR;
434 }
435 else {
436 /* GL_FEEDBACK, or glRasterPos */
437 /* emit all attribs (pos, color, texcoord) as GLfloat[4] */
438 vinfo.num_attribs = st->state.vs->cso->state.num_outputs;
439 for (i = 0; i < vinfo.num_attribs; i++) {
440 vinfo.format[i] = FORMAT_4F;
441 vinfo.interp_mode[i] = INTERP_LINEAR;
442 }
443 }
444
445 draw_set_vertex_info(st->draw, &vinfo);
446 #endif
447 }
448
449
450 /**
451 * Called by VBO to draw arrays when in selection or feedback mode and
452 * to implement glRasterPos.
453 * This is very much like the normal draw_vbo() function above.
454 * Look at code refactoring some day.
455 * Might move this into the failover module some day.
456 */
457 void
458 st_feedback_draw_vbo(GLcontext *ctx,
459 const struct gl_client_array **arrays,
460 const struct _mesa_prim *prims,
461 GLuint nr_prims,
462 const struct _mesa_index_buffer *ib,
463 GLuint min_index,
464 GLuint max_index)
465 {
466 struct st_context *st = ctx->st;
467 struct pipe_context *pipe = st->pipe;
468 struct draw_context *draw = st->draw;
469 struct pipe_winsys *winsys = pipe->winsys;
470 const struct st_vertex_program *vp;
471 const struct pipe_shader_state *vs;
472 struct pipe_buffer *index_buffer_handle = 0;
473 struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
474 GLuint attr, i;
475 ubyte *mapped_constants;
476
477 assert(draw);
478
479 st_validate_state(ctx->st);
480
481 /* must get these after state validation! */
482 vp = ctx->st->vp;
483 vs = &st->vp->state;
484
485 if (!st->vp->draw_shader) {
486 st->vp->draw_shader = draw_create_vertex_shader(draw, vs);
487 }
488
489 /*
490 * Set up the draw module's state.
491 *
492 * We'd like to do this less frequently, but the normal state-update
493 * code sends state updates to the pipe, not to our private draw module.
494 */
495 assert(draw);
496 draw_set_viewport_state(draw, &st->state.viewport);
497 draw_set_clip_state(draw, &st->state.clip);
498 draw_set_rasterizer_state(draw, &st->state.rasterizer);
499 draw_bind_vertex_shader(draw, st->vp->draw_shader);
500 set_feedback_vertex_format(ctx);
501
502 /* loop over TGSI shader inputs to determine vertex buffer
503 * and attribute info
504 */
505 for (attr = 0; attr < vp->num_inputs; attr++) {
506 const GLuint mesaAttr = vp->index_to_input[attr];
507 struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
508 struct pipe_vertex_element velement;
509 void *map;
510
511 if (bufobj && bufobj->Name) {
512 /* Attribute data is in a VBO.
513 * Recall that for VBOs, the gl_client_array->Ptr field is
514 * really an offset from the start of the VBO, not a pointer.
515 */
516 struct st_buffer_object *stobj = st_buffer_object(bufobj);
517 assert(stobj->buffer);
518
519 vbuffer[attr].buffer = NULL;
520 pipe_buffer_reference(winsys, &vbuffer[attr].buffer, stobj->buffer);
521 vbuffer[attr].buffer_offset = (unsigned) arrays[0]->Ptr;/* in bytes */
522 velement.src_offset = arrays[mesaAttr]->Ptr - arrays[0]->Ptr;
523 }
524 else {
525 /* attribute data is in user-space memory, not a VBO */
526 uint bytes = (arrays[mesaAttr]->Size
527 * _mesa_sizeof_type(arrays[mesaAttr]->Type)
528 * (max_index + 1));
529
530 /* wrap user data */
531 vbuffer[attr].buffer
532 = winsys->user_buffer_create(winsys,
533 (void *) arrays[mesaAttr]->Ptr,
534 bytes);
535 vbuffer[attr].buffer_offset = 0;
536 velement.src_offset = 0;
537 }
538
539 /* common-case setup */
540 vbuffer[attr].pitch = arrays[mesaAttr]->StrideB; /* in bytes */
541 vbuffer[attr].max_index = max_index;
542 velement.vertex_buffer_index = attr;
543 velement.nr_components = arrays[mesaAttr]->Size;
544 velement.src_format = pipe_vertex_format(arrays[mesaAttr]->Type,
545 arrays[mesaAttr]->Size,
546 arrays[mesaAttr]->Normalized);
547 assert(velement.src_format);
548
549 /* tell draw about this attribute */
550 draw_set_vertex_buffer(draw, attr, &vbuffer[attr]);
551 draw_set_vertex_element(draw, attr, &velement);
552
553 /* map the attrib buffer */
554 map = pipe->winsys->buffer_map(pipe->winsys,
555 vbuffer[attr].buffer,
556 PIPE_BUFFER_USAGE_CPU_READ);
557 draw_set_mapped_vertex_buffer(draw, attr, map);
558 }
559
560 if (ib) {
561 unsigned indexSize;
562 struct gl_buffer_object *bufobj = ib->obj;
563 struct st_buffer_object *stobj = st_buffer_object(bufobj);
564 index_buffer_handle = stobj->buffer;
565 void *map;
566
567 switch (ib->type) {
568 case GL_UNSIGNED_INT:
569 indexSize = 4;
570 break;
571 case GL_UNSIGNED_SHORT:
572 indexSize = 2;
573 break;
574 default:
575 assert(0);
576 return;
577 }
578
579 map = pipe->winsys->buffer_map(pipe->winsys,
580 index_buffer_handle,
581 PIPE_BUFFER_USAGE_CPU_READ);
582 draw_set_mapped_element_buffer(draw, indexSize, map);
583 }
584 else {
585 /* no index/element buffer */
586 draw_set_mapped_element_buffer(draw, 0, NULL);
587 }
588
589
590 /* map constant buffers */
591 mapped_constants = winsys->buffer_map(winsys,
592 st->state.constants[PIPE_SHADER_VERTEX].buffer,
593 PIPE_BUFFER_USAGE_CPU_READ);
594 draw_set_mapped_constant_buffer(st->draw, mapped_constants);
595
596
597 /* draw here */
598 for (i = 0; i < nr_prims; i++) {
599 draw_arrays(draw, prims[i].mode, prims[i].start, prims[i].count);
600 }
601
602
603 /* unmap constant buffers */
604 winsys->buffer_unmap(winsys, st->state.constants[PIPE_SHADER_VERTEX].buffer);
605
606 /*
607 * unmap vertex/index buffers
608 */
609 for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
610 if (draw->vertex_buffer[i].buffer) {
611 pipe->winsys->buffer_unmap(pipe->winsys,
612 draw->vertex_buffer[i].buffer);
613 pipe_buffer_reference(winsys, &draw->vertex_buffer[i].buffer, NULL);
614 draw_set_mapped_vertex_buffer(draw, i, NULL);
615 }
616 }
617 if (ib) {
618 pipe->winsys->buffer_unmap(pipe->winsys, index_buffer_handle);
619 draw_set_mapped_element_buffer(draw, 0, NULL);
620 }
621 }
622
623
624
625 void st_init_draw( struct st_context *st )
626 {
627 GLcontext *ctx = st->ctx;
628
629 vbo_set_draw_func(ctx, st_draw_vbo);
630 }
631
632
633 void st_destroy_draw( struct st_context *st )
634 {
635 }
636
637