r300g: do not use the index parameter in set_constant_buffer
authorMarek Olšák <maraeo@gmail.com>
Sun, 5 Dec 2010 00:30:09 +0000 (01:30 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 5 Dec 2010 04:46:56 +0000 (05:46 +0100)
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

index 092c0320929859203d188ac16567880584cb1b5e..5689275550704aa7079e31df500dac4c6b99f057 100644 (file)
@@ -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) {