gpujs/gpu.js

WebGL kernel feature checks may throw an error

jbghoul opened this issue · 0 comments

A GIF or MEME to give some spice of the internet

What is wrong?

WebGL kernel feature checks may throw an error

Where does it happen?

In WebGLKernel.setupFeatureChecks when trying to check if WebGL 1 kernel is supported

How do we replicate the issue?

prerequisite:

  • global variable document must be undefined

  • OffscreenCanvas class should be define

  • offsetCanvas.getContext('webgl') should not be truthly

  • compute GPU.isWebGLSupported

  • then, offsetCanvas.getContext('experimental-webgl') will throw an error

In Chrome you can directly test this case in console:

image

How important is this (1-5)?

2

Expected behavior (i.e. solution)

WebGLKernel.setupFeatureChecks should return without throwing exception.

testCanvas.getContext('experimental-webgl') should not be called on OffscreenCanvas

Other Comments