webGPU
From angle (OpenGL ES 3.0) to Dawn (WebGPU -> Vulkan).
https://github.com/google/angle
https://github.com/gpuweb/gpuweb
https://developer.chrome.com/blog/webgpu-io2023/
WebGL
landed in Chrome in 2011
.
By allowing web applications to take advantage of GPUs,
WebGL enables amazing experiences on the web—from Google Earth, to interactive music videos, to 3D real-estate walkthroughs and more.
WebGL was based on the OpenGL family of APIs first developed in 1992.
That's a long time ago! And you can imagine that GPU hardware has evolved significantly since that time.
To keep up with this evolution, a new breed of APIs were developed to more efficiently interact with modern GPU hardware.
APIs like Direct3D 12
, Metal
, and Vulkan
.
These new APIs have supported new and demanding use cases for GPU programming such as the explosion in machine learning and advances in rendering algorithms.
WebGPU
is the successor
to WebGL
bringing the advancements of this new class of modern APIs to the Web.
WebGPU unlocks a lot of new GPU programming possibilities in the browser.
It better reflects how modern GPU hardware works, while also laying a foundation for more advanced GPU capabilities in the future.
The API has been baking in the W3C’s "GPU for the Web" group since 2017
,
and is a collaboration between many companies such as Apple, Google, Mozilla, Microsoft, and Intel.
And now after 6 years of work, we’re excited to announce that one of the biggest additions to the Web platform is finally available!
https://developer.chrome.com/blog/webgpu-release/
2023
The Chrome team is thrilled to announce that WebGPU is now available by default in Chrome 113,
which is currently in the Beta channel. WebGPU is a new web graphics API that offers
significant benefits such as greatly reduced JavaScript workload for the same graphics and
more than three times improvements in machine learning model inferences.
This is possible due to more flexible GPU programming and access to advanced capabilities that WebGL does not provide.
This initial release of WebGPU is available on ChromeOS, macOS, and Windows.
Support for other platforms is coming later this year.
WebGPU is a new API for the web, which exposes modern hardware capabilities and
allows rendering and computation operations on a GPU, similar to Direct3D 12, Metal, and Vulkan.
Unlike the WebGL family of APIs, WebGPU offers access to more advanced GPU features and provides first-class support
for general computations on the GPU. The API is designed with the web platform in mind, featuring an idiomatic JavaScript API,
integration with promises, support for importing videos, and a polished developer experience with great error messages.
Dawn, a WebGPU implementation
Dawn (formerly NXT) is an open-source and cross-platform implementation of the work-in-progress WebGPU standard.
It exposes a C/C++ API that maps almost one-to-one to the WebGPU IDL and can be managed as part of a larger system such as a Web browser.
Dawn provides several WebGPU building blocks:
- WebGPU C/C++ headers that applications and other building blocks use.
- The main C header for the WebGPU API.
- Definition of a structure of all function pointers for this specific Dawn version (called “proctable”).
- A C++ wrapper for the C header.
- A “native” implementation of WebGPU using platforms' GPU APIs:
- D3D12 on Windows 10
- Metal on OSX (and eventually iOS)
- Vulkan on Windows, Linux (eventually ChromeOS, Android and Fuchsia too)
- OpenGL as best effort where available
- A client-server implementation of WebGPU for applications that are in a sandbox without access to native drivers
- A Dawn proc-table backend implementation of WebGPU for applications what want to be able to switch at runtime between native or client-server mode.
https://developer.chrome.com/blog/webgpu-cross-platform/
WebGPU is first and foremost the result of a collaborative
effort including major companies such as
Apple, Google, Intel, Mozilla, and Microsoft.
Among them, some realized that WebGPU could be more than a Javascript API but
a cross-platform graphics API that could be used by developers across ecosystems
other than the web.
To fulfill the primary goal, a JavaScript API was introduced in Chrome 113.
However, another significant project has been developed alongside it: the webgpu.h
C API.
This C header file lists all the available procedures and data structures of WebGPU.
It serves as a platform-agnostic hardware abstraction layer
, allowing you to build platform-specific applications
by providing a consistent interface across different platforms.
Intermediate Graphics Library (IGL)
https://github.com/facebook/igl
Intermediate Graphics Library (IGL) is a cross-platform library that commands the GPU.
It encapsulates common GPU functionality with a low-level cross-platform interface.
IGL is designed to support multiple backends implemented on top of various graphics APIs (e.g. OpenGL, Metal and Vulkan) with a common interface.
There are a lot of good options for abstracting GPU API's;
each making different trade-offs. We designed IGL around the following priorities:
- Low-level, forward-looking API. IGL embraces modern abstractions (command buffers, state containers, bindless, etc) and is designed to give more control than OpenGL's state machine API. As a result, IGL can have leaner backends for modern API's (e.g. Metal, Vulkan).
- Minimal overhead for C++. IGL supports new or existing native rendering code without overhead of language interop or the need for other language runtimes.
- Reach + scale in production. IGL has been globally battle-tested for broad device reliability (especially the long-tail of Android devices as well as Quest 2/3/Pro compatibility for OpenGL/Vulkan) and performance-tuned on our apps.