# Fatal render error, only on 1 device afaik

**URL:** https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227
**Category:** Bugs
**Created:** [March 8, 2022, 11:02am UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227 "2022-03-08T11:02:12Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)
#### Post date: [March 8, 2022, 11:02am UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/1 "2022-03-08T11:02:13Z")

</div>

```auto
TypeError: this._gl.vertexAttribDivisor is not a function
  at t.e._bindVertexBuffersAttributes
  at t.e.recordVertexArrayObject
  at e._bind at at e.render
  at e.renderUnsorted
  at e.render
  at e.render
  at t._renderForCamera

```

renderer: ARM Mali-400 MP WebGL 1.0 (OpenGL ES 2.0 Chromium)  
userAgent: Mozilla/5.0 (Linux; Android 11; Note\_4CAM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36

It is consistently happening for this device (I don’t own it, so can’t test)  
I have no clue yet what triggers it, but there is a few minutes of rendering going on before it crashes.

Seems like this is a WebGL 2 function used on a WebGL 1 renderer (which I don’t force). When I force WebGL 1.0 locally everything works fine. Also I don’t see any problems for IPhone players.

this is on beta 11, but this device has never been used before, so no telling if this is a new issue.

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [March 8, 2022, 4:08pm UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/2 "2022-03-08T16:08:28Z")

</div>

Yeah Mali drivers are terrible  
Try to turn off webgl2, that should fix it

---

<div class="post-metadata">

### Author: ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)
#### Post date: [March 9, 2022, 10:57am UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/3 "2022-03-09T10:57:54Z")

</div>

I tried it, but the result seems to be the same. I guess there is nothing we can do about this?

for reference: I added a deeplink to the site which can be used to disable webgl2: [https://tuggowar.io/webgl1](https://tuggowar.io/webgl1), I think that works.

---

<div class="post-metadata">

### Author: ![Nowayz](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nowayz/32/26674_2.png) [@Nowayz](https://forum.babylonjs.com/u/Nowayz)
#### Post date: [March 9, 2022, 3:32pm UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/4 "2022-03-09T15:32:16Z")

</div>

I’ve dealt with this before with embedded devices that had Mali drivers… The drivers are broken in so many strange ways that you don’t have many choices except to design code that dances around the numerous issues. It’s not something you would want to support in a library since the behavior is non-standard.

Should count yourself lucky that the entire operating system kernel didn’t crash (happened to me frequently).

---

<div class="post-metadata">

### Author: ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)
#### Post date: [March 10, 2022, 9:28am UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/5 "2022-03-10T09:28:41Z")

</div>

I can live with this problem for sure, but I’m still curious how it could possibly be that Babylon calls a webgl2 function when we’re in webgl1 mode 🥴

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [March 10, 2022, 5:07pm UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/6 "2022-03-10T17:07:46Z")

</div>

this would be automatically redirected by the engine creation:

```auto
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;
            }

```

So it looks like you would not support the instanceExtension and some of the code still calls into it. Are you using Particles, Sprites, EdgesRenderer, Sprites or instances in your app ?

I will find a fix ASAP 🙂

---

<div class="post-metadata">

### Author: ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)
#### Post date: [March 11, 2022, 9:13am UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/7 "2022-03-11T09:13:55Z")

</div>

yes, lots of instances.  
I’m not sure what the instanceExtension is, but keep in mind that for 999/1000 players everything works great 🙂

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [March 13, 2022, 2:42pm UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/8 "2022-03-13T14:42:07Z")

</div>

My guess is instances are not supported on this device. Could you check what the value of engine.getCaps().instancedArrays is ?

---

<div class="post-metadata">

### Author: ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)
#### Post date: [March 13, 2022, 2:55pm UTC](https://forum.babylonjs.com/t/fatal-render-error-only-on-1-device-afaik/28227/9 "2022-03-13T14:55:16Z")

</div>

I don’t have access to the device unfortunately. But I think you’re right.  
I think you need to pretty good GPU to play tuggowar without instances, so it wouldn’t help much to have a workaround for such a device. I guess a ‘this device is not supported’ will have to do.
