annotate Renderer/Engine/Tapestry.h @ 1687:81bb9b2f35ca draft

change filename
author Shohei KOKUBO
date Tue, 13 Aug 2013 01:57:13 +0900
parents d8b5648668bb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_TAPESTRY
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_TAPESTRY
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "types.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
5 #include "viewer_types.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
6 #include "MemorySegment.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
7 #include "MemList.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
8
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
9 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
10 * image file name と tapestry DB の binary tree
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
11 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
12 * // PPE
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
13 * main memory の tapestry DB (Array)
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
14 * tapestry DB への accessor
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
15 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16 * TapestryPtr getTapestry(int TapestryID);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17 * TilePtr getTile(TapestryPtr tapsetry, int tx, int ty, int scale);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 * SPE が生成する tapestry List (in CreateSpan)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 * (no texture image)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
21 * @in TapestryDBPtr, Tapestry ID, x, y, tx, ty, px, py
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
22 * x, y : polygon の中の平面座標
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23 * tx, ty : texture の座標
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
24 * px, py : texture の分割数
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
25 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 * @out (TilePtr, tix1, tiy1, tix2, tiy2)*
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
27 *
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
28 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
29 * SPE に渡す tapestry List
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
30 * @in Tile
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 * // SPE
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 * SPE 内部での tapestry DB (Hash)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 * TapestryID, scale, TilePtr, Tile
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 * SPE 内部での tapestry DB への accessor
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 * TileEntryPtr getTile(int TapestryID, int tx, int ty, int scale);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40 * if (TileEntry == NULL) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 * DMA read
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42 * }
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
43 *
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
44 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
45 * Rendering
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
46 * 1pass Zbuffer と Texture の有無の判定
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
47 * if (zbuffer ok) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48 * if (texture ある) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 * zbuffer 、linebunf に書き込む
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50 * } else {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51 * texture の load list に加える
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
52 * zbuffer だけ更新しておく
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
53 * }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
54 * } else {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
55 * 無視
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
56 * }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
57 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 * 1pass で texture が一杯になったら、中断して
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59 * ここまでのを書き込んどけ
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
61 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
62 * 2pass rgb の書き込み
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
63 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
64 * if (zbuffer の値が自分と一緒) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
65 * read した texture みて
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
66 * 書き込め!
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
67 * }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
68 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
69 */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
70 struct texture_block {
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
71
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
72 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
73
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
74 typedef MemorySegment Tile, *TilePtr;
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
75
1167
d8b5648668bb max_tile 64
yutaka@charles
parents: 1162
diff changeset
76 #define MAX_TILE 64
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
77
1162
8917aff8629c global allocate
Yutaka_Kinjyo
parents: 1161
diff changeset
78
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
79 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
80 * TileList 中の Tile の追い出しは、現在 FIFO で実装している
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
81 * これは汎用のサイズ別 freelist に置き換える
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
82 * freelist は double linked list で、LRU をサポートする
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
83 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
84 class TileList : public MemList {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
85 TileList(MemorySegment* ms) : MemList(ms) {}
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
86
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
87 /*!
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
88 中身は同じ
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
89 */
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
90 };
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
91
1161
cc1a50cac83d use MemorySegment API for pp load. do not check execution of the cell side. to be continued..
Yutaka_Kinjyo
parents: 606
diff changeset
92
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
93 typedef TileList* TileListPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
94
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
95 #endif