diff options
author | José Fonseca <[email protected]> | 2008-08-12 11:33:20 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-08-12 11:34:41 +0100 |
commit | 506b8ebdba73f85c169599ce861b339e97370eb2 (patch) | |
tree | 56f6a554aead9efe1aaf12c18dab119381152776 /src/gallium/state_trackers/python | |
parent | 4a77fadd102264f1bf2caec3263e193eb831dade (diff) |
python: Use st_buffers instead of pipe_buffers.
Diffstat (limited to 'src/gallium/state_trackers/python')
-rw-r--r-- | src/gallium/state_trackers/python/p_context.i | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i index df07f3bc47c..521a2dee075 100644 --- a/src/gallium/state_trackers/python/p_context.i +++ b/src/gallium/state_trackers/python/p_context.i @@ -106,12 +106,12 @@ struct st_context { } void set_constant_buffer(unsigned shader, unsigned index, - const struct pipe_constant_buffer *buf ) + struct st_buffer *buffer ) { struct pipe_constant_buffer state; memset(&state, 0, sizeof(state)); - state.buffer = buf->buffer; - state.size = buf->buffer->size; + state.buffer = buffer->buffer; + state.size = buffer->buffer->size; $self->pipe->set_constant_buffer($self->pipe, shader, index, &state); } @@ -142,9 +142,29 @@ struct st_context { } void set_vertex_buffer(unsigned index, - const struct pipe_vertex_buffer *buffer) { - memcpy(&$self->vertex_buffers[index], buffer, sizeof(*buffer)); - $self->pipe->set_vertex_buffers($self->pipe, PIPE_MAX_ATTRIBS, $self->vertex_buffers); + unsigned pitch, + unsigned max_index, + unsigned buffer_offset, + struct st_buffer *buffer) + { + unsigned i, num_vertex_buffers; + struct pipe_vertex_buffer state; + + memset(&state, 0, sizeof(state)); + state.pitch = pitch; + state.max_index = max_index; + state.buffer_offset = buffer_offset; + state.buffer = buffer->buffer; + + memcpy(&$self->vertex_buffers[index], &state, sizeof(state)); + + for(i = 0; i < PIPE_MAX_ATTRIBS; ++i) + if(self->vertex_buffers[i].buffer) + num_vertex_buffers = i + 1; + + $self->pipe->set_vertex_buffers($self->pipe, + num_vertex_buffers, + $self->vertex_buffers); } void set_vertex_element(unsigned index, |