summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_vbuf.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-11 15:56:59 +0200
committerMarek Olšák <[email protected]>2012-04-24 01:39:22 +0200
commitae799a4948ac1becb48568a274c2ada5d77aa07c (patch)
tree8f64028245cc38c9062fddf815e68155f664c093 /src/gallium/auxiliary/util/u_vbuf.c
parent7fe3631a7a0ad7602b4e947ac87ef86875c8bb3f (diff)
u_vbuf: pull u_vbuf_draw_max_vertex_count into r300g
Diffstat (limited to 'src/gallium/auxiliary/util/u_vbuf.c')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index f0601bda72d..653f71ececd 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -859,56 +859,6 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
}
}
-unsigned u_vbuf_draw_max_vertex_count(struct u_vbuf *mgrb)
-{
- struct u_vbuf_priv *mgr = (struct u_vbuf_priv*)mgrb;
- unsigned i, nr = mgr->ve->count;
- struct pipe_vertex_element *velems =
- mgr->fallback_ve ? mgr->fallback_velems : mgr->ve->ve;
- unsigned result = ~0;
-
- for (i = 0; i < nr; i++) {
- struct pipe_vertex_buffer *vb =
- &mgr->real_vertex_buffer[velems[i].vertex_buffer_index];
- unsigned size, max_count, value;
-
- /* We're not interested in constant and per-instance attribs. */
- if (!vb->buffer ||
- !vb->stride ||
- velems[i].instance_divisor) {
- continue;
- }
-
- size = vb->buffer->width0;
-
- /* Subtract buffer_offset. */
- value = vb->buffer_offset;
- if (value >= size) {
- return 0;
- }
- size -= value;
-
- /* Subtract src_offset. */
- value = velems[i].src_offset;
- if (value >= size) {
- return 0;
- }
- size -= value;
-
- /* Subtract format_size. */
- value = mgr->ve->native_format_size[i];
- if (value >= size) {
- return 0;
- }
- size -= value;
-
- /* Compute the max count. */
- max_count = 1 + size / vb->stride;
- result = MIN2(result, max_count);
- }
- return result;
-}
-
static boolean u_vbuf_need_minmax_index(struct u_vbuf_priv *mgr)
{
unsigned i, nr = mgr->ve->count;