ladybird
ladybird copied to clipboard
LibWeb: Start implementing WebGL 2.0
A lot of stubs here! But it does create a context when the skia gpu is enabled. ...which it's not in our test runner. makes it a bit hard to test this stuff eh.
The createContext("webgl") test does pass when run through the GUI though :D
I tried loading this WebGL fluid simulation: https://paveldogreat.github.io/WebGL-Fluid-Simulation/ ...and it appears the context is still null.
This is how their javascript is getting the WebGL context:
const params = { alpha: true, depth: false, stencil: false, antialias: false, preserveDrawingBuffer: false };
let gl = canvas.getContext('webgl2', params);
const isWebGL2 = !!gl;
if (!isWebGL2)
gl = canvas.getContext('webgl', params) || canvas.getContext('experimental-webgl', params);
(with canvas coming from document.getElementsByTagName('canvas')[0])