mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-18 16:04:10 +00:00
feat: Consolidate subKernels rendering code as part of the renderStrategy fix: remove tabs, replace with spaces fix: make FunctionBuilder.fromKernel typing static fix: Add missing FunctionBuilder.getPrototypeString definition fix: Move building logic to kernelRunShortcut as well as exec method
34 lines
912 B
JavaScript
34 lines
912 B
JavaScript
const { assert, skip, test, module: describe, only } = require('qunit');
|
|
const { GPU } = require('../../src');
|
|
|
|
describe('issue #382');
|
|
|
|
function testModKernel(mode) {
|
|
const gpu = new GPU({ mode: mode });
|
|
const conflictingName = 0.4;
|
|
const kernel = gpu.createKernel(function(a, conflictingName) {
|
|
return a[this.thread.x] + this.constants.conflictingName + conflictingName;
|
|
})
|
|
.setOutput([1])
|
|
.setConstants({
|
|
conflictingName: conflictingName
|
|
});
|
|
|
|
const result = kernel([1], 0.6);
|
|
|
|
assert.equal(result[0], 2);
|
|
gpu.destroy();
|
|
}
|
|
|
|
(GPU.isWebGLSupported ? test : skip)('Issue #382 - bad constant webgl', () => {
|
|
testModKernel('webgl');
|
|
});
|
|
|
|
(GPU.isWebGL2Supported ? test : skip)('Issue #382 - bad constant webgl2', () => {
|
|
testModKernel('webgl2');
|
|
});
|
|
|
|
(GPU.isHeadlessGLSupported ? test : skip)('Issue #382 - bad constant headlessgl', () => {
|
|
testModKernel('headlessgl');
|
|
});
|