From 9cc59fb0c329bb788defe9c56b69d0919caaba96 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 22 Jan 2009 14:59:49 +0000 Subject: 2.5 Added WM Jobs manager - WM can manage threaded jobs for you; just provide a couple of components to get it work: - customdata, free callback for it - timer step, notifier code - start callback, update callback - Once started, each job runs an own timer, and will for every time step check necessary updates, or close the job when ready. - No drawing happens in jobs, that's for notifiers! - Every job stores an owner pointer, and based on this owner it will prevent multiple jobs to enter the stack. Instead it will re-use a running job, signal it to stop and allow caller to re-initialize it even. - Check new wm_jobs.c for more explanation. Jobs API is still under construction. Fun: BLI_addtail(&wm->jobs, steve); :) Put Node shader previews back using wmJobs - Preview calculating is now fully threaded (1 thread still) - Thanks to new event system + notifiers, you can see previews update even while dragging sliders! - Currently it only starts when you change a node setting. Warning: the thread render shares Node data, so don't delete nodes while it renders! This topic is on the todo to make safe. Also: - bug in region initialize (do_versions) showed channel list in node editor wrong. - flagged the channel list 'hidden' now, it was really in the way! This is for later to work on anyway. - recoded Render API callbacks so it gets handlers passed on, no globals to use anymore, remember? - previewrender code gets now so much nicer! Will remove a lot of stuff from code soon. --- .../blender/render/intern/include/render_types.h | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'source/blender/render/intern/include/render_types.h') diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 34553208574..66722ea983f 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -208,16 +208,23 @@ struct Render struct MemArena *memArena; /* callbacks */ - void (*display_init)(RenderResult *rr); - void (*display_clear)(RenderResult *rr); - void (*display_draw)(RenderResult *rr, volatile rcti *rect); - - void (*stats_draw)(RenderStats *ri); - void (*timecursor)(int i); - - int (*test_break)(void); - int (*test_return)(void); - void (*error)(char *str); + void (*display_init)(void *handle, RenderResult *rr); + void *dih; + void (*display_clear)(void *handle, RenderResult *rr); + void *dch; + void (*display_draw)(void *handle, RenderResult *rr, volatile rcti *rect); + void *ddh; + + void (*stats_draw)(void *handle, RenderStats *ri); + void *sdh; + void (*timecursor)(void *handle, int i); + void *tch; + + int (*test_break)(void *handle); + void *tbh; + + void (*error)(void *handle, char *str); + void *erh; RenderStats i; }; -- cgit v1.2.3