I've been using Scout to profile a large application and noticed that the GPU texture memory being used is 1.5 times the amount of what it should be! So my question is, is Scout reported the actual texture memory used or is it trying to approxomiate waht the texture memory is by including a guess for mip maps?
I have written an example program to demonstrate what I mean below. In the example program I create a texture that is 64 by 64 pixels which has no mip maps. Therefore the size of this texture in memory should be 64 * 64 * 4 = 16384 bytes (16 KB). However Scout reports that the memory consumed by the texture is 24 KB which is exactly 1.5 times what it should be. I have tested this with many different texture sizes and this is always the case.
Therefore what I want to know is this Scout reported texture memory usage wrong or is the Flash runtime creating this extra memory? This is of great importance to me because I am creating large 2048 by 2048 textures which are using 24 MB instead of 16 MB which is a huge difference.
I am using Adobe Air 3.5.
Here is the simple code which should be able to compiled without dependacies for reference:
[SWF(width="640", height="480", frameRate="60", backgroundColor="#000000")]
public class TextureMemoryBug extends Sprite
// the 3d graphics window on the stage
private var context3D:Context3D;
// The Stage3d Texture that uses the above myTextureData
private var _texture:Texture;
public function TextureMemoryBug()
stage.frameRate = 60;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
private function init(event:Event):void
// and request a context3D from Stage3d
private function onContext3DCreate(event:Event):void
var stage3D:Stage3D = event.target as Stage3D;
context3D = stage3D.context3D;
if (context3D == null)
context3D.configureBackBuffer(stage.stageWidth, stage.stageHeight, 0, false);
// Generate test texture bitmap data
var bitmapData:BitmapData = new BitmapData(64, 64, false, 0);
// Create texture
_texture = context3D. createTexture(64, 64, Context3DTextureFormat.BGRA, false, 0);
addEventListener(Event.ENTER_FRAME, enterFrame, false, 0, true);
private function enterFrame(e:Event):void
context3D.clear(1, 1, 1);