Jump to content

CreateInstance crash on older android devices


Hersir
 Share

Recommended Posts

Hi, 

Got error on android device when createInstance is used ,PG.

Device: Galaxy Tab 3

WebGl: renderer:"PowerVR SGX 544MP2", vendor:"Imagination Technologies", version:"WebGL 1.0 (OpenGL ES 2.0 Chromium)"

Android: 4.4.2

Error:

Uncaught TypeError: this._gl.vertexAttribDivisor is not a function
    at n._bindVertexBuffersAttributes (babylon.js:5)
    at n.recordVertexArrayObject (babylon.js:5)
    at t._bind (babylon.js:15)
    at r._renderWithInstances (babylon.js:12)
    at r._processRendering (babylon.js:12)
    at r.render (babylon.js:12)
    at t.render (babylon.js:13)
    at t.renderUnsorted (babylon.js:9)
    at t.render (babylon.js:9)
    at t.render (babylon.js:8)

[.Offscreen-For-WebGL-0x6f7cfc20]GL ERROR :GL_INVALID_ENUM : GetIntegerv: <- error from previous GL command

[.Offscreen-For-WebGL-0x6c2ab010]GL ERROR :GL_INVALID_ENUM : GLES2DecoderImpl::ClearWorkaround: <- error from previous GL command

 

Link to comment
Share on other sites

if (this._webGLVersion > 1) {
    this._caps.instancedArrays = true;
}
else {
    var instanceExtension = this._gl.getExtension('ANGLE_instanced_arrays');
    if (instanceExtension != null) {
        this._caps.instancedArrays = true;
        this._gl.drawArraysInstanced = instanceExtension.drawArraysInstancedANGLE.bind(instanceExtension);
        this._gl.drawElementsInstanced = instanceExtension.drawElementsInstancedANGLE.bind(instanceExtension);
        this._gl.vertexAttribDivisor = instanceExtension.vertexAttribDivisorANGLE.bind(instanceExtension);
     }
     else {
        this._caps.instancedArrays = false;
     }
}

Here is this check it sets this._caps.instancedArrays to false, so it detects correct that extension doesn't exist

Link to comment
Share on other sites

@Deltakosh I think I found what is wrong, inside Mesh -> render function there is check "var hardwareInstancedRendering = (engine.getCaps().instancedArrays !== null) ..... "  but "engine.getCaps().instancedArrays" is never null its true/false. Will check if there are other places where it is used.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...