Hi Kevin, I like to read your blog and learn a lot from the many interesting code optimisations. But i'm not so sure about your statements for this particular one:
running your test a few times gives me different results: run 1: Driver,Test,Time,Bytes/Sec OpenGL,Texture from BitmapData w/o alpha,7,2396745.14 OpenGL,Texture from BitmapData w/ alpha,10,1677721.60 OpenGL,Texture from ByteArray,8,2097152.00 OpenGL,VertexBuffer from Vector,35,479341.71 OpenGL,VertexBuffer from ByteArray,3,5592320.00 OpenGL,IndexBuffer from Vector,2,1048574.00 OpenGL,IndexBuffer from ByteArray,1,2097148.00 Software Hw_disabled=explicit,Texture from BitmapData w/o alpha,9,1864135.11 Software Hw_disabled=explicit,Texture from BitmapData w/ alpha,4,4194304.00 Software Hw_disabled=explicit,Texture from ByteArray,4,4194304.00 Software Hw_disabled=explicit,VertexBuffer from Vector,12,1398080.00 Software Hw_disabled=explicit,VertexBuffer from ByteArray,5,3355392.00 Software Hw_disabled=explicit,IndexBuffer from Vector,1,2097148.00 Software Hw_disabled=explicit,IndexBuffer from ByteArray,1,2097148.00 run2: Driver,Test,Time,Bytes/Sec OpenGL,Texture from BitmapData w/o alpha,8,2097152.00 OpenGL,Texture from BitmapData w/ alpha,9,1864135.11 OpenGL,Texture from ByteArray,7,2396745.14 OpenGL,VertexBuffer from Vector,34,493440.00 OpenGL,VertexBuffer from ByteArray,3,5592320.00 OpenGL,IndexBuffer from Vector,2,1048574.00 OpenGL,IndexBuffer from ByteArray,1,2097148.00 Software Hw_disabled=explicit,Texture from BitmapData w/o alpha,9,1864135.11 Software Hw_disabled=explicit,Texture from BitmapData w/ alpha,4,4194304.00 Software Hw_disabled=explicit,Texture from ByteArray,5,3355443.20 Software Hw_disabled=explicit,VertexBuffer from Vector,12,1398080.00 Software Hw_disabled=explicit,VertexBuffer from ByteArray,4,4194240.00 Software Hw_disabled=explicit,IndexBuffer from Vector,1,2097148.00 Software Hw_disabled=explicit,IndexBuffer from ByteArray,1,2097148.00 run 3: Driver,Test,Time,Bytes/Sec OpenGL,Texture from BitmapData w/o alpha,6,2796202.67 OpenGL,Texture from BitmapData w/ alpha,9,1864135.11 OpenGL,Texture from ByteArray,8,2097152.00 OpenGL,VertexBuffer from Vector,33,508392.73 OpenGL,VertexBuffer from ByteArray,3,5592320.00 OpenGL,IndexBuffer from Vector,2,1048574.00 OpenGL,IndexBuffer from ByteArray,1,2097148.00 Software Hw_disabled=explicit,Texture from BitmapData w/o alpha,9,1864135.11 Software Hw_disabled=explicit,Texture from BitmapData w/ alpha,4,4194304.00 Software Hw_disabled=explicit,Texture from ByteArray,4,4194304.00 Software Hw_disabled=explicit,VertexBuffer from Vector,12,1398080.00 Software Hw_disabled=explicit,VertexBuffer from ByteArray,4,4194240.00 Software Hw_disabled=explicit,IndexBuffer from Vector,2,1048574.00 Software Hw_disabled=explicit,IndexBuffer from ByteArray,1,2097148.00 but for 2 of them (1 and 3) texture from bytearray is slower than texture from bitmapdata without alpha. is that because i'm on a mac? or maybe the flash player improved in the meantime? The article is a bit old :-) i'm on flash player 11.5 osx 10.8.2. Arnoud On 21-01-2013, at 20:54, Kevin Newman <capta...@unfocus.com> wrote: > Your blog post says uploads to GPU are slow, but I think that's incorrect (or > at least incomplete). I think the bottle neck is the conversion from > BitmapData to the texture format ( /texture.uploadFromBitmapData())/. If you > use texture.uploadFromByteArray you'll see much faster throughputs. Which > suggest, the bottleneck is not with stage3d and texture uploads generally, > but with uploads from BitmapData (which is what the old display list > produces). > > You may even be able to handle and cache some of that BMD -> BGRA conversion > yourself in MadComponents and gain a nice performance boost by using > uploadFromByteArray() (at least when you can bypass redraw from the display > list, which as I've said many times, is not well suited for a GPU workflow). > > More: > http://jacksondunstan.com/articles/1617 > > Kevin N. > Met vriendelijke groet, Arnoud Bos Artim interactive E arn...@artim-interactive.nl W www.artim-interactive.nl T +31 6 246 40 216 A Elisabeth Wolffstraat 77-3 1053TT Amsterdam