[Bf-committers] Re: Slow Render Bug in 2.25

Chris Want bf-committers@blender.org
Tue, 31 Dec 2002 08:07:29 -0700


> Hos and I tracked down the slow render bug in 2.25's non-unified render code.
> It seems 2.25 checks on average 10 times per pixel to see whether the ESC key 
> is pressed.

First, I would just like to comment that it
was Rob Haarsma that tracked this bug to
where the test_break gets registered in
the infamous "do_crap()" in renderwin.c,
and thus initiated this debugging process
-- cheers phase! He noticed that if you
comment out the

RE_set_test_break_callback(test_break);

in do_crap then you get way faster renders
but the esc key doesn't work.

> In rendercore.c there are a lot of calls like
> 
> if (RE_local_test_break() ) break;
> 
> inside the various  loops.  There is also a biggie in zbuf.c.
> 
> My initial solution was to change them to
> 
> if (!(loopvar%256)&&RE_local_test_break() ) break;
> 
> (replacing loopvar with the appropriate names) so they only get called 1/256th 
> of the time.  Hos thought that you could just check a static var in 
> RE_local_test_break(), but I don't like that, you could mask all calls from 
> certain loops, since there is no way for the individual loops to know what 
> the count is.  This change brings 2.25 up to the renderspeed of 2.23 and 
> still has good responce to ESC.
> 
> Note, the unified render code doesn't seem to have these problems (but it has 
> others).
> 
> Hos also sugested the correct solution, a timer.  This supposedly already has 
> a timer somewhere that isn't working properly (Hos saw it, I was on other 
> things).

This timer is in blender/src/misc/blendertimer.c

Regards,
Chris