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

Function test1D

test/features/constants-texture.js:5–26  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

3
4describe('features: constants texture 1d');
5function test1D(mode) {
6 const gpu = new GPU({ mode });
7 const createTexture = gpu
8 .createKernel(function() {
9 return 200;
10 })
11 .setOutput([2])
12 .setPipeline(true);
13 const texture = createTexture();
14 const tryConst = gpu.createKernel(
15 function() {
16 return this.constants.texture[this.thread.x];
17 },
18 {
19 constants: { texture }
20 }
21 ).setOutput([2]);
22 const result = tryConst();
23 const expected = new Float32Array([200, 200]);
24 assert.deepEqual(result, expected, 'texture constant passed test');
25 gpu.destroy();
26}
27
28test('auto', () => {
29 test1D(null);

Callers 1

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
setPipelineMethod · 0.80
setOutputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…