From: Luca Barbieri Date: Fri, 24 Sep 2010 12:12:24 +0000 (+0200) Subject: nvfx: allow setting NULL constant buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0ee833deec843742f80dc1d42b4ecc03ada06e2;p=mesa.git nvfx: allow setting NULL constant buffers --- diff --git a/src/gallium/drivers/nvfx/nvfx_state.c b/src/gallium/drivers/nvfx/nvfx_state.c index b767846a99e..54619037d82 100644 --- a/src/gallium/drivers/nvfx/nvfx_state.c +++ b/src/gallium/drivers/nvfx/nvfx_state.c @@ -305,7 +305,7 @@ nvfx_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, struct nvfx_context *nvfx = nvfx_context(pipe); nvfx->constbuf[shader] = buf; - nvfx->constbuf_nr[shader] = buf->width0 / (4 * sizeof(float)); + nvfx->constbuf_nr[shader] = buf ? (buf->width0 / (4 * sizeof(float))) : 0; if (shader == PIPE_SHADER_VERTEX) { nvfx->dirty |= NVFX_NEW_VERTCONST;