summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pt.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-09-14 17:03:25 +0200
committerMarek Olšák <[email protected]>2012-09-22 14:20:37 +0200
commit2988fa940e1d8a4531fddff4d554eec1e6e04474 (patch)
treeefe44e1a37ff1b691c95208a617679502a15a68c /src/gallium/auxiliary/draw/draw_pt.c
parentbbb2ebe2fc073793c5129b164b61fe1b36dfc4b1 (diff)
draw: fix non-indexed draw calls if there's an index buffer
pipe_draw_info::indexed determines if it should be indexed and not the presence of an index buffer. This fixes crashes in r300g. NOTE: This is a candidate for the stable branches. Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index 5b6eaa739d0..08e06e84aed 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -362,7 +362,7 @@ draw_pt_arrays_restart(struct draw_context *draw,
assert(info->primitive_restart);
- if (draw->pt.user.elts) {
+ if (draw->pt.user.eltSize) {
/* indexed prims (draw_elements) */
cur_start = start;
cur_count = 0;
@@ -433,12 +433,8 @@ draw_arrays_instanced(struct draw_context *draw,
info.count = count;
info.start_instance = startInstance;
info.instance_count = instanceCount;
-
- info.indexed = (draw->pt.user.elts != NULL);
- if (!info.indexed) {
- info.min_index = start;
- info.max_index = start + count - 1;
- }
+ info.min_index = start;
+ info.max_index = start + count - 1;
draw_vbo(draw, &info);
}
@@ -465,6 +461,7 @@ draw_vbo(struct draw_context *draw,
draw->pt.user.eltBias = info->index_bias;
draw->pt.user.min_index = 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",