From 04d29afb8b7329d66a1e9efc9fb55eb1adffa0df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 6 Jul 2012 16:55:09 +0100 Subject: [PATCH] galahad: Don't defer index buffer when it's NULL. --- src/gallium/drivers/galahad/glhd_context.c | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index 4dae61c..823f281 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -634,24 +634,24 @@ galahad_set_index_buffer(struct pipe_context *_pipe, struct pipe_context *pipe = glhd_pipe->pipe; struct pipe_index_buffer unwrapped_ib, *ib = NULL; - if (_ib->buffer) { - switch (_ib->index_size) { - case 1: - case 2: - case 4: - break; - default: - glhd_warn("index buffer %p has unrecognized index size %d", - (void *) _ib->buffer, _ib->index_size); - break; + if (_ib) { + if (_ib->buffer) { + switch (_ib->index_size) { + case 1: + case 2: + case 4: + break; + default: + glhd_warn("index buffer %p has unrecognized index size %d", + (void *) _ib->buffer, _ib->index_size); + break; + } + } + else if (_ib->offset || _ib->index_size) { + glhd_warn("non-indexed state with index offset %d and index size %d", + _ib->offset, _ib->index_size); } - } - else if (_ib->offset || _ib->index_size) { - glhd_warn("non-indexed state with index offset %d and index size %d", - _ib->offset, _ib->index_size); - } - if (_ib) { unwrapped_ib = *_ib; unwrapped_ib.buffer = galahad_resource_unwrap(_ib->buffer); ib = &unwrapped_ib; -- 2.7.4