From: José Fonseca Date: Fri, 6 Jul 2012 15:55:09 +0000 (+0100) Subject: galahad: Don't defer index buffer when it's NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=04d29afb8b7329d66a1e9efc9fb55eb1adffa0df;p=mesa.git galahad: Don't defer index buffer when it's NULL. --- diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index 4dae61ca64a..823f281a7ca 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;