diff options
author | José Fonseca <[email protected]> | 2012-07-06 16:55:09 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2012-07-06 17:02:39 +0100 |
commit | 04d29afb8b7329d66a1e9efc9fb55eb1adffa0df (patch) | |
tree | 1742b44c539a8ba0b72ee6f01d6b0337ba75af85 /src | |
parent | 232073b0d97756ee4b3961c99050f4e20aa29a44 (diff) |
galahad: Don't defer index buffer when it's NULL.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/galahad/glhd_context.c | 32 |
1 files changed, 16 insertions, 16 deletions
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; |