Path: chuka.playstation.co.uk!news From: Chris Chadwick Newsgroups: scee.yaroze.beginners Subject: Re: GpuPacketArea query. Date: Thu, 02 Jul 1998 02:16:22 -0700 Organization: PlayStation Net Yaroze (SCEE) Lines: 41 Message-ID: <359B4FE6.6894@dial.pipex.com> References: <35557807.6E248247@chowfam.demon.co.uk> <3558DF85.7C89DA42@ndirect.co.uk> <3559D87E.D5C1EBD1@chowfam.demon.co.uk> <3594C013.116@manc.u-net.com> <35991930.333A683@ndirect.co.uk> NNTP-Posting-Host: usern576.uk.uudial.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (Win95; I; 16bit) Alex Herbert wrote: > > James Shaughnessy wrote: > > > PS I still use the old formula for packet space: > > PACKET GpuPacketArea[2][NUM_SPRITES*sizeof(GsSPRITE)]; > > "sizeof(GsSPRITE)" is a macro unless I'm very much mistaken. > > Usually when I don't allow enough for NUM_SPRITES I get wierd effects > > like flickering sprites. It is amazingly difficult to actually get > > the PlayStaion to crash, I find! > > Maybe I'm missing something here, but I didn't realise that there was any > correlation between packet sizes and the size of the GsSPRITE structure. Im pretty sure there isnt! I seem to remember doing some tests on this and found a normal sprite uses 24 bytes, and a rotate/scale enabled sprite uses 40 bytes (or something). > Personally, I allocate say 64K of space for each packet buffer using > malloc(). Then, after sorting all objects (just before I DrawSync()) I > check out how much actual memory space is used, by subtracting the result > of GsGetworkbase from the address used for GsSetworkbase. (I think that's > what the functions are called.) By keeping a running peak value for memory > usage, I know exactly how much memory is required, so I can reduce the size > of the packet buffers if memory starts to get tight. > > Herbs Yeah. I also prefer using heap memory to plonk sprites, gpu buffers etc. in. I THINK I used calloc (I havent looked at my allocation functions for a long time) because this guarantees zeroed memory. My original plan was to do this so that I could reclaim memory (used to hold TIMs (etc.) before sending them to VRAM) back to the heap. I still haven't actually tried this yet mainly because Im still not sure about the usage/restrictions of the InitHeap (?) function. Does this idea make any kind of sense to anyone else - I figured allocating everything from heap memory would also stop the exe producing a sprawling bss (where, I think, static arrays would otherwise have been placed) at run time. But hey, its late, perhaps Im dreaming... zzzzZZZZZZ -Chris