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

Method setupFeatureChecks

src/backend/web-gl/kernel.js:58–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 }
57
58 static setupFeatureChecks() {
59 if (typeof document !== 'undefined') {
60 testCanvas = document.createElement('canvas');
61 } else if (typeof OffscreenCanvas !== 'undefined') {
62 testCanvas = new OffscreenCanvas(0, 0);
63 }
64 if (!testCanvas) return;
65 testContext = testCanvas.getContext('webgl') || testCanvas.getContext('experimental-webgl');
66 if (!testContext || !testContext.getExtension) return;
67 testExtensions = {
68 OES_texture_float: testContext.getExtension('OES_texture_float'),
69 OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'),
70 OES_element_index_uint: testContext.getExtension('OES_element_index_uint'),
71 WEBGL_draw_buffers: testContext.getExtension('WEBGL_draw_buffers'),
72 };
73 features = this.getFeatures();
74 }
75
76 static isContextMatch(context) {
77 if (typeof WebGLRenderingContext !== 'undefined') {

Callers 1

isSupportedMethod · 0.95

Calls 1

getFeaturesMethod · 0.45

Tested by

no test coverage detected