Browse Source

simplify array uniform check

Sebastian Bittrich 3 years ago
parent
commit
cbc941f193
1 changed files with 1 additions and 5 deletions
  1. 1 5
      src/mol-gl/webgl/uniform.ts

+ 1 - 5
src/mol-gl/webgl/uniform.ts

@@ -43,11 +43,7 @@ export function getUniformType(gl: GLRenderingContext, kind: UniformKind) {
 }
 
 export function isArrayUniform(kind: UniformKind) {
-    switch (kind) {
-        case 'b[]': case 'f[]': case 'i[]': case 'v2[]': case 'v3[]': case 'v4[]': case 'm3[]': case 'm4[]': return true;
-        case 'b': case 'f': case 'i': case 'v2': case 'v3': case 'v4': case 'm3': case 'm4': return false;
-        default: console.error(`unknown uniform kind '${kind}'`);
-    }
+    return kind.endsWith('[]');
 }
 
 export type UniformSetter = (gl: GLRenderingContext, location: number, value: any) => void