From ae0c9b56d4bec52f9accabbcaf8d42ef41a0153c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 11 Aug 2008 14:31:04 +0100 Subject: [PATCH] python: Simplify setting the constant buffers. --- src/gallium/state_trackers/python/p_context.i | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i index 172dc7256c1..df07f3bc47c 100644 --- a/src/gallium/state_trackers/python/p_context.i +++ b/src/gallium/state_trackers/python/p_context.i @@ -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 ) { -- 2.30.2