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

Function copy1DTexture

test/features/clone-textures.js:6–23  ·  view source on GitHub ↗
(precision, mode)

Source from the content-addressed store, hash-verified

4describe('features: clone textures');
5
6function copy1DTexture(precision, mode) {
7 const gpu = new GPU({ mode });
8 function makeTexture() {
9 return (gpu.createKernel(function() {
10 return this.thread.x;
11 }, {
12 output: [5],
13 pipeline: true,
14 precision
15 }))();
16 }
17 const texture = makeTexture();
18 const clone = texture.clone();
19 assert.notEqual(texture, clone);
20 assert.equal(texture.texture, clone.texture);
21 assert.deepEqual(texture.toArray(), clone.toArray());
22 gpu.destroy();
23}
24
25test('1D unsigned precision auto', () => {
26 copy1DTexture('unsigned');

Callers 1

clone-textures.jsFile · 0.85

Calls 4

destroyMethod · 0.95
makeTextureFunction · 0.70
cloneMethod · 0.45
toArrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…