From efc17bb504b6c2bbc208b1d919aad59b519ee415 Mon Sep 17 00:00:00 2001 From: Adrian Cirstei Date: Tue, 22 Feb 2022 11:41:44 +0200 Subject: [PATCH] added support for `uniform1fv` --- src/uniforms/uniforms.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/uniforms/uniforms.ts b/src/uniforms/uniforms.ts index 667ba17..5d46b09 100644 --- a/src/uniforms/uniforms.ts +++ b/src/uniforms/uniforms.ts @@ -81,6 +81,15 @@ export class Uniform { } } break; + case UniformMethod.Uniform1fv: + this.apply = (gl: WebGLRenderingContext | WebGL2RenderingContext, program: WebGLProgram) => { + if (this.dirty) { + gl.useProgram(program); + const location = gl.getUniformLocation(program, this.key); + (gl as any)[this.method].apply(gl, [location].concat([this.values])); + } + } + break; default: this.apply = (gl: WebGLRenderingContext | WebGL2RenderingContext, program: WebGLProgram) => { if (this.dirty) {