Skip to content
Snippets Groups Projects
Commit e899042a authored by Alexander Rose's avatar Alexander Rose
Browse files

ignore active attribute/uniform checks with gl.shim

parent 2a25e0ab
No related branches found
No related tags found
No related merge requests found
/** /**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * 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 ...@@ -679,14 +677,14 @@ export function createGl(width: number, height: number, contextAttributes: WebGL
return { return {
size: 1, size: 1,
type: gl.INT_VEC3, type: gl.INT_VEC3,
name: `activeUniform${index}`, name: `__activeUniform${index}`,
}; };
}, },
getActiveAttrib: function (program: WebGLProgram, index: number) { getActiveAttrib: function (program: WebGLProgram, index: number) {
return { return {
size: 1, size: 1,
type: gl.FLOAT, type: gl.FLOAT,
name: `activeAttrib${index}` name: `__activeAttrib${index}`
}; };
}, },
clear: function () { }, clear: function () { },
......
...@@ -55,6 +55,10 @@ function checkActiveAttributes(ctx: WebGLContext, program: WebGLProgram, schema: ...@@ -55,6 +55,10 @@ function checkActiveAttributes(ctx: WebGLContext, program: WebGLProgram, schema:
const info = gl.getActiveAttrib(program, i); const info = gl.getActiveAttrib(program, i);
if (info) { if (info) {
const { name, type } = info const { name, type } = info
if (name.startsWith('__activeAttribute')) {
// name assigned by `gl.shim.ts`, ignore for checks
continue
}
const spec = schema[name] const spec = schema[name]
if (spec === undefined) { if (spec === undefined) {
throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`) throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`)
...@@ -77,6 +81,10 @@ function checkActiveUniforms(ctx: WebGLContext, program: WebGLProgram, schema: R ...@@ -77,6 +81,10 @@ function checkActiveUniforms(ctx: WebGLContext, program: WebGLProgram, schema: R
const info = gl.getActiveUniform(program, i); const info = gl.getActiveUniform(program, i);
if (info) { if (info) {
const { name, type } = info const { name, type } = info
if (name.startsWith('__activeUniform')) {
// name assigned by `gl.shim.ts`, ignore for checks
continue
}
const spec = schema[name] const spec = schema[name]
if (spec === undefined) { if (spec === undefined) {
throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`) throw new Error(`missing 'uniform' or 'texture' with name '${name}' in schema`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment