Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-04-27 18:36:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-04-27 18:36:02 +0400
commit4e235c184b534d31b651ac0449a1b55a000639fc (patch)
tree9f6c464131b04b7f35f82c651ac9248cbab71866 /source/blender/windowmanager/intern/wm_draw.c
parentda376e0237517543aa21740ee2363234ee1c20ae (diff)
Blender modifications for Cycles integration.
Some notes about code status: * The Blender modifications were fairly quickly put together, much more code polish and work is needed to get this to a state where it can be committed to trunk. Files created with this version may not work in future versions. * Only simple path tracing is supported currently, but we intend to provide finer control, and more options where it makes sense. * For GPU rendering, only CUDA works currently. The intention is to have the same kernel code compile for C++/OpenCL/CUDA, some more work is needed to get OpenCL functional. * There are two shading backends: GPU compatible and Open Shading Language. Unfortunately, OSL only runs on the CPU currently, getting this to run on the GPU would be a major undertaking, and is unlikely to be supported soon. Additionally, it's not possible yet to write custom OSL shaders. * There is some code for adaptive subdivision and displacement, but it's far from finished. The intention is to eventually have a nice unified bump and displacement system. * The code currently has a number of fairly heavy dependencies: Boost, OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult to compile, we'll try to eliminate some, it may take a while before it becomes easy to compile this.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index c94ad74be72..70faa1d1e3c 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -57,6 +57,8 @@
#include "GPU_draw.h"
#include "GPU_extensions.h"
+#include "RE_pipeline.h"
+
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
@@ -115,6 +117,19 @@ static int wm_area_test_invalid_backbuf(ScrArea *sa)
return 1;
}
+static void wm_region_test_render_do_draw(ScrArea *sa, ARegion *ar)
+{
+ if(sa->spacetype == SPACE_VIEW3D) {
+ RegionView3D *rv3d = ar->regiondata;
+ RenderEngine *engine = (rv3d)? rv3d->render_engine: NULL;
+
+ if(engine && engine->do_draw) {
+ ar->do_draw = 1;
+ engine->do_draw = 0;
+ }
+ }
+}
+
/********************** draw all **************************/
/* - reference method, draw all each time */
@@ -207,7 +222,7 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
for(sa= screen->areabase.first; sa; sa= sa->next)
for(ar= sa->regionbase.first; ar; ar= ar->next)
if(ar->swinid && !wm_area_test_invalid_backbuf(sa))
- ED_region_tag_redraw(ar);
+ ED_region_tag_redraw(ar);
/* flush overlapping regions */
if(screen->regionbase.first) {
@@ -664,13 +679,28 @@ static int wm_draw_update_test_window(wmWindow *win)
{
ScrArea *sa;
ARegion *ar;
+ int do_draw= 0;
for(ar= win->screen->regionbase.first; ar; ar= ar->next) {
if(ar->do_draw_overlay) {
wm_tag_redraw_overlay(win, ar);
ar->do_draw_overlay= 0;
}
+ if(ar->swinid && ar->do_draw)
+ do_draw= 1;
+ }
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ wm_region_test_render_do_draw(sa, ar);
+
+ if(ar->swinid && ar->do_draw)
+ do_draw = 1;
+ }
}
+
+ if(do_draw)
+ return 1;
if(win->screen->do_refresh)
return 1;
@@ -683,15 +713,6 @@ static int wm_draw_update_test_window(wmWindow *win)
if(win->screen->do_draw_drag)
return 1;
- for(ar= win->screen->regionbase.first; ar; ar= ar->next)
- if(ar->swinid && ar->do_draw)
- return 1;
-
- for(sa= win->screen->areabase.first; sa; sa= sa->next)
- for(ar=sa->regionbase.first; ar; ar= ar->next)
- if(ar->swinid && ar->do_draw)
- return 1;
-
return 0;
}