StarlingGraphics / Starling-Extension-Graphics

flash.display.Graphics style extension for the Starling Flash GPU rendering framework
https://github.com/StarlingGraphics/Starling-Extension-Graphics/wiki
MIT License
282 stars 89 forks source link

Context loss SEG not recovering - No valid program set. #147

Closed Selonie closed 8 years ago

Selonie commented 8 years ago

In my game I to am experiencing issues with textures not showing up when my device sleeps. I can reproduce this every time on the desktop with Ctr Alt Del. This can be demonstrated in the provided GraphicsAPIExample. The issue only seems to occur when clear() is called, I'm guessing clear is getting called before the graphics have been restored.

To reproduce: Load up the GraphicsAPIExample, Ctr Alt Del, open task manager or cancel.

This doesn't happen when I roll back to a version from 2 June 2015.

[Fault] exception, information=Error: Error #3600: No valid program set. flash.display3D::Context3D/drawTriangles starling.display.materials::StandardMaterial/drawTrianglesEx at C:\Users\Selonie\Starling-Extension-Graphics-master\extension\src\starling\display\materials\StandardMaterial.as:149 starling.display.materials::StandardMaterial/drawTriangles at C:\Users\Selonie\Starling-Extension-Graphics-master\extension\src\starling\display\materials\StandardMaterial.as:123

IonSwitz commented 8 years ago

Thank you, I will investigate this ASAP. A clear reproduction always helps :)

IonSwitz commented 8 years ago

This is annoying. I can not repeat it, it works fine for me.

I am running Windows 10, Starling starts with "DirectX11 Baseline Constrained", Flash Player 20, debug or release makes no difference.

However, if I resize the window, everything clears out.

EDIT: I get the same error when I do a resize, so I guess the situation is similar. I can do a meaningful investigation now.

EDIT2: Ergh.. I have found the problem, wrestling with a solution.

EDIT3: I have found a solution, the Program3DCache didn't work correctly - But now I'm concerned about backwards compatibility in the fixed solution. So I will have to do more tests

Selonie commented 8 years ago

Thanks, for looking into this - I was about to go through my tests again until I saw your edits!

IonSwitz commented 8 years ago

I think the fix works fine. Please get the latest sources and try again.

Selonie commented 8 years ago

That was quick! Just running a few tests on desktop and device - In my game and the demo both seem to be recovering normally where before they were misbehaving. Thanks.