summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-03-21 19:29:29 +0100
committerMarek Olšák <[email protected]>2013-03-26 01:28:18 +0100
commita2378daf8351d3330520edfe09c40928a8984a9b (patch)
tree9830686ffd9297899ea5ff6f0735c638f7c27ca7 /src
parent53228fe2a8dafe102a3d764de97ee963ecfb4508 (diff)
r600g: fix crash while binding a NULL constant buffer
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index b0e66ac3f9a..34c70edf575 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -926,7 +926,7 @@ static void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint
/* Note that the state tracker can unbind constant buffers by
* passing NULL here.
*/
- if (unlikely(!input)) {
+ if (unlikely(!input || (!input->buffer && !input->user_buffer))) {
state->enabled_mask &= ~(1 << index);
state->dirty_mask &= ~(1 << index);
pipe_resource_reference(&state->cb[index].buffer, NULL);