Mesa (master): evergreeng: protect against null constant buffers
Keith Whitwell
keithw at kemper.freedesktop.org
Wed Nov 3 10:55:32 UTC 2010
Module: Mesa
Branch: master
Commit: b3462601cb69f277b9aafc2ee5179a0c2cf6cbcd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3462601cb69f277b9aafc2ee5179a0c2cf6cbcd
Author: Keith Whitwell <keithw at vmware.com>
Date: Wed Nov 3 10:24:28 2010 +0000
evergreeng: protect against null constant buffers
Should do better than this and actually unbind the buffer, but haven't
yet gotten it to work.
---
src/gallium/drivers/r600/evergreen_state.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 7222348..ce8e93a 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -826,6 +826,13 @@ static void evergreen_set_constant_buffer(struct pipe_context *ctx, uint shader,
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_resource *rbuffer = (struct r600_resource*)buffer;
+ /* Note that the state tracker can unbind constant buffers by
+ * passing NULL here.
+ */
+ if (buffer == NULL) {
+ return;
+ }
+
switch (shader) {
case PIPE_SHADER_VERTEX:
rctx->vs_const_buffer.nregs = 0;
More information about the mesa-commit
mailing list