summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2011-02-26 15:45:13 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-02-26 18:03:54 +0100
commit0f6e02cc1e17d3edc6ecf237b0ab5ae3e07ef433 (patch)
treeabbd3812a0f6caf417a54a80afaffc76f5907710
parent0a1fa2e82d92da339ed0b364ac217cced602aef5 (diff)
i915g: Handle null constants properly
-rw-r--r--src/gallium/drivers/i915/i915_context.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 707b2e9f95..f970f8a700 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -73,10 +73,13 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
draw_set_mapped_index_buffer(draw, mapped_indices);
if (cbuf_dirty) {
- draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
- i915_buffer(i915->constants[PIPE_SHADER_VERTEX])->data,
- (i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
+ if (i915->constants[PIPE_SHADER_VERTEX])
+ draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
+ i915_buffer(i915->constants[PIPE_SHADER_VERTEX])->data,
+ (i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
4 * sizeof(float)));
+ else
+ draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
}
/*