Mesa (master): r300g: do not use the index parameter in set_constant_buffer

Marek Olšák mareko at kemper.freedesktop.org
Sun Dec 5 05:56:20 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Dec  5 01:30:09 2010 +0100

r300g: do not use the index parameter in set_constant_buffer

It appears to be a constant buffer index (in case there are more constant
buffers explicitly used by a shader), i.e. something that Gallium currently
does not use. We treated it incorrectly as the offset to a constant buffer.

---

 src/gallium/drivers/r300/r300_state.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 092c032..5689275 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1819,7 +1819,6 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
             cbuf = (struct r300_constant_buffer*)r300->fs_constants.state;
             break;
         default:
-            assert(0);
             return;
     }
 
@@ -1831,7 +1830,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
     if (shader == PIPE_SHADER_FRAGMENT ||
         (shader == PIPE_SHADER_VERTEX && r300->screen->caps.has_tcl)) {
         assert((buf->width0 % (4 * sizeof(float))) == 0);
-        cbuf->ptr = mapped + index*4;
+        cbuf->ptr = mapped;
     }
 
     if (shader == PIPE_SHADER_VERTEX) {




More information about the mesa-commit mailing list