Mercurial > hg > Game > Cerium
changeset 1154:1ede991d6da3 draft
fix
author | yutaka@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 20 Apr 2011 16:20:33 +0900 |
parents | df293d433633 |
children | a98d601e45f6 |
files | Renderer/Engine/Makefile.def Renderer/Engine/spe/DrawSpan.cc Renderer/Engine/viewer.cc TaskManager/Makefile.def TaskManager/kernel/memory/MemHash.h TaskManager/kernel/schedule/Scheduler.cc TaskManager/kernel/schedule/Scheduler.h |
diffstat | 7 files changed, 20 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def Fri Mar 11 02:24:01 2011 +0900 +++ b/Renderer/Engine/Makefile.def Wed Apr 20 16:20:33 2011 +0900 @@ -5,7 +5,7 @@ ABIBIT = 64 ABI = -m$(ABIBIT) CC = g++ -OPT = -O9 -g #-DUSE_TASKARRAY #-DUSE_PIPELINE # +OPT = -O9 -DUSE_TASKARRAY -DUSE_PIPELINE # -g # CFLAGS = -Wall $(ABI) $(OPT) # -DDEBUG
--- a/Renderer/Engine/spe/DrawSpan.cc Fri Mar 11 02:24:01 2011 +0900 +++ b/Renderer/Engine/spe/DrawSpan.cc Wed Apr 20 16:20:33 2011 +0900 @@ -403,6 +403,7 @@ span->tex_width, (memaddr)span->tex_addr); tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; + TilePtr tile = smanager->get_segment(tex_addr,g->tileList); smanager->wait_segment(tile);
--- a/Renderer/Engine/viewer.cc Fri Mar 11 02:24:01 2011 +0900 +++ b/Renderer/Engine/viewer.cc Wed Apr 20 16:20:33 2011 +0900 @@ -657,7 +657,7 @@ HTaskPtr task_draw; while (startx < this->width) { - if (spack->info.size > 0) { + if (spack->info.size > 0 || mem_flag == 1) { // Draw SpanPack task_draw = manager->create_task(DrawSpan);
--- a/TaskManager/Makefile.def Fri Mar 11 02:24:01 2011 +0900 +++ b/TaskManager/Makefile.def Wed Apr 20 16:20:33 2011 +0900 @@ -29,7 +29,7 @@ ABIBIT = 64 -OPT = -O9 #-DUSE_CACHE #-DTASK_LIST_MAIL #-DEARLY_TOUCH #-DMAIL_QUEUE +OPT = -O9 -DUSE_CACHE -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH # # -g -DTASK_LIST_MAIL -O9
--- a/TaskManager/kernel/memory/MemHash.h Fri Mar 11 02:24:01 2011 +0900 +++ b/TaskManager/kernel/memory/MemHash.h Wed Apr 20 16:20:33 2011 +0900 @@ -21,6 +21,7 @@ typedef MemHash* MemHashPtr; const int hashSize = 263; +//const int hashSize = 1; const int tableSize = sizeof(MemorySegmentPtr)*hashSize;
--- a/TaskManager/kernel/schedule/Scheduler.cc Fri Mar 11 02:24:01 2011 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Wed Apr 20 16:20:33 2011 +0900 @@ -401,31 +401,40 @@ MemorySegment * Scheduler::get_segment(memaddr addr, MemList *m) { + +#ifdef USE_CACHE + MemorySegment *s = m->getFirst(); return get_segment(addr, m, s->size); + +#else + + MemorySegment *s = m->getFirst(); + s->tag = get_tag(); + dma_load(s->data, addr, s->size, s->tag); + + return s; + +#endif + } MemorySegment * Scheduler::get_segment(memaddr addr, MemList *m, int size) { - hash_get_count += 1; // memory segment のsizeをoverride する場合がある MemorySegment *s = hash->get(addr); - -#ifdef USE_CACHE if (s) { - hash_hit_count += 1; - /* 既に load されている */ // this->printf("get_segement loaded %llx 0x%x size 0x%d\n",addr,s->data,size); m->moveToFirst(s); return s; } -#endif + /* LRU なので、もっとも使われてない segment を上書きする */ s = m->getLast(); @@ -514,24 +523,6 @@ #endif } -void -Scheduler::show_hash_hit_ratio() -{ - - double ratio = 0; - - if (hash_get_count != 0) { - ratio = ((double)hash_hit_count / (double)hash_get_count)*100; - } - - this->printf("hash_hit_ratio = %.3g%% \n",ratio); - - hash_hit_count = 0; - hash_get_count = 0; - -} - - int Scheduler::vprintf0(const char * format, va_list ap) {
--- a/TaskManager/kernel/schedule/Scheduler.h Fri Mar 11 02:24:01 2011 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Wed Apr 20 16:20:33 2011 +0900 @@ -50,8 +50,6 @@ class Scheduler { private: TaskManagerImpl* manager_tmp; - int hash_get_count; - int hash_hit_count; public: virtual ~Scheduler();