[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14118] branches/soc-2007-joeedh/source/ blender: commit of working copy for transference to desktop
Joseph Eagar
joeedh at gmail.com
Sat Mar 15 17:45:49 CET 2008
Revision: 14118
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14118
Author: joeedh
Date: 2008-03-15 17:45:49 +0100 (Sat, 15 Mar 2008)
Log Message:
-----------
commit of working copy for transference to desktop
computer.
Modified Paths:
--------------
branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h
branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c
branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c
branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h 2008-03-15 16:29:49 UTC (rev 14117)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h 2008-03-15 16:45:49 UTC (rev 14118)
@@ -143,6 +143,7 @@
int tilesize; /*if flag->TCS_POOL_TSIZEFIXED is set*/
//unsigned int tottiles;
+ unsigned long totalsize; /*size of all data in the tile pool*/
unsigned long maxmem;
unsigned long memused; /*total amount of memory used at the moment.*/
unsigned long grace_period; /*margin, used to (hopefully) cache tiles in groups instead
@@ -188,7 +189,8 @@
memory counter.*/
#define TCS_AdjustTileMemSize(_tile, mem_to_add)\
((TCS_Tile*)(_tile))->mem_used += mem_to_add;\
- ((TCS_Tile*)(_tile))->pool->memused += mem_to_add;
+ ((TCS_Tile*)(_tile))->pool->memused += mem_to_add;\
+ ((TCS_Tile*)(_tile))->pool->totalsize += mem_to_add;
/*buffer type templates*/
extern TCS_TileBuffer TCS_DeepShadowBuffer;
@@ -286,5 +288,6 @@
/*a non-fatal warning assertion. it just prints into the console.*/
#define BASSERT(eval) if (!(eval)) printf("\nassert \"%s\" in file:\n%s\n on line %d failed.\n\n", #eval, __FILE__, __LINE__)
+#define BASSERT(eval)
#endif /* BKE_TILE_H */
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c 2008-03-15 16:29:49 UTC (rev 14117)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c 2008-03-15 16:45:49 UTC (rev 14118)
@@ -79,6 +79,8 @@
tile->pool = pool;
pool->memused += tile->mem_used + tile->struct_overhead;
+ pool->totalsize += tile->mem_used + tile->struct_overhead;
+
BLI_addhead(&pool->tiles, tile);
}
@@ -98,6 +100,8 @@
tile->pool->memused -= tile->mem_used;
}
+ tile->pool->totalsize -= tile->struct_overhead + tile->mem_used;
+
tile->pool->memused -= tile->struct_overhead;
/*add tile's file position to tile if in fixed tilesize mode.*/
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c 2008-03-15 16:29:49 UTC (rev 14117)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_dsm.c 2008-03-15 16:45:49 UTC (rev 14118)
@@ -295,7 +295,7 @@
TCS_AddToPool(pool, tile);
- printf("pool->memused: %fmb\n, maxmem: %fmb\n", (float)pool->memused/(1024*1024), (float)pool->maxmem/(1024*1024));
+ printf("pool->memused: %fmb\n, maxmem: %fmb, total cache size: %fmb\n", (float)pool->memused/(1024*1024), (float)pool->maxmem/(1024*1024), (float)pool->totalsize/(1024*1024));
TCS_RunCacher(pool);
}
Modified: branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c 2008-03-15 16:29:49 UTC (rev 14117)
+++ branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c 2008-03-15 16:45:49 UTC (rev 14118)
@@ -657,9 +657,12 @@
int i;
if (!file) return;
- fprintf(file, "numsamples-noncomp: %d\n", func->totsamples);
+ fwrite(&func->totsamples, sizeof(int), 1, file);
+ //fprintf(file, "numsamples-noncomp: %d\n", func->totsamples);
for (i=0; i<func->totsamples; i++) {
- fprintf(file, "sample: %d %f %d\n", func->samples[i].depth, func->samples[i].value, func->samples[i].orig_totsamples);
+ fwrite(&func->samples[i].depth, sizeof(int), 1, file);
+ fwrite(&func->samples[i].value, sizeof(float), 1, file);
+ //fprintf(file, "sample: %d %f %d\n", func->samples[i].depth, func->samples[i].value, func->samples[i].orig_totsamples);
}
fclose(file);
}
@@ -761,9 +764,12 @@
int i;
if (!file) return;
- fprintf(file, "numsamples: %d\n", func->totsamples);
+ fwrite(&func->totsamples, sizeof(int), 1, file);
+ //fprintf(file, "numsamples-noncomp: %d\n", func->totsamples);
for (i=0; i<func->totsamples; i++) {
- fprintf(file, "sample: %d %f %d\n", func->samples[i].depth, func->samples[i].value, func->samples[i].orig_totsamples);
+ fwrite(&func->samples[i].depth, sizeof(int), 1, file);
+ fwrite(&func->samples[i].value, sizeof(float), 1, file);
+ //fprintf(file, "sample: %d %f %d\n", func->samples[i].depth, func->samples[i].value, func->samples[i].orig_totsamples);
}
fclose(file);
}
@@ -902,7 +908,7 @@
zco = (re->winmat[3][2])/(re->winmat[2][2] - re->winmat[2][3]*zco);
zco = (zco - shb->clipsta) / (shb->clipend - shb->clipsta);
row2[totface].depth = ((float)0x7FFFFFFF)*zco;
- if (zco < -0.1 || zco > 1.001) printf("linear z: %f\n", zco);
+ //if (zco < -0.001 || zco > 1.001) printf("linear z: %f\n", zco);
} else row2[totface].depth = apn->z[a];
row2[totface].p = apn->p[a];
More information about the Bf-blender-cvs
mailing list