Re: Information Request: SWAP, and FLUSH()?

Brian Paul <[email protected]>
Newsgroups gmane.comp.graphics.chromium.user
Message-ID <[email protected]>
James Supancic wrote:
> I have been reading the Chromium source code, I have a couple of
> questions about it.
> 
> what is the difference between function and functionSWAP()?
> I keep seeing things like
> if(tilesort_spu.swap)
> {
> call1SWAP
> call2SWAP
> call3SWAP
> }
> else
> {
> call1
> call2
> call3
> }
> 
> Debugging indicates that I always use the non-SWAP version, What is
> going on here? What does tilesort_spu.swap indicate? Why are different
> functions needed for each one?

It's for byteswapping in the case the packer and unpacker use 
different byte orderings.


> Secondly, I have been looking at the integration of various parts of
> Chromium. I noticed that many calls (especially those in
> tilesortspu_gen.c) call similarly named functions in the state
> tracker. These state tracker functions appear to do call specific
> things to update the state to what it should be after that call, at
> which point they use FLUSH() (which ends up invoking doFlush() in the
> tilesort SPU) to send necessary differences to the Render SPUs? Is
> this correct? (ig, does FLUSH flush changes to Render SPUs as needed?)
> 
> If yes, why does FLUSH() get called before the state tracker updates
> the state? I noticed that FLUSH() is always at the beginning of the
> state tracker functions, shouldn't it be at the end?

The idea is to flush any pending/buffered drawing commands before you 
change the state.  If there's no accumulated drawing commands, the 
flush is a no-op.

-Brian

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.