summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-02-13 18:37:33 -0500
committerIlia Mirkin <[email protected]>2016-02-15 22:22:33 -0500
commitcfbf25ac8f7bfe3e7bd9c8f55cf2c8072b7c9490 (patch)
tree221d247e665c6880008456ffb80be05439baed52
parent76e2af3dd4ca737a2bf10deca450ba4d528a2c92 (diff)
st/mesa: empty buffer binding if the buffer's not really there
This can happen with 0-sized buffers. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_atom_atomicbuf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c b/src/mesa/state_tracker/st_atom_atomicbuf.c
index d83c3960640..a27dbe0460d 100644
--- a/src/mesa/state_tracker/st_atom_atomicbuf.c
+++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
@@ -58,9 +58,11 @@ st_bind_atomics(struct st_context *st,
st_buffer_object(binding->BufferObject);
struct pipe_shader_buffer sb = { 0 };
- sb.buffer = st_obj->buffer;
- sb.buffer_offset = binding->Offset;
- sb.buffer_size = st_obj->buffer->width0 - binding->Offset;
+ if (st_obj && st_obj->buffer) {
+ sb.buffer = st_obj->buffer;
+ sb.buffer_offset = binding->Offset;
+ sb.buffer_size = st_obj->buffer->width0 - binding->Offset;
+ }
st->pipe->set_shader_buffers(st->pipe, shader_type,
atomic->Binding, 1, &sb);