on 01-07-2012 05:30 PM
When trying to load 20 textures the Console throws this error:
warning : couldn't allocate memory 4194304 bytes (name = ScePssResourceHeap)
Theoretically it's trying to allocate 4MB, but it doesn't work.
Textures are loaded via "new Texture2D(<filename>)".
Solved! Go to Solution.
on 01-07-2012 09:02 PM
There is currently no support for compressed textures within the SDK. What this means is that your compressed PNG source file will be uncompressed in to RAW format on the GPU. Say you have a 1024x1024 PNG it will use up 1024*1024*4 bytes of memory (4MB).
One of the overloads for the new Texture() takes a further parameter to specify format (you can pass in RGB565) but note that only RGBA currently seems to work on Vita.
The dev team are aware of this issue and will hopefully be able to add texture compression support in a future update.
on 02-07-2012 03:32 AM
Martin is right. Anyways you could please send more details about? If every texture its ~60kb and its only 20 of them you are using ~1MB, could be you are not setting correctly the heap memory?.
on 02-07-2012 02:31 PM
Thank you very much for your quick answers!
Before compression the textures were 3MB each,
What I'm doing is creating a List<Texture2D> to make an array of textures, and then I add textures to that list, so I create first a Texture2D object and use the ".Add" method to add it to the list.
I've tried other aproaches like using an array of Texture2D with the same results.
02-07-2012 02:33 PM - edited 02-07-2012 02:39 PM
I also tried modifying the app.cfg file to set a greater heap size, but the result has been the same.
If I understood correctly, the maximum amount of heap available is 96MB, so trying to allocate 20 textures would be 80MB more or less, modifying "app.cfg" to have that amount of heap I amb able to load the 20 textures but, obiously, if I try to load more textures it runs out of memory.
I will wait until compressed textures are available, thank you very much.
on 02-07-2012 02:39 PM
As I said, unfortunately you're just not going to be able to load in that many textures. Assuming you have 20 textures all at 1024x1024 resolution that would equal 80MB of texture memory required.
Those textures will be being stored uncompressed in RGBA format on the GPU so each texture will take up a full 1024x1024x4 bytes (4MB).
I'd suggest you try using smaller textures, dropping down to 512x512 would reduce your memory usage down from 80MB to 20MB. Alternatively you could use RGB565 format which would result in a 50% decrease (though assumes none of your textures have alpha channels).
on 02-07-2012 09:14 PM
on 06-09-2013 12:11 PM
Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]