Mercurial > hg > Members > e085722 > Cerium
comparison Renderer/Engine/Tapestry.h @ 0:04e28d8d3c6f
first commit
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 01:23:25 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:04e28d8d3c6f |
---|---|
1 #ifndef INCLUDED_TAPESTRY | |
2 #define INCLUDED_TAPESTRY | |
3 | |
4 #include "types.h" | |
5 #include "viewer_types.h" | |
6 #include "MemorySegment.h" | |
7 #include "MemList.h" | |
8 | |
9 /** | |
10 * image file name と tapestry DB の binary tree | |
11 * | |
12 * // PPE | |
13 * main memory の tapestry DB (Array) | |
14 * tapestry DB への accessor | |
15 * | |
16 * TapestryPtr getTapestry(int TapestryID); | |
17 * TilePtr getTile(TapestryPtr tapsetry, int tx, int ty, int scale); | |
18 * | |
19 * SPE が生成する tapestry List (in CreateSpan) | |
20 * (no texture image) | |
21 * @in TapestryDBPtr, Tapestry ID, x, y, tx, ty, px, py | |
22 * x, y : polygon の中の平面座標 | |
23 * tx, ty : texture の座標 | |
24 * px, py : texture の分割数 | |
25 * | |
26 * @out (TilePtr, tix1, tiy1, tix2, tiy2)* | |
27 * | |
28 * | |
29 * SPE に渡す tapestry List | |
30 * @in Tile | |
31 * | |
32 * // SPE | |
33 * SPE 内部での tapestry DB (Hash) | |
34 * TapestryID, scale, TilePtr, Tile | |
35 * | |
36 * | |
37 * SPE 内部での tapestry DB への accessor | |
38 * TileEntryPtr getTile(int TapestryID, int tx, int ty, int scale); | |
39 * | |
40 * if (TileEntry == NULL) { | |
41 * DMA read | |
42 * } | |
43 * | |
44 * | |
45 * Rendering | |
46 * 1pass Zbuffer と Texture の有無の判定 | |
47 * if (zbuffer ok) { | |
48 * if (texture ある) { | |
49 * zbuffer 、linebunf に書き込む | |
50 * } else { | |
51 * texture の load list に加える | |
52 * zbuffer だけ更新しておく | |
53 * } | |
54 * } else { | |
55 * 無視 | |
56 * } | |
57 * | |
58 * 1pass で texture が一杯になったら、中断して | |
59 * ここまでのを書き込んどけ | |
60 * | |
61 * | |
62 * 2pass rgb の書き込み | |
63 * | |
64 * if (zbuffer の値が自分と一緒) { | |
65 * read した texture みて | |
66 * 書き込め! | |
67 * } | |
68 * | |
69 */ | |
70 struct texture_block { | |
71 | |
72 }; | |
73 | |
74 typedef MemorySegment Tile, *TilePtr; | |
75 | |
76 #define MAX_TILE 128 | |
77 | |
78 /** | |
79 * TileList 中の Tile の追い出しは、現在 FIFO で実装している | |
80 * これは汎用のサイズ別 freelist に置き換える | |
81 * freelist は double linked list で、LRU をサポートする | |
82 */ | |
83 class TileList : public MemList { | |
84 TileList(MemorySegment* ms) : MemList(ms) {} | |
85 | |
86 /*! | |
87 中身は同じ | |
88 */ | |
89 }; | |
90 | |
91 typedef TileList* TileListPtr; | |
92 | |
93 #endif |