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

Fix several regressions from recent rendering changes. #16890

Merged
merged 2 commits into from
Dec 22, 2024

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Dec 18, 2024

This commit fixes the following regressions:

  1. Transmission-specific calls to shader lighting functions didn't pass the enable_diffuse parameter, breaking the transmission example.

  2. The combination of bindless StandardMaterial and bindless lightmaps caused us to blow past the 128 texture limit on M1/M2 chips in some cases, in particular the depth_of_field example. Use Argument Buffers for binding_array on Metal gfx-rs/wgpu#3334 should fix this, but in the meantime this patch reduces the number of bindless lightmaps from 16 to 4 in order to stay under the limit.

  3. The renderer was crashing on startup on Adreno 610 chips. This PR simply disables bindless on Adreno 610 and lower.

This commit fixes the following regressions:

1. Transmission-specific calls to shader lighting functions didn't pass
   the `enable_diffuse` parameter, breaking the `transmission` example.

2. The combination of bindless `StandardMaterial` and bindless lightmaps
   caused us to blow past the 128 texture limit on M1/M2 chips in some
   cases. gfx-rs/wgpu#3334 should fix this,
   but in the meantime this patch reduces the number of bindless
   lightmaps from 16 to 4 in order to stay under the limit.

3. The renderer was crashing on startup on Adreno 610 chips. This PR
   simply disables bindless on Adreno 610 and lower.
@pcwalton pcwalton added A-Rendering Drawing game state to the screen P-Regression Functionality that used to work but no longer does. Add a test for this! C-Bug An unexpected or incorrect behavior S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 18, 2024
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Dec 18, 2024
@alice-i-cecile
Copy link
Member

I've started an example-runner test run for this :) We should expect diffs though.

Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

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

I am not qualified to review most of the rendering changes, but:

  • Confirmed that this fixes depth_of_field on my m1 mac
  • Confirmed that this fixes transmission
  • Changes related to Android make sense to me, but I can't test
  • Didn't seem to cause any additional problems in the example run (but mobile screenshots are still not running?)

@@ -71,7 +72,7 @@ pub const LIGHTMAP_SHADER_HANDLE: Handle<Shader> =
///
/// If bindless textures aren't in use, then only a single lightmap can be bound
/// at a time.
pub const LIGHTMAPS_PER_SLAB: usize = 16;
pub const LIGHTMAPS_PER_SLAB: usize = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for the 4 specifically or is it just a nice number that happens to still work because it's small enough??

@IceSentry
Copy link
Contributor

I haven't tested anything locally, but the changes LGTM

@IceSentry IceSentry 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-Review Needs reviewer attention (from anyone!) to move forward labels Dec 22, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 22, 2024
Merged via the queue into bevyengine:main with commit 6a4e0c8 Dec 22, 2024
29 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 C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! 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: Done
Development

Successfully merging this pull request may close these issues.

4 participants