Yair Kurzion (yair++at++polygon.engr.sgi.com)
Tue, 9 Mar 1999 12:38:13 -0800 (PST)
> This is about pfFlux.
>
> The man page says:
>
> " ... PFFLUX_WRITE_ONCE controls what happens when pfFlux::getWritableData is
> called and there is already a readable data buffer with the current frame
> number. Setting it to PF_ON will cause NULL to be returned from
> pfFlux::getWritableData. Setting it to PF_OFF will cause the pointer to
> the readable data buffer to be returned. ..."
>
>
> Suppose that I have a readable data buffer, and then decide that
> I want to update it. Now, if PFFLUX_WRITE_ONCE is set to PF_ON,
> getWritableData() will return a pointer to readable data
> - is that correct? Is that pointer good for writing the data?
> Else what good is that and how do I update the data in this case?
Setting PFFLUX_WRITE_ONCE is a good idea when you have multiple writers to
a Flux, and you wish to make sure that only one of them writes at any given
frame. If you only have a single writing process, and you wish to write to
a buffer in multiple places during a frame, either don't set the
PFFLUX_WRITE_ONCE flag, or call getWritableData once, and writeComplete when
all writers are done.
> It sounds strange that I can't update simply because I have a
> readable copy of it.
Having a readable copy of it means that somewhere in the current frame you
called getWritableData on the buffer, and then called writeComplete on the same
buffer.
> Further, from the man page, the only time that getWritableData()
> returns NULL is when PFFULX_WRITE_ONCE is PF_ON. In my application,
> I have it as PF_OFF (by default, again according to man pages),
> but when I call getWritableData(), I keep getting a NULL pointer.
> But if I try getCurData() instead, the data returned is the right,
> vaild, data. Furhter the getWritableData() is returnig NULL
> at only one particular call, other places I call the same
> function, returns a pointer to data that I can successfully write
> to.
Can you create a small sample program demonstrating this behavior ?
In general, if PFFULX_WRITE_ONCE is off, you should always get a non-NULL
pointer.
> Are there any instances - documented or otherwise - that
> the pfFlux::getWritableData() returns NULL?
pfFlux::getWritableData will return NULL only when you set FF_WRITE_ONCE on
the Flux, and someone has already written a buffer on this flux during the
current frame.
What Performer version are you running ?
Are you using sync-groups ?
There were some pfFlux fixes in 2.2.3
-yair
--
\_________ \_____ \__ \__ \_____ Yair Kurzion
\_________ \_____ \__ \__ \_____ yair++at++sgi.com
\__ \__ \____\__ \__ http://reality.sgi.com/yair
\__ \__ \__ Work: (650) 933-6502
\__ \__ \__ Home: (408) 226-9771
\__ \__ \__
This archive was generated by hypermail 2.0b2 on Tue Mar 09 1999 - 12:38:25 PST