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