Mercurial > hg > Papers > 2009 > tkaito-thesis
view presen/pre1.html @ 25:9aad41bc4213
final!!?
author | tkaito@nw0534.st.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 26 Feb 2009 14:56:20 +0900 |
parents | e9c273fcc019 |
children |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>2009年度卒業論文</title> <!-- metadata --> <meta name="generator" content="S5" /> <meta name="version" content="S5 1.1" /> <meta name="presdate" content="20050728" /> <meta name="author" content="Tagano Kaito" /> <meta name="company" content="ie-ryukyu" /> <!-- configuration parameters --> <meta name="defaultView" content="slideshow" /> <meta name="controlVis" content="hidden" /> <!-- style sheet links --> <link rel="stylesheet" href="ui/default/slides.css" type="text/css" media="projection" id="slideProj" /> <link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" /> <link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" /> <link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" /> <!-- S5 JS --> <script src="ui/default/slides.js" type="text/javascript"></script> <style type="text/css"> body { font-size: 100%; } p.ex8 { font-size: 2.0em; } p.ex7 { font-size: 1.9em; } p.ex6 { font-size: 1.8em; } p.ex5 { font-size: 1.7em; } p.ex4 { font-size: 1.6em; } p.ex3 { font-size: 1.5em; } p.ex2 { font-size: 1.4em; } p.ex1 { font-size: 1.3em; } p.ex0 { font-size: 1.0em; } p.ep0 { font-size: 0.5em; } span.classifier { font-family: sans-serif ; font-style: oblique } span.classifier-delimiter { font-family: sans-serif ; font-weight: bold } span.interpreted { font-family: sans-serif } span.option { white-space: nowrap } span.pre { white-space: pre } span.problematic { color: red } span.section-subtitle { /* font-size relative to parent (h1..h6 element) */ font-size: 80% } </style> </head> <body> <div class="layout"> <div id="controls"><!-- DO NOT EDIT --></div> <div id="currentSlide"><!-- DO NOT EDIT --></div> <div id="header"></div> <div id="footer"> <h1>1-322 / 20090226</h1> <h2>卒業論文</h2> </div> </div> <div class="presentation"> <div class="slide"> <center> <br><br> <p class="ex8">並列プログラミングを用いた<br>ゲームフレームワークの設計と実装</p> <p><font size="5" color="#000000">琉球大学 工学部情報 工学科 055734A</font></p> <p><font size="5" color="#000000">多賀野海人</font</p> <p><font size="5" color="#000000">指導教官:河野真治</font</p> <p><font size="5" color="#000000">Feb, 26, 2009</font></p> </center> </div> <div class="slide"> <h1>研究背景と目的</h1> <center> <p class="ex4"><font color="#000000">完成度の高いゲームを作成したい!</font></p> </center> <ul> <li><font size="5" color="#000000"> 現在、我々の研究室の学生実験では、PlayStation 3 上で ゲームプログラミング行っている。 </font></li> <br> <font size="6" color="#000000"> <ul> <li>Cell の GPU が公開されていない</li> <br> <li>Softwere Rendering で描画を行っているのでゲームの実行速度が遅い</li> </ul> </font> <br> <font size = "6"> 本研究では、Cerium における <font color="blue">Rendering 部分の高速化</font>を目的としている。 </font> </div> <div class="slide"> <h1>発表の流れ</h1> <ul> <font size="7" color="#000000"> <li>Cell の基本機能</li> <li>Rendering</li> <li>Rendering 部分の高速化</li> <li>今後の課題</li> </font> </ul> </div> <div class="slide"> <h1>Cell の基本機能</h1> <ul> <li><p class="ex4">DMA (Direct Memory Access)</p></li> DMA とは CPU を介さずにデータ転送を行う機能。 <ul> <font size="5"> <br> <li>SPE は LS(256KB) にしかアクセスできない。</li> <br> <li>メインメモリにアクセスするには、<br>MFC を通して DMA 転送命令を送る</li> <br> <li>LS にデータが転送されているあいだ、<br>SPE のプログラムは停止させたくない</li> <br> <li>SPE で処理したデータは MFC を介してメインメモリへ転送される</li> </ul> </font> </ul> <div class="slide"> <h1>Cell の基本機能 (Con't)</h1> <ul> <li>DMA 転送には待ち時間が存在する。</li> <li>待ち時間の間 SPE 有効に使わなければ、マルチコアプロセッサのパフォーマンスが極端に下がる。</li> <ol> <font size="4"> <li>Task のデータを読み込む (1)</li> <li>読み込んだデータの処理 (2) を行っている間に次の Task のデータを読み込む</li> <li>処理したデータの転送 (3) の間に、2 で読み込んだデータの処理、次の Task のデータの読み込みを行う</li> </font> </ol> <center> <img src="photo/pipeline.jpg" alt="pipeline" width="400" height="180"> </center> </ul> </div> <div class="slide"> <h1>Rendering</h1> <ul> <li>Cerium 内の Rendering </li> <br> <center> <img src="photo/byouga.jpg" alt="pipeline" width="550" height="350"> </center> </ul> </div> <div class="slide"> <h1>Rendering 部分の高速化</h1> <ul> <li>SPE の LS は256KB しかないので、Texture 情報を一度に転送すると容量を超えてしまう可能性がある。</li> <li>そこで、描画に必要な Texture データを分割、転送するという手法を用いる。</li> <br> <center> <img src="photo/cerium_rendering_tile.jpg" alt="pipeline" width="382" height="288"> </center> </ul> </div> <div class="slide"> <h1>Rendering 部分の高速化 (Con't)</h1> <ul> <li>Tile Array を用いた Rendering</li> <ul> <li>Polygon の Span から、描画に必要な Texture A を含む Tile を計算する</li> <br> <li>Tile を SPE に転送し、Tile の中の pixel 情報 (RGBα値) を取得して描画を行う</li> </ul> <center> <img src="photo/Span-tile.jpg" alt="pipeline" width="500" height="265"> </center> </ul> </div> <div class="slide"> <h1>Scale</h1> <ul> <li><p class="ex1">Texture の縮小画像の作成</p></li> <ul> <li><p class="ex0">描画されるオブジェクトが小さい場合、そのままの大きさの Texture は必要ない</p></li> <li><p class="ex0">Span の長さと、縮小 Texture の大きさが一致するような Scale の縮小 Texture を選択する</p></li> <li><p class="ex0">Texture は縦横ともに 1/2、1/4、1/8 と、2分の1ずつ縮小させる (最小 8x8 pixel)</p></li> </ul> </ul> <center> <img src="photo/Scale.jpg" alt="pipeline" width="352" height="176"> </center> </div> <div class="slide"> <h1>Scale の効果検証</h1> <ul> <li>10個のオブジェクトを用いたサンプル</li> <ul> <li>Polygon 総数 は 19860 </li> <li>Texture は合計 10 枚 <br> ( 8x8(3)、512x384(2)、616x123(4)、1024x768(1) )</li> </ul> <center> <img src="photo/wakusei.jpg" alt="pipeline" width="428" height="321"> </center> </ul> </div> <div class="slide"> <h1>実行結果(速度検証)</h1> <br> <ul> <center> <table border="4"> <tr> <th>Architecture</th> <th>Scale なし (FPS)</th> <th>Scale あり (FPS)</th> <th>速度の向上(%)</th> </tr> <tr> <th>Mac OSX</th> <td align="center">7.0</td> <td align="center">8.5</td> <td align="center">21</td> </tr> <tr> <th>PS3Linux (SPE 1)</th> <td align="center">4.3</td> <td align="center">5.6</td> <td align="center">30</td> </tr> <tr> <th>PS3Linux (SPE 6)</th> <td align="center">10.8</td> <td align="center">13.5</td> <td align="center">25</td> </tr> <caption>Scale を用いることによる実行速度の比較</caption> </table> </center> <li><p class="ex0">実行速度の比較を行った結果、<font color="#DD0000">20 ~ 30%</font> の速度向上が見られる。</li> <li>Mac OSX は SDL 経由で出力、PlayStation 3 は Frame Buffer へ直接出力している。</li> </ul> </div> <div class="slide"> <h1>実行結果 (考察)</h1> <ul> <li><p class="ex1">SPE 1 個のときの速度と SPE 6 個のとき<br><br>の速度で<u>台数効果</u>が出ていない<p></li> <li><p class="ex1">考えられる原因</p></li> <ul> <li><p class="ex1">DMA 転送待ち時間が隠されていないため遅くなっている (Amdahl則)</p></li> </ul> <br> <li>Amdahl則:例えば SPE を 6 個使えたとしても、すべ<br> ての SPE に常に処理を行わせている状態を保たなけれ<br> ば、実行速度は著しく低下する。 </li> </ul> </div> <div class="slide"> <h1>今後の課題</h1> <ul> <li><p class="ex1">実装済み</p></li> <ul> <li><p class="ex0">Polygon から Span の生成</p></li> <li><p class="ex0">描画の処理</p></li> </ul> <li><p class="ex1">実装予定</p></li> <ul> <li><p class="ex0">SceneGraph から Polygon 生成</p></li> <li><p class="ex0">SPE 上のコードの入れ替え</p></li> </ul> <li>評価をする際に、FPS だけではなく、特定の命令数、命令実行時間などの もっと細かいレベルのデータを用いて検証。</li> </ul> </div> <!-- <div class="slide"> <h1>Textureの分割、Scale</h1> <ul> <li><font size="5" color="#000000">Textureの分割、Scale処理に用いるデータ構造</font></li> <font size="4"> <pre> uint32 *tex_dest = (uint32*)manager->malloc(tile_size); // 1 / 2 for (int y = 0; y < tex_height; y += TEXTURE_SPLIT_PIXEL*2) { for (int x = 0; x < tex_width; x += TEXTURE_SPLIT_PIXEL*2) { for (int j = 0; j < TEXTURE_SPLIT_PIXEL*2; j+=2) { for (int i = 0; i < TEXTURE_SPLIT_PIXEL*2; i+=2) { tex_dest[t++] = tex_src[(x+i) + tex_width*(y+j)]; } } } } </pre> </font> </ul> <div class="handout"> [any material that should appear in print but not on the slide] </div> </div> --> <!-- <div class="slide"> <h1>ハッシュテーブル</h1> <ul> <pre><font size="4" color="#000000"> // ハッシュテーブル struct hashtable{ int tx_id; // Texture id char* key; // キー }; </font></pre> <pre><font size="4" color="#000000"> // ハッシュ関数 for(int i = 0; key[i]; i++){ //value += key[i] + 1; value += key[i]*(i+1)*17 + 1; } return fmod(value, N); } </font></pre> </ul> <div class="handout"> [any material that should appear in print but not on the slide] </div> </div> <div class="slide"> <h1>ハッシュテーブル</h1> <pre><font size="3" color="#000000"> // 登録、検索 int hash::hash_regist(const char* key){ int hash = hash_function(key); for(int i = 0; ; i++){ // 値が空のとき if(table[hash].tx_id == -1){ table[hash].key = (char*)key; table[hash].tx_id = id_count; id_count++; printf("x : hash = %d, id = %d : %s\n" , hash, table[hash].tx_id, table[hash].key); return table[hash].tx_id; </font></pre> <div class="handout"> [any material that should appear in print but not on the slide] </div> </div> <div class="slide"> <h1>ハッシュテーブル</h1> <pre><font size="3" color="#000000"> // 検索keyが一致したとき }else if(strcmp(key, table[hash].key) == 0 && table[hash].tx_id != -1){ printf("o : hash = %d, id = %d : %s\n" , hash, table[hash].tx_id, table[hash].key); return table[hash].tx_id; } printf("hash = %d => ", hash); hash = ((37*hash)^(11*i)) % N; printf("%d\n", hash); } } </font></pre> <div class="handout"> [any material that should appear in print but not on the slide] </div> </div> --> <!-- <div class="slide"> <h1></h1> <ul> <li></li> </ul> <div class="handout"> [any material that should appear in print but not on the slide] </div> </div> --> </div> </body> </html>