Module: Mesa
Branch: master
Commit: d0ee833deec843742f80dc1d42b4ecc03ada06e2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0ee833deec843742f80dc1d42b4ecc03ada06e2

Author: Luca Barbieri <[email protected]>
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;

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to