[Mesa-dev] [PATCH 4/5] draw: treat max_index = ~0 as invalid index range

Marek Olšák maraeo at gmail.com
Sat Apr 22 23:10:44 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

The next commit will simplify related code in st_draw_vbo.
---
 src/gallium/auxiliary/draw/draw_pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index 5a49acb..a1354bd 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -472,21 +472,21 @@ draw_vbo(struct draw_context *draw,
    resolve_draw_info(info, &resolved_info, &(draw->pt.vertex_buffer[0]));
    info = &resolved_info;
 
    assert(info->instance_count > 0);
    if (info->indexed)
       assert(draw->pt.user.elts);
 
    count = info->count;
 
    draw->pt.user.eltBias = info->index_bias;
-   draw->pt.user.min_index = info->min_index;
+   draw->pt.user.min_index = info->max_index == ~0 ? 0 : info->min_index;
    draw->pt.user.max_index = info->max_index;
    draw->pt.user.eltSize = info->indexed ? draw->pt.user.eltSizeIB : 0;
 
    if (0)
       debug_printf("draw_vbo(mode=%u start=%u count=%u):\n",
                    info->mode, info->start, count);
 
    if (0)
       tgsi_dump(draw->vs.vertex_shader->state.tokens, 0);
 
-- 
2.7.4



More information about the mesa-dev mailing list