gallium: adapt drivers to pipe_constant_buffer removal
[mesa.git] / src / gallium / drivers / cell / ppu / cell_state_shader.c
index 3a0d066da2a7591e970675bf8310c8b04df80ec7..cf5d681499ec08b0b0e51bd9b1b16dd87717caf9 100644 (file)
@@ -28,7 +28,7 @@
 #include "pipe/p_defines.h"
 #include "util/u_memory.h"
 #include "pipe/p_inlines.h"
-#include "pipe/p_winsys.h"
+#include "pipe/internal/p_winsys_screen.h"
 #include "draw/draw_context.h"
 #include "tgsi/tgsi_parse.h"
 
@@ -183,21 +183,22 @@ cell_delete_vs_state(struct pipe_context *pipe, void *vs)
 static void
 cell_set_constant_buffer(struct pipe_context *pipe,
                          uint shader, uint index,
-                         const struct pipe_constant_buffer *buf)
+                         const struct pipe_buffer *buf)
 {
    struct cell_context *cell = cell_context(pipe);
-   struct pipe_winsys *ws = pipe->winsys;
 
    assert(shader < PIPE_SHADER_TYPES);
    assert(index == 0);
 
+   draw_flush(cell->draw);
+
    /* note: reference counting */
-   winsys_buffer_reference(ws,
-                        &cell->constants[shader].buffer,
-                        buf->buffer);
-   cell->constants[shader].size = buf->size;
+   pipe_buffer_reference(&cell->constants[shader], buf);
 
-   cell->dirty |= CELL_NEW_CONSTANTS;
+   if (shader == PIPE_SHADER_VERTEX)
+      cell->dirty |= CELL_NEW_VS_CONSTANTS;
+   else if (shader == PIPE_SHADER_FRAGMENT)
+      cell->dirty |= CELL_NEW_FS_CONSTANTS;
 }