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

Function testGetFeatures

test/internal/backend/gl-kernel.js:265–288  ·  view source on GitHub ↗
(canvas, context)

Source from the content-addressed store, hash-verified

263});
264
265function testGetFeatures(canvas, context) {
266 const gpu = new GPU({ canvas, context });
267 const { Kernel } = gpu;
268 Kernel.setupFeatureChecks();
269 const features = Kernel.getFeatures();
270 assert.ok(typeof features.isFloatRead === 'boolean');
271 assert.ok(typeof features.isIntegerDivisionAccurate === 'boolean');
272 assert.ok(typeof features.isSpeedTacticSupported === 'boolean');
273 assert.ok(typeof features.isTextureFloat === 'boolean');
274 assert.ok(typeof features.isDrawBuffers === 'boolean');
275 assert.ok(typeof features.kernelMap === 'boolean');
276 assert.ok(typeof features.channelCount === 'number');
277 assert.ok(typeof features.maxTextureSize === 'number');
278
279 assert.ok(typeof features.lowIntPrecision.rangeMax === 'number');
280 assert.ok(typeof features.mediumIntPrecision.rangeMax === 'number');
281 assert.ok(typeof features.highIntPrecision.rangeMax === 'number');
282
283 assert.ok(typeof features.lowFloatPrecision.rangeMax === 'number');
284 assert.ok(typeof features.mediumFloatPrecision.rangeMax === 'number');
285 assert.ok(typeof features.highFloatPrecision.rangeMax === 'number');
286
287 gpu.destroy();
288}
289
290(GPU.isWebGLSupported ? test : skip)('getFeatures() webgl', () => {
291 const canvas = document.createElement('canvas');

Callers 1

gl-kernel.jsFile · 0.85

Calls 3

destroyMethod · 0.95
setupFeatureChecksMethod · 0.45
getFeaturesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…