In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Easy GPU Benchmark

Flash Plaer 11対応のGPUの簡易ベンチマークです。
CPUをなるべく使わず、GPUを痛めつけます。
※負荷のためか、OSが落ちてしまった方がいらっしゃるので編集中のファイルは保存して閉じる等して、十分に気をつけてください。

矩形の描写数を増やしていき、
直近10秒の平均fpsが30以下になった時点の矩形の数をスコアとしています。
GPUスペックの高い人は1分以上時間がかかるかもしれません。

GPUと一緒に教えていただけるとありがたいです。

FPS算出方法その他UI : http://wonderfl.net/c/hvy2

GPUの調べ方

Windows
ファイル名を指定して実行(ウィンドウズキー+R)→"dxdiag"で実行→"ディスプレイ"タブ→デバイス

GPU-Z
http://www.techpowerup.com/gpuz/

Mac
りんご→このMacについて→詳しい情報→ハードウェア→グラフィックス/ディスプレイ

linux
/sbin/lspci | grep VGA
Get Adobe Flash player
by 9balls 27 Oct 2011
  • Forked from ton's Easy Benchmark
  • Diff: 241
  • Related works: 4
  • Talk

    9balls at 09 Oct 2011 16:32
    Graphics Card : NVIDIA GeForce 9800 GT (VRAM:512) OS : WinXP x32 Browser : Google Chrome 14.0.835.202 Flash Player : 11.0.1.152 SCORE : 123300
    a24 at 09 Oct 2011 21:22
    Graphics Card : ATI Radeon HD 5800 Series OS : Windows 7 Professional 64-bit Browser : IE9.0.8112.16421 Flash Player : 11.0.1.152 SCORE : 196600
    ProjectNya at 20 Oct 2011 17:45
    Graphics Card : ATI Radeon HD 4670 OS : Mac OS X 10.6.8 Browser : Safari 5.0.5 Flash Player : 11.0.1.152 SCORE : 60000
    bkzen at 20 Oct 2011 20:25
    Graphics card : NVIDIA GeForce 8600 GT OS : WinXP Browser : Firefox 7.0 FlashPlayer : 11.0.1.152 SCORE : 44650
    szbzs2004 at 21 Oct 2011 04:44
    Graphics card: nVidia Quadro FX3500 (256 MB, BIOS: 5.71.22.29.06, driver: 6.14.12.5981) OS: WinXP x32 SP3 Browser: Firefox 3.6.23 Flash Player: 11.0.1.152 score: 71550
    fumix at 21 Oct 2011 05:43
    Graphics Card:Intel HD Graphics 3000 384 MB OS : Mac OS X 10.7 Browser : Safari 5.1 (7534.48.3) Flash Player: 11.0.1.152 SCORE : 42350
    ton at 21 Oct 2011 05:58
    Graphics Card:ATI Radeon HD 4860 512MB OS : Win7x64 Browser :IE 9.0.8112.16421 64bit Edition Flash Player: 11.0.1.152 SCORE : 169900
    mousepancyo at 21 Oct 2011 05:59
    Graphics Card : NVIDIA GeForce 8800 GT 512MB OS : Mac OS X 10.7.2 Browser : Chrome 14.0.835.202 Flash Player: 11.0.1.152 SCORE : 170400
    motikawa_rgm at 21 Oct 2011 06:01
    Graphics Card:AMD Radeon HD 6970M OS : Mac OS X 10.6.8 Browser : firefox 7.0.1 Flash Player: 11.0.1.152 SCORE : 246100
    clockmaker at 21 Oct 2011 08:11
    Graphics Card: NVIDIA GeForce GT 330M 512 MB Mac OS X Lion 10.7.1 Browser : safari 5.1 Flash Player: 11.0.1.152 (Debug) (MacBook Pro 17inch (2010 April)) YOUR SCORE : 64350
    ProjectNya at 22 Oct 2011 12:10
    Graphics Card : Intel HD Graphics 3000 512MB
 OS : Mac OS X 10.6.8 Browser : Safari 5.0.5
 Flash Player : 11.0.1.152 (debug) 

SCORE : 43400
    Hasufel at 20 Aug 2012 07:15
    Graphics Card : Intel HD Graphics 4000 512MB
 OS : Mac OS X 10.8 Browser : Firefox 14
 Flash Player : 11.3.300.271 

SCORE : 65360
    makc3d at 18 Jan 2015 23:50
    mbp/2009, score 20100
    makc3d at 18 Jan 2015 23:51
    oh and fp 16.0.0.235, nvidia geforce 9400M 256 MB
    Noel_M_Ascot at 07 Jun 2015 20:38
    Easy GPU Benchmark SCORE : 456600 [OpenGL] http://wonderfl.net/c/cTZT #Stage3DBench Graphics Card : NVIDIA GeForce GTX780 (VRAM:3072) OS : Win7 x64
    makc3d at 16 Jun 2015 02:16
    same machine, but os x yosemite now, fp 17.0.0.188 and score = 18000
    phi16 at 22 Jun 2015 13:28
    Graphics card : NVIDIA GeForce GTX 760 OS : Win 8.1 Browser : Chrome 43 FlashPlayer : 18.0.0.160 SCORE : 236350

    Tags

    Embed
package {
    import com.adobe.utils.AGALMiniAssembler;
    import flash.display.Sprite;
    import flash.display.Stage3D;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.display3D.Context3D;
    import flash.display3D.Context3DCompareMode;
    import flash.display3D.Context3DProgramType;
    import flash.display3D.Context3DRenderMode;
    import flash.display3D.Context3DTriangleFace;
    import flash.display3D.Context3DVertexBufferFormat;
    import flash.display3D.IndexBuffer3D;
    import flash.display3D.Program3D;
    import flash.display3D.VertexBuffer3D;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.utils.ByteArray;
    import flash.utils.getTimer;

    /**
     * ...
     * @author
     */
    [SWF(frameRate=240)]
    public class Main extends Sprite {
        private const MAX_PARTICLES:uint = 16383;
        private const STEP:uint = 50;
        //
        private var stageWidth:int;
        private var stageHeight:int;
        //
        private var stage3D:Stage3D;
        private var context3D:Context3D;
        private var indexBuffer:IndexBuffer3D;
        private var vertexBufferIndex:uint = 0;
        private var draw:uint = 0;
        //
        private var score:uint = 0;
        private var txtDrawCnt:TextField;
        private var txtFrameCnt:TextField;
        private var frameCnt:int = 0;
        private var oldTimer:int;
        private var frameRates:Vector.<int> = Vector.<int>([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
        private var frameIndex:int = 0;
        private var aveTotal:int = 0;
        private var aveLength:uint = 0;
        private var ave:int = 120;

        public function Main():void {
            Wonderfl.disable_capture();
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stageWidth = stage.stageWidth;
            stageHeight = stage.stageHeight;
            //
            txtDrawCnt = new TextField();
            txtDrawCnt.autoSize = TextFieldAutoSize.LEFT;
            txtDrawCnt.background = true;
            addChild(txtDrawCnt);
            //
            txtFrameCnt = new TextField();
            txtFrameCnt.autoSize = TextFieldAutoSize.LEFT;
            txtFrameCnt.background = true;
            txtFrameCnt.y = 30;
            addChild(txtFrameCnt);
            //
            stage3D = stage.stage3Ds[0];
            stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreate);
            stage3D.requestContext3D(Context3DRenderMode.AUTO);
        }

        private function onContextCreate(e:Event):void {
            context3D = stage3D.context3D;
            //context3D.enableErrorChecking = true;
            if (context3D.driverInfo.match("Software")){
                complete(false);
            } else {
                prepare();
            }
        }

        private function prepare():void {
            context3D.configureBackBuffer(stageWidth, stageHeight, 0, true);
            //vertex buffer
            var vertexBuffer:VertexBuffer3D = context3D.createVertexBuffer(MAX_PARTICLES * 4, 5);
            var vertices:Vector.<Number> = new Vector.<Number>(MAX_PARTICLES * 4);
            var index:uint = 0;
            var offsetX:Vector.<Number> = Vector.<Number>([-0.1, -0.1, 0.1, 0.1]);
            var offsetY:Vector.<Number> = Vector.<Number>([-0.1, 0.1, 0.1, -0.1]);
            for (var i:int = 0; i < MAX_PARTICLES; i++){
                var posX:Number = (Math.random() - 0.5) * 2;
                var posY:Number = (Math.random() - 0.5) * 2;
                var color:uint = Math.random() * 0x1000000;
                var r:Number = ((color >> 16) & 0xff) / 255;
                var g:Number = ((color >> 8) & 0xff) / 255;
                var b:Number = (color & 0xff) / 255;
                for (var j:int = 0; j < 4; j++){
                    vertices[index++] = posX + offsetX[j];
                    vertices[index++] = posY + offsetY[j];
                    vertices[index++] = r;
                    vertices[index++] = g;
                    vertices[index++] = b;
                }
            }
            vertexBuffer.uploadFromVector(vertices, 0, MAX_PARTICLES * 4);
            //index buffer
            indexBuffer = context3D.createIndexBuffer(MAX_PARTICLES * 6);
            var indeices:Vector.<uint> = new Vector.<uint>(MAX_PARTICLES * 6);
            index = 0;
            for (var k:int = 0; k < MAX_PARTICLES; k++){
                var n:uint = k * 4;
                indeices[index++] = n;
                indeices[index++] = n + 1;
                indeices[index++] = n + 2;
                indeices[index++] = n;
                indeices[index++] = n + 2;
                indeices[index++] = n + 3;
            }
            indexBuffer.uploadFromVector(indeices, 0, MAX_PARTICLES * 6);
            //shader and set Context3D
            var shaderProgram:Program3D = context3D.createProgram();
            var vertexShader:ByteArray = new AGALMiniAssembler().assemble(Context3DProgramType.VERTEX, "mov op va0\n" + "mov v0 va1\n");
            var fragmentShader:ByteArray = new AGALMiniAssembler().assemble(Context3DProgramType.FRAGMENT, "mov oc v0\n");
            //var vertexShaderStr:String="oAEAAAChAAAAAAAAAA8DAAAA5AAAAAAAAAAAAAAAAAAAAAAAAA8EAQAA5AAAAAAAAAAAAAAAAA==";
            //var fragmentShaderStr:String="oAEAAAChAQAAAAAAAA8DAAAA5AQAAAAAAAAAAAAAAA==";
            //var base64Decoder:Base64Decoder = new Base64Decoder();
            //base64Decoder.decode(vertexShaderStr);
            //vertexShader = base64Decoder.toByteArray();
            //vertexShader.endian = Endian.LITTLE_ENDIAN;
            //base64Decoder.decode(fragmentShaderStr);
            //fragmentShader = base64Decoder.toByteArray();
            //fragmentShader.endian = Endian.LITTLE_ENDIAN;
            shaderProgram.upload(vertexShader, fragmentShader);
            context3D.setProgram(shaderProgram);
            context3D.setDepthTest(true, Context3DCompareMode.ALWAYS)
            context3D.setCulling(Context3DTriangleFace.BACK);
            context3D.setVertexBufferAt(0, vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_2);
            context3D.setVertexBufferAt(1, vertexBuffer, 2, Context3DVertexBufferFormat.FLOAT_3);
            //
            oldTimer = getTimer();
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }

        //

        private function onEnterFrame(e:Event):void {
            updateFrame();
            if (ave <= 30){
                removeEventListener(Event.ENTER_FRAME, onEnterFrame);
                complete(true);
                return;
            }
            //
            draw += STEP;
            score += STEP;
            if (draw > MAX_PARTICLES){
                draw -= MAX_PARTICLES;
                vertexBufferIndex++;
            }
            txtDrawCnt.text = "score : " + score;
            //
            context3D.clear();
            var drawT:uint;
            for (var i:int = 0; i <= vertexBufferIndex; i++){
                if (i == vertexBufferIndex){
                    drawT = draw << 1;
                } else {
                    drawT = MAX_PARTICLES << 1;
                }
                context3D.drawTriangles(indexBuffer, 0, drawT);
            }
            context3D.present();
        }

        //

        private function updateFrame():void {
            frameCnt++;
            if (getTimer() - oldTimer >= 1000){
                aveTotal += frameCnt;
                if (aveLength < 10){
                    aveLength++;
                } else {
                    aveTotal -= frameRates[frameIndex];
                }
                frameRates[frameIndex] = frameCnt;
                ave = aveTotal / aveLength;
                frameIndex = ++frameIndex % 10;
                //
                txtFrameCnt.text = "fps : " + frameCnt + "/" + stage.frameRate + "\nave : " + ave;
                frameCnt = 0;
                oldTimer = getTimer();
            }
        }

        private function complete(isSupported:Boolean):void {
            var tf:TextField = new TextField();
            tf.autoSize = TextFieldAutoSize.LEFT;
            tf.background = true;
            tf.backgroundColor = 0xffffff;
            if (isSupported){
                tf.text = "YOUR SCORE : " + score;
                tf.scaleX = tf.scaleY = 3;
            } else {
                tf.text = "Hardware accelerated rendering\nis not supported\non YOUR GPU or CHIPSET";
                tf.scaleX = tf.scaleY = 2;
            }
            tf.x = stageWidth / 2 - tf.width / 2;
            tf.y = stageHeight / 2 - tf.height;
            addChild(tf);
            //
            var button:TextField = new TextField();
            button.background = true;
            button.backgroundColor = 0xcccccc;
            button.autoSize = TextFieldAutoSize.LEFT;
            button.selectable = false;
            button.text = "twitterに投稿";
            button.scaleX = button.scaleY = 2;
            button.x = stageWidth / 2 - button.width / 2;
            button.y = stageHeight / 2;
            var result:String
            if (isSupported){
                result = String(score);
            } else {
                result = "not supported";
            }
            var url:String = "http://twitter.com/?status=Easy GPU Benchmark SCORE : " + result + " [" + context3D.driverInfo + "] http://wonderfl.net/c/cTZT %23Stage3DBench";
            button.addEventListener(MouseEvent.CLICK, function():void {
                    navigateToURL(new URLRequest(url));
                });
            addChild(button);
        }

    }

}