From: Marek Olšák Date: Sun, 20 Nov 2011 19:33:31 +0000 (+0100) Subject: u_vbuf_mgr: rename translate_vb_slot -> fallback_vb_slot X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e53a26b9c2aab0d6ed75856b7e3d08b5590d0a2;p=mesa.git u_vbuf_mgr: rename translate_vb_slot -> fallback_vb_slot --- diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c index 7e36018a044..179073c6145 100644 --- a/src/gallium/auxiliary/util/u_vbuf_mgr.c +++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c @@ -59,9 +59,6 @@ struct u_vbuf_priv { struct pipe_context *pipe; struct translate_cache *translate_cache; - /* Whether there is any user buffer. */ - boolean any_user_vbs; - /* Vertex element state bound by the state tracker. */ void *saved_ve; /* and its associated helper structure for this module. */ @@ -74,11 +71,13 @@ struct u_vbuf_priv { void *fallback_ve; /* The vertex buffer slot index where translated vertices have been * stored in. */ - unsigned translate_vb_slot; + unsigned fallback_vb_slot; /* When binding the fallback vertex element state, we don't want to * change saved_ve and ve. This is set to TRUE in such cases. */ boolean ve_binding_lock; + /* Whether there is any user buffer. */ + boolean any_user_vbs; /* Whether there is a buffer with a non-native layout. */ boolean incompatible_vb_layout; /* Per-buffer flags. */ @@ -125,7 +124,7 @@ u_vbuf_create(struct pipe_context *pipe, mgr->pipe = pipe; mgr->translate_cache = translate_cache_create(); - mgr->translate_vb_slot = ~0; + mgr->fallback_vb_slot = ~0; mgr->b.uploader = u_upload_create(pipe, upload_buffer_size, upload_buffer_alignment, @@ -264,10 +263,10 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr, } /* Setup the new vertex buffer in the first free slot. */ - mgr->translate_vb_slot = ~0; + mgr->fallback_vb_slot = ~0; for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { if (!mgr->b.vertex_buffer[i].buffer) { - mgr->translate_vb_slot = i; + mgr->fallback_vb_slot = i; if (i >= mgr->b.nr_vertex_buffers) { mgr->b.nr_real_vertex_buffers = i+1; @@ -276,12 +275,12 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr, } } - if (mgr->translate_vb_slot != ~0) { + if (mgr->fallback_vb_slot != ~0) { /* Setup the new vertex buffer. */ pipe_resource_reference( - &mgr->b.real_vertex_buffer[mgr->translate_vb_slot].buffer, out_buffer); - mgr->b.real_vertex_buffer[mgr->translate_vb_slot].buffer_offset = out_offset; - mgr->b.real_vertex_buffer[mgr->translate_vb_slot].stride = key.output_stride; + &mgr->b.real_vertex_buffer[mgr->fallback_vb_slot].buffer, out_buffer); + mgr->b.real_vertex_buffer[mgr->fallback_vb_slot].buffer_offset = out_offset; + mgr->b.real_vertex_buffer[mgr->fallback_vb_slot].stride = key.output_stride; /* Setup new vertex elements. */ for (i = 0; i < mgr->ve->count; i++) { @@ -290,7 +289,7 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr, mgr->fallback_velems[i].instance_divisor = mgr->ve->ve[i].instance_divisor; mgr->fallback_velems[i].src_format = te->output_format; mgr->fallback_velems[i].src_offset = te->output_offset; - mgr->fallback_velems[i].vertex_buffer_index = mgr->translate_vb_slot; + mgr->fallback_velems[i].vertex_buffer_index = mgr->fallback_vb_slot; } else { memcpy(&mgr->fallback_velems[i], &mgr->ve->ve[i], sizeof(struct pipe_vertex_element)); @@ -323,9 +322,9 @@ static void u_vbuf_translate_end(struct u_vbuf_priv *mgr) mgr->fallback_ve = NULL; /* Delete the now-unused VBO. */ - pipe_resource_reference(&mgr->b.real_vertex_buffer[mgr->translate_vb_slot].buffer, + pipe_resource_reference(&mgr->b.real_vertex_buffer[mgr->fallback_vb_slot].buffer, NULL); - mgr->translate_vb_slot = ~0; + mgr->fallback_vb_slot = ~0; mgr->b.nr_real_vertex_buffers = mgr->b.nr_vertex_buffers; } @@ -555,7 +554,7 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr, unsigned instance_div, first, size; /* Skip the buffer generated by translate. */ - if (index == mgr->translate_vb_slot) { + if (index == mgr->fallback_vb_slot) { continue; }