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

Function setUniform2fvTest

test/internal/kernel.js:162–185  ·  view source on GitHub ↗

* * @param {Kernel} Kernel

(Kernel)

Source from the content-addressed store, hash-verified

160 * @param {Kernel} Kernel
161 */
162function setUniform2fvTest(Kernel) {
163 const canvas = {};
164 const context = {
165 uniform2fv: () => {
166 if (throws) new Error('This should not get called');
167 },
168 getUniformLocation: (name) => {
169 return name;
170 }
171 };
172 const kernel = new Kernel('function() {}', { canvas, context, output: [1] });
173 let throws = false;
174 kernel.setUniform2fv('test', [1, 2]);
175 assert.deepEqual(kernel.uniform2fvCache['test'], [1, 2]);
176
177 throws = true;
178 kernel.setUniform2fv('test', [1, 2]);
179 assert.deepEqual(kernel.uniform2fvCache['test'], [1, 2]);
180
181 throws = false;
182 kernel.setUniform2fv('test', [2, 3]);
183 assert.deepEqual(kernel.uniform2fvCache['test'], [2, 3]);
184 kernel.destroy();
185}
186test('WebGLKernel.setUniform2fv only calls context when values change', () => {
187 setUniform2fvTest(WebGLKernel);
188});

Callers 1

kernel.jsFile · 0.85

Calls 2

destroyMethod · 0.95
setUniform2fvMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…