Mesa (master): nvfx: allow setting NULL constant buffers
Luca Barbieri
lb at kemper.freedesktop.org
Fri Sep 24 13:12:43 UTC 2010
Module: Mesa
Branch: master
Commit: d0ee833deec843742f80dc1d42b4ecc03ada06e2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0ee833deec843742f80dc1d42b4ecc03ada06e2
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Fri Sep 24 14:12:24 2010 +0200
nvfx: allow setting NULL constant buffers
---
src/gallium/drivers/nvfx/nvfx_state.c | 2 +-
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 b767846..5461903 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;
More information about the mesa-commit
mailing list