WebGPU
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Changelog for WebGPU in Chromium / Dawn 96 Chromium's WebGPU implementation and Dawn's API try to closely follow changes to the WebGPU specification. When the WebGPU IDL changes, Chromium and Dawn will try to support both the deprecated and the new version of the IDL at the same time so prototypes can be updated. In JavaScript, uses of the deprecated path will result in a console warning, while when using Dawn directly, the deprecated path will print a warning to stderr. Note that all changes to Dawn's API make it closer to [`webgpu.h`](https://github.com/webgpu-native/webgpu-headers/blob/master/webgpu.h) that we hope will allow applications to target both [Dawn](https://dawn.googlesource.com/dawn), and [wgpu](https://github.com/gfx-rs/wgpu/) in native before being compiled in WASM. Emscripten will also be updated from the "old" to the "new" API but won't have a smooth transition since developers control which version of emscripten they use. Items deprecated in this changelog will be removed in the next branched version of Chromium. They will also be removed in Chromium Canary and top of tree Dawn two weeks after this changelog is published in Canary and top of tree Dawn (so starting 2021-11-20). Previous PSAs / changelogs: - [Changelog for WebGPU in Chromium / Dawn 94](https://hackmd.io/OxDovqjoTXqC_r_WY-aM1Q) - [PSA for Chromium / Dawn WebGPU API updates 2021-04-07](https://hackmd.io/BtRPZXulQICjbcZi4tLCdg) - [PSA for Chromium / Dawn WebGPU API updates 2020-10-19](https://hackmd.io/uH1MI9cnQBG9GGOZG20COw) - [PSA for Chromium / Dawn WebGPU API updates 2020-07-28](https://hackmd.io/szV68rOVQ56GYzPJMBko8A) - [PSA for Chromium / Dawn WebGPU API updates 2020-04-28](https://hackmd.io/Et7xlhoaThmi8dEX_s-xSw) ## New deprecations ### Implicit `GPUBindGroupLayout` compatibility changes [WebGPU PR](https://github.com/gpuweb/gpuweb/pull/2068) This is a change with no deprecation period because no content that we could see was relying on the behavior. To help developers use implicit bind group layouts (BGL) correctly, they are now only allowed to be used with the pipeline they were created for. This prevents a common source of errors where the implicit BGL changed when binding in the shader became statically unused. This was confusing when the BGL was used with a different pipeline that still statically used some bindings. ```js= const pipeline = device.createRenderPipeline({ // no layout, so the implicit ones are used. }); const implicitBGL = pipeline.getBindGroupLayout(0); const otherPipeline = device.createRenderPipeline({}); // This code will always produce an error because `implicitBGL` is only // compatible with `pipeline` const pass = createSomeRenderPassEncoder(); pass.setBindGroup(0, implicitBGL); pass.setPipeline(otherPipeline); pass.draw(3); ``` ### 0 as `undefined` in the C API Previsouly in Dawn's API 0 could be used in various places to mean the same as JavaScript `undefined` (where the implementation does the obvious correct thing as much as possible). This is now using special values like `WGPU_ARRAY_LAYER_COUNT_UNDEFINED` instead because the WebGPU defines that a value of 0 is invalid in many of these cases. Places where these updates are necessary: - `wgpu::TextureViewDescriptor::arrayLayerCount`: replace `0` with `wgpu::kArrayLayerCountUndefined`. - `wgpu::TextureViewDescriptor::mipLevelCount`: replace `0` with `wgpu::kMipLevelCountUndefined`. - `SetIndexBuffer` and `SetVertexBuffer`: replace `0` with `wgpu::kWholeSize` for the `size` argument. - `wgpu::Buffer::MapAsync`: replace `0` with `wgpu::kWholeMapSize` for the `size` argument. ## New features and improvements ### Massively improved error messages Error messages produced for validation errors in Dawn / Chromium used to be inscrutable, for example: > Buffer binding doesn't fit in the buffer Most of the error messages have now been updated to provide much more information about the object / values being validated and why they fail, context of where this validation was happening, the label of objects involved if set, debug groups and more! See this [Twitter thread](https://twitter.com/Tojiro/status/1453757993242165250) for an example and more information! Note that M96 contains roughly the first half of these changes and that error messages will keep improving in the future. ### Vertex-only `GPURenderPipeline` It is now possible to create render pipelines with only a vertex stage. This is useful for example when doing a depth-prepass that only writes to the depth buffer: only rasterization is needed and the fragment shader execution would be pure overhead. When using the JavaScript API this can be done with: ```js= const pipeline = device.createRenderPipeline({ vertex: { //... }, // no `fragment` entry! }); ``` Similarly when using Dawn's API: ```cpp= wgpu::RenderPipelineDescriptor desc; desc.fragment = nullptr; // fill other members wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&desc); ``` ### `GPUDevice.createRenderPipelineAsync` is now actually async Previously `GPUDevice.createRenderPipelineAsync` was just a shim over `createRenderPipeline`, which meant that sending a lot of compilation for async compilation would stall further operations (and could cause the GPU process timeout to lose the device in Chromium). Async render pipeline creation is now correctly implemented asynchronously and spread over multiple threads when possible. ### WGSL: using global `let` variables to size arrays It is now possible to size arrays with global constants. Previously arrays could only be sized with literals. Concretely it is now possible to write: ```rust= let UMBRELLA_COUNT = 16u; fn foo() { // Previously you had to hardcode a 16 below. var umbrellas : array<Umbralla, UMBRELLA_COUNT>; } ``` ### WGSL: the `num_workgroups` builtin is now supported This builtin mirrors the arguments that are passed to the `GPUComputePassEncoder.dispatch` call and the content of the indirect buffer in `GPUComputePassEncoder.dispatchIndirect`. It is useful to locally perform in an invocation computations that depend on the complete size of a dispatch call. ```rust= [[stage(compute)]] fn compute_stuff([[builtin(num_workgroups)]] NumWorkgroups : vec3<u32>) { // Use NumWorkgroups! } ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully