|
@@ -7,7 +7,7 @@
|
|
|
import { ShaderCode, DefineValues, addShaderDefines } from '../shader-code';
|
|
|
import { WebGLState } from './state';
|
|
|
import { WebGLExtensions } from './extensions';
|
|
|
-import { getUniformSetters, UniformsList, getUniformType, UniformSetters } from './uniform';
|
|
|
+import { getUniformSetters, UniformsList, getUniformType, UniformSetters, isArrayUniform } from './uniform';
|
|
|
import { AttributeBuffers, getAttribType } from './buffer';
|
|
|
import { TextureId, Textures } from './texture';
|
|
|
import { idFactory } from '../../mol-util/id-factory';
|
|
@@ -41,7 +41,14 @@ function getLocations(gl: GLRenderingContext, program: WebGLProgram, schema: Ren
|
|
|
|
|
|
|
|
|
locations[k] = loc;
|
|
|
- } else if (spec.type === 'uniform' || spec.type === 'texture') {
|
|
|
+ } else if (spec.type === 'uniform') {
|
|
|
+ let loc = gl.getUniformLocation(program, k);
|
|
|
+
|
|
|
+ if (loc === null && isArrayUniform(spec.kind)) loc = gl.getUniformLocation(program, k + '[0]');
|
|
|
+
|
|
|
+
|
|
|
+ locations[k] = loc as number;
|
|
|
+ } else if (spec.type === 'texture') {
|
|
|
const loc = gl.getUniformLocation(program, k);
|
|
|
|
|
|
|