diff TaskManager/Test/test_render/spe/DrawSpan.cpp @ 371:f88744ee9350

change DrawSpan, #define USE_MEMLIST use MemList(LRU)
author aaa
date Wed, 29 Jul 2009 16:34:26 +0900
parents 953811245b63
children b4b8345b5366
line wrap: on
line diff
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp	Wed Jul 29 15:09:36 2009 +0900
+++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp	Wed Jul 29 16:34:26 2009 +0900
@@ -176,9 +176,15 @@
 {
     TilePtr tile;
 
+#ifdef USE_MEMLIST
+    tile = tileList->getLast();
+    tileList->remove(tile);
+#else
     tile = tileList->nextTile();
-    uint32 *old_addr = tile->texture_addr;
-    smanager->dma_load(tile->pixel, (uint32)addr,
+#endif
+
+    uint32 *old_addr = tile->address;
+    smanager->dma_load(tile->data, (uint32)addr,
                        sizeof(uint32)*TEXTURE_BLOCK_SIZE, tag);
     /**
      * FIFO なので、もし前のが残っていれば削除
@@ -186,9 +192,9 @@
 
     hash->remove(old_addr);
 
-    tile->texture_addr = addr;
+    tile->address = addr;
 
-    hash->put(tile->texture_addr, tile);
+    hash->put(tile->address, tile);
 
     return tile;
 }
@@ -197,7 +203,7 @@
 DrawSpan::get_rgb(int tx, int ty, TilePtr tile)
 {
   
-    return tile->pixel[(TEXTURE_SPLIT_PIXEL)*ty+tx];
+    return tile->data[(TEXTURE_SPLIT_PIXEL)*ty+tx];
 }
 
 /**
@@ -334,6 +340,11 @@
             smanager->dma_wait(wait_tag);
             //return startx;
         }
+#ifdef USE_MEMLIST
+	else {
+	    tileList->moveToFirst(tile);
+	} 
+#endif
 
         updateBuffer(zpos, rangex, localx, localy,
                      tex_localx, tex_localy, tile);	
@@ -424,7 +435,11 @@
                 tile = set_rgb(tex_addr, wait_tag);
                 smanager->dma_wait(wait_tag);
 	    }
-
+#ifdef USE_MEMLIST
+	    else {
+		tileList->moveToFirst(tile);
+	    } 
+#endif
 
             updateBuffer(tex_z, rangex, localx, localy,
 			 tex_localx, tex_localy, tile);