gallium: remove unused st_draw_vertices()
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 25 Apr 2008 20:00:40 +0000 (14:00 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 25 Apr 2008 20:18:09 +0000 (14:18 -0600)
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw.h

index e40eeddff55ee272969f18b4902479b1a2893e03..6c20120ac7a8e9aac1658b4419078c002908b20b 100644 (file)
@@ -404,76 +404,6 @@ st_draw_vbo(GLcontext *ctx,
 
 
 
-/**
- * Utility function for drawing simple primitives (such as quads for
- * glClear and glDrawPixels).  Coordinates are in screen space.
- * \param mode  one of PIPE_PRIM_x
- * \param numVertex  number of vertices
- * \param verts  vertex data (all attributes are float[4])
- * \param numAttribs  number of attributes per vertex
- */
-void 
-st_draw_vertices(GLcontext *ctx, unsigned prim,
-                 unsigned numVertex, float *verts,
-                 unsigned numAttribs,
-                 GLboolean inClipCoords)
-{
-   const float width = ctx->DrawBuffer->Width;
-   const float height = ctx->DrawBuffer->Height;
-   const unsigned vertex_bytes = numVertex * numAttribs * 4 * sizeof(float);
-   struct pipe_context *pipe = ctx->st->pipe;
-   struct pipe_buffer *vbuf;
-   struct pipe_vertex_buffer vbuffer;
-   struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
-   unsigned i;
-
-   assert(numAttribs > 0);
-
-   if (!inClipCoords) {
-      /* convert to clip coords */
-      for (i = 0; i < numVertex; i++) {
-         float x = verts[i * numAttribs * 4 + 0];
-         float y = verts[i * numAttribs * 4 + 1];
-         x = x / width * 2.0 - 1.0;
-         y = y / height * 2.0 - 1.0;
-         verts[i * numAttribs * 4 + 0] = x;
-         verts[i * numAttribs * 4 + 1] = y;
-      }
-   }
-
-   /* XXX create one-time */
-   vbuf = pipe->winsys->buffer_create(pipe->winsys, 32,
-                                      PIPE_BUFFER_USAGE_VERTEX, vertex_bytes);
-   assert(vbuf);
-
-   memcpy(pipe->winsys->buffer_map(pipe->winsys, vbuf,
-                                   PIPE_BUFFER_USAGE_CPU_WRITE),
-          verts, vertex_bytes);
-   pipe->winsys->buffer_unmap(pipe->winsys, vbuf);
-
-   /* tell pipe about the vertex buffer */
-   vbuffer.buffer = vbuf;
-   vbuffer.pitch = numAttribs * 4 * sizeof(float);  /* vertex size */
-   vbuffer.buffer_offset = 0;
-   pipe->set_vertex_buffers(pipe, 1, &vbuffer);
-
-   /* tell pipe about the vertex attributes */
-   for (i = 0; i < numAttribs; i++) {
-      velements[i].src_offset = i * 4 * sizeof(GLfloat);
-      velements[i].vertex_buffer_index = 0;
-      velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
-      velements[i].nr_components = 4;
-   }
-   pipe->set_vertex_elements(pipe, numAttribs, velements);
-
-   /* draw */
-   pipe->draw_arrays(pipe, prim, 0, numVertex);
-
-   /* XXX: do one-time */
-   pipe_buffer_reference(pipe->winsys, &vbuf, NULL);
-}
-
-
 /**
  * Set the (private) draw module's post-transformed vertex format when in
  * GL_SELECT or GL_FEEDBACK mode or for glRasterPos.
index 171bde57e55a1b84bd3f56fa4f27ef9996acd575..c81f2b25dadba8fc19c03cd4ca138b251ccf0d41 100644 (file)
@@ -59,11 +59,4 @@ st_feedback_draw_vbo(GLcontext *ctx,
                      GLuint min_index,
                      GLuint max_index);
 
-void 
-st_draw_vertices(GLcontext *ctx, unsigned prim,
-                 unsigned numVertex, float *verts,
-                 unsigned numAttribs,
-                 GLboolean inClipCoords);
-
-
 #endif