Skip to content

[WebGPU, Dawn]: Upgrade Dawn and new features for WebGPU#1

Open
MikhailGorobets wants to merge 38 commits into
masterfrom
upgrade_dawn
Open

[WebGPU, Dawn]: Upgrade Dawn and new features for WebGPU#1
MikhailGorobets wants to merge 38 commits into
masterfrom
upgrade_dawn

Conversation

@MikhailGorobets
Copy link
Copy Markdown
Owner

…on for WebGPU

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the Dawn WebGPU implementation to a newer version (commit hash 042e54a9f93e6d2fed503aabe68003dff1705805) and adds support for WebGPU texture formats tier 1 extension. The upgrade includes significant API changes in the WebGPU/Dawn interface, transitioning to a new callback system and updating type names across the codebase.

Key Changes

  • Dawn version upgraded with simplified dependency management through git submodules instead of separate abseil-cpp handling
  • WebGPU API updated to use new callback structures with pUserData1/pUserData2 parameters and callback info structs
  • Type renames: WGPUImageCopyBuffer/WGPUImageCopyTextureWGPUTexelCopyBufferInfo/WGPUTexelCopyTextureInfo, WGPUSupportedLimitsWGPULimits
  • Texture tier 1 support added, replacing separate Unorm16/Snorm16 features with unified WGPUFeatureName_TextureFormatsTier1

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ThirdParty/dawn/CMakeLists.txt Updates Dawn version, adds submodule management, upgrades to C++20, and reorganizes build configuration
ThirdParty/abseil-cpp/CMakeLists.txt Removes standalone abseil-cpp as it's now managed as Dawn submodule
ThirdParty/CMakeLists.txt Comments out abseil-cpp and gtest Emscripten configuration
Graphics/ShaderTools/src/WGSLUtils.cpp Updates Tint shader compiler API calls for new IR-based workflow
Graphics/ShaderTools/src/WGSLShaderResources.cpp Adds texture format mappings for tier 1 formats
Graphics/ShaderTools/CMakeLists.txt Adds C++20 compilation requirement for shader tools
Graphics/GraphicsTools/CMakeLists.txt Adds dawn_headers dependency
Graphics/GraphicsEngineWebGPU/src/WebGPUTypeConversions.cpp Updates texture format range size
Graphics/GraphicsEngineWebGPU/src/WebGPUResourceBase.cpp Updates async map callback signature
Graphics/GraphicsEngineWebGPU/src/TextureWebGPUImpl.cpp Renames image copy structs to texel copy types
Graphics/GraphicsEngineWebGPU/src/SwapChainWebGPUImpl.cpp Updates surface status handling and string view usage
Graphics/GraphicsEngineWebGPU/src/RenderDeviceWebGPUImpl.cpp Simplifies limits handling and replaces Unorm16/Snorm16 features with TextureFormatsTier1
Graphics/GraphicsEngineWebGPU/src/PipelineStateWebGPUImpl.cpp Unifies async pipeline creation callbacks and removes platform-specific code
Graphics/GraphicsEngineWebGPU/src/EngineFactoryWebGPU.cpp Updates adapter/device creation with new callback info structs and limits API
Graphics/GraphicsEngineWebGPU/src/DeviceContextWebGPUImpl.cpp Renames image copy types throughout and updates work done callback
Graphics/GraphicsEngineWebGPU/include/pch.h Removes Emscripten compatibility layer now that web and native APIs are unified
Graphics/GraphicsEngineWebGPU/include/WebGPUStubs.hpp Removes stub definitions for texture formats now natively supported
Graphics/GraphicsEngineWebGPU/CMakeLists.txt Updates Emscripten build to use emdawnwebgpu port
BuildTools/CMake/BuildUtils.cmake Enhances FetchContent_DeclareShallowGit macro with submodule support
Comments suppressed due to low confidence (1)

Graphics/GraphicsEngineWebGPU/src/EngineFactoryWebGPU.cpp:260

  • These legacy feature checks for Unorm16TextureFormats and Snorm16TextureFormats should be updated to use WGPUFeatureName_TextureFormatsTier1 instead, which is the unified feature that supersedes them in the new Dawn version. This is inconsistent with the RenderDeviceWebGPUImpl.cpp changes that already use TextureFormatsTier1.
        if (wgpuAdapterHasFeature(wgpuAdapter, WGPUFeatureName_Unorm16TextureFormats))
            wgpuFeatures.push_back(WGPUFeatureName_Unorm16TextureFormats);

        if (wgpuAdapterHasFeature(wgpuAdapter, WGPUFeatureName_Snorm16TextureFormats))
            wgpuFeatures.push_back(WGPUFeatureName_Snorm16TextureFormats);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Graphics/ShaderTools/src/WGSLUtils.cpp Outdated
Comment thread Graphics/ShaderTools/src/WGSLUtils.cpp Outdated
Comment thread Graphics/GraphicsEngineWebGPU/src/WebGPUResourceBase.cpp Outdated
Comment thread ThirdParty/dawn/CMakeLists.txt Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Graphics/GraphicsEngineWebGPU/src/EngineFactoryWebGPU.cpp Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Graphics/GraphicsEngineWebGPU/CMakeLists.txt Outdated
@MikhailGorobets MikhailGorobets force-pushed the upgrade_dawn branch 2 times, most recently from c066299 to 50f223a Compare November 28, 2025 19:41
@MikhailGorobets MikhailGorobets changed the title [WebGPU, Dawn]: Upgrade Dawn version and added texture tier 1 extensi… [WebGPU, Dawn]: Upgrade Dawn version and added 'texture-formats-tier1' feature for WebGPU Nov 28, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Graphics/ShaderTools/src/WGSLUtils.cpp Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Graphics/ShaderTools/src/WGSLUtils.cpp Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

Graphics/GraphicsEngineWebGPU/src/EngineFactoryWebGPU.cpp:260

  • The PR title mentions adding 'texture-formats-tier1' feature support, but this feature is not being requested from the adapter in CreateDeviceForAdapter. The old separate Unorm16TextureFormats and Snorm16TextureFormats features are still being requested, which according to the WebGPU spec have been superseded by TextureFormatsTier1. Consider adding a check for WGPUFeatureName_TextureFormatsTier1 and requesting it from the adapter if available.
        if (wgpuAdapterHasFeature(wgpuAdapter, WGPUFeatureName_Unorm16TextureFormats))
            wgpuFeatures.push_back(WGPUFeatureName_Unorm16TextureFormats);

        if (wgpuAdapterHasFeature(wgpuAdapter, WGPUFeatureName_Snorm16TextureFormats))
            wgpuFeatures.push_back(WGPUFeatureName_Snorm16TextureFormats);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Graphics/GraphicsEngineWebGPU/src/EngineFactoryWebGPU.cpp Outdated
Comment thread Graphics/GraphicsEngineWebGPU/src/RenderDeviceWebGPUImpl.cpp
Comment thread Graphics/GraphicsEngineWebGPU/src/PipelineStateWebGPUImpl.cpp
Comment thread Graphics/ShaderTools/CMakeLists.txt Outdated
TheMostDiligent and others added 29 commits April 4, 2026 18:08
Switch to emscripten-core/setup-emsdk for Emscripten setup
…upload and dynamic memory managers to avoid zero-initialization overhead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants