From 84e5cb37d3cf0dd0b224d2431c7417d5e2fa6453 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Aug 2012 14:33:31 -0600 Subject: [PATCH] st/mesa: use Elements() instead of hard-coded number And add a comment about the velems_util_draw[] array. --- src/mesa/state_tracker/st_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 7735eee4f3d..2e14da2117b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -163,7 +163,10 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe ) else st->internal_target = PIPE_TEXTURE_RECT; - for (i = 0; i < 3; i++) { + /* Vertex element objects used for drawing rectangles for glBitmap, + * glDrawPixels, glClear, etc. + */ + for (i = 0; i < Elements(st->velems_util_draw); i++) { memset(&st->velems_util_draw[i], 0, sizeof(struct pipe_vertex_element)); st->velems_util_draw[i].src_offset = i * 4 * sizeof(float); st->velems_util_draw[i].instance_divisor = 0; -- 2.30.2