Cell: updates to match pipe_buffer changes
authorBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 00:34:22 +0000 (17:34 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 00:34:22 +0000 (17:34 -0700)
src/mesa/pipe/cell/ppu/cell_draw_arrays.c
src/mesa/pipe/cell/ppu/cell_state_fs.c
src/mesa/pipe/cell/ppu/cell_texture.c

index 9c41b4a523c13033c41834f61add143f34f6801f..717cd8370f98a13f11a09dc1704ee59cc6c413a0 100644 (file)
@@ -51,7 +51,7 @@ cell_map_constant_buffers(struct cell_context *sp)
    for (i = 0; i < 2; i++) {
       if (sp->constants[i].size)
          sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
-                                                  PIPE_BUFFER_FLAG_READ);
+                                                  PIPE_BUFFER_USAGE_CPU_READ);
    }
 
    draw_set_mapped_constant_buffer(sp->draw,
@@ -123,7 +123,7 @@ cell_draw_elements(struct pipe_context *pipe,
       if (sp->vertex_buffer[i].buffer) {
          void *buf = pipe->winsys->buffer_map(pipe->winsys,
                                               sp->vertex_buffer[i].buffer,
-                                              PIPE_BUFFER_FLAG_READ);
+                                              PIPE_BUFFER_USAGE_CPU_READ);
          draw_set_mapped_vertex_buffer(draw, i, buf);
       }
    }
@@ -131,7 +131,7 @@ cell_draw_elements(struct pipe_context *pipe,
    if (indexBuffer) {
       void *mapped_indexes = pipe->winsys->buffer_map(pipe->winsys,
                                                       indexBuffer,
-                                                      PIPE_BUFFER_FLAG_READ);
+                                                      PIPE_BUFFER_USAGE_CPU_READ);
       draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
    }
    else {
index 5a935f2de186379b476a6690af42e6613b08103d..81c2ac14ddc330966138fc0f1a1f291171960851 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "pipe/p_defines.h"
 #include "pipe/p_util.h"
+#include "pipe/p_inlines.h"
 #include "pipe/p_winsys.h"
 #include "pipe/draw/draw_context.h"
 #if 0
@@ -163,7 +164,7 @@ cell_set_constant_buffer(struct pipe_context *pipe,
    assert(index == 0);
 
    /* note: reference counting */
-   ws->buffer_reference(ws,
+   pipe_buffer_reference(ws,
                         &cell->constants[shader].buffer,
                         buf->buffer);
    cell->constants[shader].size = buf->size;
index 8f342d8aadc7a5d1a4c014d5c32a0b5ad3b787e8..0a8190d983ce2aa60a6e2e9205bb5baab1499661 100644 (file)
@@ -91,12 +91,9 @@ cell_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
 
       cell_texture_layout(spt);
 
-      spt->buffer = pipe->winsys->buffer_create(pipe->winsys, 32, 0, 0);
-
-      if (spt->buffer) {
-        pipe->winsys->buffer_data(pipe->winsys, spt->buffer, spt->buffer_size,
-                                  NULL, PIPE_BUFFER_USAGE_PIXEL);
-      }
+      spt->buffer = pipe->winsys->buffer_create(pipe->winsys, 32,
+                                                PIPE_BUFFER_USAGE_PIXEL,
+                                                spt->buffer_size);
 
       if (!spt->buffer) {
         FREE(spt);
@@ -124,7 +121,7 @@ cell_texture_release(struct pipe_context *pipe, struct pipe_texture **pt)
       DBG("%s deleting %p\n", __FUNCTION__, (void *) spt);
       */
 
-      pipe->winsys->buffer_reference(pipe->winsys, &spt->buffer, NULL);
+      pipe_buffer_reference(pipe->winsys, &spt->buffer, NULL);
 
       FREE(spt);
    }
@@ -147,7 +144,7 @@ cell_get_tex_surface(struct pipe_context *pipe,
    if (ps) {
       assert(ps->refcount);
       assert(ps->winsys);
-      pipe->winsys->buffer_reference(pipe->winsys, &ps->buffer, spt->buffer);
+      pipe_buffer_reference(pipe->winsys, &ps->buffer, spt->buffer);
       ps->format = pt->format;
       ps->cpp = pt->cpp;
       ps->width = pt->width[level];