Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('GPU.createKernel settings outputImmutable false', () => {
const gpu = new GPU();
const kernel = gpu.createKernel(function() {}, { outputImmutable: false });
assert.equal(kernel.immutable, false);
assert.notOk(kernel.kernel.hasOwnProperty('outputImmutable'));
gpu.destroy();
});
maxTextureSize: 9999
}
};
kernel.program = 'program';
assert.equal(kernel.constantTextureCount, 0);
kernel.setupConstants();
assert.equal(kernel.constantBitRatios.v, expectedBitRatio);
assert.equal(kernel.kernelConstants.length, 1);
kernel.kernelConstants[0].updateValue(constant);
assert.equal(kernel.constantTextureCount, expectedConstantTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}
maxTextureSize: 9999
}
};
kernel.program = 'program';
assert.equal(kernel.constantTextureCount, 0);
kernel.setupConstants();
assert.equal(kernel.constantBitRatios.v, expectedBitRatio);
assert.equal(kernel.kernelConstants.length, 1);
kernel.kernelConstants[0].updateValue(constant);
assert.equal(kernel.constantTextureCount, expectedConstantTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}
}
};
const args = [argument];
kernel.program = 'program';
assert.equal(kernel.argumentTextureCount, 0);
kernel.setupArguments(args);
assert.equal(kernel.argumentBitRatios[0], expectedBitRatio);
assert.equal(kernel.kernelArguments.length, 1);
kernel.kernelArguments[0].updateValue(argument);
assert.equal(kernel.argumentTextureCount, expectedArgumentTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}
};
const args = [argument];
kernel.program = 'program';
assert.equal(kernel.argumentTextureCount, 0);
kernel.setupArguments(args);
assert.equal(kernel.argumentBitRatios[0], expectedBitRatio);
assert.equal(kernel.kernelArguments.length, 1);
kernel.kernelArguments[0].updateValue(argument);
assert.equal(kernel.argumentTextureCount, expectedArgumentTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}
}
};
kernel.program = 'program';
assert.equal(kernel.constantTextureCount, 0);
kernel.setupConstants();
assert.equal(kernel.constantBitRatios.v, expectedBitRatio);
assert.equal(kernel.kernelConstants.length, 1);
kernel.kernelConstants[0].updateValue(constant);
assert.equal(kernel.constantTextureCount, expectedConstantTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}
}
};
kernel.program = 'program';
assert.equal(kernel.constantTextureCount, 0);
kernel.setupConstants();
assert.equal(kernel.constantBitRatios.v, expectedBitRatio);
assert.equal(kernel.kernelConstants.length, 1);
kernel.kernelConstants[0].updateValue(constant);
assert.equal(kernel.constantTextureCount, expectedConstantTextureCount);
assert.ok(texImage2DCalled);
assert.ok(activeTextureCalled);
assert.ok(bindTextureCalled);
assert.equal(texParameteriCalls, 4);
assert.equal(getUniformLocationCalls, 1);
assert.notOk(uniform3ivCalled);
assert.notOk(uniform2ivCalled);
assert.ok(uniform1iCalled);
}