Architosh

Apple’s WebGPU Standard Proposal—Aiming at Common Access to Explicit Graphics

In a post called “Next-generation 3D Graphics on the Web,” Dean Jackson of Apple’s WebKit team has called for a new industry community group at the W3C to discuss and develop a new standard API that leverages modern GPUs. Jackson not only shares a new API proposal but also offers a prototype of that API and one that chooses Apple’s Metal shading language as a temporary default placeholder.

Jackson’s post succinctly summarizes the history of API-based graphics on the web and arrives at the point of contention—today’s modern GPUs are being leveraged by a new generation of performant system graphics API technologies but none of them is available across platforms.

Fighting Against A Future of Incompatibilities

However, this is in sharp contrast to WebGL which runs in your browser as JavaScript and makes calls ultimately to the universal—but high overhead—OpenGL, a graphics API which runs across all major operating systems and devices, from desktop to smartphone to game console. (see image 01)

Key Takeaway

Apple has proposed a new web graphics API that can tap into the power of modern GPUs and non-universal (proprietary) low-level APIs such as Microsoft’s Direct3D 12, Apple’s own Metal, and the industry open Vulkan API. If successful, the new API will have the same universality as WebGL and operate across modern web browsers but on systems with divergent underlying graphics technology.

Today’s modern GPUs have a family of rival APIs that remove the code-level abstraction that makes OpenGL so easy to support across so many diverse operating systems and devices. In short, fewer lines of code can run to implement both graphics and compute-based workloads, making these competing and non-compatible platform APIs appealing to developers who want to eek out maximum performance. The major graphics platform technologies in this space are Apple’s Metal, Microsoft’s Direct3D 12, and Vulkan API from the Khronos Group.

01 – WebGL 1.0 is currently highly utilized and enables professional apps like Onshape and Frame to run in modern web browsers across many operating systems. It works well because it taps into the openness of OpenGL.

For web application developers to benefit from these three competing graphics API technologies, a new API for the web must be written that supplements WebGL. Jackson summarizes: “In order to expose a modern, low-level technology that can accelerate graphics and computation we need to design an API that can be implemented on top of many systems, including those mentioned above.”

Apple’s WebKit team has formed a new W3C Community Group named “GPU for the Web” and it is now open for membership. But who exactly will join this group?

Apple Rejects Vulkan Standard

A new industry standard is only as good as the size of the industry that stands behind it. And it only takes one major player to alter the landscape of consensus and adoption. In the case of those three major platform technologies above, Apple chose to not support the Vulkan API technology the industry, via the Khronos Group, shepherded into existence, while Microsoft did support it.

MORE: SIG: Apple looks to be going the path of ‘Metal’ for graphics—seems out on Vulkan standard

In other words, Vulkan had the chance to be the “lower level graphics API” equivalent of the universal “OpenGL graphics standard” that makes WebGL possible and universally adopted. But Vulkan doesn’t work on Apple’s platforms natively without running a Vulkan to Metal wrapper. So Apple’s WebKit team is aiming to rectify this in the form of the new proposed API—complete with two years of developmental sample code.

Apple calls its experiment towards this new standard: “WebGPU.”

Khronos Group and Industry Consensus

So there we have it. Apple has taken bold but important steps towards the creation of a new open standard similar to WebGL but to the side of it, that enables access to low-level API technologies like Direct3D, Vulkan, and Metal. (see image 02)

The success of this effort will largely depend on whether or not another competing effort takes hold and if both Apple and Microsoft, in particular, can cooperate on such a new standard.

02 – Apple’s proposed and temporary named WebGPU API standard would not tap into OpenGL but instead create a universal layer that can tap the power of varying underlying low-level, explicit APIs like Vulkan or Direct3D or Apple’s own Metal.

In communicating with Neil Trevett, VP of Nvidia and President of the Khronos Group, he wrote: “Khronos is committed to the creation of open standard GPU APIs that are effective for both native and Web developers.” “Khronos has a successful track record of creating and contributing standards for the Web community…”

Trevett also makes note that tight design cooperation between the GPU and browser communities has enabled the success of WebGL. “Khronos has a long history of bringing these two communities together under one proven IP framework,” he adds. While the W3C industry group is also a proven force in industry change around the Web, Trevett notes—as does Jackson in his post—that there is not yet industry consensus on the direction around a new generation of low-level, explicit APIs.

“Experience developing WebGL,” says Trevett, “has shown that it’s important to have web API experts, GPU vendors, and native API experts all at the table when designing such an API.” And Apple’s Jackson notes that: “Its design should fit with established patterns of the Web, to make it easy for developers to adopt the technology. It needs to be able to work well with other critical emerging web standards like WebAssembly and WebVR.”

For the sake of all users of the web let’s hope that consensus forms soon. Tapping the power of low-level, explicit APIs can offer exciting performance improvements.

Joining and Learning More

For those interested in Apple’s proposal they can read more here or join the new industry group and get involved. Jackson announced the new group on 7 February 2017. After just one week the new WC3 Community Group has 90 members.

Other Reading

For those interested in Apple’s swaying commitments to Vulkan and its decision to go with Metal instead, this thread in the Apple Developer Forums offers some interesting information. Especially important is the discovery that Apple’s Metal is higher level than Vulkan and more accessible.

Exit mobile version