From e899042a48bacb317cf61296ce1135ca8d509ed0 Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Thu, 28 Mar 2019 10:52:43 -0700 Subject: [PATCH] ignore active attribute/uniform checks with gl.shim --- src/mol-gl/_spec/gl.shim.ts | 6 ++---- src/mol-gl/webgl/program.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mol-gl/_spec/gl.shim.ts b/src/mol-gl/_spec/gl.shim.ts index d4242f5a1..b593beef4 100644 --- a/src/mol-gl/_spec/gl.shim.ts +++ b/src/mol-gl/_spec/gl.shim.ts @@ -1,5 +1,3 @@ - - /** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * @@ -679,14 +677,14 @@ export function createGl(width: number, height: number, contextAttributes: WebGL return { size: 1, type: gl.INT_VEC3, - name: `activeUniform${index}`, + name: `__activeUniform${index}`, }; }, getActiveAttrib: function (program: WebGLProgram, index: number) { return { size: 1, type: gl.FLOAT, - name: `activeAttrib${index}` + name: `__activeAttrib${index}` }; }, clear: function () { }, diff --git a/src/mol-gl/webgl/program.ts b/src/mol-gl/webgl/program.ts index 883bf8ca2..a4d842095 100644 --- a/src/mol-gl/webgl/program.ts +++ b/src/mol-gl/webgl/program.ts @@ -55,6 +55,10 @@ function checkActiveAttributes(ctx: WebGLContext, program: WebGLProgram, schema: const info = gl.getActiveAttrib(program, i); if (info) { const { name, type } = info + if (name.startsWith('__activeAttribute')) { + // name assigned by `gl.shim.ts`, ignore for checks + continue + } const spec = schema[name] if (spec === undefined) { throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`) @@ -77,6 +81,10 @@ function checkActiveUniforms(ctx: WebGLContext, program: WebGLProgram, schema: R const info = gl.getActiveUniform(program, i); if (info) { const { name, type } = info + if (name.startsWith('__activeUniform')) { + // name assigned by `gl.shim.ts`, ignore for checks + continue + } const spec = schema[name] if (spec === undefined) { throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`) -- GitLab