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

Robert Wenzlaff bf-committers@blender.org
Tue, 31 Dec 2002 08:42:05 -0500


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

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=20
of the time.  Hos thought that you could just check a static var in=20
RE_local_test_break(), but I don't like that, you could mask all calls fr=
om=20
certain loops, since there is no way for the individual loops to know wha=
t=20
the count is.  This change brings 2.25 up to the renderspeed of 2.23 and=20
still has good responce to ESC.

Note, the unified render code doesn't seem to have these problems (but it=
 has=20
others).

Hos also sugested the correct solution, a timer.  This supposedly already=
 has=20
a timer somewhere that isn't working properly (Hos saw it, I was on other=
=20
things).

But I figured it should be discussed here prior to commiting big changes.=
 =20
What do you think?
--=20
**********************************************************
New parents can never have enough child  psychology books. =20

     It will be 4-5 years before the child can=20
      reach the bathroom faucet without them.
**********************************************************
Robert Wenzlaff                rwenzlaff@soylent=3Dgreen.com