Mesa (gallium-mesa-7.4): softpipe: fix a crash
Alan Hourihane
alanh at kemper.freedesktop.org
Tue Mar 24 16:08:30 UTC 2009
Module: Mesa
Branch: gallium-mesa-7.4
Commit: e018c2f176ff3698e88db8772c8eff9c5ca083a8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e018c2f176ff3698e88db8772c8eff9c5ca083a8
Author: Alan Hourihane <alanh at vmware.com>
Date: Tue Mar 24 16:07:51 2009 +0000
softpipe: fix a crash
---
src/gallium/drivers/softpipe/sp_draw_arrays.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index ed3e8f9..7e3b9b3 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -54,7 +54,8 @@ softpipe_map_constant_buffers(struct softpipe_context *sp)
PIPE_BUFFER_USAGE_CPU_READ);
}
- draw_set_mapped_constant_buffer(sp->draw,
+ if (sp->mapped_constants[PIPE_SHADER_VERTEX])
+ draw_set_mapped_constant_buffer(sp->draw,
sp->mapped_constants[PIPE_SHADER_VERTEX],
sp->constants[PIPE_SHADER_VERTEX].buffer->size);
}
@@ -72,7 +73,7 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
draw_set_mapped_constant_buffer(sp->draw, NULL, 0);
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < PIPE_SHADER_TYPES; i++) {
if (sp->constants[i].buffer && sp->constants[i].buffer->size)
ws->buffer_unmap(ws, sp->constants[i].buffer);
sp->mapped_constants[i] = NULL;
More information about the mesa-commit
mailing list