From: Brian Paul Date: Fri, 17 Aug 2012 20:33:31 +0000 (-0600) Subject: st/mesa: use Elements() instead of hard-coded number X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84e5cb37d3cf0dd0b224d2431c7417d5e2fa6453;p=mesa.git st/mesa: use Elements() instead of hard-coded number And add a comment about the velems_util_draw[] array. --- 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;