mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
gallium: remove unused st_draw_vertices()
This commit is contained in:
parent
7dcbbdf353
commit
b6d8b21cc8
2 changed files with 0 additions and 77 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue