WebGPURenderer: Introduce compatibilityMode#30854
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a WebGPU Compatibility Mode for the renderer and improves texture handling by eliminating unnecessary mipmap generation for CubeMaps. Key changes include:
- Adding an optional compatibilityMode parameter in the WebGPUBackend.
- Updating the texture creation logic in WebGPUTextureUtils to correctly handle cube textures.
- Removing the environment texture check from mipmap generation in the Textures module.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/renderers/webgpu/utils/WebGPUTextureUtils.js | Adds a condition for cube textures, setting the textureBindingViewDimension appropriately. |
| src/renderers/webgpu/WebGPUBackend.js | Introduces the compatibilityMode parameter and passes a featureLevel option to the adapter. |
| src/renderers/common/Textures.js | Removes the environment texture check from the mipmap generation logic as PMREM now handles it. |
Files not reviewed (1)
- examples/webgpu_loader_gltf.html: Language not supported
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
This was referenced Apr 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #30725
Description
Introduce WebGPU Compatibility Mode, this is the first of other complementary PRs that are in development. After the implementation of PMREM we were still generating mipmaps in CubeMaps, which is unnecessary since PMREM already does this in a 2d texture, this should save gpu memory and should help especially on mobile devices.