(mode)
| 4 | describe('features: raw output'); |
| 5 | |
| 6 | function 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 | |
| 22 | test('raw unsigned precision render output auto', () => { |
| 23 | rawUnsignedPrecisionRenderOutput(); |
no test coverage detected
searching dependent graphs…