Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable irradiance volumes on WebGL and WebGPU. #11909

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

pcwalton
Copy link
Contributor

They cause the number of texture bindings to overflow on those platforms. Ultimately, we shouldn't unconditionally disable them, but this fixes a crash blocking 0.13.

Closes #11885.

They cause the number of texture bindings to overflow on those
platforms. Ultimately, we shouldn't unconditionally disable them, but
this fixes a crash blocking 0.13.

Closes bevyengine#11885.
@cart cart added this to the 0.13 milestone Feb 16, 2024
@cart cart added the A-Rendering Drawing game state to the screen label Feb 16, 2024
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

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

Tested on both WebGL and WebGPU and it works as expected. Thanks for the quick fix!

@@ -825,7 +827,7 @@ impl SpecializedMeshPipeline for MeshPipeline {
shader_defs.push("ENVIRONMENT_MAP".into());
}

if key.contains(MeshPipelineKey::IRRADIANCE_VOLUME) {
if key.contains(MeshPipelineKey::IRRADIANCE_VOLUME) && IRRADIANCE_VOLUMES_ARE_USABLE {
shader_defs.push("IRRADIANCE_VOLUME".into());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just reuse this shader_def instead of using a separate one?

Copy link
Member

Choose a reason for hiding this comment

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

I think there are two reasons:

  1. MeshPipelineKey::IRRADIANCE_VOLUME is currently getting set in scenes like deferred_rendering.rs, even when irradiance volumes aren't used.
  2. IRRADIANCE_VOLUMES_ARE_USABLE is used in a few places unconditionally outside of the context of shader defs.

Copy link
Member

Choose a reason for hiding this comment

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

I think for now we merge as-is. This isn't hurting anything and we're likely to improve this situation in the future.

@cart cart added this pull request to the merge queue Feb 17, 2024
Merged via the queue into bevyengine:main with commit 3058c17 Feb 17, 2024
25 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebGL2 support broken: index out of bounds
3 participants