WebGPU: Difference between revisions

Content deleted Content added
Implementations: Clarified API mentioned in source.
Tags: Mobile edit Mobile web edit
m Firefox first release statement format align to Chrome and Safari.
 
(22 intermediate revisions by 13 users not shown)
Line 2:
{{Infobox technology standard
| title = WebGPU
| image = WebGPU logo.svg
|Status status = [[World Wide Web Consortium#WorkingCandidate draftrecommendation (WDCR)|WorkingCandidate Draftrecommendation (WDCR)]]
| year_started = {{Start date|2021|05|18|df=y}}
| first_published = {{Start date|2021|05|18|df=y}}
| version = W3C WorkingCandidate Draftrecommendation
| version_date = {{Start date|(As of 20232025)}}
| organization = [[World Wide Web Consortium|W3C]]
| editors = {{Plainlist|
* Kai Ninomiya
* Justin Fan
* Brandon Jones
* Jim Blandy
* Dzmitry Malyshau
* Myles C. Maxfield (former)
* Dzmitry Malyshau (former)
* Kai Ninomiya
* Justin Fan (former)
}}
}}<ref>{{cite web | title=WebGPU: W3C Candidate Recommendation Draft | url=https://www.w3.org/TR/webgpu/}}</ref>
| ___domain = {{Plainlist|
* [[General-purpose computing on graphics processing units|GPU computing]]
Line 32 ⟶ 34:
}}
 
'''WebGPU API''' is a [[JavaScript]], [[APIRust (programming language)|Rust]] provided by a, [[web browserC++]], that enablesand [[webC page(programming language)|webpageC]] scripts[[API]] tofor efficientlycross-platform utilize a device'sefficient [[graphics processing unit]] (GPU) access. ThisUsing isa achieved with thesystem's underlying [[Vulkan]], [[Metal (API)|Metal]], or [[Direct3D 12]] systemtechnologies, APIs.WebGPU Onallows relevantfor devicesgraphics processing, games, and more, as well as AI and machine learning applications. WebGPU is intended to supersede the older [[WebGL]] as the main graphics standard for the Web.<ref name="chrome113"/>
 
In JavaScript, WebGPU can be provided by a [[web browser]] or other JavaScript environment like [[Node.js]] and [[Deno (software)|Deno]]. Rust and C++ can use their respective implementations of the WebGPU specification. Other languages like [[Python (programming language)|Python]], [[Java (programming language)|Java]], and [[Go (programming language)|Go]] can use WebGPU by extending the C language specification.
[[Google Chrome]] enabled initial WebGPU support in April 2023.<ref name="chrome113"/><ref name = "officialStatus"/> [[Safari (web browser)|Safari]] and [[Firefox]] have not yet enabled theirs.<ref name = "officialStatus">{{cite web |title=WebGPU Implementation Status |url=https://github.com/gpuweb/gpuweb/wiki/Implementation-Status |website=GitHub |access-date=14 March 2024}}</ref> The [[W3C]] standard is thus in the working draft phase.
 
[[Google Chrome]] enabledand [[Microsoft Edge]] first initialreleased WebGPU support in April 2023.<ref name="chrome113"/><ref name = "officialStatus"/> [[Safari (web browser)|Safari]] anddebuted WebGPU support in June 2025 with Safari 26.<ref>{{cite web |title=Safari 26.0 Beta Release Notes |url=https://developer.apple.com/documentation/safari-release-notes/safari-26-release-notes#WebGPU |access-date=July 11, 2025}}</ref> [[Firefox]] havefirst notreleased yetWebGPU enabledin July 2025 with Firefox theirs141.<ref name = "officialStatus">{{cite web |title=WebGPU Implementation Status |url=https://github.com/gpuweb/gpuweb/wiki/Implementation-Status |website=GitHub |access-date=14June March16, 20242025}}</ref> The [[W3C]] standard is thus in the workinga draftcandidate phaserecommendation.
 
==Technology==
WebGPU enables 3D graphics within an [[HTML]] [[Canvas element|canvas]]. It also has robust support for [[General-purpose computing on graphics processing units|general-purpose GPU]] computations.<ref>{{cite web |title=WebGPU API |url=https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API |website=developer.mozilla.org |access-date=17 March 2024}}</ref>
 
WebGPU uses its own [[shading language]] called [[WebGPU Shading language#Language|WebGPU Shading Language| (WGSL)]] that was designed to be trivially translatable to [[SPIR-V]], until complaints caused redirection into a more traditional design, similar to other shading languages. The syntax is similar to [[Rust (programming language)|Rust]].<ref>[{{Cite web |title=WebGPU Shading Language |url=https://gpuweb.github.io/gpuweb/wgsl/ WebGPU|access-date=2025-07-17 Shading|website=gpuweb.github.io Language specification]|language=en}}</ref> Tint is a [[Google]]-made [[compiler]] for WGSL.<ref>[{{Cite web |title=tint - Git at Google |url=https://dawn.googlesource.com/tint Tint|access-date=2025-07-17 source code]|website=dawn.googlesource.com}}</ref> Naga is a similar project developed for the needs of wgpu-rs.<ref>[{{Citation |title=gfx-rs/wgpu/naga |date=2025-08-06 |url=https://github.com/gfx-rs/wgpu/tree/trunk/naga Naga|access-date=2025-08-08 source|publisher=Rust code]Graphics Mages}}</ref>
 
==Implementations==
Both [[Google Chrome]] and [[Firefox]] support WebGPU with SPIR-V, with work ongoing for theand WGSL front-end. Firefox and [[Deno (software)|Deno]] use the Rust wgpu library.<ref>{{Citation |title=wgpu |date=2024-01-03 |url=https://github.com/gfx-rs/wgpu |access-date=2024-01-03 |publisher=Rust Graphics Mages}}</ref> [[Safari (web browser)|Safari]] follows upstream specifications of both WebGPU and WGSL.<ref name = "officialStatus"/>
 
Chrome version 113 enabled initial WebGPU support on [[Microsoft Windows|Windows]] devices with [[Direct3D|Direct3D 12]], [[ChromeOS]] devices with [[Vulkan]], and [[macOS]] with [[Metal (API)|Metal]].<ref name="chrome113">{{Cite web |title=Chrome ships WebGPU |url=https://developer.chrome.com/blog/webgpu-release/ |access-date=2023-04-08 |website=Chrome Developers |language=en}}</ref> This support for [[Android (operating system)|Android]] was enabled in version 121.<ref name = "officialStatus"/>
Line 75 ⟶ 79:
 
On June 1, 2018, citing "resolution on most-high level issues" in the cross-browser standardization effort, Google's [[Google Chrome|Chrome]] team announced intent to implement the future WebGPU standard.<ref name="blink-i2i"/>
 
On 13 February, 2020, Google unveiled Tint as an alternative to WHLSL textual language proposal to WebGPU API, and the language eventually became the standardized [[WebGPU Shading Language|WebGPU Shading Language (WGSL)]], and Tint became the name of compiler within Dawn, the WebGPU implementation of Chromium.
 
==References==