[WebGPU, Dawn]: Upgrade Dawn and new features for WebGPU#1
[WebGPU, Dawn]: Upgrade Dawn and new features for WebGPU#1MikhailGorobets wants to merge 38 commits into
Conversation
There was a problem hiding this comment.
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/pUserData2parameters and callback info structs - Type renames:
WGPUImageCopyBuffer/WGPUImageCopyTexture→WGPUTexelCopyBufferInfo/WGPUTexelCopyTextureInfo,WGPUSupportedLimits→WGPULimits - 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.
There was a problem hiding this comment.
💡 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".
aa11b36 to
48697ce
Compare
There was a problem hiding this comment.
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.
c066299 to
50f223a
Compare
50f223a to
52173f0
Compare
There was a problem hiding this comment.
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.
52173f0 to
47c8908
Compare
There was a problem hiding this comment.
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.
47c8908 to
308fd20
Compare
There was a problem hiding this comment.
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.
308fd20 to
43c865a
Compare
Switch to emscripten-core/setup-emsdk for Emscripten setup
…oup sizes (API256017)
…upload and dynamic memory managers to avoid zero-initialization overhead
3118c5e to
5faa527
Compare
…on for WebGPU