#include "pipe/p_defines.h"
#include "pipe/p_format.h"
#include "util/u_memory.h"
-#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "draw/draw_context.h"
{NULL, 0}
};
+static unsigned int
+cell_is_texture_referenced( struct pipe_context *pipe,
+ struct pipe_texture *texture,
+ unsigned face, unsigned level)
+{
+ /**
+ * FIXME: Optimize.
+ */
+
+ return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
+}
+
+static unsigned int
+cell_is_buffer_referenced( struct pipe_context *pipe,
+ struct pipe_buffer *buf)
+{
+ /**
+ * FIXME: Optimize.
+ */
+
+ return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
+}
struct pipe_context *
cell_create_context(struct pipe_screen *screen,
- struct cell_winsys *cws)
+ void *priv )
{
struct cell_context *cell;
uint i;
memset(cell, 0, sizeof(*cell));
- cell->winsys = cws;
- cell->pipe.winsys = screen->winsys;
+ cell->winsys = NULL; /* XXX: fixme - get this from screen? */
+ cell->pipe.winsys = NULL;
cell->pipe.screen = screen;
+ cell->pipe.priv = priv;
cell->pipe.destroy = cell_destroy_context;
- cell->pipe.clear = cell_clear_surface;
+ cell->pipe.clear = cell_clear;
cell->pipe.flush = cell_flush;
+ cell->pipe.is_texture_referenced = cell_is_texture_referenced;
+ cell->pipe.is_buffer_referenced = cell_is_buffer_referenced;
+
#if 0
cell->pipe.begin_query = cell_begin_query;
cell->pipe.end_query = cell_end_query;
*/
/* This call only works with SDK 3.0. Anyone still using 2.1??? */
cell->num_cells = spe_cpu_info_get(SPE_COUNT_PHYSICAL_CPU_NODES, -1);
- cell->num_spus = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, 0);
+ cell->num_spus = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, -1);
if (cell->debug_flags) {
printf("Cell: found %d Cell(s) with %u SPUs\n",
cell->num_cells, cell->num_spus);