From: Keith Whitwell Date: Wed, 3 Nov 2010 10:24:28 +0000 (+0000) Subject: evergreeng: protect against null constant buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3462601cb69f277b9aafc2ee5179a0c2cf6cbcd;p=mesa.git evergreeng: protect against null constant buffers Should do better than this and actually unbind the buffer, but haven't yet gotten it to work. --- diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 72223485067..ce8e93a1d25 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -826,6 +826,13 @@ static void evergreen_set_constant_buffer(struct pipe_context *ctx, uint shader, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct r600_resource *rbuffer = (struct r600_resource*)buffer; + /* Note that the state tracker can unbind constant buffers by + * passing NULL here. + */ + if (buffer == NULL) { + return; + } + switch (shader) { case PIPE_SHADER_VERTEX: rctx->vs_const_buffer.nregs = 0;