MCPcopy Index your code
hub / github.com/gpujs/gpu.js / testCloning

Function testCloning

test/internal/recycling.js:393–407  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

391});
392
393function testCloning(mode) {
394 const gpu = new GPU({ mode });
395 const kernel = gpu.createKernel(function(value) {
396 return value[0] + 1;
397 }, { output: [1], pipeline: true });
398 const texture = kernel([1]);
399 const { size } = texture;
400
401 // set size to something unique, for tracking
402 texture.size = [size[0] + 0.1, size[1] + 0.2];
403 texture.cloneTexture();
404 assert.equal(texture._framebuffer.width, size[0] + 0.1);
405 assert.equal(texture._framebuffer.height, size[1] + 0.2);
406 gpu.destroy();
407}
408
409(GPU.isWebGLSupported ? test : skip)('cloning sets up framebuffer with correct size webgl', () => {
410 testCloning('webgl');

Callers 1

recycling.jsFile · 0.85

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
cloneTextureMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…