cell_render.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void cell_flush_prim_buffer (struct cell_context *cell)
 Send the a RENDER command to all SPUs to have them render the prims in the current prim_buffer.
struct draw_stagecell_draw_render_stage (struct cell_context *cell)
 Create a new draw/render stage.


Function Documentation

struct draw_stage* cell_draw_render_stage ( struct cell_context cell  )  [read]

Create a new draw/render stage.

This will be plugged into the draw module as the last pipeline stage.

Definition at line 190 of file cell_render.c.

References CALLOC_STRUCT, render_stage::cell, draw_stage::destroy, cell_context::draw, draw_stage::draw, draw_stage::line, draw_stage::point, render_begin(), render_destroy(), render_end(), render_line(), render_point(), render_tri(), reset_stipple_counter(), draw_stage::reset_stipple_counter, render_stage::stage, and draw_stage::tri.

00191 {
00192    struct render_stage *render = CALLOC_STRUCT(render_stage);
00193 
00194    render->cell = cell;
00195    render->stage.draw = cell->draw;
00196    render->stage.begin = render_begin;
00197    render->stage.point = render_point;
00198    render->stage.line = render_line;
00199    render->stage.tri = render_tri;
00200    render->stage.end = render_end;
00201    render->stage.reset_stipple_counter = reset_stipple_counter;
00202    render->stage.destroy = render_destroy;
00203 
00204    /*
00205    render->quad.coef = render->coef;
00206    render->quad.posCoef = &render->posCoef;
00207    */
00208 
00209    return &render->stage;
00210 }

void cell_flush_prim_buffer ( struct cell_context cell  ) 

Send the a RENDER command to all SPUs to have them render the prims in the current prim_buffer.

Definition at line 144 of file cell_render.c.

References ASSERT_ALIGN16, CELL_CMD_RENDER, cell_flush(), cell_global, cell_global_info::command, cell_context::num_spus, cell_command_render::num_verts, cell_context::pipe, PIPE_PRIM_TRIANGLES, cell_command_render::prim_type, send_mbox_message(), vertex_info::size, cell_global_info::spe_contexts, cell_context::vertex_info, cell_command_render::vertex_size, cell_command_render::xmax, cell_command_render::xmin, cell_command_render::ymax, and cell_command_render::ymin.

00145 {
00146    uint i;
00147 
00148    if (cell->prim_buffer.num_verts == 0)
00149       return;
00150 
00151    for (i = 0; i < cell->num_spus; i++) {
00152       struct cell_command_render *render = &cell_global.command[i].render;
00153       render->prim_type = PIPE_PRIM_TRIANGLES;
00154       render->num_verts = cell->prim_buffer.num_verts;
00155       render->vertex_size = cell->vertex_info->size * 4;
00156       render->xmin = cell->prim_buffer.xmin;
00157       render->ymin = cell->prim_buffer.ymin;
00158       render->xmax = cell->prim_buffer.xmax;
00159       render->ymax = cell->prim_buffer.ymax;
00160       render->vertex_data = &cell->prim_buffer.vertex;
00161       ASSERT_ALIGN16(render->vertex_data);
00162       send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_RENDER);
00163    }
00164 
00165    cell->prim_buffer.num_verts = 0;
00166 
00167    cell->prim_buffer.xmin = 1e100;
00168    cell->prim_buffer.ymin = 1e100;
00169    cell->prim_buffer.xmax = -1e100;
00170    cell->prim_buffer.ymax = -1e100;
00171 
00172    /* XXX temporary, need to double-buffer the prim buffer until we get
00173     * a real command buffer/list system.
00174     */
00175    cell_flush(&cell->pipe, 0x0);
00176 }


Generated on Tue Sep 29 06:25:31 2009 for Gallium3D by  doxygen 1.5.4