python: Simplify setting the constant buffers.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 11 Aug 2008 13:31:04 +0000 (14:31 +0100)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 12 Aug 2008 10:34:40 +0000 (11:34 +0100)
src/gallium/state_trackers/python/p_context.i

index 172dc7256c12ec4ba5a472f71ed4bfe0fd40445a..df07f3bc47c4e3fb30ee463f0c3d481e139290ac 100644 (file)
@@ -106,8 +106,13 @@ struct st_context {
    }
 
    void set_constant_buffer(unsigned shader, unsigned index,
-                            const struct pipe_constant_buffer *buf ) {
-      $self->pipe->set_constant_buffer($self->pipe, shader, index, buf);
+                            const struct pipe_constant_buffer *buf ) 
+   {
+      struct pipe_constant_buffer state;
+      memset(&state, 0, sizeof(state));
+      state.buffer = buf->buffer;
+      state.size = buf->buffer->size;
+      $self->pipe->set_constant_buffer($self->pipe, shader, index, &state);
    }
 
    void set_framebuffer(const struct pipe_framebuffer_state *state ) {