st_draw.c revision 1e0d30a515e4cac891b6c590f12a33e0e8a8e295
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 "pipe/draw/draw_private.h" 51#include "pipe/draw/draw_context.h" 52 53 54static 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 61static 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 68static 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 75static 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 82static 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 89static 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 96static 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 103static 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 110static 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 117static 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 124static 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 131static 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 138static 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 145static 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 */ 156static GLuint 157pipe_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 */ 199void 200st_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 } 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 < vs->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 */ 353void 354st_draw_vertices(GLcontext *ctx, unsigned prim, 355 unsigned numVertex, float *verts, 356 unsigned numAttribs) 357{ 358 const float width = ctx->DrawBuffer->Width; 359 const float height = ctx->DrawBuffer->Height; 360 const unsigned vertex_bytes = numVertex * numAttribs * 4 * sizeof(float); 361 struct pipe_context *pipe = ctx->st->pipe; 362 struct pipe_buffer *vbuf; 363 struct pipe_vertex_buffer vbuffer; 364 struct pipe_vertex_element velement; 365 unsigned i; 366 367 assert(numAttribs > 0); 368 369 /* convert to clip coords */ 370 for (i = 0; i < numVertex; i++) { 371 float x = verts[i * numAttribs * 4 + 0]; 372 float y = verts[i * numAttribs * 4 + 1]; 373 x = x / width * 2.0 - 1.0; 374 y = y / height * 2.0 - 1.0; 375 verts[i * numAttribs * 4 + 0] = x; 376 verts[i * numAttribs * 4 + 1] = y; 377 } 378 379 /* XXX create one-time */ 380 vbuf = pipe->winsys->buffer_create(pipe->winsys, 32, 381 PIPE_BUFFER_USAGE_VERTEX, vertex_bytes); 382 assert(vbuf); 383 384 memcpy(pipe->winsys->buffer_map(pipe->winsys, vbuf, 385 PIPE_BUFFER_USAGE_CPU_WRITE), 386 verts, vertex_bytes); 387 pipe->winsys->buffer_unmap(pipe->winsys, vbuf); 388 389 /* tell pipe about the vertex buffer */ 390 vbuffer.buffer = vbuf; 391 vbuffer.pitch = numAttribs * 4 * sizeof(float); /* vertex size */ 392 vbuffer.buffer_offset = 0; 393 pipe->set_vertex_buffer(pipe, 0, &vbuffer); 394 395 /* tell pipe about the vertex attributes */ 396 for (i = 0; i < numAttribs; i++) { 397 velement.src_offset = i * 4 * sizeof(GLfloat); 398 velement.vertex_buffer_index = 0; 399 velement.src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; 400 velement.nr_components = 4; 401 pipe->set_vertex_element(pipe, i, &velement); 402 } 403 404 /* draw */ 405 pipe->draw_arrays(pipe, prim, 0, numVertex); 406 407 /* XXX: do one-time */ 408 pipe_buffer_reference(pipe->winsys, &vbuf, NULL); 409} 410 411 412/** 413 * Set the (private) draw module's post-transformed vertex format when in 414 * GL_SELECT or GL_FEEDBACK mode or for glRasterPos. 415 */ 416static void 417set_feedback_vertex_format(GLcontext *ctx) 418{ 419#if 0 420 struct st_context *st = ctx->st; 421 struct vertex_info vinfo; 422 GLuint i; 423 424 memset(&vinfo, 0, sizeof(vinfo)); 425 426 if (ctx->RenderMode == GL_SELECT) { 427 assert(ctx->RenderMode == GL_SELECT); 428 vinfo.num_attribs = 1; 429 vinfo.format[0] = FORMAT_4F; 430 vinfo.interp_mode[0] = INTERP_LINEAR; 431 } 432 else { 433 /* GL_FEEDBACK, or glRasterPos */ 434 /* emit all attribs (pos, color, texcoord) as GLfloat[4] */ 435 vinfo.num_attribs = st->state.vs->cso->state.num_outputs; 436 for (i = 0; i < vinfo.num_attribs; i++) { 437 vinfo.format[i] = FORMAT_4F; 438 vinfo.interp_mode[i] = INTERP_LINEAR; 439 } 440 } 441 442 draw_set_vertex_info(st->draw, &vinfo); 443#endif 444} 445 446 447/** 448 * Called by VBO to draw arrays when in selection or feedback mode and 449 * to implement glRasterPos. 450 * This is very much like the normal draw_vbo() function above. 451 * Look at code refactoring some day. 452 * Might move this into the failover module some day. 453 */ 454void 455st_feedback_draw_vbo(GLcontext *ctx, 456 const struct gl_client_array **arrays, 457 const struct _mesa_prim *prims, 458 GLuint nr_prims, 459 const struct _mesa_index_buffer *ib, 460 GLuint min_index, 461 GLuint max_index) 462{ 463 struct st_context *st = ctx->st; 464 struct pipe_context *pipe = st->pipe; 465 struct draw_context *draw = st->draw; 466 struct pipe_winsys *winsys = pipe->winsys; 467 const struct st_vertex_program *vp; 468 const struct pipe_shader_state *vs; 469 struct pipe_buffer *index_buffer_handle = 0; 470 struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; 471 GLuint attr, i; 472 ubyte *mapped_constants; 473 474 assert(draw); 475 476 st_validate_state(ctx->st); 477 478 /* must get these after state validation! */ 479 vp = ctx->st->vp; 480 vs = &ctx->st->state.vs->cso->state; 481 482 if (!st->state.vs->draw_shader) { 483 st->state.vs->draw_shader = draw_create_vertex_shader(draw, vs); 484 } 485 486 /* 487 * Set up the draw module's state. 488 * 489 * We'd like to do this less frequently, but the normal state-update 490 * code sends state updates to the pipe, not to our private draw module. 491 */ 492 assert(draw); 493 draw_set_viewport_state(draw, &st->state.viewport); 494 draw_set_clip_state(draw, &st->state.clip); 495 draw_set_rasterizer_state(draw, &st->state.rasterizer->state); 496 draw_bind_vertex_shader(draw, st->state.vs->draw_shader); 497 set_feedback_vertex_format(ctx); 498 499 /* loop over TGSI shader inputs to determine vertex buffer 500 * and attribute info 501 */ 502 for (attr = 0; attr < vs->num_inputs; attr++) { 503 const GLuint mesaAttr = vp->index_to_input[attr]; 504 struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj; 505 struct pipe_vertex_element velement; 506 void *map; 507 508 if (bufobj && bufobj->Name) { 509 /* Attribute data is in a VBO. 510 * Recall that for VBOs, the gl_client_array->Ptr field is 511 * really an offset from the start of the VBO, not a pointer. 512 */ 513 struct st_buffer_object *stobj = st_buffer_object(bufobj); 514 assert(stobj->buffer); 515 516 vbuffer[attr].buffer = NULL; 517 pipe_buffer_reference(winsys, &vbuffer[attr].buffer, stobj->buffer); 518 vbuffer[attr].buffer_offset = (unsigned) arrays[0]->Ptr;/* in bytes */ 519 velement.src_offset = arrays[mesaAttr]->Ptr - arrays[0]->Ptr; 520 } 521 else { 522 /* attribute data is in user-space memory, not a VBO */ 523 uint bytes = (arrays[mesaAttr]->Size 524 * _mesa_sizeof_type(arrays[mesaAttr]->Type) 525 * (max_index + 1)); 526 527 /* wrap user data */ 528 vbuffer[attr].buffer 529 = winsys->user_buffer_create(winsys, 530 (void *) arrays[mesaAttr]->Ptr, 531 bytes); 532 vbuffer[attr].buffer_offset = 0; 533 velement.src_offset = 0; 534 } 535 536 /* common-case setup */ 537 vbuffer[attr].pitch = arrays[mesaAttr]->StrideB; /* in bytes */ 538 vbuffer[attr].max_index = max_index; 539 velement.vertex_buffer_index = attr; 540 velement.nr_components = arrays[mesaAttr]->Size; 541 velement.src_format = pipe_vertex_format(arrays[mesaAttr]->Type, 542 arrays[mesaAttr]->Size, 543 arrays[mesaAttr]->Normalized); 544 assert(velement.src_format); 545 546 /* tell draw about this attribute */ 547 draw_set_vertex_buffer(draw, attr, &vbuffer[attr]); 548 draw_set_vertex_element(draw, attr, &velement); 549 550 /* map the attrib buffer */ 551 map = pipe->winsys->buffer_map(pipe->winsys, 552 vbuffer[attr].buffer, 553 PIPE_BUFFER_USAGE_CPU_READ); 554 draw_set_mapped_vertex_buffer(draw, attr, map); 555 } 556 557 if (ib) { 558 unsigned indexSize; 559 struct gl_buffer_object *bufobj = ib->obj; 560 struct st_buffer_object *stobj = st_buffer_object(bufobj); 561 index_buffer_handle = stobj->buffer; 562 void *map; 563 564 switch (ib->type) { 565 case GL_UNSIGNED_INT: 566 indexSize = 4; 567 break; 568 case GL_UNSIGNED_SHORT: 569 indexSize = 2; 570 break; 571 default: 572 assert(0); 573 } 574 575 map = pipe->winsys->buffer_map(pipe->winsys, 576 index_buffer_handle, 577 PIPE_BUFFER_USAGE_CPU_READ); 578 draw_set_mapped_element_buffer(draw, indexSize, map); 579 } 580 else { 581 /* no index/element buffer */ 582 draw_set_mapped_element_buffer(draw, 0, NULL); 583 } 584 585 586 /* map constant buffers */ 587 mapped_constants = winsys->buffer_map(winsys, 588 st->state.constants[PIPE_SHADER_VERTEX].buffer, 589 PIPE_BUFFER_USAGE_CPU_READ); 590 draw_set_mapped_constant_buffer(st->draw, mapped_constants); 591 592 593 /* draw here */ 594 for (i = 0; i < nr_prims; i++) { 595 draw_arrays(draw, prims[i].mode, prims[i].start, prims[i].count); 596 } 597 598 599 /* unmap constant buffers */ 600 winsys->buffer_unmap(winsys, st->state.constants[PIPE_SHADER_VERTEX].buffer); 601 602 /* 603 * unmap vertex/index buffers 604 */ 605 for (i = 0; i < PIPE_ATTRIB_MAX; i++) { 606 if (draw->vertex_buffer[i].buffer) { 607 pipe->winsys->buffer_unmap(pipe->winsys, 608 draw->vertex_buffer[i].buffer); 609 pipe_buffer_reference(winsys, &draw->vertex_buffer[i].buffer, NULL); 610 draw_set_mapped_vertex_buffer(draw, i, NULL); 611 } 612 } 613 if (ib) { 614 pipe->winsys->buffer_unmap(pipe->winsys, index_buffer_handle); 615 draw_set_mapped_element_buffer(draw, 0, NULL); 616 } 617} 618 619 620 621void st_init_draw( struct st_context *st ) 622{ 623 GLcontext *ctx = st->ctx; 624 625 vbo_set_draw_func(ctx, st_draw_vbo); 626} 627 628 629void st_destroy_draw( struct st_context *st ) 630{ 631} 632 633 634