feat(webcodecs): don't use software-based WebGL

This commit is contained in:
Simon Chan 2024-03-12 22:10:32 +08:00
parent 28d650f63a
commit b2be4893e9
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD

View file

@ -28,8 +28,14 @@ void main(void) {
constructor(canvas: HTMLCanvasElement) {
const gl =
canvas.getContext("webgl2", { alpha: false }) ||
canvas.getContext("webgl", { alpha: false });
canvas.getContext("webgl2", {
alpha: false,
failIfMajorPerformanceCaveat: true,
}) ||
canvas.getContext("webgl", {
alpha: false,
failIfMajorPerformanceCaveat: true,
});
if (!gl) {
throw new Error("WebGL not supported");
}