Mesa (gallium-sw-api-2): softpipe: fix constant buffer tracking after rework

Keith Whitwell keithw at kemper.freedesktop.org
Thu Mar 4 08:51:25 PST 2010


Module: Mesa
Branch: gallium-sw-api-2
Commit: 3b6a991728ccb174f19de8b9752241cd4f21398e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b6a991728ccb174f19de8b9752241cd4f21398e

Author: Keith Whitwell <keithw at vmware.com>
Date:   Thu Mar  4 16:50:22 2010 +0000

softpipe: fix constant buffer tracking after rework

---

 src/gallium/drivers/softpipe/sp_state_fs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index cd0e905..2b089c2 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -176,19 +176,17 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
    assert(shader < PIPE_SHADER_TYPES);
    assert(index == 0);
 
-   if(softpipe->constants[shader][index] == constants)
-      return;
-
    draw_flush(softpipe->draw);
 
    /* note: reference counting */
    pipe_buffer_reference(&softpipe->constants[shader][index], constants);
 
    if(shader == PIPE_SHADER_VERTEX) {
-      draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, 0,
+      draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, index,
                                       data, size);
    }
 
+   softpipe->mapped_constants[shader][index] = data;
    softpipe->dirty |= SP_NEW_CONSTANTS;
 }
 



More information about the mesa-commit mailing list