forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pspgl and memory

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Noko



Joined: 06 Sep 2008
Posts: 23

PostPosted: Thu Feb 19, 2009 8:20 pm    Post subject: pspgl and memory Reply with quote

Imagine I have a game, and it displays 480x272 background image to user. At some point I want this image to fade out and a new one to appear. I am going to use pspgl, so these images are going to be textures, and because of pspgl limitations, they have to be 512x512 (closest power of 2). This is going to take 512x512x2 bytes per picture, total of 1MB for two pictures. And if I understand correctly pspgl is going to use another two 512x512x2 pictures to draw on. PSP has 2MB of video memory; does that mean that I'll run out of memory and won't be able to get new textures until I free these?
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Thu Feb 19, 2009 8:52 pm    Post subject: Reply with quote

If i remember correctly, 2 power limitation only occurs on x on PSP, so you can upload a texture of 512x272.
alternatively you can:
1) use compressed texture format
2) use downsampled images for textures (i.e. 512*256) and stretch at draw time
2) use less than 4 bytes for pixel (i.e. something different from RGBA8888)

anyway:
512*512*4 = 1'048'576
1Mb = 1024*1024 = 1048576 bytes
so 2 images at max resolution and color depht would take _exactly_ 2Mb, but at the moment i don't know how exactly the framebuffer is arranged.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Fri Feb 20, 2009 4:21 am    Post subject: Reply with quote

Frame buffer has to be uncompressed obviously, so you WILL lose 512*272*bpp*single/double buffers.

You can however use DXT compressed textures that can be passed straight to GU functions, dunno about pspgl, so it will be compressed even when loaded in memory.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group