From 64d6e185fef4c39106692cfebf6c47475a28f0e2 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alex.rose@rcsb.org>
Date: Thu, 11 Apr 2019 16:17:19 -0700
Subject: [PATCH] createVertexArray tweaks

---
 src/mol-gl/webgl/vertex-array.ts | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mol-gl/webgl/vertex-array.ts b/src/mol-gl/webgl/vertex-array.ts
index f008d8c26..cbb630d25 100644
--- a/src/mol-gl/webgl/vertex-array.ts
+++ b/src/mol-gl/webgl/vertex-array.ts
@@ -13,11 +13,12 @@ export function createVertexArray(ctx: WebGLContext, program: Program, attribute
     let vertexArray: WebGLVertexArrayObject | null = null
     if (vertexArrayObject) {
         vertexArray = vertexArrayObject.createVertexArray()
-        vertexArrayObject.bindVertexArray(vertexArray)
-        if (elementsBuffer) elementsBuffer.bind()
-        program.bindAttributes(attributeBuffers)
-        ctx.stats.vaoCount += 1
-        vertexArrayObject.bindVertexArray(null)
+        if (vertexArray) {
+            updateVertexArray(ctx, vertexArray, program, attributeBuffers, elementsBuffer)
+            ctx.stats.vaoCount += 1
+        } else {
+            console.warn('Could not create WebGL vertex array')
+        }
     }
     return vertexArray
 }
-- 
GitLab