nvfx: allow setting NULL constant buffers

This commit is contained in:
Luca Barbieri 2010-09-24 14:12:24 +02:00
parent 8b63ed4e6c
commit d0ee833dee

View file

@ -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;