Open ghost opened 3 years ago
For this we'd need to pass in a flag .. there's already the 'streamingLevels' parameter, which is used to start displaying a texture as soon as one of the mipmap levels has loaded in. Default is zero so the mipmaps would be created but the texture would only be seen with the highest-resolution image.
Would it work if we allowed a "-1" value to mean "disable mipmap generation"? Or as an alternative we could either a) set up a global flag on the context to enable/disable mipmap generation b) just add another parameter to that createTexture() method to be clearer than using the streamingLevels value..
Let us know your thoughts!
thanks
Yes, definitely, using -1 would be awesome and pretty enough. Thank you! Everything else is up to you. All options looks well!
Please do not change the default behavior, like you said... if anything add another optional parameter for changes like this. Thanks.
Problem Description
When you create non-rectangular texture using Context3D's
createTexture()
method, looks like it automatically allocate memory for mipmaps too, even if you don't use mipmaps at all. So AIR allocates x1.5 more memory than we actually want to use. And this is a huge problem, as now we are experiencing a lot of crashes because of using too much GPU memory.I expect there should be some flag in this method for mipmaps, or at least it should read mipmaps value from loaded compressed texture.
Checked on latest AIR 33.1.1, using local emulator in IDE and Android device build.
Steps to Reproduce
Sample code:
this should allocate 67 108 864 bytes, but in fact allocate 100 663 296 bytes.