Page 1 of 1

Do RGBA surfaces save memory?

PostPosted: Feb 3, 2007 @ 8:36pm
by eugraphics
If I create an RGBA surface from a png image instead of allocating 2 surfaces (1 for an alpha mask), am I saving memory?

It does not appear so in my basic testing, but I can't believe that is correct. I assume there is some memory savings right?

PostPosted: Feb 3, 2007 @ 10:46pm
by eugraphics
Based on my logs it looks like a 240x320 surface uses 192K of VirtualMem for both the image surface and for the alpha surface (384K total). This doesnt add up if you figure 240 X 320 X 2 bytes/pixel X 2surfaces (=307K). Any idea why it wouldnt add up?

If i use RGBA surfaces it uses 320K of VM for the single image, which is better than 384K. Are there any official memory use stats for surface allocation?