-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Details
From synthetic post of Cousin Ricky in p.beta-test, 2013-06-24 circa 3:19 pm (MST)
William F Pokorny anonymous@anonymous.org wrote:
It seems to be the case the gradient warnings are only generated if the
isosurface is naked. If it is wrapped in an object as was the case with
my thread safety example, we get no warnings.
Confirmed. If only I still had the concentration required to investigate computer code.
See FS298.pov
On the command line, try:
declare=MG=1 declare=Naked=1
and
declare=MG=1 declare=Naked=0
To lose the warning, I had to declare the isosurface. Just wrapping the naked isosurface in an object{} generated a warning.
Further Analysis
isCopy seems to be intended to avoid displaying the same warning over and over for the same isosurface (as duplicated isosurface indeed are not copied but reference the same sub-structure).
declare Ob = isosurface{...}; that's not a copy
object {Ob ... } that's a copy
Previously (3.6.1) the warning was displayed at the destruction of the isosurface (when the sub-structure was actually referenced by no one else)
if((Stage == STAGE_SHUTDOWN) && (mginfo->refcnt == 0))
In 3.7, isCopy was introduced with change 4707, 16th February 2009, along with the change introducing means for objects to submit message on shutdown.
It was reported in windows source with change 4714, 21th February 2009.
If the symptom "isosurface embbeded in object (CSG) does not show the warning" is correct, it might be a "feature/bug". The parser copied the isosurface object and deleted the original before the render started. When the render ends, it find only copies and because the refcnt is not used anymore (for that purpose), it miss the last remaining true data to display.
Instead of isCopy, what about adding in mginfo a boolean "printed_warning" (actual name should be more appropriate), set to false on creation, and turn to true on the first call (instead of last for 3.6.1) of the warning displaying function (test for false, set to true if false) ? (and dropping isCopy in the process)
For instance, i'm afraid the following sequence would fails with current code:
declare Foo = isosurface{ ... };
declare Bar = object { Foo ... };
undef Foo;
(or any pop of #local context, such as building the isosurface via macro or loop, or replacing the value of a previous #declare/#local )
Comment by Grimbert Jérôme (Le_Forgeron) - Monday, 24 June 2013, 14:43 GMT+5
correction tested in 5912 (not the smp branch). Easy, works fine (but does not address FS#296).
Basically: remove isCopy field and create a print_done field deeper in the data
See: delta5912.dif
All files in attached zip.