MCPcopy Create free account
hub / github.com/gpujs/gpu.js / setUniform3fvTest

Function setUniform3fvTest

test/internal/kernel.js:200–223  ·  view source on GitHub ↗

* * @param {Kernel} Kernel

(Kernel)

Source from the content-addressed store, hash-verified

198 * @param {Kernel} Kernel
199 */
200function setUniform3fvTest(Kernel) {
201 const canvas = {};
202 const context = {
203 uniform3fv: () => {
204 if (throws) new Error('This should not get called');
205 },
206 getUniformLocation: (name) => {
207 return name;
208 }
209 };
210 const kernel = new Kernel('function() {}', { canvas, context, output: [1] });
211 let throws = false;
212 kernel.setUniform3fv('test', [1, 2, 3]);
213 assert.deepEqual(kernel.uniform3fvCache['test'], [1, 2, 3]);
214
215 throws = true;
216 kernel.setUniform3fv('test', [1, 2, 3]);
217 assert.deepEqual(kernel.uniform3fvCache['test'], [1, 2, 3]);
218
219 throws = false;
220 kernel.setUniform3fv('test', [2, 3, 4]);
221 assert.deepEqual(kernel.uniform3fvCache['test'], [2, 3, 4]);
222 kernel.destroy();
223}
224test('WebGLKernel.setUniform3fv only calls context when values change', () => {
225 setUniform3fvTest(WebGLKernel);
226});

Callers 1

kernel.jsFile · 0.85

Calls 2

destroyMethod · 0.95
setUniform3fvMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…