pspgl and memory

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Noko
Posts: 23
Joined: Sat Sep 06, 2008 8:35 pm

pspgl and memory

Post by Noko »

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?
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

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.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Post Reply