summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-24 14:12:24 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-24 15:10:03 +0200
commitb018e63d4a2458b7a7cd6758478d3a684c9d4774 (patch)
treebee0914f71dd1c8d5967d59dc4fe96832f2eaaf1
parentc7a064b4d5b6df0277d35a21d5fc1df899087784 (diff)
nvfx: allow setting NULL constant buffers
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_state.c b/src/gallium/drivers/nvfx/nvfx_state.c
index b767846a99..54619037d8 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;