diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-08 02:12:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-08 02:12:19 +0400 |
commit | a8a2782d34fd09a35598c2653a8225942c4c2ca0 (patch) | |
tree | 4715ccd75214e81662e2cfa684aaad610c8d25e5 /source/blender/render | |
parent | dd633f1affc8951a0a6ba19cdffbb58ac7f54acd (diff) | |
parent | b51908b913f318986a91c766980ed01010c5249a (diff) |
Merged changes in the trunk up to revision 51985.
Diffstat (limited to 'source/blender/render')
10 files changed, 29 insertions, 30 deletions
diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index 20024eab633..1331c287d7c 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -115,6 +115,7 @@ void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result, int int RE_engine_test_break(RenderEngine *engine); void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info); void RE_engine_update_progress(RenderEngine *engine, float progress); +void RE_engine_update_memory_stats(RenderEngine *engine, float mem_used, float mem_peak); void RE_engine_report(RenderEngine *engine, int type, const char *msg); int RE_engine_render(struct Render *re, int do_all); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 9525d1dd8f1..f5c77d49c21 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -148,6 +148,7 @@ typedef struct RenderStats { double starttime, lastframetime; const char *infostr, *statstr; char scene_name[MAX_ID_NAME - 2]; + float mem_used, mem_peak; } RenderStats; /* *********************** API ******************** */ diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 5e4417a3bc6..7f785eb3d8b 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -145,8 +145,6 @@ struct Render /* final picture width and height (within disprect) */ int rectx, recty; - /* real maximum amount of xparts/yparts after correction for minimum */ - int xparts, yparts; /* real maximum size of parts after correction for minimum * partx*xparts can be larger than rectx, in that case last part is smaller */ int partx, party; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 6d092f75663..bb7c1bdf94b 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4356,7 +4356,7 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset) /* compute average bounding box of strandpoint itself (width) */ if (obr->strandbuf->flag & R_STRAND_B_UNITS) - obr->strandbuf->maxwidth= MAX2(obr->strandbuf->ma->strand_sta, obr->strandbuf->ma->strand_end); + obr->strandbuf->maxwidth = max_ff(obr->strandbuf->ma->strand_sta, obr->strandbuf->ma->strand_end); else obr->strandbuf->maxwidth= 0.0f; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 558ba8fe062..28f70211a9c 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -148,7 +148,8 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR); envre->r.layers.first = envre->r.layers.last = NULL; envre->r.filtertype = 0; - envre->r.xparts = envre->r.yparts = 2; + envre->r.tilex = envre->r.xsch / 2; + envre->r.tiley = envre->r.ysch / 2; envre->r.size = 100; envre->r.yasp = envre->r.xasp = 1; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 076cad05c84..e2f347c05f1 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -290,13 +290,23 @@ void RE_engine_update_progress(RenderEngine *engine, float progress) } } +void RE_engine_update_memory_stats(RenderEngine *engine, float mem_used, float mem_peak) +{ + Render *re = engine->re; + + if (re) { + re->i.mem_used = mem_used; + re->i.mem_peak = mem_peak; + } +} + void RE_engine_report(RenderEngine *engine, int type, const char *msg) { Render *re = engine->re; if (re) BKE_report(engine->re->reports, type, msg); - else if(engine->reports) + else if (engine->reports) BKE_report(engine->reports, type, msg); } diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 2b564a09024..b2cf8db7995 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -555,31 +555,17 @@ void initparts(Render *re, int do_crop) xmaxb = re->disprect.xmax; ymaxb = re->disprect.ymax; - xparts = re->r.xparts; - yparts = re->r.yparts; - - /* minimum part size */ - if (re->r.mode & R_PANORAMA) { - if (ceil(re->rectx / (float)xparts) < 8) - xparts = 1 + re->rectx / 8; - } - else { - if (ceil(re->rectx / (float)xparts) < 64) - xparts = 1 + re->rectx / 64; - } - - if (ceil(re->recty / (float)yparts) < 64) - yparts = 1 + re->recty / 64; - /* part size */ - partx = ceil(re->rectx / (float)xparts); - party = ceil(re->recty / (float)yparts); + partx = min_ii(re->r.tilex, re->rectx); + party = min_ii(re->r.tiley, re->recty); - re->xparts = xparts; - re->yparts = yparts; re->partx = partx; re->party = party; + /* part count */ + xparts = (re->rectx + partx - 1) / partx; + yparts = (re->recty + party - 1) / party; + /* calculate rotation factor of 1 pixel */ if (re->r.mode & R_PANORAMA) re->panophi = panorama_pixel_rot(re); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 8f1037ec051..9dab18b3c2c 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -680,6 +680,7 @@ float panorama_pixel_rot(Render *re) { float psize, phi, xfac; float borderfac = (float)BLI_rcti_size_x(&re->disprect) / (float)re->winx; + int xparts = (re->rectx + re->partx - 1) / re->partx; /* size of 1 pixel mapped to viewplane coords */ psize = BLI_rctf_size_x(&re->viewplane) / (float)re->winx; @@ -687,7 +688,7 @@ float panorama_pixel_rot(Render *re) phi = atan(psize / re->clipsta); /* correction factor for viewplane shifting, first calculate how much the viewplane angle is */ - xfac = borderfac * BLI_rctf_size_x(&re->viewplane) / (float)re->xparts; + xfac = borderfac * BLI_rctf_size_x(&re->viewplane) / (float)xparts; xfac = atan(0.5f * xfac / re->clipsta); /* and how much the same viewplane angle is wrapped */ psize = 0.5f * phi * ((float)re->partx); @@ -2596,8 +2597,8 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env, if (env->type == ENV_CUBE) { for (i = 0; i < 12; i += 2) { - maxX = MAX2(maxX, layout[i] + 1); - maxY = MAX2(maxY, layout[i + 1] + 1); + maxX = max_ii(maxX, (int)layout[i] + 1); + maxY = max_ii(maxY, (int)layout[i + 1] + 1); } ibuf = IMB_allocImBuf(maxX * dx, maxY * dx, 24, IB_rectfloat); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 886f266b22f..7a7602dcce2 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1184,6 +1184,7 @@ static int panotestclip(Render *re, int do_pano, float *v) /* to be used for halos en infos */ float abs4; short c=0; + int xparts = (re->rectx + re->partx - 1) / re->partx; if (do_pano == FALSE) { return testclip(v); @@ -1197,7 +1198,7 @@ static int panotestclip(Render *re, int do_pano, float *v) if ( v[1]>abs4) c+=4; else if ( v[1]< -abs4) c+=8; - abs4*= re->xparts; + abs4*= xparts; if ( v[0]>abs4) c+=2; else if ( v[0]< -abs4) c+=1; diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index c37f48bc329..a7f6b40981d 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -637,7 +637,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar) maxtotvert= 0; for (obr=re->objecttable.first; obr; obr=obr->next) - maxtotvert= MAX2(obr->totvert, maxtotvert); + maxtotvert = max_ii(obr->totvert, maxtotvert); clipflag= MEM_callocN(sizeof(char)*maxtotvert, "autoclipflag"); |