From: Brian P. <bri...@tu...> - 2006-08-11 13:59:12
|
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 |