summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_state_shader.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-03-09 12:31:20 +0000
committerKeith Whitwell <keithw@vmware.com>2010-03-09 12:31:20 +0000
commitfe94a363e53ac5e19a919ea6eef2e22b4da4fc6f (patch)
tree1d74e571a8da6868c8d9cd2619bb5fad70ffaffe /src/gallium/drivers/cell/ppu/cell_state_shader.c
parent8ac10162f1412469698322c1c1baf5aaf78a4645 (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.c13
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 bc6127d7e7c..63424028547 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)