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

Method setupFeatureChecks

src/backend/web-gl2/kernel.js:41–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 static setupFeatureChecks() {
42 if (typeof document !== 'undefined') {
43 testCanvas = document.createElement('canvas');
44 } else if (typeof OffscreenCanvas !== 'undefined') {
45 testCanvas = new OffscreenCanvas(0, 0);
46 }
47 if (!testCanvas) return;
48 testContext = testCanvas.getContext('webgl2');
49 if (!testContext || !testContext.getExtension) return;
50 testExtensions = {
51 EXT_color_buffer_float: testContext.getExtension('EXT_color_buffer_float'),
52 OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'),
53 };
54 features = this.getFeatures();
55 }
56
57 static isContextMatch(context) {
58 // from global

Callers 1

isSupportedMethod · 0.95

Calls 1

getFeaturesMethod · 0.95

Tested by

no test coverage detected