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

Function arrayTexture3

test/internal/deep-types.js:360–386  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

358});
359
360function arrayTexture3(mode) {
361 const gpu = new GPU({ mode });
362 function addOne(functionValue) {
363 const declaredValue = functionValue[this.thread.x];
364 return declaredValue[0] + 1
365 + declaredValue[1] + 1
366 + declaredValue[2] + 1;
367 }
368 gpu.addFunction(addOne);
369 const texture1 = gpu.createKernel(function() {
370 return [1,2,3];
371 }, {
372 output: [1],
373 precision: 'single',
374 pipeline: true,
375 })();
376 if (mode !== 'cpu') {
377 assert.equal(texture1.type, 'ArrayTexture(3)');
378 }
379
380 const kernel = gpu.createKernel(function(kernelValue) {
381 return addOne(kernelValue);
382 }, { output: [1] });
383 const result = kernel(texture1);
384 assert.equal(result[0], 9);
385 gpu.destroy();
386}
387
388(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) auto', ()=> {
389 arrayTexture3();

Callers 1

deep-types.jsFile · 0.85

Calls 5

addFunctionMethod · 0.95
createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
addOneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…