Go to the source code of this file.
Functions | |
static void | cell_destroy_context (struct pipe_context *pipe) |
Authors Brian Paul. | |
static struct draw_context * | cell_draw_create (struct cell_context *cell) |
struct pipe_context * | cell_create_context (struct pipe_screen *screen, struct cell_winsys *cws) |
struct pipe_context* cell_create_context | ( | struct pipe_screen * | screen, | |
struct cell_winsys * | cws | |||
) | [read] |
Definition at line 98 of file cell_context.c.
References align_malloc(), pipe_context::begin_query, cell_clear_surface(), cell_destroy_context(), cell_draw_create(), cell_flush(), cell_init_batch_buffers(), cell_init_draw_functions(), cell_init_shader_functions(), cell_init_state_functions(), cell_init_surface_functions(), cell_init_texture_functions(), cell_init_vbuf(), cell_init_vertex_functions(), cell_start_spus(), pipe_context::clear, cell_context::debug_flags, debug_get_flags_option(), pipe_context::destroy, cell_context::draw, draw_set_rasterize_stage(), draw_wide_line_threshold(), draw_wide_point_threshold(), pipe_context::end_query, pipe_context::flush, cell_context::num_spus, cell_context::pipe, pipe_context::screen, cell_context::vbuf, pipe_screen::winsys, pipe_context::winsys, and cell_context::winsys.
00100 { 00101 struct cell_context *cell; 00102 00103 /* some fields need to be 16-byte aligned, so align the whole object */ 00104 cell = (struct cell_context*) align_malloc(sizeof(struct cell_context), 16); 00105 if (!cell) 00106 return NULL; 00107 00108 memset(cell, 0, sizeof(*cell)); 00109 00110 cell->winsys = cws; 00111 cell->pipe.winsys = screen->winsys; 00112 cell->pipe.screen = screen; 00113 cell->pipe.destroy = cell_destroy_context; 00114 00115 cell->pipe.clear = cell_clear_surface; 00116 cell->pipe.flush = cell_flush; 00117 00118 #if 0 00119 cell->pipe.begin_query = cell_begin_query; 00120 cell->pipe.end_query = cell_end_query; 00121 cell->pipe.wait_query = cell_wait_query; 00122 #endif 00123 00124 cell_init_draw_functions(cell); 00125 cell_init_state_functions(cell); 00126 cell_init_shader_functions(cell); 00127 cell_init_surface_functions(cell); 00128 cell_init_texture_functions(cell); 00129 cell_init_vertex_functions(cell); 00130 00131 cell->draw = cell_draw_create(cell); 00132 00133 cell_init_vbuf(cell); 00134 00135 draw_set_rasterize_stage(cell->draw, cell->vbuf); 00136 00137 /* convert all points/lines to tris for the time being */ 00138 draw_wide_point_threshold(cell->draw, 0.0); 00139 draw_wide_line_threshold(cell->draw, 0.0); 00140 00141 /* get env vars or read config file to get debug flags */ 00142 cell->debug_flags = debug_get_flags_option("CELL_DEBUG", 00143 cell_debug_flags, 00144 0 ); 00145 00146 /* 00147 * SPU stuff 00148 */ 00149 cell->num_spus = 6; 00150 /* XXX is this in SDK 3.0 only? 00151 cell->num_spus = spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1); 00152 */ 00153 00154 cell_start_spus(cell); 00155 00156 cell_init_batch_buffers(cell); 00157 00158 return &cell->pipe; 00159 }
static void cell_destroy_context | ( | struct pipe_context * | pipe | ) | [static] |
Authors Brian Paul.
Definition at line 61 of file cell_context.c.
References align_free(), cell_context(), and cell_spu_exit().
00062 { 00063 struct cell_context *cell = cell_context(pipe); 00064 00065 cell_spu_exit(cell); 00066 00067 align_free(cell); 00068 }
static struct draw_context* cell_draw_create | ( | struct cell_context * | cell | ) | [static, read] |
Definition at line 72 of file cell_context.c.
References cell_vertex_shader_queue_flush(), draw, draw_create(), and draw_context::driver_private.
00073 { 00074 struct draw_context *draw = draw_create(); 00075 00076 #if 0 /* broken */ 00077 if (getenv("GALLIUM_CELL_VS")) { 00078 /* plug in SPU-based vertex transformation code */ 00079 draw->shader_queue_flush = cell_vertex_shader_queue_flush; 00080 draw->driver_private = cell; 00081 } 00082 #endif 00083 00084 return draw; 00085 }