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 incorrect workgroupBarrier and OOB array access in auto_exposure #13283

Merged

Conversation

Kurble
Copy link
Contributor

@Kurble Kurble commented May 8, 2024

This commit fixes two issues in auto_exposure.wgsl:

  • A storageBarrier() was incorrectly used where a workgroupBarrier() should be used instead;
  • Resetting the histogram_shared array would write beyond the 64th index, which is out of bounds.

Solution

The first issue is fixed by using the appropriate workgroupBarrier instead;
The second issue is fixed by adding a range check before setting histogram_shared[local_invocation_index] = 0u.

Testing

These changes were tested using the Xcode metal profiler, and I could not find any noticable change in compute shader performance.

@Elabajaba Elabajaba added A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels May 10, 2024
@mockersf mockersf added this pull request to the merge queue May 12, 2024
Merged via the queue into bevyengine:main with commit bfc1338 May 12, 2024
30 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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants