summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-08-17 14:33:31 -0600
committerBrian Paul <[email protected]>2012-08-18 07:39:52 -0600
commit84e5cb37d3cf0dd0b224d2431c7417d5e2fa6453 (patch)
tree7083c733381f79f78afb72df86d6b31a01861efc /src
parent1a9e4d5113cf1fd608668506312167a676fcdb4f (diff)
st/mesa: use Elements() instead of hard-coded number
And add a comment about the velems_util_draw[] array.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_context.c5
1 files changed, 4 insertions, 1 deletions
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;