Skip to main content
Known Participant
July 5, 2013
Question

AIR 3.8: BASELINE_EXTENDED failing to initialize on a Nexus 7.

  • July 5, 2013
  • 1 reply
  • 4242 views

We're using BaseLine extended profile, which works fine on iPad, iPhone, Desktop and Android Nexus 10.

However when trying to initialize Starling on a Nexus 7, I get the error:

"Context3D is not available! Possible reasons: wrongRenderMode or missing device support"

Digging into Starling, this means Stage3D is throwing "Error #3702: Context3D not available."

Reverting back to BASELINE profile, and the app runs just fine.

This topic has been closed for replies.

1 reply

July 8, 2013

Hi Shawn,

The BASELINE_EXTENDED profile is not supported on all devices. It is supported only on devices which have the GL_MAX_TEXTURE_SIZE >=4096, as the only extra support in the baseline extended profile as of now, is support for 4096x4096 textures. If the underlying chipset doesn't support the same, call to requestContext3D  will return error 3702.

On Nexus 7, the maximum supported texture size is 2048. (http://gfxbench.com/device.jsp?benchmark=gfx27&D=Google+Nexus+7&testgroup=gl)

When using the BASELINE_EXTENDED profile, it is recommended that you try requesting context3D for Baseline Extended profile, if it returns error, you add a fallback to request for BASELINE profile.

Hope this helps.

Neha

Known Participant
July 8, 2013

Ah ok. Interesting approach.

I would expect the failure to only occur if I try and upload a texture that is too large for the current GPU.

For Nexus 7 our AS3 scripts would detect that it's low-resolution, and upload the 2048 textures.

Seems like this is a rather complicated thing now, involving multiple try/catch(){} blocks...

https://github.com/PrimaryFeather/Starling-Framework/issues/337#issuecomment-18523186

Extremely in-elegant solution. Did no-one think to implement a stage3d.isSupported() function?

Instead of 60 lines of cludge, we could just say:

if(stage3D.isSupported(Context3DProfile.BASELINE_EXTENDED)){
    profile = Context3DProfile.BASELINE_EXTENDED;
 } else {
    profile = Context3DProfile.BASELINE;
 }
 starling = new Starling(..., profile);
Known Participant
July 8, 2013

Here's about the smallest snippet I could come up with to check EXTENDED support:

var stage3D:Stage3D = stage.stage3Ds[0]; 
stage3D.addEventListener(flash.events.Event.CONTEXT3D_CREATE, onExtendedComplete);
stage3D.addEventListener(ErrorEvent.ERROR, function(){});
//Try and request extended profile.
try {
     stage3D.requestContext3D("auto", Context3DProfile.BASELINE_EXTENDED); 
}
catch (e:Error) {
     onExtendedComplete(false);
}
function onExtendedComplete(success:Boolean = true):void {
     stage3D.removeEventListener(flash.events.Event.CONTEXT3D_CREATE, onExtendedComplete);
     if(success){
          startStarling(Context3DProfile.BASELINE_EXTENDED);
     } else {
          startStarling(Context3DProfile.BASELINE);
     }
}