summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-04-07 12:19:14 +0100
committerJosé Fonseca <[email protected]>2011-04-07 12:20:06 +0100
commit0c501bacef3738b55986292abca149dcfe76d72d (patch)
tree520e16b5c73e0179dc1d270cd7e255594cdfb0ca /src/mesa/state_tracker/st_context.c
parent204991bf5d29caa3fa54df9e4f6898faa73752cf (diff)
mesa/st: Fix user buffer size computation when stride is zero.
Although for GL a zero stride means tightly packed elements, Mesa internally uses zero strides for constant arrays. Therefore user buffers need to be defined from buffer_offset + src_offset + min_index*stride to buffer_offset + src_offset + max_index*stride + elem_size Simplifying the later with (max_index + 1)*stride will give zero sized buffers. This change also aggregates the st_context's info about user buffers into a single array.
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 5a39ab0a110..a9461899ad5 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -206,8 +206,8 @@ static void st_destroy_context_priv( struct st_context *st )
st_destroy_drawtex(st);
/* Unreference any user vertex buffers. */
- for (i = 0; i < st->num_user_vbs; i++) {
- pipe_resource_reference(&st->user_vb[i], NULL);
+ for (i = 0; i < st->num_user_attribs; i++) {
+ pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
}
for (i = 0; i < Elements(st->state.sampler_views); i++) {