Ignore:
Timestamp:
Aug 3, 2015, 7:07:02 PM (9 years ago)
Author:
guerin
Message:

raycast: initial distributed implementation

The main task runs on processor (0,0,0). It manages game logic and
initialization, and participates in the rendering process.
The render task runs on all other processors. It tries to render a frame
slice when available, which is raycasting + pixel drawing for a pixel
column of the frame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/raycast/main.c

    r676 r683  
    44#include <malloc.h>
    55
     6static volatile unsigned int    init_sync = 0;
     7
    68// Exported functions
     9
     10__attribute__((constructor)) void render()
     11{
     12    // Wait for main initialization
     13    while (!init_sync);
     14
     15    Game *game = gameInstance();
     16
     17    // Render slices as soon as it's available
     18    while (1) {
     19        dispRenderSlice(game);
     20    }
     21}
    722
    823__attribute__((constructor)) void main()
    924{
    10         giet_tty_alloc(0);
    11         giet_tty_printf("[RAYCAST] entering main()\n");
     25    unsigned int w, h, p;
     26    unsigned int i, j;
    1227
    13         heap_init(0, 0);
    14         dispInit();
     28    giet_tty_alloc(0);
     29    giet_tty_printf("[RAYCAST] entering main()\n");
     30
     31    // Initialize heap for each cluster
     32    giet_procs_number(&w, &h, &p);
     33    for (i = 0; i < w; i++)
     34        for (j = 0; j < h; j++)
     35            heap_init(i, j);
     36
     37    // Initialize game
     38    dispInit();
     39
     40    init_sync = 1;
    1541
    1642    while (1) {
Note: See TracChangeset for help on using the changeset viewer.