Skip to content

Disable depth downsampling on GL/WebGL with downlevel flag#20304

Open
alextechcc wants to merge 1 commit intobevyengine:mainfrom
alextechcc:disable_culling_on_gl
Open

Disable depth downsampling on GL/WebGL with downlevel flag#20304
alextechcc wants to merge 1 commit intobevyengine:mainfrom
alextechcc:disable_culling_on_gl

Conversation

@alextechcc
Copy link
Copy Markdown

@alextechcc alextechcc commented Jul 27, 2025

Objective

Solution

  • There appears to be a flag already for this: DownlevelFlags::DEPTH_TEXTURE_AND_BUFFER_COPIES which is not set for the correct platforms (WebGL/GLES). It was proposed (at least I believe?) Unable to sample depth texture gfx-rs/wgpu#4524 (comment) to expand the definition of this downlevel flag to include this "textureLoad on depth texture" invalid usage. I've posted my support there, but for now it seems useful to unblock GL.

Testing

  • At least on my machine, and with additional patches surrounding Wayland display management and WGPU 26, this limits me to GpuPreprocessingMode::PreprocessingOnly which runs just fine. I will attempt to test on additional platforms soon but would appreciate any help here (I've got a Vivante, PowerVR TI GPU).

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added this to the 0.17 milestone Jul 27, 2025
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-OpenGL Specific to the OpenGL render API S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 28, 2025
@alice-i-cecile alice-i-cecile removed this from the 0.17 milestone Jul 28, 2025
@alextechcc
Copy link
Copy Markdown
Author

alextechcc commented Jul 28, 2025

I want to ensure that the other affected platform - webgl - wouldn't be downgraded by this flag. I believe that it's likely all webgl platforms fall back to cpu preprocessing.
EDIT: It won't be affected by this because it doesn't support compute shaders and falls back to CPU preprocessing.

@alextechcc alextechcc force-pushed the disable_culling_on_gl branch from 3e7805a to b14ed2b Compare August 7, 2025 22:37
@alextechcc
Copy link
Copy Markdown
Author

Not exactly sure why all the tests are failing (toolchain changed?), but I think it's safe to merge. WebGL2 doesn't support compute shaders so this is already set, and the only other backend that sets this flag is opengl which does not support the current way culling is implemented.

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-OpenGL Specific to the OpenGL render API S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

Cannot run any example in 0.16.0

3 participants