diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-03-09 12:31:20 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-03-09 12:31:20 +0000 |
commit | fe94a363e53ac5e19a919ea6eef2e22b4da4fc6f (patch) | |
tree | 1d74e571a8da6868c8d9cd2619bb5fad70ffaffe /src/gallium/drivers/cell/ppu/cell_state_shader.c | |
parent | 8ac10162f1412469698322c1c1baf5aaf78a4645 (diff) |
cell: attempt conversion to sw_winsys
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_state_shader.c')
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_state_shader.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index bc6127d7e7..6342402854 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -34,6 +34,7 @@ #include "cell_context.h" #include "cell_state.h" #include "cell_gen_fp.h" +#include "cell_buffer.h" /** cast wrapper */ @@ -185,15 +186,27 @@ cell_set_constant_buffer(struct pipe_context *pipe, struct pipe_buffer *buf) { struct cell_context *cell = cell_context(pipe); + unsigned size = constants ? constants->size : 0; + const void *data = constants ? cell_buffer(constants)->data : NULL; assert(shader < PIPE_SHADER_TYPES); assert(index == 0); + if (cell->constants[shader] == constants) + return; + draw_flush(cell->draw); /* note: reference counting */ pipe_buffer_reference(&cell->constants[shader], buf); + if(shader == PIPE_SHADER_VERTEX) { + draw_set_mapped_constant_buffer(cell->draw, PIPE_SHADER_VERTEX, 0, + data, size); + } + + cell->mapped_constants[shader] = data; + if (shader == PIPE_SHADER_VERTEX) cell->dirty |= CELL_NEW_VS_CONSTANTS; else if (shader == PIPE_SHADER_FRAGMENT) |