forked from bartvdbraak/blender
Bugfix #4557
Report noted the slow icon renders for menus, which indeed is an issue, especially when texture images need to be loaded (not to mention that will eat up loads of memory). Added a flag in scene to disable loading of images, makes it 50 times faster, at least :)
This commit is contained in:
parent
6adf0e6543
commit
bb9cafc257
@ -457,7 +457,7 @@ typedef struct Scene {
|
||||
#define R_SINGLE_LAYER 0x0200
|
||||
#define R_EXR_TILE_FILE 0x0400
|
||||
#define R_COMP_FREE 0x0800
|
||||
|
||||
#define R_NO_IMAGE_LOAD 0x1000
|
||||
|
||||
/* alphamode */
|
||||
#define R_ADDSKY 0
|
||||
|
@ -102,6 +102,9 @@ int imagewrap(Tex *tex, Image *ima, float *texvec, TexResult *texres)
|
||||
}
|
||||
|
||||
if(ima->ibuf==NULL) {
|
||||
/* hack for icon render */
|
||||
if(R.r.scemode &R_NO_IMAGE_LOAD)
|
||||
return 0;
|
||||
BLI_lock_thread(LOCK_MALLOC);
|
||||
if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, ima);
|
||||
BLI_unlock_thread(LOCK_MALLOC);
|
||||
|
@ -438,13 +438,16 @@ void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *are
|
||||
sce->r.scemode |= R_NODE_PREVIEW;
|
||||
if(sbuts->flag & SB_PRV_OSA)
|
||||
sce->r.mode |= R_OSA;
|
||||
sce->r.scemode &= ~R_NO_IMAGE_LOAD;
|
||||
}
|
||||
else if(pr_method==PR_DO_RENDER) {
|
||||
RE_test_break_cb(re, qtest);
|
||||
sce->r.scemode |= R_NODE_PREVIEW;
|
||||
sce->r.scemode &= ~R_NO_IMAGE_LOAD;
|
||||
}
|
||||
else { /* PR_ICON_RENDER */
|
||||
sce->r.scemode &= ~R_NODE_PREVIEW;
|
||||
sce->r.scemode |= R_NO_IMAGE_LOAD;
|
||||
}
|
||||
|
||||
/* allocates render result */
|
||||
|
Loading…
Reference in New Issue
Block a user