Skip to content

Fix depth prepass with msaa on webgpu#22531

Open
beicause wants to merge 3 commits intobevyengine:mainfrom
beicause:fix-forward-decal-msaa-webgpu
Open

Fix depth prepass with msaa on webgpu#22531
beicause wants to merge 3 commits intobevyengine:mainfrom
beicause:fix-forward-decal-msaa-webgpu

Conversation

@beicause
Copy link
Copy Markdown
Contributor

@beicause beicause commented Jan 15, 2026

Objective

Fixes #19148.
Should fix #19177, too, because wgpu webgl2 just doesn't support sampling depth or creating multisampled texture with TEXTURE_BINDING.

Solution

feature="webgl" and feature="webgpu" can enable together(webgpu overrides webgl), so we should bind multisampled depth texture even webgl feature is enabled.

Testing

Run decal example

@JMS55
Copy link
Copy Markdown
Contributor

JMS55 commented Jan 15, 2026

Rather than using cfg, we should be checking adapter info for the current backend imo.

@beicause
Copy link
Copy Markdown
Contributor Author

Rather than using cfg, we should be checking adapter info for the current backend imo.

This might not be necessary and is beyond the scope of this PR. We use feature gating for webgl/webgpu in many places and it doesn't have runtime checks overhead.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-Web Specific to web (WASM) builds O-WebGPU Specific to the WebGPU render API labels Jan 15, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Testing Testing must be done before this is safe to merge label Jan 15, 2026
@alice-i-cecile alice-i-cecile added this to the 0.18.1 milestone Jan 15, 2026
@cart cart added this to Rendering Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Feb 12, 2026
@cart cart removed this from Rendering Feb 12, 2026
@alice-i-cecile alice-i-cecile modified the milestones: 0.18.1, 0.19 Mar 1, 2026
@@ -733,8 +732,7 @@ pub fn prepare_mesh_view_bind_groups(

// When using WebGL, we can't have a depth texture with multisampling
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment needs updating

Copy link
Copy Markdown
Contributor Author

@beicause beicause Mar 2, 2026

Choose a reason for hiding this comment

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

This comment is still correct. What needs to be updated?

Edit: I forgot that. It's updated now.

@JMS55 JMS55 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Testing Testing must be done before this is safe to merge labels Mar 28, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds O-WebGPU Specific to the WebGPU render API S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage
Status: No status

5 participants