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. */
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. */
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,
}
/* 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;
}
}
- 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++) {
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));
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;
}
unsigned instance_div, first, size;
/* Skip the buffer generated by translate. */
- if (index == mgr->translate_vb_slot) {
+ if (index == mgr->fallback_vb_slot) {
continue;
}