Open
Description
Currently, WebGL 1.0, WebGL 2.0, and WebGPU can't be split into separate modules as targets, as enum RenderingContext
wraps all available context types and needs to have all of them in scope.
If RenderingContext
were a protocol, we could declare it in some "base" module and move GPUCanvasContext
, WebGLRenderingContext
, and WebGL2RenderingContext
to their own respective modules adding a conformance on them to that protocol.
I also thought about subclassing, but that clearly won't work due to the lack of multiple class inheritance. These types already inherit from JSBridgedClass
, and protocols are the suggested instruments of achieving multiple inheritance in Swift.