From b6d8b21cc8e36eb4f6fa72a067561f3fa8bd6ebf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Apr 2008 14:00:40 -0600 Subject: [PATCH] gallium: remove unused st_draw_vertices() --- src/mesa/state_tracker/st_draw.c | 70 -------------------------------- src/mesa/state_tracker/st_draw.h | 7 ---- 2 files changed, 77 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index e40eeddff55..6c20120ac7a 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -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. diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h index 171bde57e55..c81f2b25dad 100644 --- a/src/mesa/state_tracker/st_draw.h +++ b/src/mesa/state_tracker/st_draw.h @@ -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 -- 2.30.2