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

Function rawUnsignedPrecisionRenderOutput

test/features/raw-output.js:6–20  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

4describe('features: raw output');
5
6function rawUnsignedPrecisionRenderOutput(mode) {
7 const gpu = new GPU({ mode });
8 const kernel = gpu.createKernel(function(v) {
9 return v[this.thread.x];
10 }, {
11 output: [1],
12 precision: 'unsigned',
13 });
14 kernel.build([1]);
15 kernel.run([1]);
16 const result = kernel.renderRawOutput();
17 assert.equal(result.constructor, Uint8Array);
18 assert.deepEqual(result, new Uint8Array(new Float32Array([1]).buffer));
19 gpu.destroy();
20}
21
22test('raw unsigned precision render output auto', () => {
23 rawUnsignedPrecisionRenderOutput();

Callers 1

raw-output.jsFile · 0.85

Calls 5

createKernelMethod · 0.95
destroyMethod · 0.95
buildMethod · 0.45
runMethod · 0.45
renderRawOutputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…